diff options
Diffstat (limited to 'rtl')
| -rw-r--r-- | rtl/core/arm810.sv | 2 | ||||
| -rw-r--r-- | rtl/core/control/control.sv | 5 | ||||
| -rw-r--r-- | rtl/core/fetch/fetch.sv | 6 |
3 files changed, 10 insertions, 3 deletions
diff --git a/rtl/core/arm810.sv b/rtl/core/arm810.sv index c49600f..91f48db 100644 --- a/rtl/core/arm810.sv +++ b/rtl/core/arm810.sv @@ -54,6 +54,7 @@ module arm810 logic explicit_branch, writeback, update_flags, c_in; ptr branch_target, pc_visible; psr_mode reg_mode; + psr_flags wb_alu_flags; alu_op alu_ctrl; shifter_control shifter_ctrl; word alu_a, alu_b, wr_value; @@ -77,6 +78,7 @@ module arm810 core_psr psr ( + .alu_flags(wb_alu_flags), .* ); diff --git a/rtl/core/control/control.sv b/rtl/core/control/control.sv index 398c8c7..653d896 100644 --- a/rtl/core/control/control.sv +++ b/rtl/core/control/control.sv @@ -14,6 +14,7 @@ module core_control input ldst_decode dec_ldst, input ptr fetch_insn_pc, input psr_flags flags, + alu_flags, input word rd_value_a, rd_value_b, q_alu, @@ -33,6 +34,7 @@ module core_control output ptr branch_target, pc_visible, output psr_mode reg_mode, + output psr_flags wb_alu_flags, output alu_op alu, output word alu_a, alu_b, @@ -195,6 +197,7 @@ module core_control final_update_flags <= dec_update_flags; end + wb_alu_flags <= alu_flags; update_flags <= final_update_flags; writeback <= final_writeback; rd <= final_rd; @@ -261,6 +264,8 @@ module core_control branch_target = 30'd0; data_snd_shift_by_reg = 0; + wb_alu_flags = 4'b0000; + ldst = 0; ldst_pre = 0; ldst_writeback = 0; 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; |
