Minor syntactical editing of pull request #33, and updated version

to go along with the merge of the pull request (from Mitch Bailey).
This commit is contained in:
Tim Edwards 2021-10-14 11:22:20 -04:00
parent 42b1acc564
commit 6ceeddf096
2 changed files with 38 additions and 36 deletions

View File

@ -1 +1 @@
1.5.203
1.5.204

View File

@ -264,6 +264,9 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
int notdone, rnodenum;
char tmpstr[1024];
int nextnode, oldmax, numflat = 0;
struct objlist *myObject_p, *myPort_p;
struct objlist *myFirstPin_p, *myPin_p;
int myDeleteCount = 0;
#if !OLDPREFIX
int prefixlength;
#endif
@ -599,13 +602,12 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
}
CacheNodeNames(ThisCell);
ThisCell->dumped = 1; /* indicate cell has been flattened */
{ // Remove disconnected ports. New block to ensure isolated scope.
// Remove disconnected ports.
// 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) {
@ -613,10 +615,11 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
break;
}
}
if ( myFirstPin_p != NULL ) { // not a black box. Black boxes contain no pins.
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 (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;
@ -631,7 +634,6 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
CleanupPins(name, fnum);
}
}
}
return numflat;
}
@ -1615,8 +1617,8 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
}
}
else {
// cell exists in one circuit but not the other, so flatten it.
// match = 0;
// Apply recursive flattening when a cell exists in
// one circuit but not the other.
break;
}
}