Corrected an error in checking merge flags when doing sorting of

parallel and series devices.  This was a fairly major error
undermining the property sorting (the case where the same number
of devices are in parallel in both circuits and need to be sorted
by, e.g., width, prior to checking for matches).
This commit is contained in:
Tim Edwards 2021-05-03 11:20:44 -04:00
parent 01b2484be3
commit 92e8fed8be
2 changed files with 14 additions and 3 deletions

View File

@ -1 +1 @@
1.5.174 1.5.175

View File

@ -4120,7 +4120,7 @@ void series_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
} }
else { else {
kl = (struct property *)HashLookup(vl->key, &(tp1->propdict)); kl = (struct property *)HashLookup(vl->key, &(tp1->propdict));
if (kl && (kl->merge & MERGE_S_CRIT)) { if (kl && (kl->merge & (MERGE_S_ADD | MERGE_S_PAR))) {
if (vl->type == PROP_INTEGER) if (vl->type == PROP_INTEGER)
cval = (double)vl->value.ival; cval = (double)vl->value.ival;
else else
@ -4137,6 +4137,9 @@ void series_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
proplist[i].value = cval / (double)sval; proplist[i].value = cval / (double)sval;
sl->value.ival = 1; sl->value.ival = 1;
} }
else {
proplist[i].value = (double)0;
}
proplist[i].idx = i; proplist[i].idx = i;
proplist[i].ob = obp; proplist[i].ob = obp;
obp = obp->next; obp = obp->next;
@ -4269,8 +4272,9 @@ void parallel_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
} }
kl = (struct property *)HashLookup(vl->key, &(tp1->propdict)); kl = (struct property *)HashLookup(vl->key, &(tp1->propdict));
if (kl == NULL) continue; /* Ignored property */ if (kl == NULL) continue; /* Ignored property */
if (kl->merge & MERGE_P_CRIT) { if (kl->merge & MERGE_P_CRIT)
has_crit = TRUE; has_crit = TRUE;
else if (kl->merge & (MERGE_P_ADD | MERGE_P_PAR)) {
if ((vl->type == PROP_STRING || vl->type == PROP_EXPRESSION) && if ((vl->type == PROP_STRING || vl->type == PROP_EXPRESSION) &&
(kl->type != vl->type)) (kl->type != vl->type))
PromoteProperty(kl, vl); PromoteProperty(kl, vl);
@ -4282,6 +4286,7 @@ void parallel_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
+ (double)vl->value.string[1] / 10.0; + (double)vl->value.string[1] / 10.0;
else else
cval = vl->value.dval; cval = vl->value.dval;
merge_type = kl->merge & (MERGE_P_ADD | MERGE_P_PAR); merge_type = kl->merge & (MERGE_P_ADD | MERGE_P_PAR);
} }
} }
@ -4293,6 +4298,9 @@ void parallel_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
proplist[i].value = cval / (double)mval; proplist[i].value = cval / (double)mval;
if (ml) ml->value.ival = 1; if (ml) ml->value.ival = 1;
} }
else {
proplist[i].value = (double)0;
}
proplist[i].idx = i; proplist[i].idx = i;
proplist[i].ob = obp; proplist[i].ob = obp;
obp = obp->next; obp = obp->next;
@ -4341,6 +4349,9 @@ void parallel_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
proplist[i].value = cval / (double)mval; proplist[i].value = cval / (double)mval;
if (ml) ml->value.ival = 1; if (ml) ml->value.ival = 1;
} }
else {
proplist[i].value = 0;
}
obp = obp->next; obp = obp->next;
} }
} }