-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make TLBusWrappers' topology a configurable Field #2327
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't fully wrapped my head around this. a little unclear which changes are things that are there to preserve backwards compatability and which are "the way to use now". Can these be marked a bit more clearly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed for usability and backwards compatibility and spent less time on the internal dynamic implementation. LGTM!
(SBUS, CBUS, TLBusWrapperCrossToConnection (xTypes.sbusToCbusXType)()), | ||
(CBUS, PBUS, TLBusWrapperCrossToConnection (xTypes.cbusToPbusXType)()), | ||
(SBUS, FBUS, TLBusWrapperCrossFromConnection(xTypes.fbusToSbusXType)())) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉👍
e93ec18
to
a944a46
Compare
93c43f6
to
5e0c5ee
Compare
@hcook can you take a look at #2410 and see if that approach is advised given that this change is coming? Would like to get those OM changes in before this change if there is huge incompatibility. Since that PR is basically assuming |
val pbus = tlBusWrapperLocationMap.lift(PBUS).getOrElse(sbus) | ||
val fbus = tlBusWrapperLocationMap.lift(FBUS).getOrElse(sbus) | ||
val mbus = tlBusWrapperLocationMap.lift(MBUS).getOrElse(sbus) | ||
val cbus = tlBusWrapperLocationMap.lift(CBUS).getOrElse(sbus) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason there is no sbus
in this list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh NVM i see it is above
258076a
to
30cb4ea
Compare
…LBusWrapper subclass
…entTopology, WithCoherentTopology
and stop trying to push Dynamic
…figurableTLNetworkTopology and other trait name adjustments
is there some more detailed infomation I can get about the TLBusWrapper class? |
Overview
This PR changes the selection of the topology of TLBusWrappers that are included in the
BaseSubsystem
layer of a Rocket-Chip-based design from being a statictrait
that is mixed in at compile time to a child class ofBaseSubystem
to being a dynamic choice driven at runtime from a configurableField
. This change means that the choice of internal network-on-chip topology no longer affects the Scala class hierarchy of Subsystems. Instead, aField
is supplied by which users can create a topology on a per-Config
basis. The description of the topology is intended to be readable from a serializable format, although the current implementation maintains some programmatic escape hatches. Any number ofTLBusWrappers
in any connectivity network shape is possible, though the requirements of diplomatic TileLink must still be satisfied (no cycles, single apparent path to each address from each agent, etc).A topological
Config
alteration is namedWithCoherentBusTopology
is supplied to recreate the extant, default, 5-hierarchical-crossbars topology fromDefaultConfig
+BaseSubsystem with HasHierarchicalBusTopology
. TheHasHierarchicalBusTopology
trait itself is removed, and any child class that extendsBaseSubsystem
only to supply a different topology from that one should now be redundant (can just extendBaseSubsystem
and supply a different value for theField
TLNetworkTopologyLocated(where: HierarchicalLocation)
. Three included example sub-topologies are included, which build on each other additively in order to recreate the original 5-xbar design. The three sub-topologies areJustOneBusTopologyParams
(sbus
),HierarchicalBusTopologyParams
(fbus
,cbus
,pbus
) andCoherentBusTopologyParams
(adds a coherence manager andmbus
).API Additions and Changes
What is changed:
Location
andLocationMap
: These dynamic maps can store arbitrary things indexable by "location" (just a string name for now). For example,TLBusWrapper
references are stored in named locations inHasTileLinkLocations .tlBusWrapperLocationMap
.trait HasTileLinkLocations
: intended to be an even more generic version of the extantAttachable
trait, which now extends it.HasTileLinkLocations
providesdef locateTLBusWrapper
function for child devices to locate aTLBusWrapper
instance inside a parent that extends this trait based on a location label.TLBusWrapperTopology
is the new intended serializable entry point for describing bus topologies, see below.CoherenceManagerWrapper
is a new wrapper for all collateral related to attaching coherence managers within a topology, allowing use of theTLBusWrapper
connectivity and clock crossing APIs. This will change the instance hierarchy of the coherence manager in existing designs by adding another module hierarchy layer wrapping it and its associated adapters together.HasHierarchicalBusTopology
trait is removed, but configuration equivalentsWithCoherentBusTopology
andWithIncoherentBusTopology
are provided to be applied as alterations toDefaultConfig
instead.What is not changed:
val
members ofBaseSubsystem
namedsbus
,fbus
,cbus
etc. still exist; I would like to deprecate them in the near future in favor of using only thelocateTLBusWrapper
method.sifive-blocks
are compatible with this PRBaseSubsystem
subclasses with statically defined subnetwork graphs and connect them to the dynamically-created topology. The dynamic topology can have nothing in it (though such a configuration will fail to build e.g.DefaultConfig
in this repo). SetTLNetworkTopologyLocated("InSubsystem") => up(TLNetworkTopologyLocated("InSubsystem")).copy(connections = Nil)
in yourConfig
class to wire the standard bus locations together by hand.Intended Usage
TLBusWrapperTopology
is a serializable representation of a TileLink-based interconnect. A topology comprises instances ofTLBusWrapper
, a (previously existing) class which is an abstraction around a piece of interconnect fabric that provides some kind of connectivity between TileLink endpoints. There are currently several subtypes ofTLBusWrapper
, which each contain a particular crossbar, set of crossbars, chain of TL adapters, and/or internal devices. (In the future, some of these subtypes may just become parameterizations of a single base type.)TLBusWrappers
have helper functions for attaching themselves to endpoint devices or to each other with configurable clock crossings.The new
TLBusWrapperTopology
representation has two components,instances
andconnections
.Each
instance
is tuple that contains aLocation
and aTLBusWrapperInstantiationLike
, where the former is a named reference to the latter, which can later be used when making connections between instances (or when attaching other things to the instance). ATLBusWrapperInstantiationLike
is any class that knows how to instantiate aTLBusWrapper
. The four previously-existing[Name]BusParams
case classes all inherit from it and instantiate some particularTLBusWrapper
subtype; the parameters are things like bus data width and parameters for internal devices and adapters' control interfaces.Each
connection
is a triple that contains a pair ofLocations
and aTLBusWrapperConnectionLike
, where the former pair identifies two previously instantiatedTLBusWrappers
, and the latter provides a method for actually programmatically connecting the instances. There is currently a single case class for describing parameterized connection betweenTLBusWrappers
, namedTLBusWrapperConnection
.A
TLBusWrapperConnection
contains the following serializable parameters:xType: ClockCrossingType
: what type of TL clock crossing adapter to insert between the buses. The appropriate half of the crossing adapter ends up inside each bus.driveClockFromMaster: Option[Boolean]
: ifNone
, don't bind the bus's diplomaticclockGroupNode
, otherwise have either the master or the slave bus bind the other one'sclockGroupNode
, assuming the inserted crossing type is not asynchronous.nodeBinding: NodeBinding
: fine-grained control of multi-edge cardinality resolution for diplomatic bindings within the connection.flipRendering: Boolean
: fine-grained control of the graphML rendering of the connection.There are also three programmatic escape hatches allowing users to inject custom node chains into the connection, or control the specific point within the
TLBusWrapper
that is connected to or from on either side.Three example sub-topologies are defined,
JustOneBusTopologyParams
(sbus
),HierarchicalBusTopologyParams
(fbus
,cbus
,pbus
) andCoherentBusTopologyParams
(adds a coherence manager andmbus
). These can be combined additively.At the moment, the
BaseSubsystem
class looks up theTLNetworkTopologyLocated("InSubsystem")
Field
to discover its configurable topology. This call into theParameters
object could be replaced with reading in the topology from some serialized format. Given a topology, the subsystem first instantiates all instances, then connects all connections, passing in itself as the instantiating or connecting scope:Related issues: #2034 #2025 #2078
Impact: API modification (but largely backward compatible)
Development Phase: implementation