diff --git a/chip8.qsf b/chip8.qsf index 0282b01..3e74ba5 100644 --- a/chip8.qsf +++ b/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 aastructs.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 POWER_PRESET_COOLING_SOLUTION "23 MM HEAT SINK WITH 200 LFPM AIRFLOW" 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_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 diff --git a/chip8.sv b/chip8.sv index ea337a2..814678f 100644 --- a/chip8.sv +++ b/chip8.sv @@ -3,7 +3,9 @@ module chip8 ( input wire rst_in, output logic lcd_clk, 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; `ifdef FAST_CLK @@ -14,6 +16,9 @@ logic slow_clk; downclocker #(10) dc(fpga_clk, slow_clk); `endif + logic key_clk; + downclocker #(24) dck(fpga_clk, key_clk); + logic [7:0] rd_memory_data; logic [11:0] rd_memory_address; logic [11:0] wr_memory_address; @@ -27,8 +32,16 @@ logic slow_clk; rd_memory_address, rd_memory_data ); + + keypad keypad( + key_clk, + row, + col, + led + ); int cycle_counter; + logic [5:0] nc; cpu cpu ( slow_clk, fpga_clk, @@ -40,7 +53,7 @@ logic slow_clk; wr_go, lcd_clk, lcd_data, - led + nc ); endmodule