Updating the version number to go along with the merge of pull

request #478 from Mitch Bailey.  Also edited the code from the
PR for programming style.
This commit is contained in:
R. Timothy Edwards 2025-12-24 11:31:43 -05:00
parent 73e08e0c88
commit bd417aa54b
2 changed files with 34 additions and 18 deletions

View File

@ -1 +1 @@
8.3.584
8.3.585

View File

@ -652,15 +652,20 @@ efBuildEquiv(def, nodeName1, nodeName2, resist, isspice)
if (efWarn)
efReadError("Merged nodes %s and %s\n", nodeName1, nodeName2);
lostnode = efNodeMerge(&nn1->efnn_node, &nn2->efnn_node);
// keep the lowest valid port number
/* Keep the lowest valid port number. This avoids preferring
* names generated by "extract unique" over the original port
* name.
*/
if (nn1->efnn_port > 0)
{
if (nn2->efnn_port > 0 && nn2->efnn_port < nn1->efnn_port)
nn1->efnn_port = nn2->efnn_port;
if ((nn2->efnn_port > 0) && (nn2->efnn_port < nn1->efnn_port))
nn1->efnn_port = nn2->efnn_port;
else
nn2->efnn_port = nn1->efnn_port;
nn2->efnn_port = nn1->efnn_port;
}
else if (nn2->efnn_port > 0) nn1->efnn_port = nn2->efnn_port;
else if (nn2->efnn_port > 0)
nn1->efnn_port = nn2->efnn_port;
/* Check if there are any device terminals pointing to the
* node that was just removed.
@ -1950,30 +1955,41 @@ efNodeMerge(node1ptr, node2ptr)
EFNodeName *nn, *nnlast, *nn1, *nn2;
EFAttr *ap;
int n;
int keep; /* Which node to keep (1 or 2; 0 = unknown) */
EFNode *keeping, *removing;
/* Sanity check: ignore if same node */
if (*node1ptr == *node2ptr)
return NULL;
/* Keep the node with the greater number of entries, and merge */
/* the node with fewer entries into it. */
/* If one node is a port, keep that node */
/* If both nodes are ports, keep the lowest numbered port */
/* Since duplicate ports always have higher numbers, this */
/* should keep the original. */
/*
* Keep the node with the greater number of entries, and merge
* the node with fewer entries into it.
* If one node is a port and the other isn't, keep the port node.
* If both nodes are ports, keep the lowest numbered port. Since
* ports generated by "extract unique" always have higher numbers,
* this will preserve the original name. This is necessary due to
* the "blindness" of "extract unique" to ports being merged
* through connecting geometry in descendent cells. The unique
* suffixes are overused, and ext2spice prunes the unnecessary
* entries but needs to preserve the original node name.
*/
int keep = 0; // unknown
keep = 0;
nn1 = (*node1ptr)->efnode_name;
nn2 = (*node2ptr)->efnode_name;
if ( nn1 && nn1->efnn_port > 0 )
if (nn1 && (nn1->efnn_port > 0))
{
if ( nn2 && nn2->efnn_port > 0 && nn2->efnn_port < nn1->efnn_port ) keep = 2;
else keep = 1;
if (nn2 && (nn2->efnn_port > 0) && (nn2->efnn_port < nn1->efnn_port))
keep = 2;
else
keep = 1;
}
else if ( nn2 && nn2->efnn_port > 0 ) keep = 2;
else if (nn2 && nn2->efnn_port > 0)
keep = 2;
if (keep == 1 || ((keep == 0 && (*node1ptr)->efnode_num >= (*node2ptr)->efnode_num)))
if ((keep == 1) || ((keep == 0) &&
((*node1ptr)->efnode_num >= (*node2ptr)->efnode_num)))
{
keeping = *node1ptr;
removing = *node2ptr;