Skip to content

Commit

Permalink
[FIRRTL] Verify widths known for extmodule too.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtzSiFive committed Feb 21, 2024
1 parent 8a0f210 commit aa9386a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Dialect/FIRRTL/FIRRTLOpInterfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,16 @@ LogicalResult circt::firrtl::verifyModuleLikeOpInterface(FModuleLike module) {
return failure();

// Enforce public module requirements.
if (module.isPublic()) {
if (module.isPublic() || isa<FExtModuleOp>(module)) {
for (auto [idx, type] : llvm::enumerate(
module.getPortTypesAttr().getAsValueRange<TypeAttr>())) {
if (auto ftype = dyn_cast<FIRRTLType>(type)) {
if (ftype.hasUninferredWidth())
return emitError(module.getPortLocation(idx),
"public module port must have known width");
"public or ext module port must have known width");
if (ftype.hasUninferredReset())
return emitError(module.getPortLocation(idx),
"public module port must have concrete reset type");
"public or ext module port must have concrete reset type");
}
}
}
Expand Down

0 comments on commit aa9386a

Please sign in to comment.