summaryrefslogtreecommitdiff
path: root/hdl/top.sv
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--hdl/top.sv27
1 files changed, 20 insertions, 7 deletions
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
49 , .gpioc(gpioc) 49 , .gpioc(gpioc)
50 ); 50 );
51 51
52bit [3:1] switch_df; 52bit [2:0] switch_df;
53bit [3:1] switch_if; 53bit [2:0] switch_if;
54bit [12:1] switch_sr; 54bit [11:0] switch_sr;
55bit switch_start; 55bit switch_start;
56bit switch_load_add; 56bit switch_load_add;
57bit switch_dep; 57bit switch_dep;
@@ -61,9 +61,12 @@ bit switch_stop;
61bit switch_sing_step; 61bit switch_sing_step;
62bit switch_sing_inst; 62bit switch_sing_inst;
63 63
64assign switch_df = switch[2][3:1]; 64// Note that we are reversing the order here on a number of aggregates because
65assign switch_if = switch[2][6:4]; 65// the panel model gives us LEDs and switches in schematic-order, which is the
66assign switch_sr = switch[1]; 66// opposite of the bit order
67assign switch_df = {switch[2][1], switch[2][2], switch[2][3]};
68assign switch_if = {switch[2][4], switch[2][5], switch[2][6]};
69assign 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]};
67assign switch_start = switch[3][1]; 70assign switch_start = switch[3][1];
68assign switch_load_add = switch[3][2]; 71assign switch_load_add = switch[3][2];
69assign switch_dep = switch[3][3]; 72assign switch_dep = switch[3][3];
@@ -100,6 +103,9 @@ bit [2:0] led_df;
100bit [2:0] led_if; 103bit [2:0] led_if;
101bit led_link; 104bit led_link;
102 105
106// Note that we are reversing the order here on a number of aggregates because
107// the panel model gives us LEDs and switches in schematic-order, which is the
108// opposite of the bit order
103assign 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]}; 109assign 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]};
104assign 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]}; 110assign 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]};
105assign 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]}; 111assign 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
107assign 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]}; 113assign 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]};
108assign 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}; 114assign 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};
109assign led[7] = {2'b0, led_step_counter, led_run, led_pause, led_ion, led_break, led_current_address}; 115assign led[7] = {2'b0, led_step_counter, led_run, led_pause, led_ion, led_break, led_current_address};
110assign led[8] = {5'b0, led_link, led_if, led_df}; 116assign led[8] = {5'b0, led_link, led_if[0], led_if[1], led_if[2], led_df[0], led_df[1], led_df[2]};
111 117
112core cpu 118core cpu
113 ( .clk(clk) 119 ( .clk(clk)
114 , .reset(reset) 120 , .reset(reset)
115 121
122 , .switch_df(switch_df)
123 , .switch_if(switch_if)
124 , .switch_sr(switch_sr)
125 , .switch_start(switch_start)
126 , .switch_load_add(switch_load_add)
127 , .switch_dep(switch_dep)
128 , .switch_exam(switch_exam)
116 , .switch_cont(switch_cont) 129 , .switch_cont(switch_cont)
117 , .switch_stop(switch_stop) 130 , .switch_stop(switch_stop)
118 , .switch_sing_step(switch_sing_step) 131 , .switch_sing_step(switch_sing_step)