diff --git a/VERSION b/VERSION index c8233dac..41adeaf4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.192 +8.3.193 diff --git a/commands/CmdCD.c b/commands/CmdCD.c index 9b64a4f7..7c26e678 100644 --- a/commands/CmdCD.c +++ b/commands/CmdCD.c @@ -837,6 +837,7 @@ CmdCellname(w, cmd) bool is_cellname; bool dolist = FALSE; bool dodef = FALSE; + bool doforce = FALSE; int option; int locargc = cmd->tx_argc; char *cellname = NULL, *orient = NULL; @@ -909,6 +910,10 @@ CmdCellname(w, cmd) dodef = TRUE; locargc--; } + else if (!strcmp(option, "force")) { + doforce = TRUE; + locargc--; + } } if (locargc > 5 || locargc < 2) goto badusage; @@ -1276,7 +1281,7 @@ CmdCellname(w, cmd) case IDX_RENAME: /* Rename the cell and mark as modified. Do not write to disk. */ if (locargc != 4) goto badusage; - DBCellRename(cellname, cmd->tx_argv[3 + ((dolist) ? 1 : 0)]); + DBCellRename(cellname, cmd->tx_argv[3 + ((dolist) ? 1 : 0)], doforce); break; case IDX_CREATE: newDef = DBCellLookDef(cellname); @@ -1312,7 +1317,7 @@ badusage: "instances|celldef|delete [name]\n", cmd->tx_argv[0]); TxError("or: %s [list] allcells|topcells|window\n", cmd->tx_argv[0]); TxError("or: %s create name\n", cmd->tx_argv[0]); - TxError("or: %s rename name newname\n", cmd->tx_argv[0]); + TxError("or: %s rename name newname [-force]\n", cmd->tx_argv[0]); TxError("or: %s [un]lock [name]\n", cmd->tx_argv[0]); TxError("or: %s writeable [name] [true|false]\n", cmd->tx_argv[0]); return; diff --git a/database/DBcellname.c b/database/DBcellname.c index a0dd4d80..6885cd8c 100644 --- a/database/DBcellname.c +++ b/database/DBcellname.c @@ -77,7 +77,10 @@ extern void DBSetUseIdHash(); * * Rename a cell. This differs from the "save" command in that the * cell is not immediately written to disk. However, the cell is - * marked as modified. + * marked as modified. If "doforce" is TRUE, then allow renaming + * of vendor (read-only) cells. Because vendor cells are tied to + * a GDS file, then the vendor status gets revoked and the pointer + * to the GDS file gets removed. * * Results: * Return TRUE if the cell was successfully renamed. Return FALSE @@ -89,9 +92,10 @@ extern void DBSetUseIdHash(); * ---------------------------------------------------------------------------- */ bool -DBCellRename(cellname, newname) +DBCellRename(cellname, newname, doforce) char *cellname; char *newname; + bool doforce; { HashEntry *entry; CellDef *celldef; @@ -119,8 +123,16 @@ DBCellRename(cellname, newname) if ((celldef->cd_flags & CDVENDORGDS) == CDVENDORGDS) { - TxError("Error: Attempt to rename read-only cell \"%s\"\n", cellname); - return FALSE; + if (doforce) + { + TxPrintf("Warning: Renaming read-only cell \"%s\"\n", cellname); + TxPrintf("Read-only status will be revoked and GDS file pointer removed.\n"); + } + else + { + TxError("Error: Attempt to rename read-only cell \"%s\"\n", cellname); + return FALSE; + } } /* Good to go! */ @@ -129,6 +141,22 @@ DBCellRename(cellname, newname) result = DBCellRenameDef(celldef, newname); DBWAreaChanged(celldef, &celldef->cd_bbox, DBW_ALLWINDOWS, (TileTypeBitMask *) NULL); + + if (doforce && ((celldef->cd_flags & CDVENDORGDS) == CDVENDORGDS)) + { + char *chkgdsfile; + bool isReadOnly; + + chkgdsfile = (char *)DBPropGet(celldef, "GDS_FILE", &isReadOnly); + /* Note that clearing GDS_FILE will also clear CDVENDORGDS flag */ + if (isReadOnly) DBPropPut(celldef, "GDS_FILE", NULL); + + DBPropGet(celldef, "GDS_START", &isReadOnly); + if (isReadOnly) DBPropPut(celldef, "GDS_START", NULL); + DBPropGet(celldef, "GDS_END", &isReadOnly); + if (isReadOnly) DBPropPut(celldef, "GDS_END", NULL); + } + UndoEnable(); return result; }