summaryrefslogtreecommitdiff
path: root/rtl/core/porch
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-11-09 09:25:48 -0600
committerAlejandro Soto <alejandro@34project.org>2022-11-09 09:25:48 -0600
commit5d798386c3b1c1dc45a2fbc382c9367ccc27c524 (patch)
treea04fff74505af30c8044f80f523fd887331e6234 /rtl/core/porch
parent65590be80332d132d7037bfe3bb19e5d6e5bcd7b (diff)
Implement reset
Diffstat (limited to 'rtl/core/porch')
-rw-r--r--rtl/core/porch/porch.sv15
1 files changed, 7 insertions, 8 deletions
diff --git a/rtl/core/porch/porch.sv b/rtl/core/porch/porch.sv
index 6f5caf7..2eec438 100644
--- a/rtl/core/porch/porch.sv
+++ b/rtl/core/porch/porch.sv
@@ -3,6 +3,7 @@
module core_porch
(
input logic clk,
+ rst_n,
flush,
stall,
input psr_flags flags,
@@ -35,8 +36,12 @@ module core_porch
dec.ctrl.conditional = !flush && (dec.ctrl.conditional || conditional);
end
- always @(posedge clk)
- if(!stall) begin
+ always_ff @(posedge clk or negedge rst_n)
+ if(!rst_n) begin
+ insn <= `NOP;
+ insn_pc <= 0;
+ hold_dec <= nop;
+ end else if(!stall) begin
insn <= fetch_insn;
hold_dec <= fetch_dec;
@@ -44,10 +49,4 @@ module core_porch
insn_pc <= fetch_insn_pc;
end
- initial begin
- insn = `NOP;
- insn_pc = 0;
- hold_dec = nop;
- end
-
endmodule