Skip to content

Commit babf254

Browse files
committed
Expand checking
1 parent 9e68dfa commit babf254

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

lib/Dialect/FIRRTL/Transforms/InferDomains.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ class CircuitDomainInfo {
106106
size_t getNumDomains() const { return domainTable.size(); }
107107
DomainOp getDomain(DomainTypeID id) const { return domainTable[id]; }
108108

109-
110109
DomainTypeID getDomainTypeID(StringAttr name) const {
111110
return typeIDTable.at(name);
112111
}
@@ -361,9 +360,9 @@ void solve(Term *lhs, Term *rhs) {
361360
// CheckModuleDomains
362361
//====--------------------------------------------------------------------------
363362

364-
/// Check that a module has complete domain information.
365-
static LogicalResult checkModuleDomains(GlobalState &globals,
366-
FModuleLike module) {
363+
/// Check that a module has complete domain information for its ports.
364+
static LogicalResult checkPortDomains(GlobalState &globals,
365+
FModuleLike module) {
367366
auto numDomains = globals.circuitInfo.getNumDomains();
368367
auto domainInfo = module.getDomainInfoAttr();
369368
DenseMap<unsigned, unsigned> typeIDTable;
@@ -418,6 +417,19 @@ static LogicalResult checkModuleDomains(GlobalState &globals,
418417
return success();
419418
}
420419

420+
static LogicalResult checkModuleDomains(GlobalState &globals,
421+
FModuleOp module) {
422+
if (failed(checkPortDomains(globals, module)))
423+
return failure();
424+
425+
return success();
426+
}
427+
428+
static LogicalResult checkModuleDomains(GlobalState &globals,
429+
FExtModuleOp module) {
430+
return checkPortDomains(globals, module);
431+
}
432+
421433
//====--------------------------------------------------------------------------
422434
// InferModuleDomains: Primary workhorse for inferring domains on modules.
423435
//====--------------------------------------------------------------------------

0 commit comments

Comments
 (0)