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] Verify enabled layers of module, extmodule. #7557

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dtzSiFive
Copy link
Contributor

  • Verify specified symbols resolve for extmodule
  • Verify specified symbols resolve to LayerOp's
  • Verify public modules don't enable circuit-disabled layers. (SpecializeLayers will delete if so)

* Verify specified symbols resolve for extmodule
  (cc llvm#7447)
* Verify specified symbols resolve to LayerOp's
* Verify public modules don't enable circuit-disabled layers.
  (SpecializeLayers will delete if so)

Fixes llvm#7448.
symbolTable.lookupSymbolIn(circuitOp, cast<SymbolRefAttr>(layer));
if (!op)
return module->emitOpError() << "enables unknown layer '" << layer << "'";
if (!isa<LayerOp>(op))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This only checks the final reference is a layer, but structural requirements on layers ensure all parents will also be layerop's.

for (auto layer : module.getLayers())
if (llvm::is_contained(disabledLayersSymRefs, layer))
return module->emitOpError(
"public module has circuit-disabled layer ")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is set membership sufficient, or do we need to walk and check if parent layer disabled....?

Copy link
Member

Choose a reason for hiding this comment

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

You're going to have to check if a parent layer is disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great, thanks!

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