-
Notifications
You must be signed in to change notification settings - Fork 298
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
base: main
Are you sure you want to change the base?
Conversation
dtzSiFive
commented
Aug 26, 2024
- 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)
4cdd13c
to
ed9082c
Compare
symbolTable.lookupSymbolIn(circuitOp, cast<SymbolRefAttr>(layer)); | ||
if (!op) | ||
return module->emitOpError() << "enables unknown layer '" << layer << "'"; | ||
if (!isa<LayerOp>(op)) |
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.
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 ") |
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.
Is set membership sufficient, or do we need to walk and check if parent layer disabled....?
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.
You're going to have to check if a parent layer is disabled
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.
Great, thanks!