-
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
Standardize Tile Instantiation and Attachment #2504
Conversation
2a7ddf1
to
bcb294a
Compare
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.
Seems like a good direction API-wise (but I didn't do a code review).
@@ -41,6 +41,8 @@ class BaseSubsystemConfig extends Config ((site, here, up) => { | |||
case DebugModuleKey => Some(DefaultDebugModuleParams(site(XLen))) | |||
case CLINTKey => Some(CLINTParams()) | |||
case PLICKey => Some(PLICParams()) | |||
case TilesLocated(InSubsystem) => |
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.
Will there be an example for what direct manipulation of the TilesLocated pattern looks like? (Not using the LegacyTileFieldHelper)
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.
Good suggestion, will do
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 ended up doing this example in WithTraceGen
for the TraceGenTile
subtype. I'm not very keen to mess too much with the existing RocketTilesKey
Config
alterations since it it seems hard to change them while remaining backwards compatibly with external alterations of RocketTilesKey
. Check out WithTraceGen
and HeterogeneousTileExampleConfig
and let me know if that is sufficiently helpful.
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.
Thanks, this is pretty clear.
I noticed that manipulation of core parameters is more verbose without direct access through CoreTilesKey
, since the type of the core must be matched, and since AttachParams
adds another layer of case-class nesting. Given that manipulating tile-level parameters is the common use-case of the core-specific TilesKey
s, it may be worth defining a generic macro to modify the TileParams
matching some desired
Tile type.
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.
if you can figure out a good pattern for applying a "lens" to nested case classes in Config alterations I will buy you a beer
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.
But yes something specific to this particular use case is probably also possible
b1d2bb1
to
e5b737e
Compare
- add idOffset parameter to control hart offsets - make repeated usages append to list of tiles - use in HeterogeneousTileExampleConfig
e5b737e
to
0286604
Compare
HasTiles
is refactored to eagerly instantiate tiles of all types by pulling instances ofCanAttachTile
out of a newField
namedTilesLocated
.This change has the following benefits:
<: BaseTile
can beConfig
-urably instantiated inside a design without needing to mix in additional traits to the subsystem class hierarchy.tiles
list (e.g.nTiles
) does not have to jump through hoops to ensure that it doesn't get called before all tile-adding traits are mixed in, because those traits no longer exist.In order to make a tile instantiate-able via the new field, you must supply a class like this one:
where
tileParams
satisfies the new base classInstantiableTileParams[TileType]
(you provide a function that instantiates an instance of yourTileType
)crossingParams
satisfiesTileCrossingParamsLike
, for which you could just use the exampleRocketCrossingParams
.Backwards compatibility:
Fields
RocketTilesKey
andRocketCrossingKey
are maintained for backwards compatibility andLegacyTileFieldHelper
is applied toTilesLocated
inBaseConfig
to ensure thatConfig
alterations that manipulate these fields continue to functionBaseTile
nowextends HasLogicalTreeNode
, but aGenericLogicalTreeNode()
is supplied, which can be overridden.Type of change: other enhancement
Impact: API modification
Development Phase: implementation
Release Notes
val tiles
intrait HasTiles
is now populated eagerly via theTilesLocated
Field
.