summaryrefslogtreecommitdiff
path: root/rtl/core/fetch/fetch.sv
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-11-07 19:04:39 -0600
committerAlejandro Soto <alejandro@34project.org>2022-11-07 19:04:39 -0600
commitc67a1007045a9bf0282c26da74149723c6a2941d (patch)
tree587140176ca929cdadc58866d072b69fc5da91c9 /rtl/core/fetch/fetch.sv
parentcc7ed6bd05b8143ed4250caf97798c8bbfc6b748 (diff)
Fix long combinational path between regs and fetch
Diffstat (limited to 'rtl/core/fetch/fetch.sv')
-rw-r--r--rtl/core/fetch/fetch.sv11
1 files changed, 7 insertions, 4 deletions
diff --git a/rtl/core/fetch/fetch.sv b/rtl/core/fetch/fetch.sv
index c1f150c..d938699 100644
--- a/rtl/core/fetch/fetch.sv
+++ b/rtl/core/fetch/fetch.sv
@@ -8,8 +8,10 @@ module core_fetch
branch,
flush,
fetched,
- input word fetch_data,
- input ptr target,
+ wr_pc,
+ input ptr branch_target,
+ input word wr_current,
+ fetch_data,
output logic fetch,
output word insn,
@@ -17,9 +19,10 @@ module core_fetch
addr
);
- ptr next_pc, head, hold_addr;
+ ptr next_pc, head, hold_addr, target;
logic fetched_valid, do_flush, discard;
+ assign target = wr_pc ? wr_current[31:2] : branch_target; //TODO: alignment exception
assign do_flush = branch || flush;
assign fetched_valid = fetched && !discard;
@@ -52,8 +55,8 @@ module core_fetch
end
initial begin
- hold_addr = 0;
discard = 0;
+ hold_addr = 0;
end
endmodule