-
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
PRCI: use new RecordMap API to name signals #2487
Conversation
src/main/scala/prci/ClockNodes.scala
Outdated
@@ -73,7 +73,7 @@ object ClockSourceNode | |||
object ClockGroupImp extends SimpleNodeImp[ClockGroupSourceParameters, ClockGroupSinkParameters, ClockGroupEdgeParameters, ClockGroupBundle] | |||
{ | |||
def edge(pd: ClockGroupSourceParameters, pu: ClockGroupSinkParameters, p: Parameters, sourceInfo: SourceInfo) = ClockGroupEdgeParameters(pd, pu, p, sourceInfo) | |||
def bundle(e: ClockGroupEdgeParameters) = new ClockGroupBundle(e.bundle) | |||
def bundle(e: ClockGroupEdgeParameters) = new ClockGroupBundle(e.bundle, Some(e.bundle.members.zipWithIndex.map{ case (_, i) => s"${e.sink.name}_${i}"})) |
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.
@hcook I am right that only the sink
has a name, right? there is no source
so I can't do something like "source_to_sink" right?
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.
Correct, though such functionality would be an argument for adding such a parameter. The source-side parameters are very underdeveloped. We could also think about adding the NodePath functionality that some of the other protocols have, then lieu of a parameterized name you might be able to get the ValName of the source node or the module name of it's parent.
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 even just knowing the sink is useful IMO
attaching the diff for DefaultConfig: For example, old:
new:
|
old:
new: ...? Actually not sure what happened to this one in the new world. |
so maybe I screwed something up here... |
4754f0c
to
148a159
Compare
implicit val pp = p | ||
val ioClockGroupSourceNode = ClockGroupSourceNode(List.fill(num) { ClockGroupSourceParameters() }) | ||
groups :*= ioClockGroupSourceNode | ||
InModuleBody { ioClockGroupSourceNode.makeIOs()(vn) } | ||
InModuleBody { | ||
val bundlesAndEdges = ioClockGroupSourceNode.out |
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.
this is basically a rewrite of makeIOs
from diplomacy.Nodes, which assumes Heterogeneous Bag
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.
Yeah in a follow up PR we should just entirely replace that use of HeterogeneousBag
with RecordListMap
, I think. Will require sed/updating a moderate amount of boilerplate closed source code to change arguments like "io: HeterogeneousBag
" to "io: Record
" though
5f15496
to
4304966
Compare
This is currently giving me a compile error (just running
|
c900367
to
f51b951
Compare
4734b39
to
38d2be8
Compare
Just as an update I'm still very weirded out by the before-and-after diff. If I look at the |
68621b4
to
d246e4c
Compare
I think I figured out what was wrong /different with this. In the original, this line does something: In this new version, that is tied off to 1'b0: Which may be why things get constant-propped away. Still looking at the FIRRTL intermediate to see where things diverge |
38d2be8
to
1cec6e6
Compare
im not sure why this PR is closed but also says "merged and closed". Something is weird in github-land. Anyway, I have a suspicion what is wrong here... somewhere I am combining HeterogeneousBags of ClockGroupBundles whose names don't match up. I think the auto-bundle-zipping of diplomacy ( |
Related issue: This builds on top of #2486 and will be rebased on top of it as that API changes.
This demonstrates the use of the new RecordListMap. API to get better names for clock group signals
In the comments I'll include a diff before and after this change.
Type of change:feature request
Impact: API modification
(Generated RTL will have different output)
Development Phase: implementation
Release Notes
I/O and internal signals in the clock related modules (ClockSource, ClockGroup, etc) will have more meaninguful I/O names vs simply indexed names.