Merge branch 'master' into netgen-1.5

This commit is contained in:
Tim Edwards 2020-03-05 03:00:09 -05:00
commit 0490959b07
7 changed files with 51 additions and 23 deletions

View File

@ -1 +1 @@
1.5.141 1.5.142

View File

@ -1166,7 +1166,7 @@ struct nlist *cleanuppins(struct hashlist *p, void *clientdata)
while (ob && obt && (ob->type > FIRSTPIN || ob == firstpin) && while (ob && obt && (ob->type > FIRSTPIN || ob == firstpin) &&
ob->model.class != NULL) { ob->model.class != NULL) {
nob = ob->next; nob = ob->next;
if ((obt->type == PORT) && (obt->node == -1)) { if ((obt->type == PORT) && (obt->node == -2)) {
/* Remove this pin */ /* Remove this pin */
@ -1238,7 +1238,7 @@ int CleanupPins(char *name, int filenum)
for (ob = ThisCell->cell; ob != NULL; ob = ob->next) { for (ob = ThisCell->cell; ob != NULL; ob = ob->next) {
if (ob->type != PORT) break; if (ob->type != PORT) break;
if (ob->node == -1) { if (ob->node == -2) {
needscleanup = 1; needscleanup = 1;
break; break;
} }
@ -1265,7 +1265,7 @@ int CleanupPins(char *name, int filenum)
} }
else if (ob->type != PORT) break; else if (ob->type != PORT) break;
nob = ob->next; nob = ob->next;
if (ob->node == -1) { if (ob->node == -2) {
if (lob == NULL) { if (lob == NULL) {
ThisCell->cell = ob->next; ThisCell->cell = ob->next;
} }
@ -1539,7 +1539,7 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
/* (it without regard to cell1) improves the matching. */ /* (it without regard to cell1) improves the matching. */
else if ((ecomp->num1 != ecomp->num2) && (ecomp->cell2 != NULL) && else if ((ecomp->num1 != ecomp->num2) && (ecomp->cell2 != NULL) &&
(ecomp->cell2->class == CLASS_SUBCKT)) { (ecomp->num2 != 0) && (ecomp->cell2->class == CLASS_SUBCKT)) {
ecomp->add2 = -ecomp->num2; ecomp->add2 = -ecomp->num2;
match = 1; match = 1;
for (ob2 = ecomp->cell2->cell; ob2; ob2 = ob2->next) { for (ob2 = ecomp->cell2->cell; ob2; ob2 = ob2->next) {
@ -1597,7 +1597,7 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
/* (it without regard to cell1) improves the matching. */ /* (it without regard to cell1) improves the matching. */
else if ((ecomp->num1 != ecomp->num2) && (ecomp->cell1 != NULL) && else if ((ecomp->num1 != ecomp->num2) && (ecomp->cell1 != NULL) &&
(ecomp->cell1->class == CLASS_SUBCKT)) { (ecomp->num1 != 0) && (ecomp->cell1->class == CLASS_SUBCKT)) {
ecomp->add1 = -ecomp->num1; ecomp->add1 = -ecomp->num1;
match = 1; match = 1;
for (ob2 = ecomp->cell1->cell; ob2; ob2 = ob2->next) { for (ob2 = ecomp->cell1->cell; ob2; ob2 = ob2->next) {

View File

@ -6729,7 +6729,7 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist)
/* Make a pass through circuit 1 to find out if */ /* Make a pass through circuit 1 to find out if */
/* the pin really is connected to anything, or */ /* the pin really is connected to anything, or */
/* has been left orphaned after flattening. If */ /* has been left orphaned after flattening. If */
/* disconnected, set its node number to -1. */ /* disconnected, set its node number to -2. */
for (obt = ob1->next; obt; obt = obt->next) { for (obt = ob1->next; obt; obt = obt->next) {
if (obt->type >= FIRSTPIN) if (obt->type >= FIRSTPIN)
@ -6737,7 +6737,7 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist)
break; break;
} }
if (obt == NULL) { if (obt == NULL) {
ob1->node = -1; // Will run this through cleanuppins ob1->node = -2; // Will run this through cleanuppins
needclean1 = 1; needclean1 = 1;
} }
} }
@ -6884,7 +6884,7 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist)
break; break;
} }
if (obt == NULL) { if (obt == NULL) {
ob2->node = -1; // Will run this through cleanuppins ob2->node = -2; // Will run this through cleanuppins
needclean2 = 1; needclean2 = 1;
continue; continue;
} }
@ -6986,6 +6986,7 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist)
else if (ob1 != NULL && ob1->type == PORT) { else if (ob1 != NULL && ob1->type == PORT) {
/* Disconnected node was not meaningful, has no pin match in */ /* Disconnected node was not meaningful, has no pin match in */
/* the compared circuit, and so should be discarded. */ /* the compared circuit, and so should be discarded. */
ob1->node = -2;
needclean1 = 1; needclean1 = 1;
/* Adjust numbering around removed node */ /* Adjust numbering around removed node */

View File

@ -673,6 +673,7 @@ char *strdtok(char *pstring, char *delim1, char *delim2)
/* accordingly (needs to be done). */ /* accordingly (needs to be done). */
if (*s == '\\') { if (*s == '\\') {
s++;
while (*s != '\0') { while (*s != '\0') {
if ((*s == ' ') || (*s == '\\')) { if ((*s == ' ') || (*s == '\\')) {
s++; s++;

View File

@ -801,9 +801,12 @@ void DescribeInstance(char *name, int file)
{ {
if (ob->node > nodemax) nodemax = ob->node; if (ob->node > nodemax) nodemax = ob->node;
else if ((ob->node == -1) && (ob->model.port != PROXY)) { else if ((ob->node == -1) && (ob->model.port != PROXY)) {
if (disconnectednodes == 0) Fprintf(stderr, "\n"); if (!(tp->flags & CELL_PLACEHOLDER))
disconnectednodes++; {
Fprintf(stderr, "Cell %s disconnected node: %s\n", tp->name, ob->name); if (disconnectednodes == 0) Fprintf(stderr, "\n");
disconnectednodes++;
Fprintf(stderr, "Cell %s disconnected node: %s\n", tp->name, ob->name);
}
} }
} }
instlist = (unsigned char *) CALLOC((nodemax + 1), sizeof(unsigned char)); instlist = (unsigned char *) CALLOC((nodemax + 1), sizeof(unsigned char));

View File

@ -283,7 +283,7 @@ int GetBusTok(struct bus *wb)
int GetBus(char *astr, struct bus *wb) int GetBus(char *astr, struct bus *wb)
{ {
char *colonptr, *brackstart, *brackend, *sigend, sdelim; char *colonptr, *brackstart, *brackend, *sigend, sdelim, *aastr;
int result, start, end; int result, start, end;
if (wb == NULL) return 0; if (wb == NULL) return 0;
@ -325,15 +325,22 @@ int GetBus(char *astr, struct bus *wb)
return 0; return 0;
} }
brackstart = strchr(astr, '['); // Delimiters may appear in backslash-escaped names. . . ignore these.
aastr = astr;
if (*aastr == '\\') {
aastr++;
while (*aastr != ' ' && *aastr != '\\' && *aastr != '\0') aastr++;
}
brackstart = strchr(aastr, '[');
if (brackstart != NULL) { if (brackstart != NULL) {
brackend = strchr(astr, ']'); brackend = strchr(aastr, ']');
if (brackend == NULL) { if (brackend == NULL) {
Printf("Badly formed array notation \"%s\"\n", astr); Printf("Badly formed array notation \"%s\"\n", astr);
return 1; return 1;
} }
*brackend = '\0'; *brackend = '\0';
colonptr = strchr(astr, ':'); colonptr = strchr(aastr, ':');
if (colonptr) *colonptr = '\0'; if (colonptr) *colonptr = '\0';
result = sscanf(brackstart + 1, "%d", &start); result = sscanf(brackstart + 1, "%d", &start);
if (colonptr) *colonptr = ':'; if (colonptr) *colonptr = ':';

View File

@ -2959,15 +2959,31 @@ _netcmp_equate(ClientData clientData,
case PINS_IDX: case PINS_IDX:
if ((ElementClasses == NULL) && (auto_blackbox == FALSE)) { if ((ElementClasses == NULL) && (auto_blackbox == FALSE)) {
if (CurrentCell == NULL) if (CurrentCell == NULL) {
Fprintf(stderr, "Equate elements: no current cell.\n"); Fprintf(stderr, "Equate elements: no current cell.\n");
Fprintf(stderr, "Equate pins: cell %s and/or %s has no elements.\n", Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0));
name1, name2); return TCL_OK;
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0)); }
return TCL_OK; else if ((tp1->flags & CELL_PLACEHOLDER) ||
(tp2->flags & CELL_PLACEHOLDER)) {
if (tp1->flags & CELL_PLACEHOLDER) {
Fprintf(stdout, "Warning: Equate pins: cell %s "
"has no definition, treated as a black box.\n", name1);
}
if (tp2->flags & CELL_PLACEHOLDER) {
Fprintf(stdout, "Warning: Equate pins: cell %s "
"has no definition, treated as a black box.\n", name2);
}
}
else {
Fprintf(stdout, "Equate pins: cell %s and/or %s "
"has no elements.\n", name1, name2);
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0));
return TCL_OK;
}
} }
else if (ElementClasses == NULL) { if (ElementClasses == NULL) {
/* This has been called outside of a netlist compare, */ /* This may have been called outside of a netlist compare, */
/* probably to force name matching of pins on black-box */ /* probably to force name matching of pins on black-box */
/* devices. But MatchPins only works if tp1 == Circuit1 */ /* devices. But MatchPins only works if tp1 == Circuit1 */
/* and tp2 == Circuit2, so preserve these values and */ /* and tp2 == Circuit2, so preserve these values and */