-
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
Refactor TLBusWrapper and CrossingHelper #1548
Conversation
Move subsystem.SubsystemClockCrossing => diplomacy.ClockCrossingType Put abstract CrossingHelper base class in diplomacy Make concrete AXI4CrossingHelper, TLCrossingHelper, IntCrossingHelper Replace CrossingWrapper with AXI4CrossingWrapper, TLCrossingWrapper
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 think we need to discuss this a bit more...
} | ||
} | ||
|
||
class AXI4CrossingWrapper(val crossing: ClockCrossingType)(implicit p: Parameters) extends SimpleLazyModule with LazyScope { |
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 split the crossing helpers by type like you've done, then I think this API (the wrapper) has to die. You typically need to cross more than one bus type and this wrapper can only cross AXI. So it's mostly useless.
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.
The way these wrappers work is to drop a half of the crossing in the island and place the other half in the caller. We need to IMO reconsider a few things: is the island a new module layer just doing the crossing? How do we relate multiple clocks each with multiple busses.
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.
On the one hand, you really want only one helper per clock domain in the island. On the other hand, you want to change the crossing type based on the relationship between that domain and the clock where the other half is dropped.
We decided to:
|
@terpstra I implemented the changes we discussed. Seems strictly better than before! I need to re-check the names before merging, but in the meantime can you unblock this PR? |
I refactored both the TLBusWrapper and CrossingHelper APIs. The former is slightly more flexible and has better code reuse. The latter is a complete re-write No intended functional RTL changes other than signal names.
TLBusWrapper:
CanAttachTLSlaves
andCanAttachTLMasters
CrossingHelper:
HasCrossing
is deprecated,CrossingWrapper
uses the replacement traitCrossesToOnlyOneClockDomain
subsystem.SubsystemClockCrossing
todiplomacy.ClockCrossingType
HasClockDomainCrossing
base trait in diplomacy[Protocol][Out|In]wardCrossingHelper
case classes for each protocol type and[Protocol]ClockDomainCrossing
implicit class conversions in each package to add crossing methods to instances ofHasClockDomainCrossing
that need to be crossedClockCrossingType
argument to individual calls toCrossingHelper
methods