1
0

rocket: link dtim to its cpu

This commit is contained in:
Wesley W. Terpstra 2017-06-28 14:45:46 -07:00
parent 3f6d5110cd
commit e6c2d446cc
2 changed files with 14 additions and 3 deletions

View File

@ -89,6 +89,9 @@ class RocketTile(val rocketParams: RocketTileParams, val hartid: Int)(implicit p
++ dcache ++ icache ++ nextlevel ++ mmu ++ itlb ++ dtlb)
}
}
override def dtimOwner = Some(cpuDevice)
val intcDevice = new Device {
def describe(resources: ResourceBindings): Description = {
Description(s"cpus/cpu@${hartid}/interrupt-controller", Map(

View File

@ -13,9 +13,16 @@ import uncore.tilelink2._
import uncore.util._
import util._
class ScratchpadSlavePort(address: AddressSet)(implicit p: Parameters) extends LazyModule
class ScratchpadSlavePort(address: AddressSet, owner: => Option[Device] = None)(implicit p: Parameters) extends LazyModule
with HasCoreParameters {
val device = new SimpleDevice("dtim", Seq("sifive,dtim0"))
val device = new SimpleDevice("dtim", Seq("sifive,dtim0")) {
override def describe(resources: ResourceBindings): Description = {
val extra = owner.map(x => ("sifive,cpu" -> Seq(ResourceReference(x.label))))
val Description(name, mapping) = super.describe(resources)
Description(name, mapping ++ extra)
}
}
val node = TLManagerNode(Seq(TLManagerPortParameters(
Seq(TLManagerParameters(
address = List(address),
@ -102,6 +109,7 @@ trait CanHaveScratchpad extends HasHellaCache with HasICacheFrontend with HasCor
val module: CanHaveScratchpadModule
val slaveNode = TLInputNode() // Up to two uses for this input node:
def dtimOwner: Option[Device] = None // who owns the Scratchpad?
// 1) Frontend always exists, but may or may not have a scratchpad node
val fg = LazyModule(new TLFragmenter(fetchWidth*coreInstBytes, p(CacheBlockBytes), earlyAck=true))
@ -112,7 +120,7 @@ trait CanHaveScratchpad extends HasHellaCache with HasICacheFrontend with HasCor
// 2) ScratchpadSlavePort always has a node, but only exists when the HellaCache has a scratchpad
val scratch = tileParams.dcache.flatMap(d => d.scratch.map(s =>
LazyModule(new ScratchpadSlavePort(AddressSet(s, d.dataScratchpadBytes-1)))))
LazyModule(new ScratchpadSlavePort(AddressSet(s, d.dataScratchpadBytes-1), dtimOwner))))
scratch foreach { lm => lm.node := TLFragmenter(xLen/8, p(CacheBlockBytes), earlyAck=true)(slaveNode) }
def findScratchpadFromICache: Option[AddressSet] = scratch.map { s =>