diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-10-31 15:25:38 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-11-01 23:04:24 -0600 |
| commit | b5a065227bd176b85765461ac2a791fb0cff1c72 (patch) | |
| tree | b67393abc0b43882647037dc2294df85ea38e93e /rtl/core/decode/decode.sv | |
| parent | f4a3bb7f9656f45b7c0d9b3ed8e8b09e9bd14d37 (diff) | |
Implement multiplication decode
Diffstat (limited to 'rtl/core/decode/decode.sv')
| -rw-r--r-- | rtl/core/decode/decode.sv | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/rtl/core/decode/decode.sv b/rtl/core/decode/decode.sv index 2740b70..f5668c1 100644 --- a/rtl/core/decode/decode.sv +++ b/rtl/core/decode/decode.sv @@ -10,7 +10,8 @@ module core_decode output branch_decode branch_ctrl, output snd_decode snd_ctrl, output data_decode data_ctrl, - output ldst_decode ldst_ctrl + output ldst_decode ldst_ctrl, + output mul_decode mul_ctrl ); logic execute, undefined, conditional, writeback, update_flags, branch; @@ -115,6 +116,19 @@ module core_decode .alu(data_ldst) ); + logic mul_update_flags; + reg_num mul_rd, mul_rs, mul_rm; + + core_decode_mul group_mul + ( + .decode(mul_ctrl), + .rd(mul_rd), + .rs(mul_rs), + .rm(mul_rm), + .update_flags(mul_update_flags), + .* + ); + always_comb begin branch = 0; writeback = 0; @@ -153,6 +167,20 @@ module core_decode end end + `GROUP_MUL: begin + mul_ctrl.enable = 1; + + data_ctrl.rd = mul_rd; + data_ctrl.rn = mul_rs; + + snd_ctrl.is_imm = 0; + snd_ctrl.r = mul_rm; + snd_ctrl.shift_by_reg = 0; + + writeback = 1; + update_flags = mul_update_flags; + end + `GROUP_ALU: begin snd_is_imm = data_is_imm; snd_ror_if_imm = 1; @@ -167,9 +195,6 @@ module core_decode undefined = undefined | snd_undefined; end - /*`INSN_MUL: ; - `GROUP_BIGMUL: ;*/ - `GROUP_LDST_SINGLE_IMM, `GROUP_LDST_SINGLE_REG: begin snd_is_imm = ldst_single_is_imm; snd_ror_if_imm = 0; |
