From dd6145463e266b2702c4412a7e72d1abbae978d7 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Mon, 25 Jun 2018 21:21:45 -0400 Subject: [PATCH] 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. --- base/spice.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/base/spice.c b/base/spice.c index 45f8db1..9736c66 100644 --- a/base/spice.c +++ b/base/spice.c @@ -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(); }