diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-11-08 13:00:40 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-11-08 13:29:23 -0600 |
| commit | f6929f9a4703e3eee9d7bd9752de055729cdd498 (patch) | |
| tree | 770acb4f96fd16e0f12bec2c5ed5cfdfa5a4c315 /rtl/core/decode | |
| parent | 89a8edd4bb96787c69118dd5f549345015b2d480 (diff) | |
Register decode output in a new porch stage
Diffstat (limited to 'rtl/core/decode')
| -rw-r--r-- | rtl/core/decode/conds.sv | 47 | ||||
| -rw-r--r-- | rtl/core/decode/decode.sv | 12 | ||||
| -rw-r--r-- | rtl/core/decode/mux.sv | 16 |
3 files changed, 6 insertions, 69 deletions
diff --git a/rtl/core/decode/conds.sv b/rtl/core/decode/conds.sv deleted file mode 100644 index 60922a0..0000000 --- a/rtl/core/decode/conds.sv +++ /dev/null @@ -1,47 +0,0 @@ -`include "core/decode/isa.sv" -`include "core/uarch.sv" - -module core_decode_conds -( - input logic[3:0] cond, - input psr_flags flags, - - output logic execute, - conditional, - undefined -); - - always_comb begin - undefined = 0; - conditional = 1; - - unique case(cond) - `COND_EQ: execute = flags.z; - `COND_NE: execute = ~flags.z; - `COND_HS: execute = flags.c; - `COND_LO: execute = ~flags.c; - `COND_MI: execute = flags.n; - `COND_PL: execute = ~flags.n; - `COND_VS: execute = flags.v; - `COND_VC: execute = ~flags.v; - `COND_HI: execute = flags.c & ~flags.z; - `COND_LS: execute = ~flags.c | flags.z; - `COND_GE: execute = flags.n ~^ flags.v; - `COND_LT: execute = flags.n ^ flags.v; - `COND_GT: execute = ~flags.z & (flags.n ~^ flags.v); - `COND_LE: execute = flags.z | (flags.n ^ flags.v); - - `COND_AL: begin - execute = 1; - conditional = 0; - end - - `COND_UD: begin - execute = 1'bx; - conditional = 1'bx; - undefined = 1; - end - endcase - end - -endmodule diff --git a/rtl/core/decode/decode.sv b/rtl/core/decode/decode.sv index ab8d2b9..6c5b802 100644 --- a/rtl/core/decode/decode.sv +++ b/rtl/core/decode/decode.sv @@ -4,7 +4,6 @@ module core_decode ( input word insn, - input psr_flags flags, output insn_decode dec ); @@ -51,17 +50,6 @@ module core_decode //TODO logic restore_spsr; - logic cond_undefined, cond_execute, explicit_cond; - - core_decode_conds conds - ( - .cond(insn `FIELD_COND), - .execute(cond_execute), - .undefined(cond_undefined), - .conditional(explicit_cond), - .* - ); - logic snd_is_imm, snd_ror_if_imm, snd_shift_by_reg_if_reg, snd_undefined; snd_decode snd; diff --git a/rtl/core/decode/mux.sv b/rtl/core/decode/mux.sv index 643c942..ebcc098 100644 --- a/rtl/core/decode/mux.sv +++ b/rtl/core/decode/mux.sv @@ -5,10 +5,6 @@ module core_decode_mux ( input word insn, - input logic cond_undefined, - cond_execute, - explicit_cond, - input logic branch_link, input snd_decode snd, @@ -74,10 +70,10 @@ module core_decode_mux ldst = 0; branch = 0; coproc = 0; - execute = cond_execute; - undefined = cond_undefined; + execute = 1; + undefined = 0; writeback = 0; - conditional = explicit_cond; + conditional = 0; restore_spsr = 0; spsr = 0; @@ -139,8 +135,8 @@ module core_decode_mux update_flags = data_update_flags; restore_spsr = data_restore_spsr; - undefined = undefined | snd_undefined; - conditional = conditional | data_conditional; + undefined = snd_undefined; + conditional = data_conditional; end `GROUP_LDST_SINGLE_IMM, `GROUP_LDST_SINGLE_REG: begin @@ -152,7 +148,7 @@ module core_decode_mux dec_ldst = ldst_single; ldst_addr = ldst_single; - undefined = undefined | snd_undefined; + undefined = snd_undefined; end `GROUP_LDST_MISC_IMM, `GROUP_LDST_MISC_REG: |
