Reverted most of yesterday's modifications. Instead located the

issue at the change made in revision 214.  This was done incorrectly
in two ways, one being a set of statements inside an if() block that
should have been executed always, and the other an incorrect use of
the EF_DEVTERM flag, setting it when it should not have been set.
This commit is contained in:
Tim Edwards 2021-12-03 12:29:02 -05:00
parent 6a8f1226d1
commit 5913643ad0
4 changed files with 21 additions and 48 deletions

View File

@ -1 +1 @@
8.3.235
8.3.236

View File

@ -1496,8 +1496,7 @@ subcktVisit(use, hierName, is_top)
snode != &def->def_firstn;
snode = (EFNode *) snode->efnode_next)
{
if ((snode->efnode_flags & EF_SUBS_PORT) &&
!(snode->efnode_flags & EF_PORT))
if (snode->efnode_flags & EF_SUBS_PORT)
{
nodeName = snode->efnode_name;
if (nodeName->efnn_port < 0)
@ -1520,15 +1519,15 @@ subcktVisit(use, hierName, is_top)
/* Port numbers need not start at zero or be contiguous. */
/* They will be printed in numerical order. */
nodeList = (EFNodeName **)mallocMagic((imp_max + 1) * sizeof(EFNodeName *));
for (portidx = 0; portidx <= imp_max; portidx++)
nodeList = (EFNodeName **)mallocMagic((portmax + 1) * sizeof(EFNodeName *));
for (portidx = 0; portidx <= portmax; portidx++)
nodeList[portidx] = (EFNodeName *)NULL;
for (snode = (EFNode *) def->def_firstn.efnode_next;
snode != &def->def_firstn;
snode = (EFNode *) snode->efnode_next)
{
if (!(snode->efnode_flags & (EF_PORT | EF_SUBS_PORT))) continue;
if (!(snode->efnode_flags & EF_PORT)) continue;
for (nodeName = snode->efnode_name; nodeName != NULL;
nodeName = nodeName->efnn_next)
{
@ -1538,7 +1537,6 @@ subcktVisit(use, hierName, is_top)
portidx = nodeName->efnn_port;
if (portidx < 0) continue;
if (portidx > portmax) portmax = portidx;
if (nodeList[portidx] == NULL)
{
nodeList[portidx] = nodeName;
@ -1550,7 +1548,7 @@ subcktVisit(use, hierName, is_top)
}
}
for (portidx = 0; portidx <= imp_max; portidx++)
for (portidx = 0; portidx <= portmax; portidx++)
{
nodeName = nodeList[portidx];
@ -1583,7 +1581,6 @@ subcktVisit(use, hierName, is_top)
snode != &def->def_firstn;
snode = (EFNode *) snode->efnode_next)
{
if (snode->efnode_flags & EF_PORT) continue;
if (!(snode->efnode_flags & EF_SUBS_PORT)) continue;
nodeName = snode->efnode_name;
if (nodeName->efnn_port == portorder)
@ -1868,26 +1865,11 @@ topVisit(def, doStub)
HashStartSearch(&hs);
while (he = HashNext(&def->def_nodes, &hs))
{
HashEntry *he2;
EFNode *nnode;
sname = (EFNodeName *) HashGetValue(he);
if (sname == NULL) continue;
snode = sname->efnn_node;
/* efAddOneConn() may have changed flags only in the entry */
/* in efNodeHashTable() which is accessed by EFHNLook(). */
he2 = EFHNLook(sname->efnn_hier, (char *) NULL, "topVisit");
if (he2 != NULL)
{
snode = ((EFNodeName *)HashGetValue(he2))->efnn_node;
if (snode != sname->efnn_node)
sname->efnn_node->efnode_flags |= snode->efnode_flags;
}
else
snode = sname->efnn_node;
if (snode && (snode->efnode_flags & EF_SUBS_PORT) &&
!(snode->efnode_flags & EF_PORT))
if (snode && (snode->efnode_flags & EF_SUBS_PORT))
{
if (snode->efnode_name->efnn_port < 0)
{
@ -1903,9 +1885,6 @@ topVisit(def, doStub)
EFHNSprintf(stmp, snode->efnode_name->efnn_hier);
fprintf(esSpiceF, " %s", stmp);
snode->efnode_name->efnn_port = portorder++;
if (snode != sname->efnn_node)
sname->efnn_node->efnode_name->efnn_port =
snode->efnode_name->efnn_port;
tchars += strlen(stmp) + 1;
}
}

View File

@ -1171,6 +1171,7 @@ efBuildDevNode(def, name, isSubsNode)
{
HashEntry *he;
EFNodeName *nn;
bool isNewNode = FALSE;
he = HashFind(&def->def_nodes, name);
nn = (EFNodeName *) HashGetValue(he);
@ -1183,17 +1184,20 @@ efBuildDevNode(def, name, isSubsNode)
(char *) NULL, (char **) NULL, 0);
nn = (EFNodeName *) HashGetValue(he);
if (isSubsNode)
isNewNode = TRUE;
}
if (isSubsNode)
{
if (!EFHNIsGlob(nn->efnn_hier))
{
if (!EFHNIsGlob(nn->efnn_hier))
{
/* This node is declared to be an implicit port */
nn->efnn_node->efnode_flags |= EF_SUBS_PORT;
nn->efnn_port = -1;
def->def_flags |= DEF_SUBSNODES;
}
nn->efnn_node->efnode_flags |= (EF_DEVTERM | EF_SUBS_NODE);
/* This node is declared to be an implicit port */
nn->efnn_node->efnode_flags |= EF_SUBS_PORT;
nn->efnn_port = -1;
def->def_flags |= DEF_SUBSNODES;
}
nn->efnn_node->efnode_flags |= EF_SUBS_NODE;
if (isNewNode)
nn->efnn_node->efnode_flags |= EF_DEVTERM;
}
return nn->efnn_node;
}

View File

@ -641,20 +641,10 @@ efAddOneConn(hc, name1, name2, conn, doWarn)
if (he2 == NULL)
return 0;
newnode = ((EFNodeName *) HashGetValue(he2))->efnn_node;
if (node != newnode)
efNodeMerge(&node, &newnode);
}
/* NOTE: If called through efAddOneConn, then this is by definition */
/* a port; so if EF_SUBS_NODE is set, then it should also be defined */
/* as EF_SUBS_PORT. But, this also adds a port for the substrate */
/* even if there are no connected devices, so connections to devices */
/* need to be tracked as well as whether it is a node or a port. */
if (node->efnode_flags & EF_SUBS_NODE)
node->efnode_flags |= EF_SUBS_PORT;
return 0;
}