diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-11-07 19:04:39 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-11-07 19:04:39 -0600 |
| commit | c67a1007045a9bf0282c26da74149723c6a2941d (patch) | |
| tree | 587140176ca929cdadc58866d072b69fc5da91c9 /rtl/core/fetch | |
| parent | cc7ed6bd05b8143ed4250caf97798c8bbfc6b748 (diff) | |
Fix long combinational path between regs and fetch
Diffstat (limited to '')
| -rw-r--r-- | rtl/core/fetch/fetch.sv | 11 |
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 |
