From 92e8fed8beec9ef3151f0b57ac2e16d3fa83c511 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Mon, 3 May 2021 11:20:44 -0400 Subject: [PATCH] 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). --- VERSION | 2 +- base/netcmp.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index d9f5db6..fc03852 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.174 +1.5.175 diff --git a/base/netcmp.c b/base/netcmp.c index 38887e7..3a29ae4 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -4120,7 +4120,7 @@ void series_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run) } else { 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) cval = (double)vl->value.ival; else @@ -4137,6 +4137,9 @@ void series_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run) proplist[i].value = cval / (double)sval; sl->value.ival = 1; } + else { + proplist[i].value = (double)0; + } proplist[i].idx = i; proplist[i].ob = obp; 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)); if (kl == NULL) continue; /* Ignored property */ - if (kl->merge & MERGE_P_CRIT) { + if (kl->merge & MERGE_P_CRIT) has_crit = TRUE; + else if (kl->merge & (MERGE_P_ADD | MERGE_P_PAR)) { if ((vl->type == PROP_STRING || vl->type == PROP_EXPRESSION) && (kl->type != vl->type)) 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; else cval = vl->value.dval; + 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; if (ml) ml->value.ival = 1; } + else { + proplist[i].value = (double)0; + } proplist[i].idx = i; proplist[i].ob = obp; 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; if (ml) ml->value.ival = 1; } + else { + proplist[i].value = 0; + } obp = obp->next; } }