提交 6fe623af 编写于 作者: L Lingrui98

bpu: add reset back

上级 076dea5f
......@@ -298,7 +298,7 @@ class FTB(implicit p: Parameters) extends BasePredictor with FTBParams with BPUU
})
// Extract holdRead logic to fix bug that update read override predict read result
val ftb = Module(new SRAMTemplate(new FTBEntryWithTag, set = numSets, way = numWays, shouldReset = false, holdRead = false, singlePort = true))
val ftb = Module(new SRAMTemplate(new FTBEntryWithTag, set = numSets, way = numWays, shouldReset = true, holdRead = false, singlePort = true))
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))
......
......@@ -221,7 +221,7 @@ class ITTageTable
val us = Module(new Folded1WDataModuleTemplate(Bool(), nRows, 1, isSync=true, width=uFoldedWidth))
// val table = Module(new SRAMTemplate(new ITTageEntry, set=nRows, way=1, shouldReset=true, holdRead=true, singlePort=false))
val table_banks = Seq.fill(nBanks)(
Module(new FoldedSRAMTemplate(new ITTageEntry, set=nRows/nBanks, width=bankFoldWidth, shouldReset=false, holdRead=true, singlePort=true)))
Module(new FoldedSRAMTemplate(new ITTageEntry, set=nRows/nBanks, width=bankFoldWidth, shouldReset=true, holdRead=true, singlePort=true)))
for (b <- 0 until nBanks) {
table_banks(b).io.r.req.valid := io.req.fire && s0_bank_req_1h(b)
......
......@@ -166,6 +166,16 @@ class RAS(implicit p: Parameters) extends BasePredictor {
io.sp := sp
io.top := top
val resetIdx = RegInit(0.U(log2Ceil(RasSize).W))
val do_reset = RegInit(true.B)
when (do_reset) {
stack.write(resetIdx, RASEntry(0x80000000L.U, 0.U))
}
resetIdx := resetIdx + do_reset
when (resetIdx === (RasSize-1).U) {
do_reset := false.B
}
debugIO.spec_push_entry := RASEntry(io.spec_new_addr, Mux(spec_alloc_new, 1.U, top.ctr + 1.U))
debugIO.spec_alloc_new := spec_alloc_new
debugIO.recover_push_entry := RASEntry(io.recover_new_addr, Mux(recover_alloc_new, 1.U, io.recover_top.ctr + 1.U))
......
......@@ -68,7 +68,7 @@ class SCTable(val nRows: Int, val ctrBits: Int, val histLen: Int)(implicit p: Pa
val io = IO(new SCTableIO(ctrBits))
// val table = Module(new SRAMTemplate(SInt(ctrBits.W), set=nRows, way=2*TageBanks, shouldReset=true, holdRead=true, singlePort=false))
val table = Module(new SRAMTemplate(SInt(ctrBits.W), set=nRows, way=2*TageBanks, shouldReset=false, holdRead=true, singlePort=false, bypassWrite=true))
val table = Module(new SRAMTemplate(SInt(ctrBits.W), set=nRows, way=2*TageBanks, shouldReset=true, holdRead=true, singlePort=false, bypassWrite=true))
// def getIdx(hist: UInt, pc: UInt) = {
// (compute_folded_ghist(hist, log2Ceil(nRows)) ^ (pc >> instOffsetBits))(log2Ceil(nRows)-1,0)
......
......@@ -152,7 +152,7 @@ class TageBTable(implicit p: Parameters) extends XSModule with TBTParams{
val bimAddr = new TableAddr(log2Up(BtSize), instOffsetBits)
val bt = Module(new SRAMTemplate(UInt(2.W), set = BtSize, way=numBr, shouldReset = false, holdRead = true, bypassWrite = true))
val bt = Module(new SRAMTemplate(UInt(2.W), set = BtSize, way=numBr, shouldReset = true, holdRead = true, bypassWrite = true))
val doing_reset = RegInit(true.B)
val resetRow = RegInit(0.U(log2Ceil(BtSize).W))
......@@ -306,7 +306,7 @@ class TageTable
val table_banks = Seq.fill(nBanks)(
Module(new FoldedSRAMTemplate(new TageEntry, set=bankSize, width=bankFoldWidth, way=numBr, shouldReset=false, holdRead=true, singlePort=true)))
Module(new FoldedSRAMTemplate(new TageEntry, set=bankSize, width=bankFoldWidth, way=numBr, shouldReset=true, holdRead=true, singlePort=true)))
val (s0_idx, s0_tag) = compute_tag_and_hash(req_unhashed_idx, io.req.bits.folded_hist)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册