Skip to content
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

[FIRRTL] add DedupGroupAnnotation #5787

Merged
merged 9 commits into from
Aug 9, 2023
Merged

Conversation

albertchen-sifive
Copy link
Contributor

This implements DedupGroupAnnotation as described by @jackkoenig in this comment chipsalliance/firrtl-spec#116 (comment)

Copy link
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks good, can we update docs/Dialects/FIRRTL/FIRRTLAnnotations.md as well?

@albertchen-sifive
Copy link
Contributor Author

I added the suggestions. @uenoku could you take another look to make sure I'm not doing anything dumb with null strings or whatever

Copy link
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Do you have thoughts on behaivor when there are multiple DedupGroupAnno? Currently implementation should pick the first DedupGroupAnno so it would not work as expected. I think it wold be fine to just raise an error if there are annotations.

lib/Dialect/FIRRTL/Transforms/Dedup.cpp Outdated Show resolved Hide resolved
lib/Dialect/FIRRTL/Transforms/Dedup.cpp Outdated Show resolved Hide resolved
Comment on lines 1526 to 1527
for (auto module : modules)
AnnotationSet::removeAnnotations(module, dedupGroupClass);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems modules is already invalid here. Probably it should be sufficient to just replace module with circuit.getOps<FModuleOp>().

Copy link
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@albertchen-sifive albertchen-sifive merged commit 174ff92 into main Aug 9, 2023
5 checks passed
@albertchen-sifive albertchen-sifive deleted the dev/albertc/dedup-group branch August 9, 2023 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants