Skip to content

Commit

Permalink
fix(L2TLB): fix hptw_bypassed wrong used in refill_valid (#4366)
Browse files Browse the repository at this point in the history
The Reg `hptw_bypassed` is used to indicate a hptw's mem response no
need to refill PTWCache.
So add condition `from_hptw(mem.d.bits.source)` for `hptw_bypassed` used
in `refill_valid`,
to fix bug of Reg `hptw_bypassed` wrongly killing refill request from
another ptw.
  • Loading branch information
yxtx1994 authored Mar 9, 2025
1 parent 11269ca commit 591ae1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/xiangshan/cache/mmu/L2TLB.scala
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ class L2TLBImp(outer: L2TLB)(implicit p: Parameters) extends PtwModule(outer) wi
val refill_from_ptw = mem_resp_from_ptw
val refill_from_hptw = mem_resp_from_hptw
val refill_level = Mux(refill_from_llptw, 0.U, Mux(refill_from_ptw, RegEnable(ptw.io.refill.level, 0.U, ptw.io.mem.req.fire), RegEnable(hptw.io.refill.level, 0.U, hptw.io.mem.req.fire)))
val refill_valid = mem_resp_done && (if (HasBitmapCheck) !mem_resp_from_bitmap else true.B) && !flush && !flush_latch(mem.d.bits.source) && !hptw_bypassed
val refill_valid = mem_resp_done && (if (HasBitmapCheck) !mem_resp_from_bitmap else true.B) && !flush && !flush_latch(mem.d.bits.source) && !(from_hptw(mem.d.bits.source) && hptw_bypassed)

cache.io.refill.valid := GatedValidRegNext(refill_valid, false.B)
cache.io.refill.bits.ptes := refill_data.asUInt
Expand Down

0 comments on commit 591ae1c

Please sign in to comment.