From 83808dcf796f7e451f5cfd438d7aceb34aeeee45 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Mon, 1 Mar 2021 11:08:25 -0500 Subject: [PATCH] Corrected an error that was causing disconnects in the hierarchical SPICE netlist output that appears to have come from flags created for writing DEF that inappropriately got set during ext2spice. A redundant call to efAddNodes() was adding confusion by appearing to handle most cases but actually missing some. With the corrected flag, the redundant call is really redundant and can be removed. It has not been tested whether DEF output is affected by the change (DEF output from magic is rarely used, anyway). --- ext2spice/ext2hier.c | 8 ++++++-- extflat/EFflat.c | 16 ++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ext2spice/ext2hier.c b/ext2spice/ext2hier.c index b8dff398..90fc6404 100644 --- a/ext2spice/ext2hier.c +++ b/ext2spice/ext2hier.c @@ -81,6 +81,7 @@ ESGenerateHierarchy(inName, flags) hc.hc_hierName = NULL; hc.hc_trans = GeoIdentityTransform; hc.hc_x = hc.hc_y = 0; + EFHierSrDefs(&hc, esMakePorts, NULL); EFHierSrDefs(&hc, NULL, NULL); /* Clear processed */ @@ -1637,8 +1638,11 @@ esMakePorts(hc, cdata) *tptr = '/'; portname = tptr + 1; - // Find the net of portname in the subcell and - // make it a port if it is not already. + /* Find the net of portname in the subcell and make it a + * port if it is not already. It is possible that the + * preferred node name is in the merge list, so the merging + * code may need to replace it with another name. + */ if (portdef) { diff --git a/extflat/EFflat.c b/extflat/EFflat.c index 3c333dd1..516c1f50 100644 --- a/extflat/EFflat.c +++ b/extflat/EFflat.c @@ -204,7 +204,7 @@ EFFlatBuildOneLevel(def, flags) efFlatRootUse.use_def = efFlatRootDef; /* Record all nodes down the hierarchy from here */ - flatnodeflags = FLATNODE_STDCELL; /* No FLATDNODE_DOWARN flag */ + flatnodeflags = 0; /* No FLATNODE_DOWARN */ efFlatNodes(&efFlatContext, (ClientData)flatnodeflags); /* Expand all subcells that contain connectivity information but */ @@ -219,10 +219,6 @@ EFFlatBuildOneLevel(def, flags) if ((usecount == 0) && (HashGetNumEntries(&efFlatRootUse.use_def->def_devs) == 0)) efFlatRootUse.use_def->def_flags |= DEF_NODEVICES; - /* Record all local nodes */ - efAddNodes(&efFlatContext, FALSE); - efAddConns(&efFlatContext, TRUE); - efFlatKills(&efFlatContext); if (!(flags & EF_NONAMEMERGE)) efFlatGlob(); @@ -297,6 +293,9 @@ EFFlatDone() * Adds node names to the table of flattened node names efNodeHashTable. * May merge nodes from the list efNodeList as per the connection * list hc->hc_use->use_def->def_conns. + * + * Note: + * stdcell = TRUE is only used when writing DEF files. * * ---------------------------------------------------------------------------- */ @@ -499,15 +498,15 @@ efAddNodes(hc, stdcell) newnode->efnode_loc.r_ybot = (int)((float)(newnode->efnode_loc.r_ybot) * scale); newnode->efnode_loc.r_ytop = (int)((float)(newnode->efnode_loc.r_ytop) * scale); + /* Add each name for this node to the hash table */ + newnode->efnode_name = (EFNodeName *) NULL; + /* Prepend to global node list */ newnode->efnode_next = efNodeList.efnode_next; newnode->efnode_prev = (EFNodeHdr *) &efNodeList; efNodeList.efnode_next->efnhdr_prev = (EFNodeHdr *) newnode; efNodeList.efnode_next = (EFNodeHdr *) newnode; - /* Add each name for this node to the hash table */ - newnode->efnode_name = (EFNodeName *) NULL; - for (nn = node->efnode_name; nn; nn = nn->efnn_next) { /* @@ -557,6 +556,7 @@ efAddNodes(hc, stdcell) newnode->efnode_name = newname; } } + } return 0; }