Skip to content

Commit

Permalink
Bump utility (#146)
Browse files Browse the repository at this point in the history
* use BigInt for initValue of Constantin.createRecord
  • Loading branch information
poemonsense authored May 9, 2024
1 parent 3c00e79 commit 46bc5f7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/coupledL2/prefetch/BestOffsetPrefetch.scala
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ class OffsetScoreTable(name: String = "")(implicit p: Parameters) extends BOPMod
val ptr = RegInit(0.U(scoreTableIdxBits.W))
val round = RegInit(0.U(roundBits.W))

val badscoreConstant = WireInit(Constantin.createRecord(name+"BadScore", bopParams.badScore.U))
val initscoreConstant = WireInit(Constantin.createRecord(name+"InitScore", (bopParams.badScore+1).U))
val badscoreConstant = Constantin.createRecord(name+"BadScore", bopParams.badScore)
val initscoreConstant = Constantin.createRecord(name+"InitScore", bopParams.badScore + 1)
val bestOffset = RegInit(2.U(offsetWidth.W)) // the entry with the highest score while traversing
val bestScore = RegInit(10.U)
val testOffset = offList(ptr)
Expand Down Expand Up @@ -404,7 +404,7 @@ class PrefetchReqBuffer(implicit p: Parameters) extends BOPModule{
val out_req = DecoupledIO(new PrefetchReq)
})

val firstTlbReplayCnt = WireInit(Constantin.createRecord("firstTlbReplayCnt", bopParams.tlbReplayCnt.U))
val firstTlbReplayCnt = Constantin.createRecord("firstTlbReplayCnt", bopParams.tlbReplayCnt)

def wayMap[T <: Data](f: Int => T) = VecInit((0 until REQ_FILTER_SIZE).map(f))
def get_flag(vaddr: UInt) = get_block_vaddr(vaddr)
Expand Down Expand Up @@ -586,7 +586,7 @@ class DelayQueue(name: String = "")(implicit p: Parameters) extends BOPModule{
val outValid = !empty && !queue(head).cnt.orR && valids(head)

/* In & Out */
var setDqLatency = WireInit(Constantin.createRecord("DelayQueueLatency"+name, dQLatency.U))
var setDqLatency = Constantin.createRecord("DelayQueueLatency"+name, dQLatency)
when(io.in.valid && !full) {
// if queue is full, we drop the new request
queue(tail).addrNoOffset := io.in.bits
Expand Down
14 changes: 7 additions & 7 deletions src/main/scala/coupledL2/prefetch/TemporalPrefetch.scala
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,19 @@ class TemporalPrefetch(implicit p: Parameters) extends TPModule {
require(cacheParams.hartIds.size == 1)
val hartid = cacheParams.hartIds.head
// 0 / 1: whether to enable temporal prefetcher
private val enableTP = WireInit(Constantin.createRecord("enableTP"+hartid.toString, initValue = 1.U))
private val enableTP = Constantin.createRecord("enableTP"+hartid.toString, initValue = 1)
// 0 ~ N: throttle cycles for each prefetch request
private val tpThrottleCycles = WireInit(Constantin.createRecord("tp_throttleCycles"+hartid.toString, initValue = 4.U(3.W)))
private val tpThrottleCycles = Constantin.createRecord("tp_throttleCycles"+hartid.toString, initValue = 4)
// 0 / 1: whether request to set as trigger on meta hit
private val hitAsTrigger = WireInit(Constantin.createRecord("tp_hitAsTrigger"+hartid.toString, initValue = 1.U))
private val hitAsTrigger = Constantin.createRecord("tp_hitAsTrigger"+hartid.toString, initValue = 1)
// 1 ~ triggerQueueDepth: enqueue threshold for triggerQueue
private val triggerThres = WireInit(Constantin.createRecord("tp_triggerThres"+hartid.toString, initValue = 1.U(3.W)))
private val triggerThres = Constantin.createRecord("tp_triggerThres"+hartid.toString, initValue = 1)
// 1 ~ tpEntryMaxLen: record threshold for recorder and sender (storage size will not be affected)
private val recordThres = WireInit(Constantin.createRecord("tp_recordThres"+hartid.toString, initValue = tpEntryMaxLen.U))
private val recordThres = Constantin.createRecord("tp_recordThres"+hartid.toString, initValue = tpEntryMaxLen)
// 0 / 1: whether to train on vaddr
private val trainOnVaddr = WireInit(Constantin.createRecord("tp_trainOnVaddr"+hartid.toString, initValue = 0.U))
private val trainOnVaddr = Constantin.createRecord("tp_trainOnVaddr"+hartid.toString, initValue = 0)
// 0 / 1: whether to eliminate L1 prefetch request training
private val trainOnL1PF = WireInit(Constantin.createRecord("tp_trainOnL1PF"+hartid.toString, initValue = 0.U))
private val trainOnL1PF = Constantin.createRecord("tp_trainOnL1PF"+hartid.toString, initValue = 0)

if (vaddrBitsOpt.isEmpty) {
assert(!trainOnVaddr)
Expand Down
2 changes: 1 addition & 1 deletion utility

0 comments on commit 46bc5f7

Please sign in to comment.