1
0

Fix BTB perf bug

In rare cases, it would replace into a different row than it recorded.
This commit is contained in:
Andrew Waterman 2016-07-06 03:16:05 -07:00
parent f3e22984d5
commit c0e6ecebfc

View File

@ -182,9 +182,8 @@ class BTB(implicit p: Parameters) extends BtbModule {
val useUpdatePageHit = updatePageHit.orR val useUpdatePageHit = updatePageHit.orR
val usePageHit = pageHit.orR val usePageHit = pageHit.orR
val doIdxPageRepl = !useUpdatePageHit val doIdxPageRepl = !useUpdatePageHit
val idxPageRepl = UIntToOH(nextPageRepl) val idxPageRepl = Mux(usePageHit, Cat(pageHit(nPages-2,0), pageHit(nPages-1)), UIntToOH(nextPageRepl))
val idxPageUpdateOH = Mux(useUpdatePageHit, updatePageHit, val idxPageUpdateOH = Mux(useUpdatePageHit, updatePageHit, idxPageRepl)
Mux(usePageHit, Cat(pageHit(nPages-2,0), pageHit(nPages-1)), idxPageRepl))
val idxPageUpdate = OHToUInt(idxPageUpdateOH) val idxPageUpdate = OHToUInt(idxPageUpdateOH)
val idxPageReplEn = Mux(doIdxPageRepl, idxPageRepl, UInt(0)) val idxPageReplEn = Mux(doIdxPageRepl, idxPageRepl, UInt(0))