Revert "Remove disconnected ports after flattening."

This reverts commit 6d6da9cf5c.

Reverting back to before pull request #33.
This commit is contained in:
Tim Edwards 2021-10-23 14:42:37 -04:00
parent d09f0dd53b
commit 23ff2f00a3
1 changed files with 0 additions and 33 deletions

View File

@ -599,39 +599,6 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
} }
CacheNodeNames(ThisCell); CacheNodeNames(ThisCell);
ThisCell->dumped = 1; /* indicate cell has been flattened */ ThisCell->dumped = 1; /* indicate cell has been flattened */
{ // Remove disconnected ports. New block to ensure isolated scope.
// Fprintf(stdout, "DEBUG: check pins for %s of %d\n", name, fnum);
struct objlist *myObject_p, *myPort_p;
struct objlist *myFirstPin_p, *myPin_p;
int myDeleteCount = 0;
myFirstPin_p = NULL;
// Save first pin definition so we don't have to search for each port
for ( myObject_p = ThisCell->cell; myObject_p != NULL; myObject_p = myObject_p->next ) {
if ( myObject_p->type >= FIRSTPIN ) {
myFirstPin_p = myObject_p;
break;
}
}
if ( myFirstPin_p != NULL ) { // not a black box. Black boxes contain no pins.
// For each port, check for pin connection. If none, mark for deletion.
// Assumes that all ports occur at the beginning of the list
for ( myPort_p = ThisCell->cell; myPort_p != NULL && IsPort(myPort_p); myPort_p = myPort_p->next ) {
for ( myPin_p = myFirstPin_p; myPin_p != NULL; myPin_p = myPin_p->next ) {
if ( myPort_p->node == myPin_p->node ) { // only need to find one connection
break;
}
}
if ( myPin_p == NULL ) { // mark disconnected ports
myDeleteCount++;
myPort_p->node = -2;
}
}
if ( myDeleteCount > 0 ) { // delete disconnected ports
CleanupPins(name, fnum);
}
}
}
return numflat; return numflat;
} }