Skip to content

Commit 5b665f4

Browse files
committed
Fixing wire def bug in serv
- This is why we declare the wires first!
1 parent f733969 commit 5b665f4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

logikbench/blocks/serv/rtl/serv_state.v

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ module serv_state
6464

6565
reg [4:2] o_cnt;
6666
wire [3:0] cnt_r;
67+
wire trap_pending;
68+
reg ibus_cyc;
6769

68-
reg ibus_cyc;
6970
//Update PC in RUN or TRAP states
7071
assign o_ctrl_pc_en = o_cnt_en & !o_init;
7172

@@ -124,7 +125,7 @@ module serv_state
124125
shift : Shift in during phase 1. Continue shifting between phases (except
125126
for the first cycle after init). Shift out during phase 2
126127
*/
127-
128+
128129
assign o_bufreg_en = (o_cnt_en & (o_init | ((o_ctrl_trap | i_branch_op) & i_two_stage_op))) | (i_shift_op & init_done & (i_sh_right | i_sh_done));
129130

130131
assign o_ibus_cyc = ibus_cyc & !i_rst;
@@ -214,7 +215,7 @@ module serv_state
214215

215216
//trap_pending is only guaranteed to have correct value during the
216217
// last cycle of the init stage
217-
wire trap_pending = WITH_CSR & ((take_branch & i_ctrl_misalign & !ALIGN) |
218+
assign trap_pending = WITH_CSR & ((take_branch & i_ctrl_misalign & !ALIGN) |
218219
(i_dbus_en & i_mem_misalign));
219220

220221
generate

0 commit comments

Comments
 (0)