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] Allow layers under when and match. #7234

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

dtzSiFive
Copy link
Contributor

Behavior is same as-if the contained operations were not under a layer.

Some layer-related passes such as LayerMerge (for completeness) and LowerLayers (for correctness) now explicitly require ExpandWhen's to execute first.

The FIRRTL specification does not yet permit this.

Copy link
Member

@youngar youngar left a comment

Choose a reason for hiding this comment

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

💯

Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

Can you include tests of a layer block under a when under a layer block? Also, can you include a test of an assert under a when under a layer block?

Do these both work?

@dtzSiFive
Copy link
Contributor Author

Can you include tests of a layer block under a when under a layer block?

This is already included in the modified firtool/layers.fir test -- is there something more specific you'd like to test? Very happy to add tests for whichever just LMK 👍 .

Also, can you include a test of an assert under a when under a layer block?

Those appeared to work in local testing -- I'll add tests for these as well.
The expand-when's test for printf shows that working for ( when-influenced-statement )-under-layer-under-when. I'll add an e2e test for assert too since that's of particular importance. Thanks!

Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

LGTM

test/Dialect/FIRRTL/expand-whens.mlir Outdated Show resolved Hide resolved
@dtzSiFive dtzSiFive merged commit 3f0dcf4 into llvm:main Jun 26, 2024
4 checks passed
@dtzSiFive dtzSiFive deleted the feature/layer-under-when branch June 26, 2024 13:35
mingzheTerapines pushed a commit to Terapines/circt that referenced this pull request Jun 27, 2024
Behavior is same as-if the contained operations were
not under a layer.
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.

3 participants