提交 04fea0f7 编写于 作者: S Steve Gou 提交者: Lingrui98

tage-sc: add bypassWrite for SC srams and fix a bug of resp_invalid_by_write in TageTable (#1702)

上级 66612162
......@@ -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))
val table = Module(new SRAMTemplate(SInt(ctrBits.W), set=nRows, way=2*TageBanks, shouldReset=false, holdRead=true, singlePort=false, bypassWrite=true))
// def getIdx(hist: UInt, pc: UInt) = {
// (compute_folded_ghist(hist, log2Ceil(nRows)) ^ (pc >> instOffsetBits))(log2Ceil(nRows)-1,0)
......
......@@ -326,13 +326,13 @@ class TageTable
val s1_tag = RegEnable(s0_tag, io.req.fire)
val s1_pc = RegEnable(io.req.bits.pc, io.req.fire)
val s1_bank_req_1h = RegEnable(s0_bank_req_1h, io.req.fire)
val s1_bank_has_write_last_cycle = RegNext(VecInit(table_banks.map(_.io.w.req.valid)))
val s1_bank_has_write_on_this_req = RegEnable(VecInit(table_banks.map(_.io.w.req.valid)), io.req.valid)
val tables_r = table_banks.map(_.io.r.resp.data) // s1
val resp_selected = Mux1H(s1_bank_req_1h, tables_r)
val resp_invalid_by_write = Mux1H(s1_bank_req_1h, s1_bank_has_write_last_cycle)
val resp_invalid_by_write = Mux1H(s1_bank_req_1h, s1_bank_has_write_on_this_req)
val per_br_resp = VecInit((0 until numBr).map(i => Mux1H(UIntToOH(get_phy_br_idx(s1_unhashed_idx, i), numBr), resp_selected)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册