From 15f081b4da8bfd2748d01cb517e2c8fd98ac42f3 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 5 Oct 2021 20:34:22 -0400 Subject: [PATCH] Made a change to ext2hier.c that should prevent the propagation of substrate nodes in subcircuits that don't make connections to the substrate (such as arrays of pFETs). This is done under the restriction that ext2spice is being called without generating parasitics (otherwise the connection to substrate is valid), as it would be when extracting for LVS. The ground node must not appear as a connection to any device. This is then propagated up the hierarchy such that if none of a subcell's descendents connect to the substrate, then neither does the subcell. --- ext2spice/ext2hier.c | 14 ++++++++++++-- extflat/EFbuild.c | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ext2spice/ext2hier.c b/ext2spice/ext2hier.c index 390937e0..e5a23549 100644 --- a/ext2spice/ext2hier.c +++ b/ext2spice/ext2hier.c @@ -1683,8 +1683,18 @@ esMakePorts(hc, cdata) if (nn->efnn_node && !(nn->efnn_node->efnode_flags & EF_PORT)) { - nn->efnn_node->efnode_flags |= EF_PORT; - nn->efnn_port = -1; // Will be sorted later + /* If a node is marked EF_SUBS_NODE (is substrate) */ + /* but not EF_SUBS_PORT (connects to no devices) */ + /* and parasitic output is disabled, then do not */ + /* force the substrate connection to be a port. */ + + if ((EFCapThreshold != (EFCapValue)INFINITE_THRESHOLD_F) || + (!(nn->efnn_node->efnode_flags & EF_SUBS_NODE)) || + (nn->efnn_node->efnode_flags & EF_SUBS_PORT)) + { + nn->efnn_node->efnode_flags |= EF_PORT; + nn->efnn_port = -1; // Will be sorted later + } // Diagnostic // TxPrintf("Port connection in %s from net %s to net %s (%s)\n", diff --git a/extflat/EFbuild.c b/extflat/EFbuild.c index d8db412d..88281ea9 100644 --- a/extflat/EFbuild.c +++ b/extflat/EFbuild.c @@ -1844,6 +1844,8 @@ efNodeMerge(node1ptr, node2ptr) keeping->efnode_flags |= EF_PORT; if (removing->efnode_flags & EF_TOP_PORT) keeping->efnode_flags |= EF_TOP_PORT; + if (removing->efnode_flags & EF_SUBS_PORT) + keeping->efnode_flags |= EF_SUBS_PORT; /* * If "removing" has the EF_SUBS_NODE flag set, then copy the port