Fix BTB error (requires Chisel update)
This commit is contained in:
parent
cbb37ccc3e
commit
8bc1c33540
@ -146,14 +146,12 @@ class BTB(implicit conf: BTBConfig) extends Module {
|
|||||||
val nextRepl = Counter(!updateHit && updateValid, conf.entries)._1
|
val nextRepl = Counter(!updateHit && updateValid, conf.entries)._1
|
||||||
val waddr = Mux(updateHit, update.bits.prediction.bits.entry, nextRepl)
|
val waddr = Mux(updateHit, update.bits.prediction.bits.entry, nextRepl)
|
||||||
|
|
||||||
when (doPageRepl) {
|
// invalidate entries if we stomp on pages they depend upon
|
||||||
val clearValid = for (i <- 0 until conf.entries)
|
idxValid := idxValid & ~Vec.tabulate(conf.entries)(i => (pageReplEn & (idxPagesOH(i) | tgtPagesOH(i))).orR).toBits
|
||||||
yield (pageReplEn & (idxPagesOH(i) | tgtPagesOH(i))).orR
|
|
||||||
idxValid := idxValid & ~Vec(clearValid).toBits
|
idxValid(waddr) := updateValid
|
||||||
}
|
|
||||||
when (updateTarget) {
|
when (updateTarget) {
|
||||||
assert(io.req === update.bits.target, "BTB request != I$ target")
|
assert(io.req === update.bits.target, "BTB request != I$ target")
|
||||||
idxValid := idxValid.bitSet(waddr, updateValid)
|
|
||||||
idxs(waddr) := update.bits.pc
|
idxs(waddr) := update.bits.pc
|
||||||
tgts(waddr) := update_target
|
tgts(waddr) := update_target
|
||||||
idxPages(waddr) := idxPageUpdate
|
idxPages(waddr) := idxPageUpdate
|
||||||
|
Loading…
Reference in New Issue
Block a user