From c0015efbe0a27d5d258d2238744c671492773c5b Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 13 Oct 2020 09:47:54 -0400 Subject: [PATCH] Added experimental "calma addendum" option to output only references to readonly cells but not the readonly cells themselves when writing a GDS library. --- VERSION | 2 +- calma/CalmaWrite.c | 21 ++++++++++++------ calma/calma.h | 1 + commands/CmdCD.c | 54 ++++++++++++++++++++++++++++++++-------------- 4 files changed, 54 insertions(+), 24 deletions(-) diff --git a/VERSION b/VERSION index b941f982..50db9de7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.64 +8.3.65 diff --git a/calma/CalmaWrite.c b/calma/CalmaWrite.c index b2815e0b..2118c18a 100644 --- a/calma/CalmaWrite.c +++ b/calma/CalmaWrite.c @@ -57,6 +57,7 @@ bool CalmaDoLibrary = FALSE; /* If TRUE, do not output the top level */ bool CalmaDoLabels = TRUE; /* If FALSE, don't output labels with GDS-II */ bool CalmaDoLower = TRUE; /* If TRUE, allow lowercase labels. */ bool CalmaFlattenArrays = FALSE; /* If TRUE, output arrays as individual uses */ +bool CalmaAddendum = FALSE; /* If TRUE, do not output readonly cell defs */ /* Experimental stuff---not thoroughly tested (as of Sept. 2007)! */ bool CalmaContactArrays = FALSE; /* If TRUE, output contacts as subcell arrays */ @@ -774,13 +775,6 @@ calmaProcessDef(def, outf, do_library) return (0); } - /* - * Output the definitions for any of our descendants that have - * not already been output. Numbers are assigned to the subcells - * as they are output. - */ - (void) DBCellEnum(def, calmaProcessUse, (ClientData) outf); - /* * Check if this is a read-only file that is supposed to be copied * verbatim from input to output. If so, do the direct copy. If @@ -799,6 +793,19 @@ calmaProcessDef(def, outf, do_library) DBPropGet(def, "GDS_END", &hasGDSEnd); filename = (char *)DBPropGet(def, "GDS_FILE", &isReadOnly); + /* When used with "calma addendum true", don't output the read-only */ + /* cells. This makes the library incomplete and dependent on the */ + /* vendor libraries, so use with caution. */ + + if (isReadOnly && hasContent && CalmaAddendum) return (0); + + /* + * Output the definitions for any of our descendants that have + * not already been output. Numbers are assigned to the subcells + * as they are output. + */ + (void) DBCellEnum(def, calmaProcessUse, (ClientData) outf); + if (isReadOnly && hasContent) { char *buffer, *offptr, *retfilename; diff --git a/calma/calma.h b/calma/calma.h index a7e7ebb7..bedc169b 100644 --- a/calma/calma.h +++ b/calma/calma.h @@ -30,6 +30,7 @@ extern bool CalmaSubcellPaths; extern bool CalmaDoLabels; extern bool CalmaDoLibrary; extern bool CalmaDoLower; +extern bool CalmaAddendum; extern bool CalmaMergeTiles; extern bool CalmaFlattenArrays; extern bool CalmaNoDRCCheck; diff --git a/commands/CmdCD.c b/commands/CmdCD.c index 3eb439d5..f235f693 100644 --- a/commands/CmdCD.c +++ b/commands/CmdCD.c @@ -89,22 +89,23 @@ bool cmdDumpParseArgs(); */ #define CALMA_HELP 0 -#define CALMA_ARRAYS 1 -#define CALMA_CONTACTS 2 -#define CALMA_DRCCHECK 3 -#define CALMA_FLATTEN 4 -#define CALMA_ORDERING 5 -#define CALMA_LABELS 6 -#define CALMA_LIBRARY 7 -#define CALMA_LOWER 8 -#define CALMA_MERGE 9 -#define CALMA_READ 10 -#define CALMA_READONLY 11 -#define CALMA_RESCALE 12 -#define CALMA_WARNING 13 -#define CALMA_WRITE 14 -#define CALMA_POLYS 15 -#define CALMA_PATHS 16 +#define CALMA_ADDENDUM 1 +#define CALMA_ARRAYS 2 +#define CALMA_CONTACTS 3 +#define CALMA_DRCCHECK 4 +#define CALMA_FLATTEN 5 +#define CALMA_ORDERING 6 +#define CALMA_LABELS 7 +#define CALMA_LIBRARY 8 +#define CALMA_LOWER 9 +#define CALMA_MERGE 10 +#define CALMA_READ 11 +#define CALMA_READONLY 12 +#define CALMA_RESCALE 13 +#define CALMA_WARNING 14 +#define CALMA_WRITE 15 +#define CALMA_POLYS 16 +#define CALMA_PATHS 17 #define CALMA_WARN_HELP CIF_WARN_END /* undefined by CIF module */ @@ -127,6 +128,7 @@ CmdCalma(w, cmd) static char *cmdCalmaOption[] = { "help print this help information", + "addendum [yes|no] output only cells that are not type \"readonly\"", "arrays [yes|no] output arrays as individual subuses (like in CIF)", "contacts [yes|no] optimize output by arraying contacts as subcells", "drccheck [yes|no] mark all cells as needing DRC checking", @@ -249,6 +251,26 @@ CmdCalma(w, cmd) CalmaDoLibrary = (option < 3) ? FALSE : TRUE; return; + case CALMA_ADDENDUM: + if (cmd->tx_argc == 2) + { +#ifdef MAGIC_WRAPPER + Tcl_SetObjResult(magicinterp, Tcl_NewBooleanObj(CalmaAddendum)); +#else + TxPrintf("Read-only cell defs will %sbe output to the GDS file.\n", + (CalmaAddendum) ? "not " : ""); +#endif + return; + } + else if (cmd->tx_argc != 3) + goto wrongNumArgs; + + option = Lookup(cmd->tx_argv[2], cmdCalmaYesNo); + if (option < 0) + goto wrongNumArgs; + CalmaAddendum = (option < 3) ? FALSE : TRUE; + return; + case CALMA_CONTACTS: if (cmd->tx_argc == 2) {