summaryrefslogtreecommitdiff
path: root/rtl/core/fetch
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-10-17 01:03:25 -0600
committerAlejandro Soto <alejandro@34project.org>2022-10-17 01:03:25 -0600
commit5079281c8e8889efc2eeba664d93644126006743 (patch)
tree7d02022f71cd860caaae9d63f280d19f2d92ddab /rtl/core/fetch
parent87c73314d7ce0062b13ae14f376ec50a4653fb18 (diff)
Fix data hazards in nzcv and PC increment
Diffstat (limited to '')
-rw-r--r--rtl/core/fetch/fetch.sv6
1 files changed, 3 insertions, 3 deletions
diff --git a/rtl/core/fetch/fetch.sv b/rtl/core/fetch/fetch.sv
index e8c6a9b..c1f150c 100644
--- a/rtl/core/fetch/fetch.sv
+++ b/rtl/core/fetch/fetch.sv
@@ -20,8 +20,8 @@ module core_fetch
ptr next_pc, head, hold_addr;
logic fetched_valid, do_flush, discard;
- assign do_flush = branch | flush;
- assign fetched_valid = fetched & ~discard;
+ assign do_flush = branch || flush;
+ assign fetched_valid = fetched && !discard;
core_prefetch #(.ORDER(PREFETCH_ORDER)) prefetch
(
@@ -40,7 +40,7 @@ module core_fetch
if(do_flush)
addr = head;
- else if(fetched_valid)
+ else if(fetch && fetched_valid)
addr = hold_addr + 1;
else
addr = hold_addr;