From cc4da9a05fde8d6c1de5bb8737973a0dbf0d1844 Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Sat, 11 Jul 2026 17:09:26 -0400 Subject: [PATCH] Corrected a subtle error in substrate extraction: In extHierSubstrate(), extFindNodes() is called to find just the substrate node, then ExtLabelRegions() is called to label the substrate node if such a label exists. The ExtLabelRegions() routine has a section at line 344 in which if it finds a label on the substrate plane that is over space, then it attaches the label to the default substrate region. However, if the label is inside an isolated substrate region, then it passes this check, which never actually detects whether or not the label is over space. Doing so is actually simple, since the preceding code detected connecting tiles under the label, and that fact just needed to be carried forward and checked. The upshot of the error was that if an isolated substrate region like a pwell inside deep nwell was *labeled*, then it would mysteriously get shorted to the global substrate, which is clearly wrong. Thanks to Mark Martin for providing the failing example (and apologies to Mark Martin for spending time trying to debug a very obscure problem). --- VERSION | 2 +- extract/ExtRegion.c | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/VERSION b/VERSION index d9b61970..9452f2a2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.674 +8.3.675 diff --git a/extract/ExtRegion.c b/extract/ExtRegion.c index ba9f9e13..b769ce62 100644 --- a/extract/ExtRegion.c +++ b/extract/ExtRegion.c @@ -265,13 +265,14 @@ ExtLabelRegions(def, connTo, nodeList, clipArea) NodeRegion *newNode; int quad, pNum, n, nclasses; Point p; - bool found; + bool found, connected; TileType extSubType = 0; LabelList *retList = NULL; for (lab = def->cd_labels; lab; lab = lab->lab_next) { found = FALSE; + connected = FALSE; pNum = DBPlane(lab->lab_type); if (lab->lab_type == TT_SPACE || pNum < PL_TECHDEPBASE) continue; @@ -284,6 +285,8 @@ ExtLabelRegions(def, connTo, nodeList, clipArea) for (quad = 0; quad < 4; quad++) { + bool locconn; + /* * Visit each of the four quadrants surrounding the center * point of the label, searching for a tile whose type matches @@ -296,8 +299,9 @@ ExtLabelRegions(def, connTo, nodeList, clipArea) tp = PlaneGetHint(def->cd_planes[pNum]); GOTOPOINT(tp, &p); PlaneSetHint(def->cd_planes[pNum], tp); - if (extConnectsTo(TiGetType(tp), lab->lab_type, connTo) - && extHasRegion(tp, CLIENTDEFAULT)) + + locconn = extConnectsTo(TiGetType(tp), lab->lab_type, connTo); + if (locconn && extHasRegion(tp, CLIENTDEFAULT)) { found = TRUE; reg = (LabRegion *) ExtGetRegion(tp, (TileType)0); @@ -327,20 +331,27 @@ ExtLabelRegions(def, connTo, nodeList, clipArea) } break; } + else if (locconn) + /* Label connects to a tile here (but it is not a + * substrate region). + */ + connected = TRUE; } if (found == FALSE) { /* Handle unconnected node label. */ - /* If the label is the substrate type and is over */ - /* space, then assign the label to the default */ - /* substrate region. The label need not be in the */ - /* clip area. */ + /* If the label is the substrate type and is over space, + * then assign the label to the default substrate region. + * The label need not be in the clip area. The check for + * "connected" eliminates labels attached to isolated + * substrate regions (the label is not over space). + */ ll = (LabelList *)NULL; if ((pNum == ExtCurStyle->exts_globSubstratePlane) && TTMaskHasType(&ExtCurStyle->exts_globSubstrateTypes, - lab->lab_type)) + lab->lab_type) && (connected == FALSE)) { if (nodeList != NULL) {