diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-10-18 08:47:57 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-10-18 08:47:57 -0600 |
| commit | 9162c76e3e6717b114190051e59eaf70205d9111 (patch) | |
| tree | 041542ae6a2b0ce241c655e2e6a8ba294602f7a7 | |
| parent | 52f1f2f94bddfb1e73d2c094cfd693916750a467 (diff) | |
Implement branch with link
| -rw-r--r-- | rtl/core/control/control.sv | 3 | ||||
| -rw-r--r-- | rtl/core/decode/decode.sv | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/rtl/core/control/control.sv b/rtl/core/control/control.sv index e1bdbb8..95d3bb9 100644 --- a/rtl/core/control/control.sv +++ b/rtl/core/control/control.sv @@ -84,7 +84,8 @@ module core_control assign next_bubble = ((dec_update_flags || dec_conditional) && (final_update_flags || update_flags)) - || (final_writeback && ((dec_uses_rn && final_rd == dec_data.rn) || final_rd == dec_snd.r)); + || (final_writeback && ((dec_uses_rn && (final_rd == dec_data.rn || dec_data.rn == `R15)) + || final_rd == dec_snd.r || dec_snd.r == `R15)); core_control_ldst_pop ldst_pop ( diff --git a/rtl/core/decode/decode.sv b/rtl/core/decode/decode.sv index 2580701..9367e6d 100644 --- a/rtl/core/decode/decode.sv +++ b/rtl/core/decode/decode.sv @@ -143,9 +143,11 @@ module core_decode `GROUP_B: begin branch = 1; if(branch_link) begin + data_ctrl.op = `ALU_SUB; data_ctrl.rd = `R14; + data_ctrl.rn = `R15; + snd_ctrl.imm = 12'd4; writeback = 1; - //TODO: Valor de LR end end |
