-
Notifications
You must be signed in to change notification settings - Fork 614
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
Implement typeName API for stable Module names #3130
Conversation
e7299ce
to
6dfb9cf
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.
Should you update the naming cookbook, especially https://github.com/chipsalliance/chisel/blob/main/docs/src/cookbooks/naming.md#my-module-names-are-super-unstable---i-change-one-thing-and-queue_1-becomes-queue_42-help after this change?
I think I will, but also clarify that queue names will still have some measure of instability based on the specificity of the |
Co-authored-by: Megan Wachs <[email protected]>
Co-authored-by: Megan Wachs <[email protected]>
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.
LGTM!
* Implement `typeName` API for a few `Data` types * Fix silly compilation error * Implement typeName API further for most data types and modules which need it * Compilation error fixes * Remove width parameter from Bool * Test for Queue naming using typeNames * Remove width-sensitive override for AsyncReset as it is irrelevant * Add typeName for Analogs * Add additional types to be tested * Scalafmt * Use circt ChiselStage * Update queue naming of existing tests * Scalafmt * Change pipe desiredName to be consistent with other modules * Update naming cookbook * Update docs/src/cookbooks/naming.md Co-authored-by: Megan Wachs <[email protected]> * Update docs/src/cookbooks/naming.md Co-authored-by: Megan Wachs <[email protected]> * Add SInt to TypenameSpec * Fix cookbook mdoc errors * compileOnly tag on scala code * More improvements of mdoc * compileOnly -> compile-only * Final mdoc review and fixes * Add inferred UInt to test --------- Co-authored-by: Megan Wachs <[email protected]>
* Implement `typeName` API for a few `Data` types * Fix silly compilation error * Implement typeName API further for most data types and modules which need it * Compilation error fixes * Remove width parameter from Bool * Test for Queue naming using typeNames * Remove width-sensitive override for AsyncReset as it is irrelevant * Add typeName for Analogs * Add additional types to be tested * Scalafmt * Use circt ChiselStage * Update queue naming of existing tests * Scalafmt * Change pipe desiredName to be consistent with other modules * Update naming cookbook * Update docs/src/cookbooks/naming.md Co-authored-by: Megan Wachs <[email protected]> * Update docs/src/cookbooks/naming.md Co-authored-by: Megan Wachs <[email protected]> * Add SInt to TypenameSpec * Fix cookbook mdoc errors * compileOnly tag on scala code * More improvements of mdoc * compileOnly -> compile-only * Final mdoc review and fixes * Add inferred UInt to test --------- Co-authored-by: Megan Wachs <[email protected]>
@Mergifyio backport 3.6.x |
✅ Backports have been created
|
* Implement `typeName` API for a few `Data` types * Fix silly compilation error * Implement typeName API further for most data types and modules which need it * Compilation error fixes * Remove width parameter from Bool * Test for Queue naming using typeNames * Remove width-sensitive override for AsyncReset as it is irrelevant * Add typeName for Analogs * Add additional types to be tested * Scalafmt * Use circt ChiselStage * Update queue naming of existing tests * Scalafmt * Change pipe desiredName to be consistent with other modules * Update naming cookbook * Update docs/src/cookbooks/naming.md Co-authored-by: Megan Wachs <[email protected]> * Update docs/src/cookbooks/naming.md Co-authored-by: Megan Wachs <[email protected]> * Add SInt to TypenameSpec * Fix cookbook mdoc errors * compileOnly tag on scala code * More improvements of mdoc * compileOnly -> compile-only * Final mdoc review and fixes * Add inferred UInt to test --------- Co-authored-by: Megan Wachs <[email protected]> (cherry picked from commit 0ce115e) # Conflicts: # docs/src/cookbooks/naming.md # src/main/scala/chisel3/util/Decoupled.scala # src/main/scala/chisel3/util/Valid.scala
Backport requested by @jerryz123 |
* Implement `typeName` API for a few `Data` types * Fix silly compilation error * Implement typeName API further for most data types and modules which need it * Compilation error fixes * Remove width parameter from Bool * Test for Queue naming using typeNames * Remove width-sensitive override for AsyncReset as it is irrelevant * Add typeName for Analogs * Add additional types to be tested * Scalafmt * Use circt ChiselStage * Update queue naming of existing tests * Scalafmt * Change pipe desiredName to be consistent with other modules * Update naming cookbook * Update docs/src/cookbooks/naming.md Co-authored-by: Megan Wachs <[email protected]> * Update docs/src/cookbooks/naming.md Co-authored-by: Megan Wachs <[email protected]> * Add SInt to TypenameSpec * Fix cookbook mdoc errors * compileOnly tag on scala code * More improvements of mdoc * compileOnly -> compile-only * Final mdoc review and fixes * Add inferred UInt to test --------- Co-authored-by: Megan Wachs <[email protected]> (cherry picked from commit 0ce115e) # Conflicts: # docs/src/cookbooks/naming.md # src/main/scala/chisel3/util/Decoupled.scala # src/main/scala/chisel3/util/Valid.scala
* Implement typeName API for stable Module names (#3130) * Implement `typeName` API for a few `Data` types * Fix silly compilation error * Implement typeName API further for most data types and modules which need it * Compilation error fixes * Remove width parameter from Bool * Test for Queue naming using typeNames * Remove width-sensitive override for AsyncReset as it is irrelevant * Add typeName for Analogs * Add additional types to be tested * Scalafmt * Use circt ChiselStage * Update queue naming of existing tests * Scalafmt * Change pipe desiredName to be consistent with other modules * Update naming cookbook * Update docs/src/cookbooks/naming.md Co-authored-by: Megan Wachs <[email protected]> * Update docs/src/cookbooks/naming.md Co-authored-by: Megan Wachs <[email protected]> * Add SInt to TypenameSpec * Fix cookbook mdoc errors * compileOnly tag on scala code * More improvements of mdoc * compileOnly -> compile-only * Final mdoc review and fixes * Add inferred UInt to test --------- Co-authored-by: Megan Wachs <[email protected]> (cherry picked from commit 0ce115e) # Conflicts: # docs/src/cookbooks/naming.md # src/main/scala/chisel3/util/Decoupled.scala # src/main/scala/chisel3/util/Valid.scala * Resolve conflicts, remove desiredName overrides, remove docs All things that are removed can be enjoyed by users by bumping to a newer version of Chisel. --------- Co-authored-by: Jack Koenig <[email protected]>
typeName
is a new member ofData
types which specifies a default, non-ambiguous name of its type. This is useful for problems like generating a descriptive name for a Chisel type, as it allows modules (e.g.Queue
) to use this naming information for their owndesiredName
.As a motivating use case,
Queue
modules now have a default name based on the depth parameter of theQueue
as well as the generatedtypeName
of the Chisel type passed to it. For example,Queue4_UInt4
describes aQueue
of size 4 which takes aUInt(4.W)
, and would be the defaultdesiredName
of such a queue.User-defined types like
Bundles
should override this feature if needed to diversify the names ofModules
that use them, preventing situations like multipleQueues
all sharing the same name and having unstable names as a result.Contributor Checklist
docs/src
?Type of Improvement
API Impact
Adds a new public-facing feature to
Data
Backend Code Generation Impact
Module names in FIRRTL will now include the parameter information of their respective Chisel modules in their names (via overriding
desiredName
), and consequently Verilog names will differ as well.Desired Merge Strategy
Squash and merge
Release Notes
This gives a flexible way to generate a stable name for a Chisel type, which is useful for problems like generating stable names for
Modules
andQueues
Reviewer Checklist (only modified by reviewer)
3.5.x
or3.6.x
depending on impact, API modification or big change:5.0.0
)?Enable auto-merge (squash)
, clean up the commit message, and label withPlease Merge
.Create a merge commit
.