Modified DBTreeCopyConnect() so that it can take an argument to
not copy labels; not copying labels speeds up the antenna checks (which don't need labels) greatly. Also fixed several numerical overflow problems in the antenna checks, which resulted in false positive errors, as well as nonsensical results.
This commit is contained in:
parent
08fabeedd5
commit
937e848d03
|
|
@ -3431,7 +3431,7 @@ CIFGenLayer(op, area, cellDef, temps, clientdata)
|
||||||
scx.scx_use = CIFDummyUse;
|
scx.scx_use = CIFDummyUse;
|
||||||
scx.scx_trans = GeoIdentityTransform;
|
scx.scx_trans = GeoIdentityTransform;
|
||||||
DBTreeCopyConnect(&scx, &DBConnectTbl[ttype], 0,
|
DBTreeCopyConnect(&scx, &DBConnectTbl[ttype], 0,
|
||||||
DBConnectTbl, &TiPlaneRect, Select2Use);
|
DBConnectTbl, &TiPlaneRect, FALSE, Select2Use);
|
||||||
cifSrTiles(op, area, Select2Def, temps, cifPaintFunc,
|
cifSrTiles(op, area, Select2Def, temps, cifPaintFunc,
|
||||||
(ClientData) CIFPaintTable);
|
(ClientData) CIFPaintTable);
|
||||||
DBCellClearDef(Select2Def);
|
DBCellClearDef(Select2Def);
|
||||||
|
|
|
||||||
|
|
@ -1795,6 +1795,7 @@ dbScaleCell(cellDef, scalen, scaled)
|
||||||
LinkedTile *lhead, *lt;
|
LinkedTile *lhead, *lt;
|
||||||
LinkedCellUse *luhead, *lu;
|
LinkedCellUse *luhead, *lu;
|
||||||
Plane *newplane;
|
Plane *newplane;
|
||||||
|
BPlane *cellPlane, *cellPlaneOrig;
|
||||||
|
|
||||||
/* DBCellEnum() attempts to read unavailable celldefs. We don't */
|
/* DBCellEnum() attempts to read unavailable celldefs. We don't */
|
||||||
/* want to do that here, so check CDAVAILABLE flag first. */
|
/* want to do that here, so check CDAVAILABLE flag first. */
|
||||||
|
|
@ -1811,6 +1812,7 @@ dbScaleCell(cellDef, scalen, scaled)
|
||||||
|
|
||||||
(void) DBCellEnum(cellDef, dbCellUseEnumFunc, (ClientData) &luhead);
|
(void) DBCellEnum(cellDef, dbCellUseEnumFunc, (ClientData) &luhead);
|
||||||
|
|
||||||
|
cellPlane = BPNew();
|
||||||
lu = luhead;
|
lu = luhead;
|
||||||
while (lu != NULL)
|
while (lu != NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -1838,9 +1840,16 @@ dbScaleCell(cellDef, scalen, scaled)
|
||||||
DBScaleValue(&use->cu_array.ar_xsep, scalen, scaled);
|
DBScaleValue(&use->cu_array.ar_xsep, scalen, scaled);
|
||||||
DBScaleValue(&use->cu_array.ar_ysep, scalen, scaled);
|
DBScaleValue(&use->cu_array.ar_ysep, scalen, scaled);
|
||||||
|
|
||||||
|
BPAdd(cellPlane, use);
|
||||||
|
|
||||||
lu = lu->cu_next;
|
lu = lu->cu_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Swap the CellDef's cell plane */
|
||||||
|
cellPlaneOrig = cellDef->cd_cellPlane;
|
||||||
|
cellDef->cd_cellPlane = cellPlane;
|
||||||
|
BPFree(cellPlaneOrig);
|
||||||
|
|
||||||
/* Free this linked cellUse structure */
|
/* Free this linked cellUse structure */
|
||||||
lu = luhead;
|
lu = luhead;
|
||||||
while (lu != NULL)
|
while (lu != NULL)
|
||||||
|
|
@ -2010,6 +2019,7 @@ DBMoveCell(cellDef, origx, origy)
|
||||||
LinkedTile *lhead, *lt;
|
LinkedTile *lhead, *lt;
|
||||||
LinkedCellUse *luhead, *lu;
|
LinkedCellUse *luhead, *lu;
|
||||||
Plane *newplane;
|
Plane *newplane;
|
||||||
|
BPlane *cellPlane, *cellPlaneOrig;
|
||||||
|
|
||||||
/* Unlike dbScaleCell(), this routine is only run on valid edit defs */
|
/* Unlike dbScaleCell(), this routine is only run on valid edit defs */
|
||||||
|
|
||||||
|
|
@ -2022,6 +2032,7 @@ DBMoveCell(cellDef, origx, origy)
|
||||||
|
|
||||||
(void) DBCellEnum(cellDef, dbCellUseEnumFunc, (ClientData) &luhead);
|
(void) DBCellEnum(cellDef, dbCellUseEnumFunc, (ClientData) &luhead);
|
||||||
|
|
||||||
|
cellPlane = BPNew();
|
||||||
lu = luhead;
|
lu = luhead;
|
||||||
while (lu != NULL)
|
while (lu != NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -2046,9 +2057,16 @@ DBMoveCell(cellDef, origx, origy)
|
||||||
use->cu_transform.t_c -= origx;
|
use->cu_transform.t_c -= origx;
|
||||||
use->cu_transform.t_f -= origy;
|
use->cu_transform.t_f -= origy;
|
||||||
|
|
||||||
|
BPAdd(cellPlane, use);
|
||||||
|
|
||||||
lu = lu->cu_next;
|
lu = lu->cu_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Swap the CellDef's cell plane */
|
||||||
|
cellPlaneOrig = cellDef->cd_cellPlane;
|
||||||
|
cellDef->cd_cellPlane = cellPlane;
|
||||||
|
BPFree(cellPlaneOrig);
|
||||||
|
|
||||||
/* Free this linked cellUse structure */
|
/* Free this linked cellUse structure */
|
||||||
lu = luhead;
|
lu = luhead;
|
||||||
while (lu != NULL)
|
while (lu != NULL)
|
||||||
|
|
|
||||||
|
|
@ -994,7 +994,7 @@ dbcConnectFunc(tile, cx)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
DBTreeCopyConnect(scx, mask, xMask, connect, area, destUse)
|
DBTreeCopyConnect(scx, mask, xMask, connect, area, doLabels, destUse)
|
||||||
SearchContext *scx; /* Describes starting area. The
|
SearchContext *scx; /* Describes starting area. The
|
||||||
* scx_use field gives the root of
|
* scx_use field gives the root of
|
||||||
* the hierarchy to search, and the
|
* the hierarchy to search, and the
|
||||||
|
|
@ -1018,6 +1018,10 @@ DBTreeCopyConnect(scx, mask, xMask, connect, area, destUse)
|
||||||
* clipped to this area. Pass
|
* clipped to this area. Pass
|
||||||
* TiPlaneRect to get everything.
|
* TiPlaneRect to get everything.
|
||||||
*/
|
*/
|
||||||
|
bool doLabels; /* If TRUE, copy connected labels
|
||||||
|
* and paint. If FALSE, copy only
|
||||||
|
* connected paint.
|
||||||
|
*/
|
||||||
CellUse *destUse; /* Result use in which to place
|
CellUse *destUse; /* Result use in which to place
|
||||||
* anything connected to material of
|
* anything connected to material of
|
||||||
* type mask in area of rootUse.
|
* type mask in area of rootUse.
|
||||||
|
|
@ -1093,6 +1097,7 @@ DBTreeCopyConnect(scx, mask, xMask, connect, area, destUse)
|
||||||
searchtype |= TF_LABEL_ATTACH_NOT_SE;
|
searchtype |= TF_LABEL_ATTACH_NOT_SE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (doLabels)
|
||||||
DBTreeSrLabels(scx, newmask, xMask, &tpath, searchtype,
|
DBTreeSrLabels(scx, newmask, xMask, &tpath, searchtype,
|
||||||
dbcConnectLabelFunc, (ClientData) &csa2);
|
dbcConnectLabelFunc, (ClientData) &csa2);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,14 +83,14 @@ static int efAntennaDebug = FALSE;
|
||||||
TileType *EFDeviceTypes;
|
TileType *EFDeviceTypes;
|
||||||
|
|
||||||
typedef struct _aas {
|
typedef struct _aas {
|
||||||
int *accum; /* Pointer to array of accumulated areas per type */
|
dlong *accum; /* Pointer to array of accumulated areas per type */
|
||||||
int pNum; /* Plane of check */
|
int pNum; /* Plane of check */
|
||||||
Rect r; /* Holds any one visited rectangle */
|
Rect r; /* Holds any one visited rectangle */
|
||||||
CellDef *def; /* CellDef for adding feedback */
|
CellDef *def; /* CellDef for adding feedback */
|
||||||
} AntennaAccumStruct;
|
} AntennaAccumStruct;
|
||||||
|
|
||||||
typedef struct _gdas {
|
typedef struct _gdas {
|
||||||
int accum; /* Accumulated area of all gates/diff */
|
dlong accum; /* Accumulated area of all gates/diff */
|
||||||
Rect r; /* Holds any one visited rectangle */
|
Rect r; /* Holds any one visited rectangle */
|
||||||
CellDef *def; /* CellDef for adding feedback */
|
CellDef *def; /* CellDef for adding feedback */
|
||||||
} GateDiffAccumStruct;
|
} GateDiffAccumStruct;
|
||||||
|
|
@ -345,10 +345,11 @@ antennacheckVisit(dev, hierName, scale, trans, editUse)
|
||||||
{
|
{
|
||||||
DevTerm *gate;
|
DevTerm *gate;
|
||||||
TileType t, conType;
|
TileType t, conType;
|
||||||
int pos, pNum, pNum2, pmax, p, i, j, gatearea, diffarea, total;
|
int pos, pNum, pNum2, pmax, p, i, j, total;
|
||||||
|
dlong gatearea, diffarea;
|
||||||
double anttotal;
|
double anttotal;
|
||||||
float saveRatio, ratioTotal;
|
float saveRatio, ratioTotal;
|
||||||
int *antennaarea;
|
dlong *antennaarea;
|
||||||
Rect r, gaterect;
|
Rect r, gaterect;
|
||||||
EFNode *gnode;
|
EFNode *gnode;
|
||||||
SearchContext scx;
|
SearchContext scx;
|
||||||
|
|
@ -360,7 +361,7 @@ antennacheckVisit(dev, hierName, scale, trans, editUse)
|
||||||
|
|
||||||
extern int areaAccumFunc(), antennaAccumFunc(), areaMarkFunc();
|
extern int areaAccumFunc(), antennaAccumFunc(), areaMarkFunc();
|
||||||
|
|
||||||
antennaarea = (int *)mallocMagic(DBNumTypes * sizeof(int));
|
antennaarea = (dlong *)mallocMagic(DBNumTypes * sizeof(dlong));
|
||||||
|
|
||||||
switch(dev->dev_class)
|
switch(dev->dev_class)
|
||||||
{
|
{
|
||||||
|
|
@ -482,7 +483,7 @@ antennacheckVisit(dev, hierName, scale, trans, editUse)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < DBNumTypes; i++) antennaarea[i] = 0;
|
for (i = 0; i < DBNumTypes; i++) antennaarea[i] = (dlong)0;
|
||||||
gatearea = 0;
|
gatearea = 0;
|
||||||
diffarea = 0;
|
diffarea = 0;
|
||||||
|
|
||||||
|
|
@ -496,10 +497,10 @@ antennacheckVisit(dev, hierName, scale, trans, editUse)
|
||||||
/* To do: Mark tiles so area count can be progressive */
|
/* To do: Mark tiles so area count can be progressive */
|
||||||
|
|
||||||
DBTreeCopyConnect(&scx, &DBConnectTbl[t], 0,
|
DBTreeCopyConnect(&scx, &DBConnectTbl[t], 0,
|
||||||
DBConnectTbl, &TiPlaneRect, extPathUse);
|
DBConnectTbl, &TiPlaneRect, FALSE, extPathUse);
|
||||||
|
|
||||||
/* Search planes of tie types and accumulate all tiedown areas */
|
/* Search planes of tie types and accumulate all tiedown areas */
|
||||||
gdas.accum = 0;
|
gdas.accum = (dlong)0;
|
||||||
for (p = 0; p < DBNumPlanes; p++)
|
for (p = 0; p < DBNumPlanes; p++)
|
||||||
DBSrPaintArea((Tile *)NULL, extPathUse->cu_def->cd_planes[p],
|
DBSrPaintArea((Tile *)NULL, extPathUse->cu_def->cd_planes[p],
|
||||||
&TiPlaneRect, &ExtCurStyle->exts_antennaTieTypes,
|
&TiPlaneRect, &ExtCurStyle->exts_antennaTieTypes,
|
||||||
|
|
@ -507,7 +508,7 @@ antennacheckVisit(dev, hierName, scale, trans, editUse)
|
||||||
diffarea = gdas.accum;
|
diffarea = gdas.accum;
|
||||||
|
|
||||||
/* Search plane of gate type and accumulate all gate area */
|
/* Search plane of gate type and accumulate all gate area */
|
||||||
gdas.accum = 0;
|
gdas.accum = (dlong)0;
|
||||||
DBSrPaintArea((Tile *)NULL, extPathUse->cu_def->cd_planes[pNum],
|
DBSrPaintArea((Tile *)NULL, extPathUse->cu_def->cd_planes[pNum],
|
||||||
&TiPlaneRect, &gatemask, areaAccumFunc, (ClientData)&gdas);
|
&TiPlaneRect, &gatemask, areaAccumFunc, (ClientData)&gdas);
|
||||||
gatearea = gdas.accum;
|
gatearea = gdas.accum;
|
||||||
|
|
@ -667,10 +668,11 @@ areaAccumFunc(tile, gdas)
|
||||||
GateDiffAccumStruct *gdas;
|
GateDiffAccumStruct *gdas;
|
||||||
{
|
{
|
||||||
Rect *rect = &(gdas->r);
|
Rect *rect = &(gdas->r);
|
||||||
int area, type;
|
int type;
|
||||||
|
dlong area;
|
||||||
|
|
||||||
TiToRect(tile, rect);
|
TiToRect(tile, rect);
|
||||||
area = (rect->r_xtop - rect->r_xbot) * (rect->r_ytop - rect->r_ybot);
|
area = (dlong)(rect->r_xtop - rect->r_xbot) * (dlong)(rect->r_ytop - rect->r_ybot);
|
||||||
gdas->accum += area;
|
gdas->accum += area;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -694,9 +696,9 @@ antennaAccumFunc(tile, aaptr)
|
||||||
AntennaAccumStruct *aaptr;
|
AntennaAccumStruct *aaptr;
|
||||||
{
|
{
|
||||||
Rect *rect = &(aaptr->r);
|
Rect *rect = &(aaptr->r);
|
||||||
int area;
|
dlong area;
|
||||||
int type;
|
int type;
|
||||||
int *typeareas = aaptr->accum;
|
dlong *typeareas = aaptr->accum;
|
||||||
int plane = aaptr->pNum;
|
int plane = aaptr->pNum;
|
||||||
float thick;
|
float thick;
|
||||||
|
|
||||||
|
|
@ -773,7 +775,7 @@ antennaAccumFunc(tile, aaptr)
|
||||||
if (DBTypeOnPlane(ttype, plane))
|
if (DBTypeOnPlane(ttype, plane))
|
||||||
{
|
{
|
||||||
thick = ExtCurStyle->exts_thick[ttype];
|
thick = ExtCurStyle->exts_thick[ttype];
|
||||||
typeareas[ttype] += (int)((float)perimeter * thick);
|
typeareas[ttype] += (dlong)((float)perimeter * thick);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type >= DBNumUserLayers)
|
if (type >= DBNumUserLayers)
|
||||||
|
|
@ -784,27 +786,28 @@ antennaAccumFunc(tile, aaptr)
|
||||||
if (DBTypeOnPlane(ttype, plane))
|
if (DBTypeOnPlane(ttype, plane))
|
||||||
{
|
{
|
||||||
thick = ExtCurStyle->exts_thick[ttype];
|
thick = ExtCurStyle->exts_thick[ttype];
|
||||||
typeareas[ttype] += (int)((float)perimeter * thick);
|
typeareas[ttype] += (dlong)((float)perimeter * thick);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
thick = ExtCurStyle->exts_thick[type];
|
thick = ExtCurStyle->exts_thick[type];
|
||||||
typeareas[type] += (int)((float)perimeter * thick);
|
typeareas[type] += (dlong)((float)perimeter * thick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Area is perimeter times layer thickness */
|
/* Area is perimeter times layer thickness */
|
||||||
thick = ExtCurStyle->exts_thick[type];
|
thick = ExtCurStyle->exts_thick[type];
|
||||||
typeareas[type] += (int)((float)perimeter * thick);
|
typeareas[type] += (dlong)((float)perimeter * thick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ExtCurStyle->exts_antennaRatio[type].areaType & ANTENNAMODEL_SURFACE)
|
else if (ExtCurStyle->exts_antennaRatio[type].areaType & ANTENNAMODEL_SURFACE)
|
||||||
{
|
{
|
||||||
/* Simple tile area calculation */
|
/* Simple tile area calculation */
|
||||||
area = (rect->r_xtop - rect->r_xbot) * (rect->r_ytop - rect->r_ybot);
|
area = (dlong)(rect->r_xtop - rect->r_xbot)
|
||||||
|
* (dlong)(rect->r_ytop - rect->r_ybot);
|
||||||
|
|
||||||
/* If type is a contact, then add area to both residues as well */
|
/* If type is a contact, then add area to both residues as well */
|
||||||
/* as the contact type. */
|
/* as the contact type. */
|
||||||
|
|
|
||||||
|
|
@ -368,7 +368,7 @@ extLengthYank(use, labList)
|
||||||
scx.scx_trans = GeoIdentityTransform;
|
scx.scx_trans = GeoIdentityTransform;
|
||||||
GEO_EXPAND(&lab->lab_rect, 1, &scx.scx_area);
|
GEO_EXPAND(&lab->lab_rect, 1, &scx.scx_area);
|
||||||
DBTreeCopyConnect(&scx, &DBConnectTbl[lab->lab_type], 0,
|
DBTreeCopyConnect(&scx, &DBConnectTbl[lab->lab_type], 0,
|
||||||
DBConnectTbl, &TiPlaneRect, extPathUse);
|
DBConnectTbl, &TiPlaneRect, TRUE, extPathUse);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DebugIsSet(extDebugID, extDebLength))
|
if (DebugIsSet(extDebugID, extDebLength))
|
||||||
|
|
|
||||||
|
|
@ -294,7 +294,7 @@ NMShowUnderBox()
|
||||||
&DBAllButSpaceBits);
|
&DBAllButSpaceBits);
|
||||||
DBCellClearDef(nmscShowUse->cu_def);
|
DBCellClearDef(nmscShowUse->cu_def);
|
||||||
DBTreeCopyConnect(&scx, &DBAllButSpaceAndDRCBits, 0,
|
DBTreeCopyConnect(&scx, &DBAllButSpaceAndDRCBits, 0,
|
||||||
DBConnectTbl, &TiPlaneRect, nmscShowUse);
|
DBConnectTbl, &TiPlaneRect, TRUE, nmscShowUse);
|
||||||
DBWAreaChanged(nmscShowDef, &nmscShowDef->cd_bbox, DBW_ALLWINDOWS,
|
DBWAreaChanged(nmscShowDef, &nmscShowDef->cd_bbox, DBW_ALLWINDOWS,
|
||||||
&DBAllButSpaceBits);
|
&DBAllButSpaceBits);
|
||||||
NMShowCell(nmscShowUse, rootDef);
|
NMShowCell(nmscShowUse, rootDef);
|
||||||
|
|
@ -418,6 +418,6 @@ nmSRNFunc(rect, name, label, cdarg)
|
||||||
scx.scx_trans = GeoIdentityTransform;
|
scx.scx_trans = GeoIdentityTransform;
|
||||||
|
|
||||||
DBTreeCopyConnect(&scx, &DBConnectTbl[label->lab_type], 0,
|
DBTreeCopyConnect(&scx, &DBConnectTbl[label->lab_type], 0,
|
||||||
DBConnectTbl, &TiPlaneRect, nmscShowUse);
|
DBConnectTbl, &TiPlaneRect, TRUE, nmscShowUse);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -749,7 +749,7 @@ SelectRegion(scx, type, xMask, pArea, less)
|
||||||
UndoDisable();
|
UndoDisable();
|
||||||
DBCellClearDef(Select2Def);
|
DBCellClearDef(Select2Def);
|
||||||
DBTreeCopyConnect(scx, &connections[type], xMask, connections,
|
DBTreeCopyConnect(scx, &connections[type], xMask, connections,
|
||||||
&TiPlaneRect, Select2Use);
|
&TiPlaneRect, TRUE, Select2Use);
|
||||||
UndoEnable();
|
UndoEnable();
|
||||||
|
|
||||||
/* Now transfer what we found into the main selection cell. Pick
|
/* Now transfer what we found into the main selection cell. Pick
|
||||||
|
|
@ -850,7 +850,7 @@ SelectNet(scx, type, xMask, pArea, less)
|
||||||
UndoDisable();
|
UndoDisable();
|
||||||
DBCellClearDef(Select2Def);
|
DBCellClearDef(Select2Def);
|
||||||
DBTreeCopyConnect(scx, &mask, xMask, DBConnectTbl,
|
DBTreeCopyConnect(scx, &mask, xMask, DBConnectTbl,
|
||||||
&TiPlaneRect, Select2Use);
|
&TiPlaneRect, TRUE, Select2Use);
|
||||||
UndoEnable();
|
UndoEnable();
|
||||||
|
|
||||||
/* Network undo method added by Nishit and Tim, July 8-10, 2004 */
|
/* Network undo method added by Nishit and Tim, July 8-10, 2004 */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue