Skip to content

Commit

Permalink
[FIRRTL] Since spec allows it, don't reject abstract reset on extmod.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtzSiFive committed Feb 21, 2024
1 parent aa9386a commit c10af05
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Dialect/FIRRTL/FIRRTLOpInterfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,19 @@ LogicalResult circt::firrtl::verifyModuleLikeOpInterface(FModuleLike module) {
if (failed(verifyNoInputProbes(module)))
return failure();

// Enforce public module requirements.
// Enforce public and ext module requirements.
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 or ext module port must have known width");
if (ftype.hasUninferredReset())
// Presently abstract reset on extmodule is not explicitly disallowed in
// the FIRRTL spec.
if (ftype.hasUninferredReset() && !isa<FExtModuleOp>(module))
return emitError(module.getPortLocation(idx),
"public or ext module port must have concrete reset type");
"public module port must have concrete reset type");
}
}
}
Expand Down

0 comments on commit c10af05

Please sign in to comment.