Implemented a new command option "gds magscale" to reinterpret the
meaning of the MAG record in GDS files. Most available GDS documentation is decidedly vague about what MAG means. Most layout tools seem to interpret a MAG of 1 as corresponding to a text height of 1um. However, there are a few tools that interpret it as 1 centimicron, and there's no reason to assume that any given interpretation is correct. "gds magscale" allows the scale to be redefined.
This commit is contained in:
parent
8b3bb1ae77
commit
36fa9aabd1
|
|
@ -872,8 +872,11 @@ calmaElementText()
|
|||
else
|
||||
/* Assume that MAG is the label size in microns */
|
||||
/* "size" is the label size in 10 * (database units) */
|
||||
size = (int)((dval * 1000 * cifCurReadStyle->crs_multiplier)
|
||||
/ cifCurReadStyle->crs_scaleFactor);
|
||||
/* The "calma magscale" option can be used to */
|
||||
/* reinterpret the size for any specific GDS file. */
|
||||
size = (int)(0.5 + ((dval * 1000 * CalmaMagScale
|
||||
* cifCurReadStyle->crs_multiplier)
|
||||
/ cifCurReadStyle->crs_scaleFactor));
|
||||
}
|
||||
else
|
||||
UNREADRH(nbytes, rtype);
|
||||
|
|
|
|||
|
|
@ -82,6 +82,12 @@ bool CalmaReadOnly = FALSE; /* Set files to read-only and
|
|||
* retain file position information
|
||||
* so cells can be written verbatim.
|
||||
*/
|
||||
float CalmaMagScale = 1.0; /* Scale by which to interpret the MAG
|
||||
* record in GDS text records. The
|
||||
* default is to treat the value as
|
||||
* the text height in microns. This
|
||||
* value reinterprets the scale.
|
||||
*/
|
||||
bool CalmaNoDRCCheck = FALSE; /* If TRUE, don't mark cells as needing
|
||||
* a DRC check; they will be assumed
|
||||
* DRC clean.
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ extern bool CalmaMergeTiles;
|
|||
extern bool CalmaFlattenArrays;
|
||||
extern bool CalmaNoDRCCheck;
|
||||
extern bool CalmaFlattenUses;
|
||||
extern int CalmaFlattenLimit;
|
||||
extern float CalmaMagScale;
|
||||
extern char **CalmaFlattenUsesByName;
|
||||
extern bool CalmaReadOnly;
|
||||
extern bool CalmaContactArrays;
|
||||
|
|
|
|||
|
|
@ -105,20 +105,21 @@ bool cmdDumpParseArgs();
|
|||
#define CALMA_LABELS 10
|
||||
#define CALMA_LIBRARY 11
|
||||
#define CALMA_LOWER 12
|
||||
#define CALMA_MASKHINTS 13
|
||||
#define CALMA_MERGE 14
|
||||
#define CALMA_NO_STAMP 15
|
||||
#define CALMA_NO_DUP 16
|
||||
#define CALMA_ORDERING 17
|
||||
#define CALMA_READ 18
|
||||
#define CALMA_READONLY 19
|
||||
#define CALMA_RESCALE 20
|
||||
#define CALMA_WARNING 21
|
||||
#define CALMA_WRITE 22
|
||||
#define CALMA_POLYS 23
|
||||
#define CALMA_PATHS 24
|
||||
#define CALMA_UNDEFINED 25
|
||||
#define CALMA_UNIQUE 26
|
||||
#define CALMA_MAGSCALE 13
|
||||
#define CALMA_MASKHINTS 14
|
||||
#define CALMA_MERGE 15
|
||||
#define CALMA_NO_STAMP 16
|
||||
#define CALMA_NO_DUP 17
|
||||
#define CALMA_ORDERING 18
|
||||
#define CALMA_READ 19
|
||||
#define CALMA_READONLY 20
|
||||
#define CALMA_RESCALE 21
|
||||
#define CALMA_WARNING 22
|
||||
#define CALMA_WRITE 23
|
||||
#define CALMA_POLYS 24
|
||||
#define CALMA_PATHS 25
|
||||
#define CALMA_UNDEFINED 26
|
||||
#define CALMA_UNIQUE 27
|
||||
|
||||
#define CALMA_WARN_HELP CIF_WARN_END /* undefined by CIF module */
|
||||
|
||||
|
|
@ -137,8 +138,6 @@ CmdCalma(w, cmd)
|
|||
gzFile fz;
|
||||
#endif
|
||||
|
||||
extern int CalmaFlattenLimit;
|
||||
|
||||
static char *gdsExts[] = {".gds", ".gds.gz", ".gds2", ".strm", "", NULL};
|
||||
static char *cmdCalmaYesNo[] = {
|
||||
"no", "false", "off", "0", "yes", "true", "on", "1", 0 };
|
||||
|
|
@ -162,6 +161,7 @@ CmdCalma(w, cmd)
|
|||
"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",
|
||||
"magscale [value] scale to interpret text magnification 1 in microns",
|
||||
"maskhints [yes|no] generate mask hint properties on input",
|
||||
"merge [yes|no] merge tiles into polygons in the output",
|
||||
"nodatestamp [yes|no] write a zero value creation date stamp",
|
||||
|
|
@ -421,6 +421,27 @@ CmdCalma(w, cmd)
|
|||
CalmaNoDRCCheck = (option < 4) ? TRUE : FALSE;
|
||||
return;
|
||||
|
||||
case CALMA_MAGSCALE:
|
||||
if (cmd->tx_argc == 2)
|
||||
{
|
||||
#ifdef MAGIC_WRAPPER
|
||||
Tcl_SetObjResult(magicinterp, Tcl_NewDoubleObj((double)CalmaMagScale));
|
||||
#else
|
||||
TxPrintf("Text magnification 1.0 = %g microns.\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
else if (cmd->tx_argc != 3)
|
||||
goto wrongNumArgs;
|
||||
|
||||
if (StrIsNumeric(cmd->tx_argv[2]))
|
||||
CalmaMagScale = (float)atof(cmd->tx_argv[2]);
|
||||
else if (!strcmp(cmd->tx_argv[2], "default"))
|
||||
CalmaMagScale = 1.0;
|
||||
else
|
||||
goto wrongNumArgs;
|
||||
return;
|
||||
|
||||
case CALMA_FLATTEN:
|
||||
if (cmd->tx_argc == 2)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -105,6 +105,14 @@ Read GDSII input or generate GDSII output.
|
|||
Otherwise, the use of <B>yes</B> and <B>no</B> toggles the
|
||||
flattening behavior without affecting any value previously
|
||||
set by <B>flatten</B> <I>number</I>.
|
||||
<DT> <B>magscale</B> [<I>value</I>|<B>default</B>]
|
||||
<DD> By default magic interprets the GDS magnification value
|
||||
of 1.0 as 1 micron for text scale. As this definition is
|
||||
not universal, some GDS files may read in with text at
|
||||
an unusual scale. The value <I>value</I> sets the text
|
||||
height in microns at a magnification of 1. Value <B>default</B>
|
||||
resets the value to the default of 1. If no option is given,
|
||||
then return the magnification value.
|
||||
<DT> <B>maskhints</B> [<B>yes</B>|<B>no</B>|<I>layers</I>]
|
||||
<DD> When set to <B>yes</B>, then after reading each cell
|
||||
definition from the GDS file, magic will re-generate the
|
||||
|
|
|
|||
Loading…
Reference in New Issue