Added a "calma library" command option, to generate a GDS library

from the subcircuits of a top-level layout without also writing the
top level.
This commit is contained in:
Tim Edwards 2020-07-16 08:55:46 -04:00
parent 7a8e6352a3
commit 838c9b840d
4 changed files with 40 additions and 14 deletions

View File

@ -1 +1 @@
8.3.33
8.3.34

View File

@ -53,6 +53,7 @@ static char rcsid[] __attribute__ ((unused)) ="$Header: /usr/cvsroot/magic-8.0/c
#include "utils/stack.h"
/* Exports */
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 */
@ -328,7 +329,7 @@ CalmaWrite(rootDef, f)
* to insure that each child cell is output before it is used. The
* root cell is output last.
*/
(void) calmaProcessDef(rootDef, f);
(void) calmaProcessDef(rootDef, f, CalmaDoLibrary);
/* Finish up by outputting the end-of-library marker */
calmaOutRH(4, CALMA_ENDLIB, CALMA_NODATA, f);
@ -741,13 +742,14 @@ calmaProcessUse(use, outf)
CellUse *use; /* Process use->cu_def */
FILE *outf; /* Stream file */
{
return (calmaProcessDef(use->cu_def, outf));
return (calmaProcessDef(use->cu_def, outf, FALSE));
}
int
calmaProcessDef(def, outf)
calmaProcessDef(def, outf, do_library)
CellDef *def; /* Output this def's children, then the def itself */
FILE *outf; /* Stream file */
bool do_library; /* If TRUE, output only children of def, but not def */
{
char *filename;
bool isReadOnly, oldStyle, hasContent, isAbstract, hasGDSEnd;
@ -907,7 +909,8 @@ calmaProcessDef(def, outf)
/* Output this cell definition from the Magic database */
if (!isReadOnly)
calmaOutFunc(def, outf, &TiPlaneRect);
if (!do_library)
calmaOutFunc(def, outf, &TiPlaneRect);
return (0);
}

View File

@ -28,6 +28,7 @@
extern bool CalmaSubcellPolygons;
extern bool CalmaSubcellPaths;
extern bool CalmaDoLabels;
extern bool CalmaDoLibrary;
extern bool CalmaDoLower;
extern bool CalmaMergeTiles;
extern bool CalmaFlattenArrays;

View File

@ -95,15 +95,16 @@ bool cmdDumpParseArgs();
#define CALMA_FLATTEN 4
#define CALMA_ORDERING 5
#define CALMA_LABELS 6
#define CALMA_LOWER 7
#define CALMA_MERGE 8
#define CALMA_READ 9
#define CALMA_READONLY 10
#define CALMA_RESCALE 11
#define CALMA_WARNING 12
#define CALMA_WRITE 13
#define CALMA_POLYS 14
#define CALMA_PATHS 15
#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_WARN_HELP CIF_WARN_END /* undefined by CIF module */
@ -132,6 +133,7 @@ CmdCalma(w, cmd)
"flatten [yes|no|limit] flatten simple cells (e.g., contacts) on input",
"ordering [on|off] cause cells to be read in post-order",
"labels [yes|no] cause labels to be output when writing GDS-II",
"library [yes|no] do not output the top level, only subcells",
"lower [yes|no] allow both upper and lower case in labels",
"merge [yes|no] merge tiles into polygons in the output",
"read file read Calma GDS-II format from \"file\"\n"
@ -227,6 +229,26 @@ CmdCalma(w, cmd)
CalmaDoLabels = (option < 3) ? FALSE : TRUE;
return;
case CALMA_LIBRARY:
if (cmd->tx_argc == 2)
{
#ifdef MAGIC_WRAPPER
Tcl_SetObjResult(magicinterp, Tcl_NewBooleanObj(CalmaDoLibrary));
#else
TxPrintf("The top-level cell will %sbe output to the GDS file.\n",
(CalmaDoLibrary) ? "not " : "");
#endif
return;
}
else if (cmd->tx_argc != 3)
goto wrongNumArgs;
option = Lookup(cmd->tx_argv[2], cmdCalmaYesNo);
if (option < 0)
goto wrongNumArgs;
CalmaDoLibrary = (option < 3) ? FALSE : TRUE;
return;
case CALMA_CONTACTS:
if (cmd->tx_argc == 2)
{