-
Notifications
You must be signed in to change notification settings - Fork 383
Allow Bound-in layers under inline layers #8642
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
Conversation
6d28628 to
6b86340
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.
Very cool to see this work by just turning off the verifier.
I'd like to see one end-to-end test. Otherwise, LGTM.
Follow-on:
- Please open a PR to update this line in the FIRRTL spec: https://github.com/chipsalliance/firrtl-spec/blob/main/spec.md?plain=1#L255
| if (newInstance.getInnerSymAttr()) | ||
| if (auto forceName = circuitState.instanceForceNames.lookup( | ||
| {cast<hw::HWModuleOp>(newInstance->getParentOp()).getNameAttr(), | ||
| {newInstance->getParentOfType<hw::HWModuleOp>().getNameAttr(), |
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.
Nice cleanup. Always feel free to land this kind of change directly (especially since it is nicely factored into a separate commit!).
| OpBuilder builder(layerBlock); | ||
| auto macroName = macroNames[layer]; | ||
| auto ifDef = sv::IfDefOp::create(builder, layerBlock.getLoc(), macroName); | ||
| ifDef.getBodyRegion().takeBody(layerBlock.getBodyRegion()); | ||
| if (!layerBlock.getBody()->empty()) { | ||
| OpBuilder builder(layerBlock); | ||
| auto macroName = macroNames[layer]; | ||
| auto ifDef = builder.create<sv::IfDefOp>(layerBlock.getLoc(), macroName); | ||
| ifDef.getBodyRegion().takeBody(layerBlock.getBodyRegion()); | ||
| } |
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.
Not creating the empty ifdefs unnecessarily seems good.
Out of curiosity, do we canonicalize these away in SV if they are empty today?
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.
Yep there is a canonicalizer.
6b86340 to
4f45330
Compare
Enable the ability for "bind" layers to appear under "inline" layers.