From a9a3b8f7ab7f2067843a9a642447a9b7270440ce Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sun, 21 Nov 2021 13:28:55 -0800 Subject: Implement switches Start and LoadAdd. --- hdl/top.sv | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'hdl/top.sv') diff --git a/hdl/top.sv b/hdl/top.sv index 00225ee..8ed2bc6 100644 --- a/hdl/top.sv +++ b/hdl/top.sv @@ -49,9 +49,9 @@ panel fp , .gpioc(gpioc) ); -bit [3:1] switch_df; -bit [3:1] switch_if; -bit [12:1] switch_sr; +bit [2:0] switch_df; +bit [2:0] switch_if; +bit [11:0] switch_sr; bit switch_start; bit switch_load_add; bit switch_dep; @@ -61,9 +61,12 @@ bit switch_stop; bit switch_sing_step; bit switch_sing_inst; -assign switch_df = switch[2][3:1]; -assign switch_if = switch[2][6:4]; -assign switch_sr = switch[1]; +// Note that we are reversing the order here on a number of aggregates because +// the panel model gives us LEDs and switches in schematic-order, which is the +// opposite of the bit order +assign switch_df = {switch[2][1], switch[2][2], switch[2][3]}; +assign switch_if = {switch[2][4], switch[2][5], switch[2][6]}; +assign switch_sr = {switch[1][1], switch[1][2], switch[1][3], switch[1][4], switch[1][5], switch[1][6], switch[1][7], switch[1][8], switch[1][9], switch[1][10], switch[1][11], switch[1][12]}; assign switch_start = switch[3][1]; assign switch_load_add = switch[3][2]; assign switch_dep = switch[3][3]; @@ -100,6 +103,9 @@ bit [2:0] led_df; bit [2:0] led_if; bit led_link; +// Note that we are reversing the order here on a number of aggregates because +// the panel model gives us LEDs and switches in schematic-order, which is the +// opposite of the bit order assign led[1] = {led_pc[0], led_pc[1], led_pc[2], led_pc[3], led_pc[4], led_pc[5], led_pc[6], led_pc[7], led_pc[8], led_pc[9], led_pc[10], led_pc[11]}; assign led[2] = {led_memaddr[0], led_memaddr[1], led_memaddr[2], led_memaddr[3], led_memaddr[4], led_memaddr[5], led_memaddr[6], led_memaddr[7], led_memaddr[8], led_memaddr[9], led_memaddr[10], led_memaddr[11]}; assign led[3] = {led_memdata[0], led_memdata[1], led_memdata[2], led_memdata[3], led_memdata[4], led_memdata[5], led_memdata[6], led_memdata[7], led_memdata[8], led_memdata[9], led_memdata[10], led_memdata[11]}; @@ -107,12 +113,19 @@ assign led[4] = {led_acc[0], led_acc[1], led_acc[2], led_acc[3], led_acc[4], led assign led[5] = {led_mq[0], led_mq[1], led_mq[2], led_mq[3], led_mq[4], led_mq[5], led_mq[6], led_mq[7], led_mq[8], led_mq[9], led_mq[10], led_mq[11]}; assign led[6] = {led_word_count, led_defer, led_execute, led_fetch, led_opr, led_iot, led_jmp, led_jms, led_dca, led_isz, led_tad, led_and}; assign led[7] = {2'b0, led_step_counter, led_run, led_pause, led_ion, led_break, led_current_address}; -assign led[8] = {5'b0, led_link, led_if, led_df}; +assign led[8] = {5'b0, led_link, led_if[0], led_if[1], led_if[2], led_df[0], led_df[1], led_df[2]}; core cpu ( .clk(clk) , .reset(reset) + , .switch_df(switch_df) + , .switch_if(switch_if) + , .switch_sr(switch_sr) + , .switch_start(switch_start) + , .switch_load_add(switch_load_add) + , .switch_dep(switch_dep) + , .switch_exam(switch_exam) , .switch_cont(switch_cont) , .switch_stop(switch_stop) , .switch_sing_step(switch_sing_step) -- cgit v1.2.3