- casez(insn)
- `DECODE_LDRSTR_UNDEFINED: begin
- writeback <= 1'b0;
- regsel <= 4'hx;
- regdata <= 32'hxxxxxxxx;
- notdone <= 1'b0;
- end
- `DECODE_LDRSTR: begin
- if(insn[20] && !inc_next) begin /* load - delegate regfile write to writeback stage */
- if(insn[15:12] == 4'hF) begin
- newpc <= align_rddata;
- end
- else begin
- writeback <= 1'b1;
- regsel <= insn[15:12];
- regdata <= align_rddata;
- end
- inc_next <= 1'b1;
- end
- else if(insn[21]) begin /* write back */
- writeback <= 1'b1;
- regsel <= insn[19:16];
- regdata <= addr;
- inc_next <= 1'b0;
- end else begin
- writeback <= 1'b0;
- inc_next <= 1'b0;
- regsel <= 4'hx;
- regdata <= 32'hxxxxxxxx;
- end
- notdone <= rw_wait & insn[20] & insn[21];
- end
- `DECODE_LDMSTM: begin
- end
- default: begin
- writeback <= 1'b0;
- regsel <= 4'hx;
- regdata <= 32'hxxxxxxxx;
- notdone <= 1'b0;
- end
- endcase
+ writeback <= next_writeback;
+ regsel <= next_regsel;
+ regdata <= next_regdata;
+ notdone <= next_notdone;
+ newpc <= next_newpc;
+ inc_next <= next_inc_next;