Resolved some issues with working with ext2spice using abstract

views.  Because the abstract view does not necessarily represent
actual connectivity, rely on the port indexes in the .ext file
to determine the number of ports and port order.  Do not use
SpiceNodeName() to look up the node name, or unique ports that
are deemed shorted will go missing.  Also:  Modified the read-in
of .ext files so that use names may contain backslashes.  Only
backslashes that end a line will be handled differently.
This commit is contained in:
Tim Edwards 2020-01-13 12:58:04 -05:00
parent 8e6f770afa
commit afe38c55c8
2 changed files with 28 additions and 9 deletions

View File

@ -1501,9 +1501,7 @@ subcktVisit(use, hierName, is_top)
{
nodeName = nodeList[portidx];
if (nodeName == NULL)
TxError("No port connection on port %d; need to resolve.\n", portidx);
else
if (nodeName != NULL)
{
if (tchars > 80)
{
@ -1513,6 +1511,12 @@ subcktVisit(use, hierName, is_top)
tchars += spcdevOutNode(hierName, nodeName->efnn_hier,
"subcircuit", esSpiceF);
}
else
{
// As port indexes do not have to be contiguous, this does not
// necessarily indicate an error condition. No need to report?
// TxError("No port connection on port %d; need to resolve.\n", portidx);
}
}
freeMagic(nodeList);
@ -1717,6 +1721,7 @@ topVisit(def, doStub)
HashStartSearch(&hs);
while (he = HashNext(&def->def_nodes, &hs))
{
char stmp[MAX_STR_SIZE];
int portidx;
EFNodeName *unnumbered;
@ -1737,7 +1742,17 @@ topVisit(def, doStub)
fprintf(esSpiceF, "\n+");
tchars = 1;
}
pname = nodeSpiceName(snode->efnode_name->efnn_hier, NULL);
// If view is abstract, rely on the given port name, not
// the node. Otherwise, artifacts of the abstract view
// may cause nodes to be merged and the names lost.
if (def->def_flags & DEF_ABSTRACT)
{
EFHNSprintf(stmp, nodeName->efnn_hier);
pname = stmp;
}
else
pname = nodeSpiceName(snode->efnode_name->efnn_hier, NULL);
fprintf(esSpiceF, " %s", pname);
tchars += strlen(pname) + 1;
break;

View File

@ -728,11 +728,15 @@ start:
}
}
if (*get == '\\') /* Process quoted characters literally */
{
get++;
if (*get == '\0') break;
}
/* Process backslash characters literally unless they */
/* are followed by the end-of-line. */
if (*get == '\\')
if (*(get + 1) == '\0')
{
get++;
break;
}
/* Copy into token receiving area */
*put++ = *get++;