Modified the handling of subcircuit names beginning with non-alphanumeric

characters.  Instead of removing the non-alphanumeric characters, magic
now prepends an "x" to the name.  Since this naming restriction does not
necessarily impact, say, LVS, it would probably be better to let this
behavior be enabled or disabled by a command.
This commit is contained in:
Tim Edwards 2021-03-06 19:39:34 -05:00
parent 324721b514
commit feddffcf45
2 changed files with 16 additions and 5 deletions

View File

@ -1 +1 @@
8.3.137
8.3.138

View File

@ -1553,10 +1553,15 @@ subcktVisit(use, hierName, is_top)
}
}
/* SPICE subcircuit names must begin with A-Z. This will also be */
/* enforced when writing X subcircuit calls. */
/* SPICE subcircuit names must begin with A-Z. */
subcktname = def->def_name;
while (!isalpha(*subcktname)) subcktname++;
if (!isalpha(*subcktname))
{
subcktname = mallocMagic(2 + strlen(def->def_name));
sprintf(subcktname, "x%s", def->def_name);
freeMagic(def->def_name);
def->def_name = subcktname;
}
if (tchars > 80) fprintf(esSpiceF, "\n+");
fprintf(esSpiceF, " %s", subcktname); /* subcircuit model name */
@ -1664,7 +1669,13 @@ topVisit(def, doStub)
/* SPICE subcircuit names must begin with A-Z. This will also be */
/* enforced when writing X subcircuit calls. */
subcktname = def->def_name;
while (!isalpha(*subcktname)) subcktname++;
if (!isalpha(*subcktname))
{
subcktname = mallocMagic(2 + strlen(def->def_name));
sprintf(subcktname, "x%s", def->def_name);
freeMagic(def->def_name);
def->def_name = subcktname;
}
fprintf(esSpiceF, ".subckt %s", subcktname);
tchars = 8 + strlen(subcktname);