diff --git a/base/flatten.c b/base/flatten.c index 66e9a36..1f278ba 100644 --- a/base/flatten.c +++ b/base/flatten.c @@ -193,17 +193,19 @@ void flattenCell(char *name, int file) if (Debug) Printf("Renaming %s to %s\n", tmp->name, tmpstr); FreeString(tmp->name); tmp->name = strsave(tmpstr); -#if OLDPREFIX - sprintf(tmpstr, "%s%s%s", ParentParams->instance.name, SEPARATOR, - tmp->instance.name); -#else - strcpy(tmpstr+prefixlength,tmp->instance.name); -#endif - FreeString(tmp->instance.name); - tmp->instance.name = strsave(tmpstr); HashPtrInstall(tmp->name, tmp, &(ThisCell->objdict)); - if (tmp->type == FIRSTPIN) - HashPtrInstall(tmp->instance.name, tmp, &(ThisCell->instdict)); + if ((tmp->type != NODE) && (tmp->instance.name != NULL)) { +#if OLDPREFIX + sprintf(tmpstr, "%s%s%s", ParentParams->instance.name, SEPARATOR, + tmp->instance.name); +#else + strcpy(tmpstr+prefixlength,tmp->instance.name); +#endif + FreeString(tmp->instance.name); + tmp->instance.name = strsave(tmpstr); + if (tmp->type == FIRSTPIN) + HashPtrInstall(tmp->instance.name, tmp, &(ThisCell->instdict)); + } } /* splice instance out of parent */ @@ -470,17 +472,19 @@ int flattenInstancesOf(char *name, int fnum, char *instance) if (Debug) Printf("Renaming %s to %s\n", tmp->name, tmpstr); FreeString(tmp->name); tmp->name = strsave(tmpstr); -#if OLDPREFIX - sprintf(tmpstr, "%s%s%s", ParentParams->instance.name, SEPARATOR, - tmp->instance.name); -#else - strcpy(tmpstr+prefixlength,tmp->instance.name); -#endif - FreeString(tmp->instance.name); - tmp->instance.name = strsave(tmpstr); HashPtrInstall(tmp->name, tmp, &(ThisCell->objdict)); - if (tmp->type == FIRSTPIN) - HashPtrInstall(tmp->instance.name, tmp, &(ThisCell->instdict)); + if ((tmp->type != NODE) && (tmp->instance.name != NULL)) { +#if OLDPREFIX + sprintf(tmpstr, "%s%s%s", ParentParams->instance.name, SEPARATOR, + tmp->instance.name); +#else + strcpy(tmpstr+prefixlength,tmp->instance.name); +#endif + FreeString(tmp->instance.name); + tmp->instance.name = strsave(tmpstr); + if (tmp->type == FIRSTPIN) + HashPtrInstall(tmp->instance.name, tmp, &(ThisCell->instdict)); + } } /* Do property inheritance */ diff --git a/base/netcmp.c b/base/netcmp.c index 1585d4b..962aa18 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -5360,6 +5360,32 @@ PropertyMatch(struct objlist *ob1, int file1, #endif } + /* WIP---Check for no-connect pins in merged devices on both sides. */ + /* Both sides should either have no-connects marked, or neither. */ + /* (Permutable pins may need to be handled correctly. . . */ + for (tp1 = ob1, tp2 = ob2; (tp1 != NULL) && tp1->type >= FIRSTPIN && + (tp2 != NULL) && tp2->type >= FIRSTPIN; tp1 = tp1->next, tp2 = tp2->next) + { + struct objlist *node1, *node2; + + node1 = Circuit1->nodename_cache[tp1->node]; + node2 = Circuit2->nodename_cache[tp2->node]; + + if (node1->instance.flags != node2->instance.flags) + { + Fprintf(stdout, " Parallelized instances disagree on pin connections.\n"); + Fprintf(stdout, " Circuit1 instance %s pin %s connections are %s (%d)\n", + tp1->instance.name, node1->name, + (node1->instance.flags == 0) ? "tied together" : "no connects", + node1->instance.flags); + Fprintf(stdout, " Circuit2 instance %s pin %s connections are %s (%d)\n", + tp2->instance.name, node2->name, + (node2->instance.flags == 0) ? "tied together" : "no connects", + node2->instance.flags); + mismatches++; + } + } + // Attempt to organize devices by series and parallel combination if (t1type == PROPERTY && t2type == PROPERTY) PropertySortAndCombine(obn1, tc1, obn2, tc2); diff --git a/base/netgen.c b/base/netgen.c index 36ae071..ab8e97f 100644 --- a/base/netgen.c +++ b/base/netgen.c @@ -1337,7 +1337,7 @@ void Node(char *name) tp->name = strsave(name); tp->type = NODE; /* internal node type */ tp->model.class = NULL; - tp->instance.name = NULL; + tp->instance.flags = 0; tp->node = -1; /* null node */ tp->next = NULL; AddToCurrentCell (tp); @@ -3217,7 +3217,11 @@ int CombineParallel(char *model, int file) for (ob2 = ob; ob2 && (ob2->type > FIRSTPIN || ob2 == ob); ob2 = ob2->next) { if ((ob2->node >= 0) && (nodecount[ob2->node] == 1)) + { + nob = (tp->nodename_cache)[ob2->node]; + nob->instance.flags = NO_CONNECT; strcat(pptr, "_nc"); + } else sprintf(pptr, "_%d", ob2->node); pptr += strlen(pptr); diff --git a/base/objlist.c b/base/objlist.c index c0b5448..284c68e 100644 --- a/base/objlist.c +++ b/base/objlist.c @@ -975,7 +975,10 @@ struct objlist *CopyObjList(struct objlist *oldlist, unsigned char doforall) newob->model.class = NULL; else newob->model.class = strsave(tmp->model.class); - newob->instance.name = (tmp->instance.name) ? + if (newob->type == NODE) + newob->instance.flags = tmp->instance.flags; + else + newob->instance.name = (tmp->instance.name) ? strsave(tmp->instance.name) : NULL; } newob->node = tmp->node; @@ -1095,8 +1098,8 @@ void FreeObject(struct objlist *ob) FREE(ob->instance.props); } } - else { - /* All other records */ + else if (ob->type != NODE) { + /* All other records except NODE, which uses this for flags */ if (ob->instance.name != NULL) FreeString(ob->instance.name); } if (ob->model.class != NULL) FreeString(ob->model.class); diff --git a/base/objlist.h b/base/objlist.h index 8bcd64c..550ad2d 100644 --- a/base/objlist.h +++ b/base/objlist.h @@ -28,6 +28,8 @@ #define PROXY (0) /* Used in model.port record of ports */ +#define NO_CONNECT 1 /* Use in object list to flag an isolated net */ + /* Lists of device properties. Order is defined at the time of */ /* the cell definition; values are sorted at the time instances */ /* are read. */ @@ -160,6 +162,7 @@ struct objlist { union { char *name; /* unique name for the instance, or */ /* (string) value of property for properties */ + int flags; /* Used by NODE type to flag isolated net */ struct valuelist *props; /* Property record */ } instance; int node; /* the electrical node number of the port/node/pin */