Modified the "def write" routine to strip any path component off of

a cell name (although cell names are not supposed to have path
components, so need to find out where they came from. . .).
This commit is contained in:
Tim Edwards 2019-05-28 17:14:24 -04:00
parent a56309fdb6
commit b098fbbfbb
1 changed files with 11 additions and 1 deletions

View File

@ -1821,6 +1821,7 @@ defComponentFunc(cellUse, defdata)
{ {
FILE *f = defdata->f; FILE *f = defdata->f;
float oscale = defdata->scale; float oscale = defdata->scale;
char *nameroot;
/* Ignore any cellUse that does not have an identifier string. */ /* Ignore any cellUse that does not have an identifier string. */
if (cellUse->cu_id == NULL) return 0; if (cellUse->cu_id == NULL) return 0;
@ -1831,8 +1832,17 @@ defComponentFunc(cellUse, defdata)
return 0; return 0;
} }
/* In case the cd_name contains a path component (it's not supposed to), */
/* remove it. */
nameroot = strrchr(cellUse->cu_def->cd_name, '/');
if (nameroot != NULL)
nameroot++;
else
nameroot = cellUse->cu_def->cd_name;
fprintf(f, " - %s %s\n + PLACED ( %.10g %.10g ) %s ;\n", fprintf(f, " - %s %s\n + PLACED ( %.10g %.10g ) %s ;\n",
cellUse->cu_id, cellUse->cu_def->cd_name, cellUse->cu_id, nameroot,
(float)cellUse->cu_bbox.r_xbot * oscale, (float)cellUse->cu_bbox.r_xbot * oscale,
(float)cellUse->cu_bbox.r_ybot * oscale, (float)cellUse->cu_bbox.r_ybot * oscale,
defTransPos(&cellUse->cu_transform)); defTransPos(&cellUse->cu_transform));