From 20a661e1ec542c33051d34b47bc4052bcff32915 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 24 Jan 2020 17:13:59 -0500 Subject: [PATCH] Corrected problem in "extresist" if a port is a label with the sticky flag set, and the type of the label does not correspond exactly to the type under the label (e.g., label defined on m1 but is on top of a contact). --- resis/ResMain.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/resis/ResMain.c b/resis/ResMain.c index e25a8e88..18c03850 100644 --- a/resis/ResMain.c +++ b/resis/ResMain.c @@ -648,7 +648,12 @@ ResExtractNet(startlist,goodies,cellname) scx.scx_area.r_ur.p_x = fix->fp_loc.p_x+2; scx.scx_area.r_ur.p_y = fix->fp_loc.p_y+2; startpoint = fix->fp_loc; - TTMaskSetOnlyType(&FirstTileMask,fix->fp_ttype); + + // Because fix->fp_ttype might come from a label with a sticky type + // that does not correspond exactly to the layer underneath, include + // all connecting types. + /* TTMaskSetOnlyType(&FirstTileMask,fix->fp_ttype); */ + TTMaskSetMask(&FirstTileMask, &DBConnectTbl[fix->fp_ttype]); newdevtiles = DBTreeCopyConnectDCS(&scx, &FirstTileMask, 0, ResCopyMask, &TiPlaneRect, ResUse); @@ -829,8 +834,31 @@ FindStartTile(goodies, SourcePoint) int pnum, t1, t2; ExtDevice *devptr; + /* If the drive point is on a contact, check for the contact residues */ + /* first, then the contact type itself. */ + + if (DBIsContact(goodies->rg_ttype)) + { + TileTypeBitMask *rmask = DBResidueMask(goodies->rg_ttype); + TileType savtype = goodies->rg_ttype; + TileType rtype; + + savtype = goodies->rg_ttype; + for (rtype = TT_TECHDEPBASE; rtype < DBNumUserLayers; rtype++) + if (TTMaskHasType(rmask, rtype)) + { + if ((tile = FindStartTile(goodies, SourcePoint)) != NULL) + { + goodies->rg_ttype = savtype; + return tile; + } + } + goodies->rg_ttype = savtype; + } + workingPoint.p_x = goodies->rg_devloc->p_x; workingPoint.p_y = goodies->rg_devloc->p_y; + pnum = DBPlane(goodies->rg_ttype); /* for drivepoints, we don't have to find a device */ @@ -840,6 +868,7 @@ FindStartTile(goodies, SourcePoint) GOTOPOINT(tile, &workingPoint); SourcePoint->p_x = workingPoint.p_x; SourcePoint->p_y = workingPoint.p_y; + if (TiGetTypeExact(tile) == goodies->rg_ttype) return tile; else