Added extension to "gds flatten" command option to change the limit

of geometry primitives that triggers flattening (default 10).
This commit is contained in:
Tim Edwards 2020-05-14 15:59:39 -04:00
parent 38c6ce3b07
commit 028612b70a
2 changed files with 17 additions and 4 deletions

View File

@ -47,6 +47,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include "calma/calma.h"
int calmaNonManhattan;
int CalmaFlattenLimit = 10;
extern HashTable calmaDefInitHash;
@ -410,7 +411,8 @@ calmaParseStructure(filename)
* cell by painting when instanced. But---if this cell was
* instanced before it was defined, then it can't be flattened.
*/
if (CalmaFlattenUses && (!was_called) && (npaths < 10) && (nsrefs == 0))
if (CalmaFlattenUses && (!was_called) && (npaths < CalmaFlattenLimit)
&& (nsrefs == 0))
{
/* If CDFLATGDS is already set, may need to remove */
/* existing planes and free memory. */

View File

@ -117,6 +117,8 @@ CmdCalma(w, cmd)
CellDef *rootDef;
FILE *f;
extern int CalmaFlattenLimit;
static char *gdsExts[] = {".gds", ".gds2", ".strm", "", NULL};
static char *cmdCalmaYesNo[] = { "no", "false", "off", "yes", "true", "on", 0 };
static char *cmdCalmaWarnOptions[] = { "default", "none", "align",
@ -127,7 +129,7 @@ CmdCalma(w, cmd)
"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",
"flatten [yes|no] flatten simple cells (e.g., contacts) on input",
"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",
"lower [yes|no] allow both upper and lower case in labels",
@ -285,8 +287,17 @@ CmdCalma(w, cmd)
option = Lookup(cmd->tx_argv[2], cmdCalmaYesNo);
if (option < 0)
goto wrongNumArgs;
CalmaFlattenUses = (option < 3) ? FALSE : TRUE;
{
if (StrIsInt(cmd->tx_argv[2]))
{
CalmaFlattenLimit = atoi(cmd->tx_argv[2]);
CalmaFlattenUses = (CalmaFlattenLimit > 0) ? TRUE : FALSE;
}
else
goto wrongNumArgs;
}
else
CalmaFlattenUses = (option < 3) ? FALSE : TRUE;
return;
case CALMA_ORDERING: