summaryrefslogtreecommitdiff
path: root/rtl/core/decode/data.sv
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-11-07 21:03:49 -0600
committerAlejandro Soto <alejandro@34project.org>2022-11-07 21:03:49 -0600
commit19c860221fb2fc129e6d2c1a41a77a8e8010f6c3 (patch)
tree849d03150399751d409d5e5ab5fd07e1a638a8ac /rtl/core/decode/data.sv
parent4ccb96c1aaf348f677954171751b58ad8f4dccf1 (diff)
Fix flags hazard in ADC, SBC, RSC
Diffstat (limited to 'rtl/core/decode/data.sv')
-rw-r--r--rtl/core/decode/data.sv9
1 files changed, 9 insertions, 0 deletions
diff --git a/rtl/core/decode/data.sv b/rtl/core/decode/data.sv
index 1bd7ef9..f744972 100644
--- a/rtl/core/decode/data.sv
+++ b/rtl/core/decode/data.sv
@@ -9,6 +9,7 @@ module core_decode_data
output logic snd_is_imm,
snd_shift_by_reg_if_reg,
writeback,
+ conditional,
update_flags,
restore_spsr
);
@@ -31,6 +32,14 @@ module core_decode_data
always_comb begin
unique case(op)
+ `ALU_ADC, `ALU_SBC, `ALU_RSC:
+ conditional = 1;
+
+ default:
+ conditional = 0;
+ endcase
+
+ unique case(op)
`ALU_CMP, `ALU_CMN, `ALU_TST, `ALU_TEQ:
writeback = 0;