Corrected a long-standing issue with permutation, which turned out

to be caused by failing to have a systematic way of determining
which pin's hash value would be used for the hash value of all the
pins.  Because equivalent cells in the two netlists may have pins in
different order, it was possible that they might end up with
different hashes.  This was solved simply by always taking the
larger hash value of the two pins belonging to the permutable pair.
Now permutation works correctly for arbitrary subcircuits.
(Previously it worked for low-level components like MOSFETs because
the pin order is always the same.)
This commit is contained in:
Tim Edwards 2025-02-09 21:26:54 -05:00
parent 021dfa6e8a
commit 4457248ecd
2 changed files with 20 additions and 7 deletions

View File

@ -1 +1 @@
1.5.291
1.5.292

View File

@ -1217,7 +1217,8 @@ SortFanoutLists(nlist1, nlist2)
f2 -= 1;
matched[f1] = -1;
total++;
if (f2 != f1) {
if ((f2 != f1) && (nlist2->flist[f1].permute != 0) &&
(nlist2->flist[f2].permute != 0)) {
temp = nlist2->flist[f2];
nlist2->flist[f2] = nlist2->flist[f1];
nlist2->flist[f1] = temp;
@ -1251,7 +1252,8 @@ SortFanoutLists(nlist1, nlist2)
f1 -= 1;
matched[f2] = -1;
total++;
if (f1 != f2) {
if ((f1 != f2) && (nlist1->flist[f1].permute != 0) &&
(nlist1->flist[f2].permute != 0)) {
temp = nlist1->flist[f1];
nlist1->flist[f1] = nlist1->flist[f2];
nlist1->flist[f2] = temp;
@ -7013,10 +7015,21 @@ int Permute()
return (0);
}
/* update magic numbers */
for (NL = E->nodelist; NL != NULL; NL = NL->next)
if (NL->pin_magic == one)
NL->pin_magic = two;
/* Update magic numbers. To ensure that this works */
/* regardless of the pin order of the pins in each */
/* netlist, always set both pins to the larger of */
/* the two pin_magic values. */
if (one > two) {
for (NL = E->nodelist; NL != NULL; NL = NL->next)
if (NL->pin_magic == two)
NL->pin_magic = one;
}
else {
for (NL = E->nodelist; NL != NULL; NL = NL->next)
if (NL->pin_magic == one)
NL->pin_magic = two;
}
}
}
}