1
0

rocket: include hartid in cache master names

This commit is contained in:
Wesley W. Terpstra 2017-06-02 15:29:30 -07:00
parent d25ad10592
commit 80c63c0da6
4 changed files with 12 additions and 11 deletions

View File

@ -69,7 +69,7 @@ abstract class GroundTest(implicit val p: Parameters) extends Module
class GroundTestTile(implicit p: Parameters) extends LazyModule class GroundTestTile(implicit p: Parameters) extends LazyModule
with HasGroundTestParameters { with HasGroundTestParameters {
val slave = None val slave = None
val dcacheOpt = tileParams.dcache.map { dc => HellaCache(dc.nMSHRs == 0) } val dcacheOpt = tileParams.dcache.map { dc => HellaCache(0, dc.nMSHRs == 0) }
val ucLegacy = LazyModule(new TLLegacy) val ucLegacy = LazyModule(new TLLegacy)
val masterNode = TLOutputNode() val masterNode = TLOutputNode()

View File

@ -39,7 +39,7 @@ class DCacheDataArray(implicit p: Parameters) extends L1HellaCacheModule()(p) {
} }
} }
class DCache(val scratch: () => Option[AddressSet] = () => None)(implicit p: Parameters) extends HellaCache()(p) { class DCache(hartid: Int, val scratch: () => Option[AddressSet] = () => None)(implicit p: Parameters) extends HellaCache(hartid)(p) {
override lazy val module = new DCacheModule(this) override lazy val module = new DCacheModule(this)
} }

View File

@ -147,23 +147,23 @@ class HellaCacheIO(implicit p: Parameters) extends CoreBundle()(p) {
/** Base classes for Diplomatic TL2 HellaCaches */ /** Base classes for Diplomatic TL2 HellaCaches */
abstract class HellaCache(implicit p: Parameters) extends LazyModule { abstract class HellaCache(hartid: Int)(implicit p: Parameters) extends LazyModule {
private val cfg = p(TileKey).dcache.get private val cfg = p(TileKey).dcache.get
val firstMMIO = max(1, cfg.nMSHRs) val firstMMIO = max(1, cfg.nMSHRs)
val node = TLClientNode(Seq(TLClientPortParameters( val node = TLClientNode(Seq(TLClientPortParameters(
clients = cfg.scratch.map { _ => Seq( clients = cfg.scratch.map { _ => Seq(
TLClientParameters( TLClientParameters(
name = s"Core xx DCache MMIO", name = s"Core ${hartid} DCache MMIO",
sourceId = IdRange(0, cfg.nMMIOs), sourceId = IdRange(0, cfg.nMMIOs),
requestFifo = true)) requestFifo = true))
} getOrElse { Seq( } getOrElse { Seq(
TLClientParameters( TLClientParameters(
name = s"Core xx DCache MMIO", name = s"Core ${hartid} DCache",
sourceId = IdRange(0, firstMMIO), sourceId = IdRange(0, firstMMIO),
supportsProbe = TransferSizes(1, cfg.blockBytes)), supportsProbe = TransferSizes(1, cfg.blockBytes)),
TLClientParameters( TLClientParameters(
name = s"Core xx DCache", name = s"Core ${hartid} DCache MMIO",
sourceId = IdRange(firstMMIO, firstMMIO+cfg.nMMIOs), sourceId = IdRange(firstMMIO, firstMMIO+cfg.nMMIOs),
requestFifo = true)) requestFifo = true))
}, },
@ -189,9 +189,9 @@ class HellaCacheModule(outer: HellaCache) extends LazyModuleImp(outer)
} }
object HellaCache { object HellaCache {
def apply(blocking: Boolean, scratch: () => Option[AddressSet] = () => None)(implicit p: Parameters) = { def apply(hartid: Int, blocking: Boolean, scratch: () => Option[AddressSet] = () => None)(implicit p: Parameters) = {
if (blocking) LazyModule(new DCache(scratch)) if (blocking) LazyModule(new DCache(hartid, scratch))
else LazyModule(new NonBlockingDCache) else LazyModule(new NonBlockingDCache(hartid))
} }
} }
@ -201,8 +201,9 @@ trait HasHellaCache extends HasTileLinkMasterPort with HasTileParameters {
val module: HasHellaCacheModule val module: HasHellaCacheModule
implicit val p: Parameters implicit val p: Parameters
def findScratchpadFromICache: Option[AddressSet] def findScratchpadFromICache: Option[AddressSet]
val hartid: Int
var nDCachePorts = 0 var nDCachePorts = 0
val dcache = HellaCache(tileParams.dcache.get.nMSHRs == 0, findScratchpadFromICache _) val dcache = HellaCache(hartid, tileParams.dcache.get.nMSHRs == 0, findScratchpadFromICache _)
tileBus.node := dcache.node tileBus.node := dcache.node
} }

View File

@ -660,7 +660,7 @@ class DataArray(implicit p: Parameters) extends L1HellaCacheModule()(p) {
io.write.ready := Bool(true) io.write.ready := Bool(true)
} }
class NonBlockingDCache(implicit p: Parameters) extends HellaCache()(p) { class NonBlockingDCache(hartid: Int)(implicit p: Parameters) extends HellaCache(hartid)(p) {
override lazy val module = new NonBlockingDCacheModule(this) override lazy val module = new NonBlockingDCacheModule(this)
} }