Skip to content

Commit

Permalink
fix(ftb): fix ftb pred_rdata not reset (OpenXiangShan#3628)
Browse files Browse the repository at this point in the history
  • Loading branch information
eastonman authored Oct 30, 2024
1 parent dcf4211 commit 3bfc01b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/scala/xiangshan/frontend/FTB.scala
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,11 @@ class FTB(implicit p: Parameters) extends BasePredictor with FTBParams with BPUU
))
val ftb_r_entries = ftb.io.r.resp.data.map(_.entry)

val pred_rdata = HoldUnless(ftb.io.r.resp.data, RegNext(io.req_pc.valid && !io.update_access))
val pred_rdata = HoldUnless(
ftb.io.r.resp.data,
RegNext(io.req_pc.valid && !io.update_access),
init = Some(VecInit.fill(numWays)(0.U.asTypeOf(new FTBEntryWithTag)))
) // rdata has ftb_entry.valid, shoud reset
ftb.io.r.req.valid := io.req_pc.valid || io.u_req_pc.valid // io.s0_fire
ftb.io.r.req.bits.setIdx := Mux(
io.u_req_pc.valid,
Expand Down

0 comments on commit 3bfc01b

Please sign in to comment.