From ea414c822d5f5fe166471ab310330770267548f6 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Mon, 20 Dec 2021 13:12:49 -0500 Subject: [PATCH] Got to the bottom of why area and perimeter values are no longer output for transistors. The problem came from a change made to fix an issue with capacitors marked as floating nodes because some nodes are not output as source or drain. But those nodes are output before the parameters, so when generating parameter output, all nodes appear to have already been output. Solution: Specify an additional bit in the "visited" mask for the node having been output that is separate from the mask for resist classes used by the code that writes parameter values, and use that bit as a test for whether the node is connected to some device (not necessarily a FET source or drain). --- VERSION | 2 +- ext2spice/ext2spice.c | 32 +++++++++++++++++--------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/VERSION b/VERSION index 5509f090..2300af08 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.241 +8.3.242 diff --git a/ext2spice/ext2spice.c b/ext2spice/ext2spice.c index caff347a..dd4a3de6 100644 --- a/ext2spice/ext2spice.c +++ b/ext2spice/ext2spice.c @@ -3015,15 +3015,16 @@ FILE *outf; fprintf(outf, "%s", nodeSpiceName(nn->efnn_node->efnode_name->efnn_hier, NULL)); - /* Mark node as visited */ + /* Create node client if it doesn't exist */ if ((nodeClient *)nn->efnn_node->efnode_client == (ClientData)NULL) initNodeClientHier(nn->efnn_node); - if (!esDistrJunct) - { - TTMaskZero(&((nodeClient *)nn->efnn_node->efnode_client)->m_w.visitMask); - TTMaskCom(&((nodeClient *)nn->efnn_node->efnode_client)->m_w.visitMask); - } + /* Mark node as visited (set bit one higher than number of resist classes) */ + if (esDistrJunct) + update_w(efNumResistClasses, 1, nn->efnn_node); + else + markVisited((nodeClientHier *)nn->efnn_node->efnode_client, + efNumResistClasses); return nn->efnn_node; } } @@ -3236,12 +3237,12 @@ spcdevOutNode(prefix, suffix, name, outf) nname = nodeSpiceName(nn->efnn_node->efnode_name->efnn_hier, NULL); fprintf(outf, " %s", nname); - /* Mark node as visited */ - if (!esDistrJunct) - { - TTMaskZero(&((nodeClient *)nn->efnn_node->efnode_client)->m_w.visitMask); - TTMaskCom(&((nodeClient *)nn->efnn_node->efnode_client)->m_w.visitMask); - } + /* Mark node as visited (set bit one higher than number of resist classes) */ + if (esDistrJunct) + update_w(efNumResistClasses, 1, nn->efnn_node); + else + markVisited((nodeClientHier *)nn->efnn_node->efnode_client, + efNumResistClasses); return (1 + strlen(nname)); } @@ -3394,7 +3395,8 @@ spcnodeVisit(node, res, cap) { isConnected = (esDistrJunct) ? (((nodeClient *)node->efnode_client)->m_w.widths != NULL) : - (!TTMaskIsZero(&((nodeClient *)node->efnode_client)->m_w.visitMask)); + (!TTMaskHasType(&((nodeClient *)node->efnode_client)->m_w.visitMask, + efNumResistClasses)); } if (!isConnected && esDevNodesOnly) return 0; @@ -4100,8 +4102,8 @@ update_w(resClass, w, n) if (nc->m_w.widths == NULL) { (nc->m_w.widths) = (float *)mallocMagic((unsigned)sizeof(float) - * efNumResistClasses); - for (i = 0; i < efNumResistClasses; i++) + * (efNumResistClasses + 1)); + for (i = 0; i <= efNumResistClasses; i++) nc->m_w.widths[i] = 0.0; } nc->m_w.widths[resClass] += (float)w;