Corrections to the extresist code. Some of the changes are just

text formatting.  Made one critical correction to ResGetDevice() to
pass the device type;  otherwise, devices on different planes (e.g.,
MiM caps) with the same coordinate will always return the device on
the lowest plane, leading to incorrect results and an eventual crash
when the device record is free'd twice.
This commit is contained in:
Tim Edwards 2021-09-12 17:20:22 -04:00
parent 96b7c20c17
commit 02f42e7260
7 changed files with 131 additions and 136 deletions

View File

@ -1 +1 @@
8.3.205 8.3.206

View File

@ -291,7 +291,8 @@ ExtUnique(rootUse, option)
while (def = (CellDef *) StackPop(extDefStack)) while (def = (CellDef *) StackPop(extDefStack))
{ {
/* EXT_UNIQ_NOTOPPORTS: Use EXT_UNIQ_ALL on all cells other than the top */ /* EXT_UNIQ_NOTOPPORTS: Use EXT_UNIQ_ALL on all cells other than the top */
if ((option == EXT_UNIQ_NOTOPPORTS) && (StackLook(extDefStack) != NULL)) if ((option == EXT_UNIQ_NOTOPPORTS) &&
(StackLook(extDefStack) != (ClientData)NULL))
locoption = EXT_UNIQ_ALL; locoption = EXT_UNIQ_ALL;
else else
locoption = option; locoption = option;

View File

@ -1260,7 +1260,8 @@ FindStartTile(goodies, SourcePoint)
* *
* ResGetDevice -- Once the net is extracted, we still have to equate * ResGetDevice -- Once the net is extracted, we still have to equate
* the sim file devices with the layout devices. ResGetDevice * the sim file devices with the layout devices. ResGetDevice
* looks for a device at the given location. * looks for a device at the given location. "type" is also
* specified to that the right plane will be searched.
* *
* Results: returns device structure at location DevicePoint, if it * Results: returns device structure at location DevicePoint, if it
* exists. * exists.
@ -1271,9 +1272,9 @@ FindStartTile(goodies, SourcePoint)
*/ */
resDevice * resDevice *
ResGetDevice(pt) ResGetDevice(pt, type)
Point *pt; Point *pt;
TileType type;
{ {
Point workingPoint; Point workingPoint;
Tile *tile; Tile *tile;
@ -1282,10 +1283,7 @@ ResGetDevice(pt)
workingPoint.p_x = (*pt).p_x; workingPoint.p_x = (*pt).p_x;
workingPoint.p_y = (*pt).p_y; workingPoint.p_y = (*pt).p_y;
for (pnum = PL_TECHDEPBASE; pnum < DBNumPlanes; pnum++) pnum = DBPlane(type);
{
if (TTMaskIntersect(&ExtCurStyle->exts_deviceMask, &DBPlaneTypes[pnum]) == 0)
continue;
/* Start at hint tile for device plane */ /* Start at hint tile for device plane */
@ -1299,9 +1297,7 @@ ResGetDevice(pt)
return (((tileJunk *)tile->ti_client)->deviceList); return (((tileJunk *)tile->ti_client)->deviceList);
} }
else if (TTMaskHasType(&ExtCurStyle->exts_deviceMask, TiGetType(tile))) else if (TTMaskHasType(&ExtCurStyle->exts_deviceMask, TiGetType(tile)))
{
return (((tileJunk *)tile->ti_client)->deviceList); return (((tileJunk *)tile->ti_client)->deviceList);
}
}
return NULL; return NULL;
} }

View File

@ -86,12 +86,10 @@ ResDoneWithNode(resptr)
ResDeleteResPointer(rr1->rr_connection1, rr1); ResDeleteResPointer(rr1->rr_connection1, rr1);
ResDeleteResPointer(rr1->rr_connection2, rr1); ResDeleteResPointer(rr1->rr_connection2, rr1);
if (rr1->rr_connection1 == resptr) if (rr1->rr_connection1 == resptr)
{
resptr2 = rr1->rr_connection2; resptr2 = rr1->rr_connection2;
}else else
{
resptr2 = rr1->rr_connection1; resptr2 = rr1->rr_connection1;
}
ResMergeNodes(resptr2, resptr, &ResNodeQueue, &ResNodeList); ResMergeNodes(resptr2, resptr, &ResNodeQueue, &ResNodeList);
resptr2->rn_float.rn_area += rr1->rr_float.rr_area; resptr2->rn_float.rn_area += rr1->rr_float.rr_area;
ResEliminateResistor(rr1, &ResResList); ResEliminateResistor(rr1, &ResResList);
@ -540,7 +538,7 @@ ResTriangleCheck(resptr)
} }
n3 = (resNode *)mallocMagic((unsigned)(sizeof(resNode))); n3 = (resNode *)mallocMagic((unsigned)(sizeof(resNode)));
/* Where should the new node be `put'? It */ /* Where should the new node be put? It */
/* is arbitrarily assigned to the location */ /* is arbitrarily assigned to the location */
/* occupied by the first node. */ /* occupied by the first node. */

View File

@ -1660,7 +1660,7 @@ ResWriteExtFile(celldef, node, tol, rctol, nidx, eidx)
} }
for (ptr = node->firstDev; ptr != NULL; ptr=ptr->nextDev) for (ptr = node->firstDev; ptr != NULL; ptr=ptr->nextDev)
{ {
if (layoutDev = ResGetDevice(&ptr->thisDev->location)) if (layoutDev = ResGetDevice(&ptr->thisDev->location, ptr->thisDev->rs_ttype))
{ {
ResFixUpConnections(ptr->thisDev, layoutDev, node, newname); ResFixUpConnections(ptr->thisDev, layoutDev, node, newname);
} }