From b5a065227bd176b85765461ac2a791fb0cff1c72 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Mon, 31 Oct 2022 15:25:38 -0600 Subject: Implement multiplication decode --- rtl/core/decode/decode.sv | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'rtl/core/decode/decode.sv') 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; -- cgit v1.2.3