Files
radiance/src/main/scala/tilelink/TracerSystemMem.scala
Hansung Kim 7e6ebb9e35 Create SoC-integrated Config for Coalescer
This requires config.addressWidth to be increased to 32.
FIXME: This breaks CoalescerUnitTest with unsatisfied requirement
`Link's max transfer (8) < List<...>'s beatBytes (32)`.
2023-05-12 01:15:28 -07:00

36 lines
1.4 KiB
Scala

package freechips.rocketchip.tilelink
import freechips.rocketchip.diplomacy.LazyModule
import freechips.rocketchip.subsystem.BaseSubsystem
import org.chipsalliance.cde.config.Parameters
// The trait is attached to DigitalTop of Chipyard system, informing it indeed
// has the ability to attach GPU tracer node onto the system bus
trait CanHaveMemtraceCore { this: BaseSubsystem =>
implicit val p: Parameters
p(MemtraceCoreKey).map { param =>
// Safe to use get as WithMemtraceCore requires WithNLanes to be defined
val simtParam = p(SIMTCoreKey).get
val config = defaultConfig.copy(numLanes = simtParam.nLanes)
val tracer = LazyModule(
new MemTraceDriver(config, param.tracefilename, param.traceHasSource)(p)
)
// Must use :=* to ensure the N edges from Tracer doesn't get merged into 1
// when connecting to SBus
println(
s"============ MemTraceDriver instantiated [filename=${param.tracefilename}]"
)
val upstream = p(CoalescerKey) match {
case Some(coalParam) => {
val coal = LazyModule(new CoalescingUnit(coalParam))
println(s"============ CoalescingUnit instantiated [numLanes=${coalParam.numLanes}]")
coal.cpuNode :=* tracer.node // N lanes
coal.aggregateNode // N+1 lanes
}
case None => tracer.node
}
sbus.fromPort(Some("gpu-tracer"))() :=* upstream
}
}