cool little keypad test
This commit is contained in:
		
							parent
							
								
									10cd8cb673
								
							
						
					
					
						commit
						f9135c13b8
					
				
					 2 changed files with 35 additions and 2 deletions
				
			
		
							
								
								
									
										20
									
								
								chip8.qsf
									
										
									
									
									
								
							
							
						
						
									
										20
									
								
								chip8.qsf
									
										
									
									
									
								
							| 
						 | 
					@ -34,6 +34,7 @@ set_global_assignment -name SYSTEMVERILOG_FILE cpu.sv
 | 
				
			||||||
set_global_assignment -name SYSTEMVERILOG_FILE alu.sv
 | 
					set_global_assignment -name SYSTEMVERILOG_FILE alu.sv
 | 
				
			||||||
set_global_assignment -name SYSTEMVERILOG_FILE aastructs.sv
 | 
					set_global_assignment -name SYSTEMVERILOG_FILE aastructs.sv
 | 
				
			||||||
set_global_assignment -name SYSTEMVERILOG_FILE downclocker.sv
 | 
					set_global_assignment -name SYSTEMVERILOG_FILE downclocker.sv
 | 
				
			||||||
 | 
					set_global_assignment -name SYSTEMVERILOG_FILE keypad.sv
 | 
				
			||||||
set_global_assignment -name SDC_FILE chip8.sdc
 | 
					set_global_assignment -name SDC_FILE chip8.sdc
 | 
				
			||||||
set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "23 MM HEAT SINK WITH 200 LFPM AIRFLOW"
 | 
					set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "23 MM HEAT SINK WITH 200 LFPM AIRFLOW"
 | 
				
			||||||
set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)"
 | 
					set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)"
 | 
				
			||||||
| 
						 | 
					@ -64,4 +65,23 @@ set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to lcd_data
 | 
				
			||||||
set_location_assignment PIN_W20 -to rst_in
 | 
					set_location_assignment PIN_W20 -to rst_in
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
 | 
					set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
 | 
				
			||||||
 | 
					set_location_assignment PIN_AE17 -to col[3]
 | 
				
			||||||
 | 
					set_location_assignment PIN_AE20 -to col[2]
 | 
				
			||||||
 | 
					set_location_assignment PIN_AF20 -to col[1]
 | 
				
			||||||
 | 
					set_location_assignment PIN_AH18 -to col[0]
 | 
				
			||||||
 | 
					set_location_assignment PIN_AC24 -to row[0]
 | 
				
			||||||
 | 
					set_location_assignment PIN_AD26 -to row[1]
 | 
				
			||||||
 | 
					set_location_assignment PIN_AF28 -to row[2]
 | 
				
			||||||
 | 
					set_location_assignment PIN_AF27 -to row[3]
 | 
				
			||||||
 | 
					set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to row[3]
 | 
				
			||||||
 | 
					set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to col[3]
 | 
				
			||||||
 | 
					set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to col[2]
 | 
				
			||||||
 | 
					set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to col[1]
 | 
				
			||||||
 | 
					set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to col[0]
 | 
				
			||||||
 | 
					set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to col
 | 
				
			||||||
 | 
					set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to row[0]
 | 
				
			||||||
 | 
					set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to row[1]
 | 
				
			||||||
 | 
					set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to row[2]
 | 
				
			||||||
 | 
					set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to row
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										17
									
								
								chip8.sv
									
										
									
									
									
								
							
							
						
						
									
										17
									
								
								chip8.sv
									
										
									
									
									
								
							| 
						 | 
					@ -3,7 +3,9 @@ module chip8 (
 | 
				
			||||||
    input wire rst_in,
 | 
					    input wire rst_in,
 | 
				
			||||||
    output logic lcd_clk, 
 | 
					    output logic lcd_clk, 
 | 
				
			||||||
    output logic lcd_data,
 | 
					    output logic lcd_data,
 | 
				
			||||||
    output logic [5:0] led
 | 
					    output logic [5:0] led,
 | 
				
			||||||
 | 
					    input wire [3:0] row,
 | 
				
			||||||
 | 
					    output logic [3:0] col
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
logic slow_clk;
 | 
					logic slow_clk;
 | 
				
			||||||
`ifdef FAST_CLK
 | 
					`ifdef FAST_CLK
 | 
				
			||||||
| 
						 | 
					@ -14,6 +16,9 @@ logic slow_clk;
 | 
				
			||||||
    downclocker #(10) dc(fpga_clk, slow_clk);
 | 
					    downclocker #(10) dc(fpga_clk, slow_clk);
 | 
				
			||||||
`endif
 | 
					`endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  logic key_clk;
 | 
				
			||||||
 | 
					  downclocker #(24) dck(fpga_clk, key_clk);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  logic [7:0] rd_memory_data;
 | 
					  logic [7:0] rd_memory_data;
 | 
				
			||||||
  logic [11:0] rd_memory_address;
 | 
					  logic [11:0] rd_memory_address;
 | 
				
			||||||
  logic [11:0] wr_memory_address;
 | 
					  logic [11:0] wr_memory_address;
 | 
				
			||||||
| 
						 | 
					@ -28,7 +33,15 @@ logic slow_clk;
 | 
				
			||||||
        rd_memory_data
 | 
					        rd_memory_data
 | 
				
			||||||
      );
 | 
					      );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  keypad keypad(
 | 
				
			||||||
 | 
					        key_clk,
 | 
				
			||||||
 | 
					        row,
 | 
				
			||||||
 | 
					        col,
 | 
				
			||||||
 | 
					        led
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  int cycle_counter;
 | 
					  int cycle_counter;
 | 
				
			||||||
 | 
					  logic [5:0] nc;
 | 
				
			||||||
  cpu cpu (
 | 
					  cpu cpu (
 | 
				
			||||||
      slow_clk,
 | 
					      slow_clk,
 | 
				
			||||||
      fpga_clk,
 | 
					      fpga_clk,
 | 
				
			||||||
| 
						 | 
					@ -40,7 +53,7 @@ logic slow_clk;
 | 
				
			||||||
      wr_go,
 | 
					      wr_go,
 | 
				
			||||||
      lcd_clk,
 | 
					      lcd_clk,
 | 
				
			||||||
      lcd_data,
 | 
					      lcd_data,
 | 
				
			||||||
      led
 | 
					      nc
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
endmodule
 | 
					endmodule
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue