Reverted the toolkit change from the last commit after realizing
that the feature for implementing callbacks on a selection list was already implemented via the add_dependency procedure. Modified the GDS read to remove cell instances that are placed directly on top of one another in the same cell. Modified the GDS read to make a better selection of a default font size for text that specifies a font but not a size, using the minimum width for the layer the text is placed on. Modified the GDS read to remove text with empty-string placeholders (created when a pin layer is read but no text exists to go along with it, due to GDS not having a specific way to make pins, such that pins have to be split between one record for geometry and another for text).
This commit is contained in:
parent
677cd8ab5e
commit
3b396d65f0
|
|
@ -364,6 +364,7 @@ calmaParseStructure(filename)
|
||||||
bool predefined;
|
bool predefined;
|
||||||
bool do_flatten;
|
bool do_flatten;
|
||||||
CellDef *def;
|
CellDef *def;
|
||||||
|
Label *lab;
|
||||||
|
|
||||||
locPolygonCount = CalmaPolygonCount;
|
locPolygonCount = CalmaPolygonCount;
|
||||||
|
|
||||||
|
|
@ -600,6 +601,11 @@ calmaParseStructure(filename)
|
||||||
CIFPaintCurrent(FILE_CALMA);
|
CIFPaintCurrent(FILE_CALMA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check for empty string labels that are caused by pin geometry that
|
||||||
|
* did not get any corresponding text type, and remove them.
|
||||||
|
*/
|
||||||
|
DBEraseLabelsByContent(cifReadCellDef, NULL, -1, "");
|
||||||
|
|
||||||
if ((!CalmaSubcellPolygons) && (locPolygonCount < CalmaPolygonCount))
|
if ((!CalmaSubcellPolygons) && (locPolygonCount < CalmaPolygonCount))
|
||||||
DBCellEnum(cifReadCellDef, calmaFlattenPolygonFunc, (ClientData)cifReadCellDef);
|
DBCellEnum(cifReadCellDef, calmaFlattenPolygonFunc, (ClientData)cifReadCellDef);
|
||||||
|
|
||||||
|
|
@ -1094,7 +1100,14 @@ calmaElementSref(filename)
|
||||||
if (isArray)
|
if (isArray)
|
||||||
DBMakeArray(use, &GeoIdentityTransform, xlo, ylo, xhi, yhi, xsep, ysep);
|
DBMakeArray(use, &GeoIdentityTransform, xlo, ylo, xhi, yhi, xsep, ysep);
|
||||||
DBSetTrans(use, &trans);
|
DBSetTrans(use, &trans);
|
||||||
DBPlaceCell(use, cifReadCellDef);
|
if (DBCellFindDup(use, cifReadCellDef) != NULL)
|
||||||
|
{
|
||||||
|
DBCellDeleteUse(use);
|
||||||
|
CalmaReadError("Warning: cell \"%s\" placed on top of"
|
||||||
|
" itself. Ignoring the extra one.\n", def->cd_name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
DBPlaceCell(use, cifReadCellDef);
|
||||||
|
|
||||||
break; // No need to do 2nd loop
|
break; // No need to do 2nd loop
|
||||||
}
|
}
|
||||||
|
|
@ -1161,8 +1174,17 @@ calmaElementSref(filename)
|
||||||
if (isArray)
|
if (isArray)
|
||||||
DBMakeArray(use, &GeoIdentityTransform, xlo, ylo, xhi, yhi, xsep, ysep);
|
DBMakeArray(use, &GeoIdentityTransform, xlo, ylo, xhi, yhi, xsep, ysep);
|
||||||
DBSetTrans(use, &trans);
|
DBSetTrans(use, &trans);
|
||||||
DBPlaceCell(use, cifReadCellDef);
|
if (DBCellFindDup(use, cifReadCellDef) != NULL)
|
||||||
madeinst = TRUE;
|
{
|
||||||
|
DBCellDeleteUse(use);
|
||||||
|
CalmaReadError("Warning: cell \"%s\" placed on top of"
|
||||||
|
" itself. Ignoring the extra one.\n", def->cd_name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DBPlaceCell(use, cifReadCellDef);
|
||||||
|
madeinst = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1179,8 +1201,17 @@ calmaElementSref(filename)
|
||||||
if (isArray)
|
if (isArray)
|
||||||
DBMakeArray(use, &GeoIdentityTransform, xlo, ylo, xhi, yhi, xsep, ysep);
|
DBMakeArray(use, &GeoIdentityTransform, xlo, ylo, xhi, yhi, xsep, ysep);
|
||||||
DBSetTrans(use, &trans);
|
DBSetTrans(use, &trans);
|
||||||
DBPlaceCell(use, cifReadCellDef);
|
if (DBCellFindDup(use, cifReadCellDef) != NULL)
|
||||||
madeinst = TRUE;
|
{
|
||||||
|
DBCellDeleteUse(use);
|
||||||
|
CalmaReadError("Warning: cell \"%s\" placed on top of"
|
||||||
|
" itself. Ignoring the extra one.\n", def->cd_name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DBPlaceCell(use, cifReadCellDef);
|
||||||
|
madeinst = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -709,7 +709,7 @@ calmaElementText()
|
||||||
TileType type;
|
TileType type;
|
||||||
Rect r;
|
Rect r;
|
||||||
double dval;
|
double dval;
|
||||||
int size, angle, font, pos;
|
int size, micron, angle, font, pos;
|
||||||
|
|
||||||
/* Skip CALMA_ELFLAGS, CALMA_PLEX */
|
/* Skip CALMA_ELFLAGS, CALMA_PLEX */
|
||||||
calmaSkipSet(calmaElementIgnore);
|
calmaSkipSet(calmaElementIgnore);
|
||||||
|
|
@ -732,9 +732,23 @@ calmaElementText()
|
||||||
font = -1;
|
font = -1;
|
||||||
angle = 0;
|
angle = 0;
|
||||||
|
|
||||||
/* Default size is 1um */
|
/* Use the minimum width of the layer on which the text is placed
|
||||||
size = (int)((1000 * cifCurReadStyle->crs_multiplier)
|
* as the default text size, or 1um, whichever is smaller. Account
|
||||||
|
* for the 8/10 difference encoded in the rendered font height.
|
||||||
|
*/
|
||||||
|
size = DRCGetDefaultLayerWidth(type);
|
||||||
|
if (size > 0)
|
||||||
|
{
|
||||||
|
size *= (calmaReadScale2 * cifCurReadStyle->crs_multiplier * 8);
|
||||||
|
size /= (calmaReadScale1 * cifCurReadStyle->crs_scaleFactor * 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Default or maximum size is 1um */
|
||||||
|
micron = (int)((800 * cifCurReadStyle->crs_multiplier)
|
||||||
/ cifCurReadStyle->crs_scaleFactor);
|
/ cifCurReadStyle->crs_scaleFactor);
|
||||||
|
if ((size == 0) || (size > micron))
|
||||||
|
size = micron;
|
||||||
|
|
||||||
/* Default position is bottom-right (but what the spec calls "top-left"!) */
|
/* Default position is bottom-right (but what the spec calls "top-left"!) */
|
||||||
pos = GEO_SOUTHEAST;
|
pos = GEO_SOUTHEAST;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,14 +102,14 @@ bool cmdDumpParseArgs();
|
||||||
#define CALMA_DRCCHECK 7
|
#define CALMA_DRCCHECK 7
|
||||||
#define CALMA_FLATTEN 8
|
#define CALMA_FLATTEN 8
|
||||||
#define CALMA_FLATGLOB 9
|
#define CALMA_FLATGLOB 9
|
||||||
#define CALMA_ORDERING 10
|
#define CALMA_LABELS 10
|
||||||
#define CALMA_LABELS 11
|
#define CALMA_LIBRARY 11
|
||||||
#define CALMA_LIBRARY 12
|
#define CALMA_LOWER 12
|
||||||
#define CALMA_LOWER 13
|
#define CALMA_MASKHINTS 13
|
||||||
#define CALMA_MASKHINTS 14
|
#define CALMA_MERGE 14
|
||||||
#define CALMA_MERGE 15
|
#define CALMA_NO_STAMP 15
|
||||||
#define CALMA_NO_STAMP 16
|
#define CALMA_NO_DUP 16
|
||||||
#define CALMA_NO_DUP 17
|
#define CALMA_ORDERING 17
|
||||||
#define CALMA_READ 18
|
#define CALMA_READ 18
|
||||||
#define CALMA_READONLY 19
|
#define CALMA_READONLY 19
|
||||||
#define CALMA_RESCALE 20
|
#define CALMA_RESCALE 20
|
||||||
|
|
@ -158,7 +158,6 @@ CmdCalma(w, cmd)
|
||||||
"drccheck [yes|no] mark all cells as needing DRC checking",
|
"drccheck [yes|no] mark all cells as needing DRC checking",
|
||||||
"flatten [yes|no|limit] flatten simple cells (e.g., contacts) on input",
|
"flatten [yes|no|limit] flatten simple cells (e.g., contacts) on input",
|
||||||
"flatglob [<name>|none] flatten cells by name with glob patterning",
|
"flatglob [<name>|none] flatten cells by name with glob patterning",
|
||||||
"ordering [on|off] cause cells to be read in post-order",
|
|
||||||
"labels [yes|no] cause labels to be output when writing GDS-II",
|
"labels [yes|no] cause labels to be output when writing GDS-II",
|
||||||
"library [yes|no] do not output the top level, only subcells",
|
"library [yes|no] do not output the top level, only subcells",
|
||||||
"lower [yes|no] allow both upper and lower case in labels",
|
"lower [yes|no] allow both upper and lower case in labels",
|
||||||
|
|
@ -166,6 +165,7 @@ CmdCalma(w, cmd)
|
||||||
"merge [yes|no] merge tiles into polygons in the output",
|
"merge [yes|no] merge tiles into polygons in the output",
|
||||||
"nodatestamp [yes|no] write a zero value creation date stamp",
|
"nodatestamp [yes|no] write a zero value creation date stamp",
|
||||||
"noduplicates [yes|no] do not read cells that exist before reading GDS",
|
"noduplicates [yes|no] do not read cells that exist before reading GDS",
|
||||||
|
"ordering [on|off] cause cells to be read in post-order",
|
||||||
"read file read Calma GDS-II format from \"file\"\n"
|
"read file read Calma GDS-II format from \"file\"\n"
|
||||||
" into edit cell",
|
" into edit cell",
|
||||||
"readonly [yes|no] set cell as read-only and generate output from GDS file",
|
"readonly [yes|no] set cell as read-only and generate output from GDS file",
|
||||||
|
|
|
||||||
|
|
@ -1162,13 +1162,11 @@ proc magic::add_message {pname ptext parameters {color blue}} {
|
||||||
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
# Add a selectable-list parameter to the gencell window
|
# Add a selectable-list parameter to the gencell window
|
||||||
# Added 12/14/2022: Optional argument "func" specifies a
|
# (NOTE: Use magic::add_dependency to add a callback to
|
||||||
# callback procedure to trigger when a menu item is
|
# the selection list choice.)
|
||||||
# selected.
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
|
|
||||||
proc magic::add_selectlist {pname ptext all_values parameters {itext ""} \
|
proc magic::add_selectlist {pname ptext all_values parameters {itext ""}} {
|
||||||
{func {}}} {
|
|
||||||
|
|
||||||
if [dict exists $parameters $pname] {
|
if [dict exists $parameters $pname] {
|
||||||
set value [dict get $parameters $pname]
|
set value [dict get $parameters $pname]
|
||||||
|
|
@ -1185,8 +1183,7 @@ proc magic::add_selectlist {pname ptext all_values parameters {itext ""} \
|
||||||
menu .params.edits.${pname}_sel.menu -tearoff 0
|
menu .params.edits.${pname}_sel.menu -tearoff 0
|
||||||
foreach item ${all_values} {
|
foreach item ${all_values} {
|
||||||
set cmdtxt ".params.edits.${pname}_sel configure -text $item"
|
set cmdtxt ".params.edits.${pname}_sel configure -text $item"
|
||||||
if {$func != {}} {set cmdtxt "$cmdtxt ; $func"}
|
.params.edits.${pname}_sel.menu add radio -label $item \
|
||||||
.params.edits.${pname}_sel.menu add radio -label $item \
|
|
||||||
-variable magic::${pname}_val -value $item \
|
-variable magic::${pname}_val -value $item \
|
||||||
-command $cmdtxt
|
-command $cmdtxt
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue