Skip to content

Commit

Permalink
SourceB: use dcacheSourceIdStart instead of 0.U for source in Probe (#57
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Ivyfeather committed Sep 14, 2023
1 parent ccac874 commit 56c1bd9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/scala/coupledL2/CoupledL2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ class CoupledL2(implicit p: Parameters) extends LazyModule with HasCoupledL2Para
node.edges.in.headOption.foreach { n =>
n.client.clients.zipWithIndex.foreach {
case (c, i) =>
println(s"\t${i} <= ${c.name}")
println(s"\t${i} <= ${c.name};" +
s"\tsourceRange: ${c.sourceId.start}~${c.sourceId.end}")
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/coupledL2/GrantBuffer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,6 @@ class GrantBuffer(implicit p: Parameters) extends L2Module {
}
// pftRespQueue is about to be full, and using back pressure to block All MainPipe Entrance
// which can SERIOUSLY affect performance, should consider less drastic prefetch policy
XSPerfAccumulate(cacheParams, "WARNING_pftRespQueue_about_to_full", noSpaceForSinkPft.getOrElse(false.B))
XSPerfAccumulate(cacheParams, "WARNING_pftRespQueue_about_to_full", noSpaceForMSHRPft.getOrElse(false.B))
}
}
6 changes: 5 additions & 1 deletion src/main/scala/coupledL2/SourceB.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ class SourceB(implicit p: Parameters) extends L2Module {
val grantStatus = Input(Vec(grantBufInflightSize, new GrantStatus))
})

val dcacheSourceIdStart = edgeIn.client.clients
.filter(_.supports.probe)
.map(c => c.sourceId.start.U).head

def toTLBundleB(task: SourceBReq) = {
val b = Wire(new TLBundleB(edgeIn.bundle))
b.opcode := task.opcode
b.param := task.param
b.size := offsetBits.U
b.source := 0.U // make sure there are only 1 client
b.source := dcacheSourceIdStart
b.address := Cat(task.tag, task.set, 0.U(offsetBits.W))
b.mask := Fill(beatBytes, 1.U(1.W))
b.data := Cat(task.alias.getOrElse(0.U), 0.U(1.W)) // this is the same as HuanCun
Expand Down

0 comments on commit 56c1bd9

Please sign in to comment.