From 65f034777e5667d79b250376a5edb46e4dbb51ba Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Sun, 7 Jun 2026 19:37:52 -0400 Subject: [PATCH] Corrected an issue where a device was given the wrong type due to ambiguity in the tech file and therefore also in the .ext file. This is easy to resolve and it was only necessary to change the type after finding the tile belonging to the device. There are pathological cases where this might still go wrong, like defining a "short" device name for metal resistors on any plane; then, if a "short" device overlaps something on another plane, it might be given the wrong type. Avoiding all ambiguity would require adding an extra item to "device" lines in the .ext file output; the short plane name would be most efficient. --- extract/ExtBasic.c | 6 ++++++ resis/ResMain.c | 2 +- resis/ResUtils.c | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/extract/ExtBasic.c b/extract/ExtBasic.c index d6e14fff..0c376378 100644 --- a/extract/ExtBasic.c +++ b/extract/ExtBasic.c @@ -821,8 +821,14 @@ extOutputNodes(nodeList, outFile) * For a net to be shorted to itself is not an error. * NOTE: Potentially the unique name could be removed * here and save ext2spice the trouble. + * + * Also: If "extresist" is being run in the same + * pass, then don't print an error, because + * electrical shorts are meaningless in an R-C + * extraction. */ if ((portname != NULL) && + (!(ExtOptions & EXT_DORESISTANCE)) && (ll->ll_attr == LL_PORTATTR) && (strcmp(ll->ll_label->lab_text, portname))) { diff --git a/resis/ResMain.c b/resis/ResMain.c index 405f2280..4dd8ce4f 100644 --- a/resis/ResMain.c +++ b/resis/ResMain.c @@ -1371,7 +1371,7 @@ ResExtractNet(node, resisdata, cellname) * the reason, rewrite the tptr->thisDev and local thisDev records * to match the actual device at the location. */ - thisDev->type = tptr->thisDev->rs_ttype; + tptr->thisDev->rs_ttype = thisDev->type; for (devptr = ExtCurStyle->exts_device[thisDev->type]; devptr; devptr = devptr->exts_next) { diff --git a/resis/ResUtils.c b/resis/ResUtils.c index bd65b092..a0a70922 100644 --- a/resis/ResUtils.c +++ b/resis/ResUtils.c @@ -465,6 +465,12 @@ ResAddDevPlumbing( tile = PlaneGetHint(plane); GOTOPOINT(tile, &(thisDev->area.r_ll)); + if (TiGetTypeExact(tile) == TT_SPACE) + { + TxError("Bad device location at (%d %d). There is nothing here.\n", + thisDev->area.r_ll.p_x, thisDev->area.r_ll.p_y); + return; + } PlaneSetHint(plane, tile); if (IsSplit(tile))