Merge branch 'master' into netgen-1.5

This commit is contained in:
Tim Edwards 2021-02-17 03:00:31 -05:00
commit 5341d7a5fd
3 changed files with 42 additions and 14 deletions

View File

@ -1 +1 @@
1.5.166 1.5.167

View File

@ -253,7 +253,7 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
{ {
struct objlist *ParentParams; struct objlist *ParentParams;
struct objlist *ParentProps; struct objlist *ParentProps;
struct objlist *NextObj; struct objlist *NextObj, *LastObj, *prepp;
struct objlist *ChildObjList; struct objlist *ChildObjList;
struct nlist *ThisCell; struct nlist *ThisCell;
struct nlist *ChildCell; struct nlist *ChildCell;
@ -296,21 +296,35 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
while (notdone) { while (notdone) {
notdone = 0; notdone = 0;
ParentParams = ThisCell->cell; ParentParams = ThisCell->cell;
LastObj = NULL;
for (ParentParams = ThisCell->cell; ParentParams != NULL; for (ParentParams = ThisCell->cell; ParentParams != NULL;
ParentParams = NextObj) { ParentParams = NextObj) {
if (Debug) Printf("Parent = %s, type = %d\n", if (Debug) Printf("Parent = %s, type = %d\n",
ParentParams->name, ParentParams->type); ParentParams->name, ParentParams->type);
NextObj = ParentParams->next; NextObj = ParentParams->next;
if (ParentParams->type != FIRSTPIN) continue; if (ParentParams->type != FIRSTPIN) {
if (!(*matchfunc)(ParentParams->model.class, instance)) continue; LastObj = ParentParams;
continue;
}
if (!(*matchfunc)(ParentParams->model.class, instance)) {
LastObj = ParentParams;
continue;
}
ChildCell = LookupCellFile(ParentParams->model.class, ThisCell->file); ChildCell = LookupCellFile(ParentParams->model.class, ThisCell->file);
if (Debug) if (Debug)
Printf(" Flattening instance: %s, primitive = %s\n", Printf(" Flattening instance: %s, primitive = %s\n",
ParentParams->instance.name, (ChildCell->class == ParentParams->instance.name, (ChildCell->class ==
CLASS_SUBCKT) ? "no" : "yes"); CLASS_SUBCKT) ? "no" : "yes");
if (ChildCell->class != CLASS_SUBCKT) continue; if (ChildCell->class != CLASS_SUBCKT) {
if (ChildCell == ThisCell) continue; // Avoid infinite loop LastObj = ParentParams;
continue;
}
if (ChildCell == ThisCell) {
LastObj = ParentParams;
continue; // Avoid infinite loop
}
/* Does the parent cell have properties? If so, save a pointer to them */ /* Does the parent cell have properties? If so, save a pointer to them */
for (ParentProps = ParentParams->next; ParentProps && for (ParentProps = ParentParams->next; ParentProps &&
@ -373,9 +387,9 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
} }
/* in pathological cases, the lengths of the port lists may /* in pathological cases, the lengths of the port lists may
change. This is an error, but that is no reason to allow * change. This is an error, but that is no reason to allow
the code to core dump. We avoid this by placing a * the code to core dump. We avoid this by placing a
superfluous check on ob2->type * superfluous check on ob2->type
*/ */
if (ob2 != NULL) if (ob2 != NULL)
@ -497,8 +511,19 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
for (ob2 = ChildObjList; ob2 && ob2->next != NULL; ob2 = ob2->next) ; for (ob2 = ChildObjList; ob2 && ob2->next != NULL; ob2 = ob2->next) ;
} }
else { else {
/* find ParentParams in ThisCell list */ /* find ParentParams in ThisCell list. In most cases, LastObj */
/* should be pointing to it. */
if (LastObj && (LastObj->next == ParentParams)) {
ob2 = LastObj;
}
else {
for (ob2 = LastObj; ob2 && ob2->next != ParentParams; ob2=ob2->next);
if (ob2 == NULL) {
/* It should not happen that LastObj is ahead of ParentParams */
/* but just in case, this long loop will find it. */
for (ob2 = ThisCell->cell; ob2 && ob2->next != ParentParams; ob2=ob2->next); for (ob2 = ThisCell->cell; ob2 && ob2->next != ParentParams; ob2=ob2->next);
}
}
if (ob2) if (ob2)
for (ob2->next = ChildObjList; ob2->next != NULL; ob2 = ob2->next) ; for (ob2->next = ChildObjList; ob2->next != NULL; ob2 = ob2->next) ;
} }

View File

@ -3132,6 +3132,9 @@ int remove_group_tags(struct objlist *ob)
/* If the device has permutable pins, then duplicate hashes are made */ /* If the device has permutable pins, then duplicate hashes are made */
/* for each permutation. */ /* for each permutation. */
/* */ /* */
/* If the device has isolated (unconnected) pins, then treat them as */
/* all belonging to the same net for the purpose of parallel merging. */
/* */
/* Return the number of devices merged. */ /* Return the number of devices merged. */
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/