Modified the SPICE parser to at least sanely deal with (possibly

CDL syntax) parameters that have values which are multi-word and
space separated (who the hell comes up with these things?).  One
can presumably safely assume that additional pin names are not
intermixed with parameters, so now if a multi-token parameter
value is encountered, the first word is taken as the value and
the remaining words are ignored, generating a warning message.
Since I have no idea what these values are used for, I cannot say
with certainty whether or not this would break LVS, but in the
test case given to me, the parameter had no impact on LVS, but
was apparently an annotation for the layout editor.
This commit is contained in:
Tim Edwards 2018-06-25 21:21:45 -04:00
parent f4ff74783c
commit dd6145463e
1 changed files with 9 additions and 2 deletions

View File

@ -1573,7 +1573,7 @@ skip_ends:
else if (toupper(nexttok[0]) == 'X') { /* subcircuit instances */
char instancename[100], subcktname[100];
int itype;
int itype, in_props;
instancename[99] = '\0';
subcktname[99] = '\0';
@ -1596,6 +1596,7 @@ skip_ends:
head = NULL;
tail = NULL;
SpiceTokNoNewline();
in_props = FALSE;
while (nexttok != NULL) {
/* must still be a node or a parameter */
struct portelement *new_port;
@ -1622,10 +1623,11 @@ skip_ends:
if (((eqptr = strchr(nexttok, '=')) != NULL) &&
((tp = LookupCellFile(nexttok, filenum)) == NULL))
{
in_props = TRUE;
*eqptr = '\0';
AddProperty(&kvlist, nexttok, eqptr + 1);
}
else
else if (in_props == FALSE)
{
new_port = (struct portelement *)CALLOC(1, sizeof(struct portelement));
new_port->name = strsave(nexttok);
@ -1634,6 +1636,11 @@ skip_ends:
new_port->next = NULL;
tail = new_port;
}
else
{
Fprintf(stderr, "Token \"%s\" is not a parameter!\n", nexttok);
InputParseError(stderr);
}
SpiceTokNoNewline();
}