Add Jump instructions

This commit is contained in:
Victor Timofei 2022-01-16 20:36:50 +02:00
parent ce288f2840
commit d2b945d974
Signed by: vtimofei
GPG Key ID: B790DCEBE281403A
1 changed files with 6 additions and 1 deletions

View File

@ -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};