Updated the "lef write -hide" to understand and use widespacing rules
(may still need additional enhancements, as it does not specifically look for layer-to-obstruction rules).
This commit is contained in:
parent
54c6ccc8cd
commit
007806521c
|
|
@ -4031,3 +4031,62 @@ DRCGetDefaultLayerSurround(ttype1, ttype2)
|
||||||
}
|
}
|
||||||
return layerSurround;
|
return layerSurround;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*-----------------------------------------------------------------------------
|
||||||
|
* DRCGetDefaultLayerWideSpacing ---
|
||||||
|
*
|
||||||
|
* Determine a default layer-to-self wide-layer spacing rule from
|
||||||
|
* the DRC width rules of a layer.
|
||||||
|
*
|
||||||
|
* Results:
|
||||||
|
* The minimum spacing between the specified magic layer type and
|
||||||
|
* itself, where one of the shapes has width greater than "twidth".
|
||||||
|
* The result value is in magic internal units.
|
||||||
|
*
|
||||||
|
* Side effects:
|
||||||
|
* None.
|
||||||
|
*
|
||||||
|
*-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
int
|
||||||
|
DRCGetDefaultWideLayerSpacing(ttype, twidth)
|
||||||
|
TileType ttype;
|
||||||
|
int twidth;
|
||||||
|
{
|
||||||
|
int routeSpacing = 0;
|
||||||
|
DRCCookie *cptr;
|
||||||
|
TileTypeBitMask *set;
|
||||||
|
bool widerule = FALSE;
|
||||||
|
|
||||||
|
for (cptr = DRCCurStyle->DRCRulesTbl[ttype][TT_SPACE]; cptr != (DRCCookie *) NULL;
|
||||||
|
cptr = cptr->drcc_next)
|
||||||
|
{
|
||||||
|
if (cptr->drcc_flags & DRC_TRIGGER) /* Widespacing rule */
|
||||||
|
{
|
||||||
|
widerule = TRUE;
|
||||||
|
if (cptr->drcc_dist > twidth) /* Check against rule width */
|
||||||
|
return routeSpacing;
|
||||||
|
}
|
||||||
|
if (widerule && ((cptr->drcc_flags & DRC_REVERSE) == 0)) /* FORWARD only */
|
||||||
|
{
|
||||||
|
set = &cptr->drcc_mask;
|
||||||
|
if (!TTMaskHasType(set, ttype))
|
||||||
|
if (PlaneMaskHasPlane(DBTypePlaneMaskTbl[ttype], cptr->drcc_plane) &&
|
||||||
|
(cptr->drcc_dist == cptr->drcc_cdist))
|
||||||
|
{
|
||||||
|
routeSpacing = cptr->drcc_dist;
|
||||||
|
/* Diagnostic */
|
||||||
|
/*
|
||||||
|
TxPrintf("DRC: Layer %s has wide spacing %d to layer %s width %d\n",
|
||||||
|
DBTypeLongNameTbl[ttype1], routeSpacing,
|
||||||
|
DBTypeLongNameTbl[ttype2], twidth);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!(cptr->drcc_flags & DRC_TRIGGER)) widerule = FALSE;
|
||||||
|
}
|
||||||
|
return routeSpacing;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1103,15 +1103,25 @@ lefWriteMacro(def, f, scale, hide)
|
||||||
|
|
||||||
for (thislll = lll; thislll; thislll = thislll->lll_next)
|
for (thislll = lll; thislll; thislll = thislll->lll_next)
|
||||||
{
|
{
|
||||||
int lspace;
|
int lspacex, lspacey, lwidth;
|
||||||
|
|
||||||
lab = thislll->lll_label;
|
lab = thislll->lll_label;
|
||||||
|
|
||||||
lspace = DRCGetDefaultLayerSpacing(lab->lab_type, lab->lab_type);
|
/* Look for wide spacing rules. If there are no wide spacing */
|
||||||
thislll->lll_area.r_xbot -= lspace;
|
/* rules, then fall back on the default spacing rule. */
|
||||||
thislll->lll_area.r_ybot -= lspace;
|
lwidth = thislll->lll_area.r_xtop - thislll->lll_area.r_xbot;
|
||||||
thislll->lll_area.r_xtop += lspace;
|
lspacex = DRCGetDefaultWideLayerSpacing(lab->lab_type, lwidth);
|
||||||
thislll->lll_area.r_ytop += lspace;
|
if (lspacex == 0)
|
||||||
|
lspacex = DRCGetDefaultLayerSpacing(lab->lab_type, lab->lab_type);
|
||||||
|
lwidth = thislll->lll_area.r_ytop - thislll->lll_area.r_ybot;
|
||||||
|
lspacey = DRCGetDefaultWideLayerSpacing(lab->lab_type, lwidth);
|
||||||
|
if (lspacey == 0)
|
||||||
|
lspacey = DRCGetDefaultLayerSpacing(lab->lab_type, lab->lab_type);
|
||||||
|
|
||||||
|
thislll->lll_area.r_xbot -= lspacex;
|
||||||
|
thislll->lll_area.r_ybot -= lspacey;
|
||||||
|
thislll->lll_area.r_xtop += lspacex;
|
||||||
|
thislll->lll_area.r_ytop += lspacey;
|
||||||
DBErase(lc.lefYank, &thislll->lll_area, lab->lab_type);
|
DBErase(lc.lefYank, &thislll->lll_area, lab->lab_type);
|
||||||
|
|
||||||
freeMagic(thislll);
|
freeMagic(thislll);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue