Added a way to subvert the adding of a prefix to subcells of a dumped

GDS library from an abstract view, by defining the property LEFview
in the cell as "no_prefix" instead of "TRUE".
This commit is contained in:
Tim Edwards 2020-04-23 16:03:29 -04:00
parent 0f16b7da6c
commit 669ae1dfcc
1 changed files with 47 additions and 30 deletions

View File

@ -470,8 +470,8 @@ calmaDumpStructure(def, outf, calmaDefHash, filename)
newnameptr = strname; /* Should never happen */
else
{
newnameptr = mallocMagic(strlen(strname) + strlen(prefix) + 9);
sprintf(newnameptr, "1%s_%s", prefix, strname);
newnameptr = mallocMagic(strlen(strname) + strlen(prefix) + 8);
sprintf(newnameptr, "1%s%s", prefix, strname);
HashSetValue(he, (char *)newnameptr);
}
}
@ -485,8 +485,8 @@ calmaDumpStructure(def, outf, calmaDefHash, filename)
newnameptr = strname; /* Should never happen */
else
{
newnameptr = mallocMagic(strlen(strname) + strlen(prefix) + 9);
sprintf(newnameptr, "1%s_%s", prefix, strname);
newnameptr = mallocMagic(strlen(strname) + strlen(prefix) + 8);
sprintf(newnameptr, "1%s%s", prefix, strname);
HashSetValue(he, (char *)newnameptr);
}
}
@ -538,12 +538,12 @@ calmaDumpStructure(def, outf, calmaDefHash, filename)
/* the same way used for structure definitions. */
newnameptr = (char *)mallocMagic(strlen(strname) +
strlen(prefix) + 9);
sprintf(newnameptr, "0%s_%s", prefix, strname);
strlen(prefix) + 8);
sprintf(newnameptr, "0%s%s", prefix, strname);
edef = DBCellLookDef(newnameptr + 1);
if (edef != NULL)
sprintf(newnameptr, "0%s_%s[[0]]", prefix, strname);
sprintf(newnameptr, "0%s%s[[0]]", prefix, strname);
HashSetValue(he, (char *)newnameptr);
calmaOutStringRecord(CALMA_SNAME, newnameptr + 1, outf);
}
@ -602,8 +602,9 @@ calmaFullDump(def, fi, outf, filename)
char *filename;
{
int version, rval, i;
char *libname = NULL, uniqlibname[3];
char *sptr;
char *libname = NULL, uniqlibname[4];
char *sptr, *viewopts;
bool isAbstract;
HashTable calmaDefHash;
HashEntry *he;
@ -633,6 +634,18 @@ calmaFullDump(def, fi, outf, filename)
// Record the GDS library so it will not be processed again.
he = HashFind(&calmaLibHash, filename);
/* If property LEFview is defined as "no_prefix" instead of "TRUE",
* then do not create a unique prefix for subcells. This is generally
* ill-advised, but can be needed if a foundry runs specific DRC checks
* on specific cell names, in which case adding a prefix can cause DRC
* errors to appear. It is then incumbent on the user to ensure that
* names in the GDS file do not shadow any names in the database.
*/
viewopts = (char *)DBPropGet(def, "LEFview", &isAbstract);
if ((!isAbstract) || (strcasecmp(viewopts, "no_prefix")))
{
/* Generate a SHORT name for this cell (else it is easy to run into the
* GDS 32-character cellname limit). Save it in the hash record. The
* chance of generating the same prefix for a library that has items
@ -650,7 +663,8 @@ calmaFullDump(def, fi, outf, filename)
('0' + rval - 52));
uniqlibname[i] = (char)(rval & 127);
}
uniqlibname[2] = '\0';
uniqlibname[2] = '_';
uniqlibname[3] = '\0';
he2 = HashLookOnly(&calmaPrefixHash, uniqlibname);
if (he2 == NULL)
{
@ -659,6 +673,9 @@ calmaFullDump(def, fi, outf, filename)
}
}
HashSetValue(he, StrDup(NULL, uniqlibname));
}
else
HashSetValue(he, StrDup(NULL, ""));
while (calmaDumpStructure(def, outf, &calmaDefHash, filename))
if (SigInterruptPending)