-
Notifications
You must be signed in to change notification settings - Fork 615
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
Add safer Chisel annotation API, deprecate old ones (backport #4643) #4697
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The new one enables safety checks and smarter logic for views. (cherry picked from commit a95cfe4) # Conflicts: # build.mill # build.sbt # core/src/main/scala/chisel3/Annotation.scala # core/src/main/scala/chisel3/ChiselEnum.scala # core/src/main/scala/chisel3/Module.scala # core/src/main/scala/chisel3/dontTouch.scala # core/src/main/scala/chisel3/experimental/hierarchy/core/Definition.scala # src/main/scala/chisel3/util/AttributeAnnotation.scala # src/main/scala/chisel3/util/experimental/Inline.scala # src/main/scala/chisel3/util/experimental/LoadMemoryTransform.scala # src/main/scala/circt/OutputDirAnnotation.scala # src/test/scala-2/chiselTests/util/SRAMSpec.scala # src/test/scala/chiselTests/AnnotatingDiamondSpec.scala # src/test/scala/chiselTests/experimental/hierarchy/Annotations.scala # src/test/scala/circtTests/stage/ChiselStageSpec.scala
Cherry-pick of a95cfe4 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
14 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Backport
Automated backport, please consider for minor release
Deprecation
Deprecates an API, will be included in release notes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note that I tested that the deprecated versions of
annotate
work by updating them first, making sure all tests pass, then removing all uses of ChiselAnnotation and ChiselMultiAnnotation except in ChiselEnum. The ones in ChiselEnum have duplication checking that I could replicate with the annotations, but is annoying. I figure we'd rather just remove those (and roll out firrtl enums? 🙏) so I just left them. They also do help test the deprecated APIs.This PR has two purposes:
(2) will be in a follow on PR.
One weirdness in the PR that I would appreciate review of is that the new API asks the caller to "report" all
InstanceIds
that will be annotated. We really only currently care aboutData
but I figure in the future we may want checks for other things. The awkwardness though, is thatInstanceId
includesData
,BaseModule
, andMemBase
, but notHierarchy
nor the new SRAM targets. So if we wanted more checks, we might need to change the API anyway in the future since users can't currently reportHierarchy
orSRAM
targets being annotated. I could take a step back and try to find a way to unify all of these, or just leave it, or switch the API toData
to make it more clear that that is all we're checking. WDYT?Contributor Checklist
docs/src
?Type of Improvement
Desired Merge Strategy
Release Notes
Creating annotations in Chisel now requires reporting what
InstanceIds
are going to be annotated so that Chisel can do some safety checks.Reviewer Checklist (only modified by reviewer)
3.6.x
,5.x
, or6.x
depending on impact, API modification or big change:7.0
)?Enable auto-merge (squash)
, clean up the commit message, and label withPlease Merge
.Create a merge commit
.This is an automatic backport of pull request #4643 done by [Mergify](https://mergify.com).