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