diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-09-24 21:41:07 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-09-24 21:41:07 -0600 |
| commit | 80805f772cf37b13383c81135cc313bbf92068e9 (patch) | |
| tree | 542fb44bdb3dd26b583c4d5c87ca5a001c36560a | |
| parent | 5f55ae1551760b7975ae005e01e4b3c63de49a64 (diff) | |
Implement decode of branch instructions
Diffstat (limited to '')
| -rw-r--r-- | rtl/core/decode/branch.sv | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/rtl/core/decode/branch.sv b/rtl/core/decode/branch.sv new file mode 100644 index 0000000..97e62b5 --- /dev/null +++ b/rtl/core/decode/branch.sv @@ -0,0 +1,16 @@ +`include "core/isa.sv" + +module core_decode_branch +( + input logic[31:0] insn, + output logic link, + output logic[29:0] offset +); + + logic[23:0] immediate; + assign immediate = insn `FIELD_B_OFFSET; + + assign link = insn `FIELD_B_L; + assign offset = {{6{immediate[23]}}, immediate}; + +endmodule |
