mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-08-29 01:24:51 +02:00
Added a method for a property named OBS_BBOX to specify a minimum
area to be marked as an obstruction when writing a LEF file with the "-hide" option.
This commit is contained in:
+51
-1
@@ -553,6 +553,25 @@ lefGetBound(tile, cdata)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
* lefHasPaint---
|
||||
*
|
||||
* Simple callback that returns 1 to stop the search when any tile matching
|
||||
* the search mask is found.
|
||||
*
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
lefHasPaint(tile, clientData)
|
||||
Tile *tile;
|
||||
ClientData clientData;
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
@@ -1722,8 +1741,31 @@ lefWriteMacro(def, f, scale, setback, pinonly, toplayer, domaster)
|
||||
/* sure that every pin has a legal path to the outside of the */
|
||||
/* cell. Otherwise, this routine can block internal pins. */
|
||||
|
||||
Rect layerBound;
|
||||
Rect layerBound, manualBound;
|
||||
labelLinkedList *thislll;
|
||||
bool propfound;
|
||||
char *propvalue;
|
||||
|
||||
/* If there is a property OBS_BBOX, then use the value of the */
|
||||
/* defined box to set the minimum hidden area. This will still */
|
||||
/* get clipped to the setback. */
|
||||
|
||||
propvalue = (char *)DBPropGet(def, "OBS_BBOX", &propfound);
|
||||
if (propfound)
|
||||
{
|
||||
if (sscanf(propvalue, "%d %d %d %d",
|
||||
&(manualBound.r_xbot),
|
||||
&(manualBound.r_ybot),
|
||||
&(manualBound.r_xtop),
|
||||
&(manualBound.r_ytop)) != 4)
|
||||
{
|
||||
TxError("Improper values for obstruction bounding box "
|
||||
"OBS_BBOX property");
|
||||
manualBound = GeoNullRect;
|
||||
}
|
||||
}
|
||||
else
|
||||
manualBound = GeoNullRect;
|
||||
|
||||
for (ttype = TT_TECHDEPBASE; ttype < DBNumTypes; ttype++)
|
||||
if (TTMaskHasType(&lmask, ttype))
|
||||
@@ -1736,6 +1778,14 @@ lefWriteMacro(def, f, scale, setback, pinonly, toplayer, domaster)
|
||||
DBSrPaintArea((Tile *)NULL, lefFlatUse.cu_def->cd_planes[pNum],
|
||||
&TiPlaneRect, &DBAllButSpaceAndDRCBits,
|
||||
lefGetBound, (ClientData)(&layerBound));
|
||||
|
||||
/* Add any manual boundary if there is any */
|
||||
/* material at all in the cell on this plane. */
|
||||
if (!GEO_RECTNULL(&manualBound))
|
||||
if (DBSrPaintArea((Tile *)NULL, def->cd_planes[pNum],
|
||||
&TiPlaneRect, &DBAllButSpaceAndDRCBits,
|
||||
lefHasPaint, (ClientData)NULL) == 1)
|
||||
GeoInclude(&manualBound, &layerBound);
|
||||
}
|
||||
|
||||
/* Clip layerBound to setback boundary */
|
||||
|
||||
Reference in New Issue
Block a user