diff --git a/rocket/src/main/scala/dpath.scala b/rocket/src/main/scala/dpath.scala index 23c54a4a..e6951109 100644 --- a/rocket/src/main/scala/dpath.scala +++ b/rocket/src/main/scala/dpath.scala @@ -184,7 +184,7 @@ class Datapath(implicit conf: RocketConfiguration) extends Module e(0))) } val ex_br_base = Mux(io.ctrl.ex_jalr, ex_rs1, ex_reg_pc) - val ex_br_offset = Mux(io.ctrl.ex_predicted_taken && !io.ctrl.ex_jalr, SInt(4), ex_imm) + val ex_br_offset = Mux(io.ctrl.ex_predicted_taken && !io.ctrl.ex_jalr, SInt(4), ex_imm(19,0).toSInt) val ex_br64 = ex_br_base + ex_br_offset val ex_br_msb = Mux(io.ctrl.ex_jalr, vaSign(ex_rs1, ex_br64), vaSign(ex_reg_pc, ex_br64)) val ex_br_addr = Cat(ex_br_msb, ex_br64(VADDR_BITS-1,0))