From b44dafbdca5ab6a90320b84c99a3ff05689afbe5 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Tue, 29 Oct 2013 04:13:50 -0700 Subject: [PATCH] Simplify branch offset mux --- rocket/src/main/scala/dpath.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))