Skip to content

Commit

Permalink
Add busContextName
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryz123 committed Feb 1, 2023
1 parent b68bf0c commit ba35010
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/main/scala/subsystem/Attachable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ trait HasPRCILocations extends LazyScopeWithParameters { this: LazyModule =>

/** Layers of hierarchy with this trait contain attachment points for TileLink interfaces */
trait HasTileLinkLocations extends HasPRCILocations { this: LazyModule =>
val busContextName: String
val tlBusWrapperLocationMap = LocationMap.empty[TLBusWrapper]
def locateTLBusWrapper(location: Location[TLBusWrapper]): TLBusWrapper = locateTLBusWrapper(location.name)
def locateTLBusWrapper(name: String): TLBusWrapper = tlBusWrapperLocationMap(Location[TLBusWrapper](name))
Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/subsystem/BaseSubsystem.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ abstract class BaseSubsystem(val location: HierarchicalLocation = InSubsystem)
{
override val module: BaseSubsystemModuleImp[BaseSubsystem]

val busContextName = "subsystem"

// TODO must there really always be an "sbus"?
val sbus = tlBusWrapperLocationMap(SBUS)
tlBusWrapperLocationMap.lift(SBUS).map { _.clockGroupNode := allClockGroupsNode }
Expand Down
12 changes: 6 additions & 6 deletions src/main/scala/subsystem/BusTopology.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ case object MemoryBusKey extends Field[MemoryBusParams]
// dynamically-configured topologies.

class TLBusWrapperLocation(name: String) extends Location[TLBusWrapper](name)
case object SBUS extends TLBusWrapperLocation("subsystem_sbus")
case object PBUS extends TLBusWrapperLocation("subsystem_pbus")
case object FBUS extends TLBusWrapperLocation("subsystem_fbus")
case object MBUS extends TLBusWrapperLocation("subsystem_mbus")
case object CBUS extends TLBusWrapperLocation("subsystem_cbus")
case object COH extends TLBusWrapperLocation("subsystem_coh")
case object SBUS extends TLBusWrapperLocation("sbus")
case object PBUS extends TLBusWrapperLocation("pbus")
case object FBUS extends TLBusWrapperLocation("fbus")
case object MBUS extends TLBusWrapperLocation("mbus")
case object CBUS extends TLBusWrapperLocation("cbus")
case object COH extends TLBusWrapperLocation("coh")

/** Parameterizes the subsystem in terms of optional clock-crossings
* that are insertable between some of the five traditional tilelink bus wrappers.
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/subsystem/Cluster.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Cluster(
with InstantiatesElements
with HasElements
{
val busContextName = thisClusterParams.baseName
lazy val clusterId = thisClusterParams.clusterId
lazy val location = InCluster(clusterId)

Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/tilelink/BusWrapper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ case class AddressAdjusterWrapperParams(
{
val dtsFrequency = None
def instantiate(context: HasTileLinkLocations, loc: Location[TLBusWrapper])(implicit p: Parameters): AddressAdjusterWrapper = {
val aaWrapper = LazyModule(new AddressAdjusterWrapper(this, loc.name))
aaWrapper.suggestName(loc.name + "_wrapper")
val aaWrapper = LazyModule(new AddressAdjusterWrapper(this, context.busContextName + "_" + loc.name))
aaWrapper.suggestName(context.busContextName + "_" + loc.name + "_wrapper")
context.tlBusWrapperLocationMap += (loc -> aaWrapper)
aaWrapper
}
Expand Down Expand Up @@ -269,8 +269,8 @@ case class TLJBarWrapperParams(
{
val dtsFrequency = None
def instantiate(context: HasTileLinkLocations, loc: Location[TLBusWrapper])(implicit p: Parameters): TLJBarWrapper = {
val jbarWrapper = LazyModule(new TLJBarWrapper(this, loc.name))
jbarWrapper.suggestName(loc.name + "_wrapper")
val jbarWrapper = LazyModule(new TLJBarWrapper(this, context.busContextName + "_" + loc.name))
jbarWrapper.suggestName(context.busContextName + "_" + loc.name + "_wrapper")
context.tlBusWrapperLocationMap += (loc -> jbarWrapper)
jbarWrapper
}
Expand Down

0 comments on commit ba35010

Please sign in to comment.