diff --git a/VERSION b/VERSION index 4c6e14dd..0ba50bd8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.352 +8.3.353 diff --git a/calma/CalmaRdcl.c b/calma/CalmaRdcl.c index cfc527fd..38814823 100644 --- a/calma/CalmaRdcl.c +++ b/calma/CalmaRdcl.c @@ -287,6 +287,13 @@ calmaExact() * in fact can be much faster than reading the polygons * directly into the cell from GDS. * + * Return value: + * Return 0 to keep the search going + * + * Side effects: + * Polygons are copied from use->cu_def to parent. + * use->cu_def is deleted. + * * ---------------------------------------------------------------------------- */ @@ -298,6 +305,7 @@ calmaFlattenPolygonFunc(use, parent) int i; CellUse dummy; SearchContext scx; + HashEntry *he; if (use->cu_def == NULL || use->cu_def->cd_name == NULL) return 0; if (strncmp(use->cu_def->cd_name, "polygon", 7)) return 0; @@ -310,12 +318,14 @@ calmaFlattenPolygonFunc(use, parent) scx.scx_trans = GeoIdentityTransform; DBCellCopyAllPaint(&scx, &DBAllButSpaceAndDRCBits, 0, &dummy); DBDeleteCellNoModify(use); + HashRemove(&CifCellTable, use->cu_def->cd_name); + /* There should only be one use, so it can just be cleared */ + use->cu_def->cd_parents = (CellUse *)NULL; DBCellDeleteDef(use->cu_def); return 0; /* Keep the search going */ } - /* * ---------------------------------------------------------------------------- * @@ -347,6 +357,7 @@ calmaParseStructure(filename) int timestampval = 0; int suffix; int mfactor; + int locPolygonCount; OFFTYPE filepos; bool was_called; bool was_initialized; @@ -354,6 +365,8 @@ calmaParseStructure(filename) bool do_flatten; CellDef *def; + locPolygonCount = CalmaPolygonCount; + /* Make sure this is a structure; if not, let the caller know we're done */ PEEKRH(nbytes, rtype); if (nbytes <= 0 || rtype != CALMA_BGNSTR) @@ -587,11 +600,8 @@ calmaParseStructure(filename) CIFPaintCurrent(FILE_CALMA); } - if ((!CalmaSubcellPolygons) && (CalmaPolygonCount > 0)) - { + if ((!CalmaSubcellPolygons) && (locPolygonCount < CalmaPolygonCount)) DBCellEnum(cifReadCellDef, calmaFlattenPolygonFunc, (ClientData)cifReadCellDef); - CalmaPolygonCount = 0; - } DBAdjustLabelsNew(cifReadCellDef, &TiPlaneRect, (cifCurReadStyle->crs_flags & CRF_NO_RECONNECT_LABELS) ? 1 : 0); diff --git a/commands/CmdFI.c b/commands/CmdFI.c index b362c395..1f318501 100644 --- a/commands/CmdFI.c +++ b/commands/CmdFI.c @@ -1959,7 +1959,7 @@ CmdFlatten(w, cmd) TxCommand *cmd; { int rval, xMask; - bool dolabels, dobox, toplabels, invert, doports; + bool dolabels, dobox, toplabels, invert, doports, doinplace; char *destname; CellDef *newdef; CellUse *newuse; @@ -1972,6 +1972,7 @@ CmdFlatten(w, cmd) toplabels = FALSE; dobox = FALSE; doports = TRUE; + doinplace = FALSE; rval = 0; if (cmd->tx_argc > 2) @@ -2000,6 +2001,9 @@ CmdFlatten(w, cmd) case 'b': dobox = (invert) ? FALSE : TRUE; break; + case 'i': + doinplace = (invert) ? FALSE : TRUE; + break; case 'l': dolabels = (invert) ? FALSE : TRUE; break; @@ -2020,7 +2024,8 @@ CmdFlatten(w, cmd) break; default: TxError("options are: -nolabels, -nosubcircuits, -noports, " - "-novendor, -dotoplabels, -doproperty, -dobox\n"); + "-novendor, -dotoplabels, -doproperty, -dobox, " + "-doinplace\n"); break; } } @@ -2034,6 +2039,51 @@ CmdFlatten(w, cmd) TxError("usage: flatten [-