Skip to content

Commit

Permalink
Bump utility and disable ConstantIn by default (#2955)
Browse files Browse the repository at this point in the history
* use BigInt for initValue of Constantin.createRecord
* use WITH_CONSTANTIN=1 to enable the ConstantIn plugin
  • Loading branch information
poemonsense authored May 10, 2024
1 parent bc3d558 commit c686adc
Show file tree
Hide file tree
Showing 21 changed files with 65 additions and 62 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ override SIM_ARGS += --disable-alwaysdb
endif

# dynamic switch CONSTANTIN
ifeq ($(WITH_CONSTANTIN),0)
$(info disable WITH_CONSTANTIN)
else
ifeq ($(WITH_CONSTANTIN),1)
override SIM_ARGS += --with-constantin
endif

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/xiangshan/backend/Backend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ class BackendImp(override val wrapper: Backend)(implicit p: Parameters) extends

io.mem.redirect := ctrlBlock.io.redirect
io.mem.issueUops.zip(toMem.flatten).foreach { case (sink, source) =>
val enableMdp = Constantin.createRecord("EnableMdp", true.B)(0)
val enableMdp = Constantin.createRecord("EnableMdp", true)
sink.valid := source.valid
source.ready := sink.ready
sink.bits.iqIdx := source.bits.iqIdx
Expand Down
9 changes: 5 additions & 4 deletions src/main/scala/xiangshan/backend/MemBlock.scala
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,11 @@ class MemBlockImp(outer: MemBlock) extends LazyModuleImp(outer)
sms
}
prefetcherOpt.foreach{ pf => pf.io.l1_req.ready := false.B }
val hartId = p(XSCoreParamsKey).HartId
val l1PrefetcherOpt: Option[BasePrefecher] = coreParams.prefetcher.map {
case _ =>
val l1Prefetcher = Module(new L1Prefetcher())
l1Prefetcher.io.enable := WireInit(Constantin.createRecord("enableL1StreamPrefetcher" + p(XSCoreParamsKey).HartId.toString, initValue = 1.U)) === 1.U
l1Prefetcher.io.enable := Constantin.createRecord(s"enableL1StreamPrefetcher$hartId", initValue = true)
l1Prefetcher.pf_ctrl <> dcache.io.pf_ctrl
l1Prefetcher.l2PfqBusy := io.l2PfqBusy

Expand Down Expand Up @@ -496,7 +497,7 @@ class MemBlockImp(outer: MemBlock) extends LazyModuleImp(outer)

val l2_trace = Wire(new LoadPfDbBundle)
l2_trace.paddr := outer.l2_pf_sender_opt.get.out.head._1.addr
val table = ChiselDB.createTable("L2PrefetchTrace"+ p(XSCoreParamsKey).HartId.toString, new LoadPfDbBundle, basicDB = false)
val table = ChiselDB.createTable(s"L2PrefetchTrace$hartId", new LoadPfDbBundle, basicDB = false)
table.log(l2_trace, l1_pf_to_l2.valid, "StreamPrefetchTrace", clock, reset)
table.log(l2_trace, !l1_pf_to_l2.valid && sms_pf_to_l2.valid, "L2PrefetchTrace", clock, reset)

Expand All @@ -507,7 +508,7 @@ class MemBlockImp(outer: MemBlock) extends LazyModuleImp(outer)

val l3_trace = Wire(new LoadPfDbBundle)
l3_trace.paddr := outer.l3_pf_sender_opt.get.out.head._1.addr
val l3_table = ChiselDB.createTable("L3PrefetchTrace"+ p(XSCoreParamsKey).HartId.toString, new LoadPfDbBundle, basicDB = false)
val l3_table = ChiselDB.createTable(s"L3PrefetchTrace$hartId", new LoadPfDbBundle, basicDB = false)
l3_table.log(l3_trace, l1_pf_to_l3.valid, "StreamPrefetchTrace", clock, reset)

XSPerfAccumulate("prefetch_fire_l2", outer.l2_pf_sender_opt.get.out.head._1.addr_valid)
Expand Down Expand Up @@ -672,7 +673,7 @@ class MemBlockImp(outer: MemBlock) extends LazyModuleImp(outer)
PrintTriggerInfo(tEnable(j), tdata(j))

// LoadUnit
val correctMissTrain = WireInit(Constantin.createRecord("CorrectMissTrain" + p(XSCoreParamsKey).HartId.toString, initValue = 0.U)) === 1.U
val correctMissTrain = Constantin.createRecord(s"CorrectMissTrain$hartId", initValue = false)

for (i <- 0 until LduCnt) {
loadUnits(i).io.redirect <> redirect
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/xiangshan/backend/fu/CSR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ class CSR(cfg: FuConfig)(implicit p: Parameters) extends FuncUnit(cfg)
// Overhead: extra two redirections in every 64K cycles => ~0.1% overhead
val slvpredctl = Reg(UInt(XLEN.W))
when(reset.asBool) {
slvpredctl := Constantin.createRecord("slvpredctl", "h60".U)
slvpredctl := Constantin.createRecord("slvpredctl", 0x60)
}
csrio.customCtrl.lvpred_disable := slvpredctl(0)
csrio.customCtrl.no_spec_load := slvpredctl(1)
Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/xiangshan/backend/issue/Dispatch2Iq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,8 @@ class Dispatch2IqMemImp(override val wrapper: Dispatch2Iq)(implicit p: Parameter

// decide the priority of hyu for load instructions
val hyuPriorityCtr = RegInit(0x100.U(9.W))
val addCtr = io.in.map(in => Mux(in.fire && FuType.isLoad(in.bits.fuType), Constantin.createRecord("hyuPriorityAddCtr", 2.U)(1, 0), 0.U)).reduce(_ +& _) // loadCnt * 2
val subCtr = io.in.map(in => Mux(in.fire && FuType.isStore(in.bits.fuType), Constantin.createRecord("hyuPrioritySubCtr", 5.U)(2, 0), 0.U)).reduce(_ +& _) // storeCnt * 5
val addCtr = io.in.map(in => Mux(in.fire && FuType.isLoad(in.bits.fuType), Constantin.createRecord("hyuPriorityAddCtr", 2)(1, 0), 0.U)).reduce(_ +& _) // loadCnt * 2
val subCtr = io.in.map(in => Mux(in.fire && FuType.isStore(in.bits.fuType), Constantin.createRecord("hyuPrioritySubCtr", 5)(2, 0), 0.U)).reduce(_ +& _) // storeCnt * 5
val nextCtr = hyuPriorityCtr + addCtr - subCtr
hyuPriorityCtr := Mux(addCtr > subCtr && hyuPriorityCtr > nextCtr, 0x1FF.U(9.W),
Mux(addCtr < subCtr && hyuPriorityCtr < nextCtr, 0x000.U(9.W),
Expand Down Expand Up @@ -875,8 +875,8 @@ class Dispatch2IqMemImp(override val wrapper: Dispatch2Iq)(implicit p: Parameter
val loadIqValidCnt = loadIqIdx.map(io.iqValidCnt)
val sthyIqValidCnt = stHyIqIdx.map(io.iqValidCnt)

val loadDeqNeedFlip = RegNext(loadIqValidCnt.last < loadIqValidCnt.head) && Constantin.createRecord("enableLoadBalance", true.B)(0)
val storeDeqNeedFlip = RegNext(sthyIqValidCnt.last < sthyIqValidCnt.head) && Constantin.createRecord("enableStoreBalance", true.B)(0)
val loadDeqNeedFlip = RegNext(loadIqValidCnt.last < loadIqValidCnt.head) && Constantin.createRecord("enableLoadBalance", true)
val storeDeqNeedFlip = RegNext(sthyIqValidCnt.last < sthyIqValidCnt.head) && Constantin.createRecord("enableStoreBalance", true)
val loadValidDecoder = LoadValidTable.truthTable.map(decoder(EspressoMinimizer, inIsNotLoadVec, _))
val storeValidDecoder = StoreValidTable.truthTable.map(decoder(EspressoMinimizer, inIsStoreAmoVec, _))

Expand Down
13 changes: 7 additions & 6 deletions src/main/scala/xiangshan/cache/dcache/DCacheWrapper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1171,10 +1171,11 @@ class DCacheImp(outer: DCache) extends LazyModuleImp(outer) with HasDCacheParame
XSPerfAccumulate("late_load_hit", ldu.map(_.io.prefetch_info.naive.late_load_hit).reduce(_ || _))

/** LoadMissDB: record load miss state */
val isWriteLoadMissTable = WireInit(Constantin.createRecord("isWriteLoadMissTable" + p(XSCoreParamsKey).HartId.toString))
val isFirstHitWrite = WireInit(Constantin.createRecord("isFirstHitWrite" + p(XSCoreParamsKey).HartId.toString))
val tableName = "LoadMissDB" + p(XSCoreParamsKey).HartId.toString
val siteName = "DcacheWrapper" + p(XSCoreParamsKey).HartId.toString
val hartId = p(XSCoreParamsKey).HartId
val isWriteLoadMissTable = Constantin.createRecord(s"isWriteLoadMissTable$hartId")
val isFirstHitWrite = Constantin.createRecord(s"isFirstHitWrite$hartId")
val tableName = s"LoadMissDB$hartId"
val siteName = s"DcacheWrapper$hartId"
val loadMissTable = ChiselDB.createTable(tableName, new LoadMissEntry)
for( i <- 0 until LoadPipelineWidth){
val loadMissEntry = Wire(new LoadMissEntry)
Expand All @@ -1199,8 +1200,8 @@ class DCacheImp(outer: DCache) extends LazyModuleImp(outer) with HasDCacheParame
)
}

val isWriteLoadAccessTable = WireInit(Constantin.createRecord("isWriteLoadAccessTable" + p(XSCoreParamsKey).HartId.toString))
val loadAccessTable = ChiselDB.createTable("LoadAccessDB" + p(XSCoreParamsKey).HartId.toString, new LoadAccessEntry)
val isWriteLoadAccessTable = Constantin.createRecord(s"isWriteLoadAccessTable$hartId")
val loadAccessTable = ChiselDB.createTable(s"LoadAccessDB$hartId", new LoadAccessEntry)
for (i <- 0 until LoadPipelineWidth) {
val loadAccessEntry = Wire(new LoadAccessEntry)
loadAccessEntry.timeCnt := GTimer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ class SramedDataArray(implicit p: Parameters) extends AbstractBankedDataArray {
bankConflictData.fake_rr_bank_conflict := false.B
}

val isWriteBankConflictTable = WireInit(Constantin.createRecord("isWriteBankConflictTable" + p(XSCoreParamsKey).HartId.toString))
val isWriteBankConflictTable = Constantin.createRecord(s"isWriteBankConflictTable${p(XSCoreParamsKey).HartId}")
bankConflictTable.log(
data = bankConflictData,
en = isWriteBankConflictTable.orR && rr_bank_conflict(0)(1),
Expand Down Expand Up @@ -1054,7 +1054,7 @@ class BankedDataArray(implicit p: Parameters) extends AbstractBankedDataArray {
bankConflictData.fake_rr_bank_conflict := false.B
}

val isWriteBankConflictTable = WireInit(Constantin.createRecord("isWriteBankConflictTable" + p(XSCoreParamsKey).HartId.toString))
val isWriteBankConflictTable = Constantin.createRecord(s"isWriteBankConflictTable${p(XSCoreParamsKey).HartId}")
bankConflictTable.log(
data = bankConflictData,
en = isWriteBankConflictTable.orR && rr_bank_conflict(0)(1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class MainPipe(implicit p: Parameters) extends DCacheModule with HasPerfEvents w
// convert store req to main pipe req, and select a req from store and probe
val storeWaitCycles = RegInit(0.U(4.W))
val StoreWaitThreshold = Wire(UInt(4.W))
StoreWaitThreshold := Constantin.createRecord("StoreWaitThreshold_"+p(XSCoreParamsKey).HartId.toString(), initValue = 0.U)
StoreWaitThreshold := Constantin.createRecord(s"StoreWaitThreshold_${p(XSCoreParamsKey).HartId}", initValue = 0)
val storeWaitTooLong = storeWaitCycles >= StoreWaitThreshold
val loadsAreComing = io.data_read.asUInt.orR
val storeCanAccept = storeWaitTooLong || !loadsAreComing || io.force_write
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ class MissQueue(edge: TLEdgeOut)(implicit p: Parameters) extends DCacheModule

io.mem_grant.ready := false.B

val nMaxPrefetchEntry = WireInit(Constantin.createRecord("nMaxPrefetchEntry" + p(XSCoreParamsKey).HartId.toString, initValue = 14.U))
val nMaxPrefetchEntry = Constantin.createRecord(s"nMaxPrefetchEntry${p(XSCoreParamsKey).HartId}", initValue = 14)
entries.zipWithIndex.foreach {
case (e, i) =>
val former_primary_ready = if(i == 0)
Expand Down Expand Up @@ -1021,8 +1021,8 @@ class MissQueue(edge: TLEdgeOut)(implicit p: Parameters) extends DCacheModule
debug_miss_trace.source := io.req.bits.source
debug_miss_trace.pc := io.req.bits.pc

val isWriteL1MissQMissTable = WireInit(Constantin.createRecord("isWriteL1MissQMissTable" + p(XSCoreParamsKey).HartId.toString))
val table = ChiselDB.createTable("L1MissQMissTrace_hart"+ p(XSCoreParamsKey).HartId.toString, new L1MissTrace)
val isWriteL1MissQMissTable = Constantin.createRecord(s"isWriteL1MissQMissTable${p(XSCoreParamsKey).HartId}")
val table = ChiselDB.createTable(s"L1MissQMissTrace_hart${p(XSCoreParamsKey).HartId}", new L1MissTrace)
table.log(debug_miss_trace, isWriteL1MissQMissTable.orR && io.req.valid && !io.req.bits.cancel && alloc, "MissQueue", clock, reset)

// Difftest
Expand Down
21 changes: 11 additions & 10 deletions src/main/scala/xiangshan/cache/mmu/L2TLB.scala
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class L2TLBImp(outer: L2TLB)(implicit p: Parameters) extends PtwModule(outer) wi
arb2.io.in(InArbHPTWPort).bits.isLLptw := false.B
arb2.io.in(InArbHPTWPort).bits.hptwId := hptw_req_arb.io.out.bits.id
hptw_req_arb.io.out.ready := arb2.io.in(InArbHPTWPort).ready
val hartId = p(XSCoreParamsKey).HartId
if (l2tlbParams.enablePrefetch) {
val prefetch = Module(new L2TlbPrefetch())
val recv = cache.io.resp
Expand All @@ -184,8 +185,8 @@ class L2TLBImp(outer: L2TLB)(implicit p: Parameters) extends PtwModule(outer) wi
prefetch.io.csr := csr_dup(0)
arb2.io.in(InArbPrefetchPort) <> prefetch.io.out

val isWriteL2TlbPrefetchTable = WireInit(Constantin.createRecord("isWriteL2TlbPrefetchTable" + p(XSCoreParamsKey).HartId.toString))
val L2TlbPrefetchTable = ChiselDB.createTable("L2TlbPrefetch_hart" + p(XSCoreParamsKey).HartId.toString, new L2TlbPrefetchDB)
val isWriteL2TlbPrefetchTable = Constantin.createRecord(s"isWriteL2TlbPrefetchTable$hartId")
val L2TlbPrefetchTable = ChiselDB.createTable(s"L2TlbPrefetch_hart$hartId", new L2TlbPrefetchDB)
val L2TlbPrefetchDB = Wire(new L2TlbPrefetchDB)
L2TlbPrefetchDB.vpn := prefetch.io.out.bits.req_info.vpn
L2TlbPrefetchTable.log(L2TlbPrefetchDB, isWriteL2TlbPrefetchTable.orR && prefetch.io.out.fire, "L2TlbPrefetch", clock, reset)
Expand Down Expand Up @@ -623,8 +624,8 @@ class L2TLBImp(outer: L2TLB)(implicit p: Parameters) extends PtwModule(outer) wi
val perfEvents = Seq(llptw, cache, ptw).flatMap(_.getPerfEvents)
generatePerfEvent()

val isWriteL1TlbTable = WireInit(Constantin.createRecord("isWriteL1TlbTable" + p(XSCoreParamsKey).HartId.toString))
val L1TlbTable = ChiselDB.createTable("L1Tlb_hart" + p(XSCoreParamsKey).HartId.toString, new L1TlbDB)
val isWriteL1TlbTable = Constantin.createRecord(s"isWriteL1TlbTable$hartId")
val L1TlbTable = ChiselDB.createTable(s"L1Tlb_hart$hartId", new L1TlbDB)
val ITlbReqDB, DTlbReqDB, ITlbRespDB, DTlbRespDB = Wire(new L1TlbDB)
ITlbReqDB.vpn := io.tlb(0).req(0).bits.vpn
DTlbReqDB.vpn := io.tlb(1).req(0).bits.vpn
Expand All @@ -635,8 +636,8 @@ class L2TLBImp(outer: L2TLB)(implicit p: Parameters) extends PtwModule(outer) wi
L1TlbTable.log(ITlbRespDB, isWriteL1TlbTable.orR && io.tlb(0).resp.fire, "ITlbResp", clock, reset)
L1TlbTable.log(DTlbRespDB, isWriteL1TlbTable.orR && io.tlb(1).resp.fire, "DTlbResp", clock, reset)

val isWritePageCacheTable = WireInit(Constantin.createRecord("isWritePageCacheTable" + p(XSCoreParamsKey).HartId.toString))
val PageCacheTable = ChiselDB.createTable("PageCache_hart" + p(XSCoreParamsKey).HartId.toString, new PageCacheDB)
val isWritePageCacheTable = Constantin.createRecord(s"isWritePageCacheTable$hartId")
val PageCacheTable = ChiselDB.createTable(s"PageCache_hart$hartId", new PageCacheDB)
val PageCacheDB = Wire(new PageCacheDB)
PageCacheDB.vpn := Cat(cache.io.resp.bits.toTlb.entry(0).tag, OHToUInt(cache.io.resp.bits.toTlb.pteidx))
PageCacheDB.source := cache.io.resp.bits.req_info.source
Expand All @@ -649,8 +650,8 @@ class L2TLBImp(outer: L2TLB)(implicit p: Parameters) extends PtwModule(outer) wi
PageCacheDB.hit := cache.io.resp.bits.hit
PageCacheTable.log(PageCacheDB, isWritePageCacheTable.orR && cache.io.resp.fire, "PageCache", clock, reset)

val isWritePTWTable = WireInit(Constantin.createRecord("isWritePTWTable" + p(XSCoreParamsKey).HartId.toString))
val PTWTable = ChiselDB.createTable("PTW_hart" + p(XSCoreParamsKey).HartId.toString, new PTWDB)
val isWritePTWTable = Constantin.createRecord(s"isWritePTWTable$hartId")
val PTWTable = ChiselDB.createTable(s"PTW_hart$hartId", new PTWDB)
val PTWReqDB, PTWRespDB, LLPTWReqDB, LLPTWRespDB = Wire(new PTWDB)
PTWReqDB.vpn := ptw.io.req.bits.req_info.vpn
PTWReqDB.source := ptw.io.req.bits.req_info.source
Expand All @@ -665,8 +666,8 @@ class L2TLBImp(outer: L2TLB)(implicit p: Parameters) extends PtwModule(outer) wi
PTWTable.log(LLPTWReqDB, isWritePTWTable.orR && llptw.io.in.fire, "LLPTWReq", clock, reset)
PTWTable.log(LLPTWRespDB, isWritePTWTable.orR && llptw.io.mem.resp.fire, "LLPTWResp", clock, reset)

val isWriteL2TlbMissQueueTable = WireInit(Constantin.createRecord("isWriteL2TlbMissQueueTable" + p(XSCoreParamsKey).HartId.toString))
val L2TlbMissQueueTable = ChiselDB.createTable("L2TlbMissQueue_hart" + p(XSCoreParamsKey).HartId.toString, new L2TlbMissQueueDB)
val isWriteL2TlbMissQueueTable = Constantin.createRecord(s"isWriteL2TlbMissQueueTable$hartId")
val L2TlbMissQueueTable = ChiselDB.createTable(s"L2TlbMissQueue_hart$hartId", new L2TlbMissQueueDB)
val L2TlbMissQueueInDB, L2TlbMissQueueOutDB = Wire(new L2TlbMissQueueDB)
L2TlbMissQueueInDB.vpn := missQueue.io.in.bits.req_info.vpn
L2TlbMissQueueOutDB.vpn := missQueue.io.out.bits.req_info.vpn
Expand Down
9 changes: 5 additions & 4 deletions src/main/scala/xiangshan/frontend/IFU.scala
Original file line number Diff line number Diff line change
Expand Up @@ -970,10 +970,11 @@ class NewIFU(implicit p: Parameters) extends XSModule
XSPerfAccumulate("except_0", f3_perf_info.except_0 && io.toIbuffer.fire )
XSPerfHistogram("ifu2ibuffer_validCnt", PopCount(io.toIbuffer.bits.valid & io.toIbuffer.bits.enqEnable), io.toIbuffer.fire, 0, PredictWidth + 1, 1)

val isWriteFetchToIBufferTable = WireInit(Constantin.createRecord("isWriteFetchToIBufferTable" + p(XSCoreParamsKey).HartId.toString))
val isWriteIfuWbToFtqTable = WireInit(Constantin.createRecord("isWriteIfuWbToFtqTable" + p(XSCoreParamsKey).HartId.toString))
val fetchToIBufferTable = ChiselDB.createTable("FetchToIBuffer" + p(XSCoreParamsKey).HartId.toString, new FetchToIBufferDB)
val ifuWbToFtqTable = ChiselDB.createTable("IfuWbToFtq" + p(XSCoreParamsKey).HartId.toString, new IfuWbToFtqDB)
val hartId = p(XSCoreParamsKey).HartId
val isWriteFetchToIBufferTable = Constantin.createRecord(s"isWriteFetchToIBufferTable$hartId")
val isWriteIfuWbToFtqTable = Constantin.createRecord(s"isWriteIfuWbToFtqTable$hartId")
val fetchToIBufferTable = ChiselDB.createTable(s"FetchToIBuffer$hartId", new FetchToIBufferDB)
val ifuWbToFtqTable = ChiselDB.createTable(s"IfuWbToFtq$hartId", new IfuWbToFtqDB)

val fetchIBufferDumpData = Wire(new FetchToIBufferDB)
fetchIBufferDumpData.start_addr := f3_ftq_req.startAddr
Expand Down
9 changes: 5 additions & 4 deletions src/main/scala/xiangshan/frontend/NewFtq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1361,8 +1361,9 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
io.toPrefetch.req.bits.target := RegNext(ftq_pc_mem.io.other_rdatas(0).startAddr)

// record position relationship between ifuPtr, pfPtr and bpuPtr
val isWritePrefetchPtrTable = WireInit(Constantin.createRecord("isWritePrefetchPtrTable" + p(XSCoreParamsKey).HartId.toString))
val prefetchPtrTable = ChiselDB.createTable("PrefetchPtrTable" + p(XSCoreParamsKey).HartId.toString, new PrefetchPtrDB)
val hartId = p(XSCoreParamsKey).HartId
val isWritePrefetchPtrTable = Constantin.createRecord(s"isWritePrefetchPtrTable$hartId")
val prefetchPtrTable = ChiselDB.createTable(s"PrefetchPtrTable$hartId", new PrefetchPtrDB)
val prefetchPtrDumpData = Wire(new PrefetchPtrDB)
prefetchPtrDumpData.fromFtqPtr := distanceBetween(bpuPtr, prefetchPtr)
prefetchPtrDumpData.fromIfuPtr := distanceBetween(prefetchPtr, ifuPtr)
Expand Down Expand Up @@ -1396,8 +1397,8 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
io.bpuInfo.bpRight := PopCount(mbpRights)
io.bpuInfo.bpWrong := PopCount(mbpWrongs)

val isWriteFTQTable = WireInit(Constantin.createRecord("isWriteFTQTable" + p(XSCoreParamsKey).HartId.toString))
val ftqBranchTraceDB = ChiselDB.createTable("FTQTable" + p(XSCoreParamsKey).HartId.toString, new FtqDebugBundle)
val isWriteFTQTable = Constantin.createRecord(s"isWriteFTQTable$hartId")
val ftqBranchTraceDB = ChiselDB.createTable(s"FTQTable$hartId", new FtqDebugBundle)
// Cfi Info
for (i <- 0 until PredictWidth) {
val pc = commit_pc_bundle.startAddr + (i * instBytes).U
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ class ICacheMainPipe(implicit p: Parameters) extends ICacheModule
s1_fire := s1_valid && tlbRespAllValid && s2_ready && !s1_wait

// record cacheline log
val isWriteICacheTable = WireInit(Constantin.createRecord("isWriteICacheTable" + p(XSCoreParamsKey).HartId.toString))
val isWriteICacheTable = Constantin.createRecord(s"isWriteICacheTable${p(XSCoreParamsKey).HartId}")
val ICacheTable = ChiselDB.createTable("ICacheTable" + p(XSCoreParamsKey).HartId.toString, new ICacheDB)

val ICacheDumpData_req0 = Wire(new ICacheDB)
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/xiangshan/mem/lsqueue/LoadQueueReplay.scala
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ class LoadQueueReplay(implicit p: Parameters) extends XSModule
val ColdDownCycles = 16
val coldCounter = RegInit(VecInit(List.fill(LoadPipelineWidth)(0.U(log2Up(ColdDownCycles).W))))
val ColdDownThreshold = Wire(UInt(log2Up(ColdDownCycles).W))
ColdDownThreshold := Constantin.createRecord("ColdDownThreshold_"+p(XSCoreParamsKey).HartId.toString(), initValue = 12.U)
ColdDownThreshold := Constantin.createRecord(s"ColdDownThreshold_${p(XSCoreParamsKey).HartId}", initValue = 12)
assert(ColdDownCycles.U > ColdDownThreshold, "ColdDownCycles must great than ColdDownThreshold!")

def replayCanFire(i: Int) = coldCounter(i) >= 0.U && coldCounter(i) < ColdDownThreshold
Expand Down Expand Up @@ -530,7 +530,7 @@ class LoadQueueReplay(implicit p: Parameters) extends XSModule
}
}

val EnableHybridUnitReplay = Constantin.createRecord("EnableHybridUnitReplay", true.B)(0)
val EnableHybridUnitReplay = Constantin.createRecord("EnableHybridUnitReplay", true)
when(EnableHybridUnitReplay) {
for (i <- 0 until LoadPipelineWidth)
io.replay(i) <> replay_req(i)
Expand Down
Loading

0 comments on commit c686adc

Please sign in to comment.