diff options
| author | Alejandro Soto <alejandro@34project.org> | 2024-01-21 06:23:46 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2024-02-20 11:11:17 -0600 |
| commit | f3b18ead59ae02f95dabbf0a1dea40873a816975 (patch) | |
| tree | 8979e50f2a37f66a4cd27e937b480efe60d72cf7 /rtl/core/core_decode_mul.sv | |
| parent | a8bc5a353ea997f73209b39377ee15a73e471237 (diff) | |
rtl: refactor filenames and directory hierarchy
Diffstat (limited to 'rtl/core/core_decode_mul.sv')
| -rw-r--r-- | rtl/core/core_decode_mul.sv | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/rtl/core/core_decode_mul.sv b/rtl/core/core_decode_mul.sv new file mode 100644 index 0000000..88cc422 --- /dev/null +++ b/rtl/core/core_decode_mul.sv @@ -0,0 +1,33 @@ +`include "core/isa.sv" +`include "core/uarch.sv" + +module core_decode_mul +( + input word insn, + + output mul_decode decode, + output reg_num rd, + rs, + rm, + output logic update_flags +); + + logic long_mul; + reg_num short_rd, rn; + + assign rd = long_mul ? rn : short_rd; + assign rs = insn `FIELD_MUL_RS; + assign rm = insn `FIELD_MUL_RM; + assign update_flags = insn `FIELD_MUL_S; + + assign decode.add = insn `FIELD_MUL_ACC; + assign decode.long_mul = long_mul; + assign decode.signed_mul = insn `FIELD_MUL_SIGNED; + assign decode.r_add_lo = rn; + assign decode.r_add_hi = short_rd; + + assign long_mul = insn `FIELD_MUL_LONG; + assign short_rd = insn `FIELD_MUL_RD; + assign rn = insn `FIELD_MUL_RN; + +endmodule |
