Corrected issue with finding devices in ResMain()---there is not
necessarily a 1:1 correspondence from tile types to extracted device names, and not necessarily a 1:1 correspondence in the other direction, either. So the search for devices at the location given by the .sim file has been loosened to look for any tile type at that location. Matches are restricted to those in which the plane of the type found is the same as the plane of the device recorded in the .sim file; this prevents matching device like MiM caps that may be in the same location as a device in another plane.
This commit is contained in:
parent
cc16b82a79
commit
25166f2f7c
|
|
@ -431,6 +431,11 @@ ExtGetDevInfo(idx, devnameptr, devtypeptr, s_rclassptr, d_rclassptr,
|
|||
* Results:
|
||||
* Tile type that represents the device "devname" in the magic database.
|
||||
*
|
||||
* Notes:
|
||||
* It is possible for the extract section to define multiple tile types
|
||||
* that produce the same extracted device name, so the returned TileType
|
||||
* is not guaranteed to be unique to the device name.
|
||||
*
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -652,11 +652,29 @@ resMakeDevFunc(tile, cx)
|
|||
{
|
||||
ResDevTile *thisDev = (ResDevTile *)cx->tc_filter->tf_arg;
|
||||
Rect devArea;
|
||||
TileType ttype;
|
||||
|
||||
TiToRect(tile, &devArea);
|
||||
GeoTransRect(&cx->tc_scx->scx_trans, &devArea, &thisDev->area);
|
||||
ResCalcPerimOverlap(tile, thisDev);
|
||||
|
||||
if (IsSplit(tile))
|
||||
ttype = (SplitSide(tile)) ? SplitRightType(tile) : SplitLeftType(tile);
|
||||
else
|
||||
ttype = TiGetType(tile);
|
||||
|
||||
/* If more than one tile type extracts to the same device, then */
|
||||
/* the device type may be different from what was recorded when */
|
||||
/* the sim file was read. Restricted to the plane of the */
|
||||
/* original type to avoid conflict with completely different */
|
||||
/* devices (like transistors vs. MiM caps). */
|
||||
|
||||
if (ttype != thisDev->type)
|
||||
{
|
||||
if (DBPlane(ttype) != DBPlane(thisDev->type))
|
||||
return 0; /* Completely different device? */
|
||||
thisDev->type = ttype;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -769,9 +787,8 @@ ResExtractNet(node, goodies, cellname)
|
|||
DevTiles = NULL;
|
||||
for (tptr = node->firstDev; tptr; tptr = tptr->nextDev)
|
||||
{
|
||||
TileTypeBitMask devMask;
|
||||
int result;
|
||||
|
||||
TTMaskSetOnlyType(&devMask, tptr->thisDev->rs_ttype);
|
||||
thisDev = (ResDevTile *)mallocMagic(sizeof(ResDevTile));
|
||||
thisDev->devptr = tptr->thisDev->rs_devptr;
|
||||
thisDev->type = tptr->thisDev->rs_ttype;
|
||||
|
|
@ -779,7 +796,17 @@ ResExtractNet(node, goodies, cellname)
|
|||
scx.scx_area.r_ll.p_y = tptr->thisDev->location.p_y;
|
||||
scx.scx_area.r_xtop = scx.scx_area.r_xbot + 1;
|
||||
scx.scx_area.r_ytop = scx.scx_area.r_ybot + 1;
|
||||
DBTreeSrTiles(&scx, &devMask, 0, resMakeDevFunc, (ClientData)thisDev);
|
||||
result = DBTreeSrTiles(&scx, &DBAllButSpaceAndDRCBits, 0,
|
||||
resMakeDevFunc, (ClientData)thisDev);
|
||||
if (result == 0)
|
||||
{
|
||||
freeMagic(thisDev);
|
||||
TxError("No device of type %s found at location %d,%d\n",
|
||||
DBTypeLongNameTbl[thisDev->type],
|
||||
tptr->thisDev->location.p_x,
|
||||
tptr->thisDev->location.p_y);
|
||||
continue;
|
||||
}
|
||||
thisDev->nextDev = DevTiles;
|
||||
DevTiles = thisDev;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue