Skip to content

Commit

Permalink
Merge pull request #256 from d-m-bailey/allow_empty
Browse files Browse the repository at this point in the history
Allow empty subcircuits
  • Loading branch information
d-m-bailey authored Oct 4, 2022
2 parents 5ce9390 + 0c3c2b8 commit df85a63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/CCvcDb_interactive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1197,12 +1197,12 @@ void CCvcDb::DumpUnknownLogicalPorts(instanceId_t theCurrentInstanceId, string t
mySearchInstance = UNKNOWN_INSTANCE;
}
if ( mySearchInstance == UNKNOWN_INSTANCE ) { // source outside hierarchy or input (no source)
mySearchInstance == FindNetInstance(myNet, theCurrentInstanceId);
mySearchInstance = FindNetInstance(myNet, theCurrentInstanceId);
}
if ( IsInternalNet(myNet, mySearchInstance) ) continue; // ignore non ports
netId_t port_it;
//netId_t port_it;
CInstance * mySearchInstance_p;
CCircuit * mySearchCircuit_p;
//CCircuit * mySearchCircuit_p;
text_t myLocalNetName = NULL;
while ( mySearchInstance != theCurrentInstanceId && IsSubcircuitOf(mySearchInstance, theCurrentInstanceId) && ! myNetFound ) {
// unfortunately requires 2 reverse searches. port given global net, and name given port
Expand All @@ -1220,8 +1220,8 @@ void CCvcDb::DumpUnknownLogicalPorts(instanceId_t theCurrentInstanceId, string t
}
if ( ! myNetFound && mySearchInstance == theCurrentInstanceId ) { // include internal nets of top level
mySearchInstance_p = instancePtr_v[theCurrentInstanceId];
mySearchCircuit_p = mySearchInstance_p->master_p;
netId_t mySearchLimit = mySearchInstance_p->localToGlobalNetId_v.size();
//mySearchCircuit_p = mySearchInstance_p->master_p;
//netId_t mySearchLimit = mySearchInstance_p->localToGlobalNetId_v.size();
myLocalNetName = GetLocalNetName(theCurrentInstanceId, myNet);
if ( myLocalNetName != NULL ) {
myNetFound = regex_match(myLocalNetName, mySearchPattern);
Expand Down
8 changes: 4 additions & 4 deletions src/CInstance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ void CInstance::AssignTopGlobalIDs(CCvcDb * theCvcDb_p, CCircuit * theMaster_p)
instanceId_t myLastSubcircuitId = theMaster_p->subcircuitPtr_v.size();
instanceId_t myNewInstanceId;
for (instanceId_t subcircuit_it = 0; subcircuit_it < myLastSubcircuitId; subcircuit_it++) {
if (theMaster_p->subcircuitPtr_v[subcircuit_it]->master_p->deviceCount > 0) {
//if (theMaster_p->subcircuitPtr_v[subcircuit_it]->master_p->deviceCount > 0) {
myNewInstanceId = firstSubcircuitId + subcircuit_it;
CDevice * mySubcircuit_p = theMaster_p->subcircuitPtr_v[subcircuit_it];
if ( mySubcircuit_p->master_p->instanceId_v.size() == 0 ) mySubcircuit_p->master_p->AllocateInstances(theCvcDb_p, myNewInstanceId);
theCvcDb_p->instancePtr_v[myNewInstanceId] = new CInstance;
theCvcDb_p->instancePtr_v[myNewInstanceId]->AssignGlobalIDs(theCvcDb_p, myNewInstanceId, mySubcircuit_p, 0, this, NOT_PARALLEL);
}
//}
}
theCvcDb_p->netParent_v.shrink_to_fit();
theCvcDb_p->deviceParent_v.shrink_to_fit();
Expand Down Expand Up @@ -133,11 +133,11 @@ void CInstance::AssignGlobalIDs(CCvcDb * theCvcDb_p, const instanceId_t theInsta
for (instanceId_t subcircuit_it = 0; subcircuit_it < myLastSubcircuitId; subcircuit_it++) {
myNewInstanceId = firstSubcircuitId + subcircuit_it;
CDevice * mySubcircuit_p = master_p->subcircuitPtr_v[subcircuit_it];
if (mySubcircuit_p->master_p->deviceCount > 0) {
//if (mySubcircuit_p->master_p->deviceCount > 0) {
if ( mySubcircuit_p->master_p->instanceId_v.size() == 0 ) mySubcircuit_p->master_p->AllocateInstances(theCvcDb_p, myNewInstanceId);
theCvcDb_p->instancePtr_v[myNewInstanceId] = new CInstance;
theCvcDb_p->instancePtr_v[myNewInstanceId]->AssignGlobalIDs(theCvcDb_p, myNewInstanceId, mySubcircuit_p, theInstanceId, this, isParallel);
}
//}
}
}

Expand Down

0 comments on commit df85a63

Please sign in to comment.