-
Notifications
You must be signed in to change notification settings - Fork 324
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 a new FIRRTL annotation to specify type lowering behavior of module body #7751
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
35a3766
[FIRRTL] Add a new FIRRTL annotation to specify type lowering behavio…
uenoku ad9ffb0
Specify behaivor when there is a conflict
uenoku aef34e5
Merge branch 'main' into dev/hidetou/convention-atr
uenoku 2bb4500
fixup test
uenoku 388787b
Remove `includeHierarchy` from convention attr. Clean up.
uenoku File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1405,6 +1405,45 @@ firrtl.circuit "UnrealizedConversion" { | |
} | ||
} | ||
|
||
firrtl.circuit "Conventions1" { | ||
// COMMON-LABEL: @Conventions1 | ||
// AGGREGATE-SAME: %input_0 | ||
// AGGREGATE-NEXT: firrtl.reg | ||
// AGGREGATE-SAME: !firrtl.vector<uint<8>, 1> | ||
firrtl.module public @Conventions1(in %input: !firrtl.vector<uint<8>, 1>, in %clk: !firrtl.clock, out %port: !firrtl.vector<uint<8>, 1>) attributes {convention = #firrtl<convention scalarized>, body_type_lowering = #firrtl<convention internal>}{ | ||
%r = firrtl.reg interesting_name %clk : !firrtl.clock, !firrtl.vector<uint<8>, 1> | ||
firrtl.matchingconnect %r, %input : !firrtl.vector<uint<8>, 1> | ||
firrtl.matchingconnect %port, %r : !firrtl.vector<uint<8>, 1> | ||
} | ||
// COMMON-LABEL: @Conventions2 | ||
// AGGREGATE-SAME: %input_0: !firrtl.uint<8> | ||
// AGGREGATE-NEXT: firrtl.reg | ||
// AGGREGATE-SAME: !firrtl.uint<8> | ||
firrtl.module private @Conventions2(in %input: !firrtl.vector<uint<8>, 1>, in %clk: !firrtl.clock, out %port: !firrtl.vector<uint<8>, 1>) attributes {convention = #firrtl<convention scalarized>, body_type_lowering = #firrtl<convention scalarized>}{ | ||
%r = firrtl.reg interesting_name %clk : !firrtl.clock, !firrtl.vector<uint<8>, 1> | ||
firrtl.matchingconnect %r, %input : !firrtl.vector<uint<8>, 1> | ||
firrtl.matchingconnect %port, %r : !firrtl.vector<uint<8>, 1> | ||
} | ||
// COMMON-LABEL: @Conventions3 | ||
// AGGREGATE-SAME: %input: !firrtl.vector<uint<8>, 1> | ||
// AGGREGATE-NEXT: firrtl.reg | ||
// AGGREGATE-SAME: !firrtl.vector<uint<8>, 1> | ||
firrtl.module private @Conventions3(in %input: !firrtl.vector<uint<8>, 1>, in %clk: !firrtl.clock, out %port: !firrtl.vector<uint<8>, 1>) attributes {convention = #firrtl<convention internal>, body_type_lowering = #firrtl<convention internal>}{ | ||
%r = firrtl.reg interesting_name %clk : !firrtl.clock, !firrtl.vector<uint<8>, 1> | ||
firrtl.matchingconnect %r, %input : !firrtl.vector<uint<8>, 1> | ||
firrtl.matchingconnect %port, %r : !firrtl.vector<uint<8>, 1> | ||
} | ||
// COMMON-LABEL: @Conventions4 | ||
// AGGREGATE-SAME: %input: !firrtl.vector<uint<8>, 1> | ||
// AGGREGATE-NEXT: firrtl.reg | ||
// AGGREGATE-SAME: !firrtl.uint<8> | ||
firrtl.module private @Conventions4(in %input: !firrtl.vector<uint<8>, 1>, in %clk: !firrtl.clock, out %port: !firrtl.vector<uint<8>, 1>) attributes {convention = #firrtl<convention internal>, body_type_lowering = #firrtl<convention scalarized>}{ | ||
%r = firrtl.reg interesting_name %clk : !firrtl.clock, !firrtl.vector<uint<8>, 1> | ||
firrtl.matchingconnect %r, %input : !firrtl.vector<uint<8>, 1> | ||
firrtl.matchingconnect %port, %r : !firrtl.vector<uint<8>, 1> | ||
} | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, exhaustive test. 👍 |
||
// Test that memories have their prefixes copied when lowering. | ||
// See: https://github.com/llvm/circt/issues/7835 | ||
firrtl.circuit "MemoryPrefixCopying" { | ||
|
Oops, something went wrong.
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.
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.
What is interesting about these changes is that we could move in a direction of removing the CLI options for aggregate preservation and instead rely on the annotations / attributes. As a middle ground, it may be better to change the CLI (in a follow-on) to apply the annotations or do it as a part of parsing.
This is more of a thought than a definite direction we should go.