diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-11-07 21:03:49 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-11-07 21:03:49 -0600 |
| commit | 19c860221fb2fc129e6d2c1a41a77a8e8010f6c3 (patch) | |
| tree | 849d03150399751d409d5e5ab5fd07e1a638a8ac | |
| parent | 4ccb96c1aaf348f677954171751b58ad8f4dccf1 (diff) | |
Fix flags hazard in ADC, SBC, RSC
Diffstat (limited to '')
| -rw-r--r-- | rtl/core/decode/data.sv | 9 | ||||
| -rw-r--r-- | rtl/core/decode/decode.sv | 3 | ||||
| -rw-r--r-- | rtl/core/decode/mux.sv | 3 |
3 files changed, 14 insertions, 1 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; diff --git a/rtl/core/decode/decode.sv b/rtl/core/decode/decode.sv index f8042a9..3096c7a 100644 --- a/rtl/core/decode/decode.sv +++ b/rtl/core/decode/decode.sv @@ -75,12 +75,13 @@ module core_decode data_decode data; logic data_writeback, data_update_flags, data_restore_spsr, - data_is_imm, data_shift_by_reg_if_reg; + data_is_imm, data_shift_by_reg_if_reg, data_conditional; core_decode_data group_data ( .decode(data), .writeback(data_writeback), + .conditional(data_conditional), .update_flags(data_update_flags), .restore_spsr(data_restore_spsr), .snd_is_imm(data_is_imm), diff --git a/rtl/core/decode/mux.sv b/rtl/core/decode/mux.sv index 9d86f9e..65af9c6 100644 --- a/rtl/core/decode/mux.sv +++ b/rtl/core/decode/mux.sv @@ -16,6 +16,7 @@ module core_decode_mux input data_decode data, input logic data_writeback, + data_conditional, data_update_flags, data_restore_spsr, data_is_imm, @@ -137,7 +138,9 @@ module core_decode_mux writeback = data_writeback; update_flags = data_update_flags; restore_spsr = data_restore_spsr; + undefined = undefined | snd_undefined; + conditional = conditional | data_conditional; end `GROUP_LDST_SINGLE_IMM, `GROUP_LDST_SINGLE_REG: begin |
