diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-12-07 19:18:04 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-12-07 19:51:41 -0600 |
| commit | c39552375661e495b344e8386649ade92a4d45b2 (patch) | |
| tree | 45623ce35964e43ae7d8804c1ef1c6dedb3ba7a1 /rtl/core/porch | |
| parent | b1761b8eac5777c09723bbc8cd31cc05d8ec35ae (diff) | |
Implement single-stepping
Diffstat (limited to 'rtl/core/porch')
| -rw-r--r-- | rtl/core/porch/porch.sv | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/rtl/core/porch/porch.sv b/rtl/core/porch/porch.sv index 238da88..4369836 100644 --- a/rtl/core/porch/porch.sv +++ b/rtl/core/porch/porch.sv @@ -9,6 +9,7 @@ module core_porch input psr_flags flags, input word fetch_insn, + input logic fetch_nop, input ptr fetch_insn_pc, fetch_head, input insn_decode fetch_dec, @@ -18,12 +19,13 @@ module core_porch output insn_decode dec ); - logic execute, conditional, undefined; + logic execute, conditional, undefined, nop; insn_decode hold_dec; always_comb begin dec = hold_dec; - dec.ctrl.execute = !flush && dec.ctrl.execute && execute; + dec.ctrl.nop = nop; + dec.ctrl.execute = !flush && dec.ctrl.execute && execute && !nop; dec.ctrl.undefined = !flush && (dec.ctrl.undefined || undefined); dec.ctrl.conditional = !flush && (dec.ctrl.conditional || conditional); end @@ -35,10 +37,12 @@ module core_porch always_ff @(posedge clk or negedge rst_n) if(!rst_n) begin + nop <= 0; // Even though it is a NOP insn <= `NOP; insn_pc <= 0; hold_dec <= {$bits(hold_dec){1'b0}}; end else if(flush || !stall) begin + nop <= flush ? 1 : fetch_nop; insn <= flush ? `NOP : fetch_insn; insn_pc <= flush ? fetch_head : fetch_insn_pc; hold_dec <= fetch_dec; |
