summaryrefslogtreecommitdiff
path: root/rtl/core/porch
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-12-11 23:54:38 -0600
committerAlejandro Soto <alejandro@34project.org>2022-12-16 16:29:10 -0600
commit79e05aa7f0ccce6eb26248ddef3e928727857a9c (patch)
tree8c67d6532234dac0eace7f005638efc8441105a5 /rtl/core/porch
parent0284628a47d5b4797c89f6846b9efee3f1243b94 (diff)
Implement prefetch aborts
Diffstat (limited to 'rtl/core/porch')
-rw-r--r--rtl/core/porch/porch.sv8
1 files changed, 6 insertions, 2 deletions
diff --git a/rtl/core/porch/porch.sv b/rtl/core/porch/porch.sv
index 4369836..99ba9ed 100644
--- a/rtl/core/porch/porch.sv
+++ b/rtl/core/porch/porch.sv
@@ -10,13 +10,15 @@ module core_porch
input word fetch_insn,
input logic fetch_nop,
+ fetch_abort,
input ptr fetch_insn_pc,
fetch_head,
input insn_decode fetch_dec,
output word insn,
output ptr insn_pc,
- output insn_decode dec
+ output insn_decode dec,
+ output logic abort
);
logic execute, conditional, undefined, nop;
@@ -25,7 +27,7 @@ module core_porch
always_comb begin
dec = hold_dec;
dec.ctrl.nop = nop;
- dec.ctrl.execute = !flush && dec.ctrl.execute && execute && !nop;
+ dec.ctrl.execute = !flush && dec.ctrl.execute && execute && !nop && !abort;
dec.ctrl.undefined = !flush && (dec.ctrl.undefined || undefined);
dec.ctrl.conditional = !flush && (dec.ctrl.conditional || conditional);
end
@@ -39,11 +41,13 @@ module core_porch
if(!rst_n) begin
nop <= 0; // Even though it is a NOP
insn <= `NOP;
+ abort <= 0;
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;
+ abort <= flush ? 0 : fetch_abort;
insn_pc <= flush ? fetch_head : fetch_insn_pc;
hold_dec <= fetch_dec;
end