From d2b945d97407446307afe533a84dc48d1bc7981a Mon Sep 17 00:00:00 2001 From: Victor Timofei Date: Sun, 16 Jan 2022 20:36:50 +0200 Subject: [PATCH] Add Jump instructions --- risc-v_shell.tlv | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/risc-v_shell.tlv b/risc-v_shell.tlv index 903e8d4..4be2512 100644 --- a/risc-v_shell.tlv +++ b/risc-v_shell.tlv @@ -36,6 +36,8 @@ // Program counter $next_pc[31:0] = $reset ? 0 : $taken_br ? $br_tgt_pc : + $is_jal ? $br_tgt_pc : + $is_jalr ? $jalr_tgt_pc : ($pc + 4); $pc[31:0] = >>1$next_pc; @@ -124,9 +126,12 @@ $is_bgeu ? $src1_value >= $src2_value : 0; - // Branch target + // Branch/JAL target $br_tgt_pc[31:0] = $pc + $imm; + // Jump and link register target + $jalr_tgt_pc[31:0] = $src1_value + $imm; + // Arithmetic Logic Unit $sltu_rslt[31:0] = {31'b0, $src1_value < $src2_value}; $sltiu_rslt[31:0] = {31'b0, $src1_value < $imm};