提交 e5a3f9fd 编写于 作者: Z Zihao Yu

Revert "noop,BRU: move prediction checking to WBU to imporve timing"

This reverts commit 89b7c53e.
上级 88da9da1
......@@ -52,7 +52,6 @@ class BranchIO extends Bundle {
class CommitIO extends Bundle with HasFuType {
val pc = Output(UInt(32.W))
val npc = Output(UInt(32.W))
val ctrl = new CtrlPathIO
val isMMIO = Output(Bool())
val commits = Output(Vec(FuTypeNum, new WriteBackIO))
......
......@@ -58,7 +58,6 @@ class EXU(implicit val p: NOOPConfig) extends Module with HasFuType {
csr.io.out.ready := true.B
io.out.bits.br <> Mux(csr.io.csrjmp.isTaken, csr.io.csrjmp, bru.io.branch)
io.out.bits.npc := io.in.bits.npc
io.out.bits.ctrl := DontCare
(io.out.bits.ctrl, io.in.bits.ctrl) match { case (o, i) =>
......
......@@ -17,7 +17,7 @@ class WBU(implicit val p: NOOPConfig) extends Module {
io.in.ready := true.B
io.brOut <> io.in.bits.br
io.brOut.isTaken := io.in.bits.br.isTaken && io.in.valid && (io.in.bits.br.target =/= io.in.bits.npc)
io.brOut.isTaken := io.in.bits.br.isTaken && io.in.valid
BoringUtils.addSource(io.in.valid, "perfCntCondMinstret")
if (!p.FPGAPlatform) {
......
......@@ -93,8 +93,7 @@ class BRU extends Module with HasBRUOpType {
val target = Mux(func === BruJalr || func === BruRet, src1, io.pc) + io.offset
io.branch.target := Mux(!taken && isBranch(func), io.pc + 4.U, target)
// with branch predictor, this is actually to fix the wrong prediction
// to improve timing, we move the prediction checking to WBU statge
io.branch.isTaken := valid
io.branch.isTaken := valid && (io.branch.target =/= io.npc)
io.out.bits := io.pc + 4.U
io.in.ready := true.B
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册