From 5fcd4441c16c03a13e6713b7a73eb11771ef2f55 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Mon, 13 Feb 2023 10:57:43 -0500 Subject: [PATCH] Corrected the "extresist" command behavior to ensure that transistor records match between the ".ext" file and the ".res.ext" file for the number of terminals per device. Previously, the first device type for the layer type was always being used, and if it had fewer terminals (e.g., a MOScap), then one terminal would go missing in the output. --- VERSION | 2 +- resis/ResPrint.c | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 39416f26..8e5ca847 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.365 +8.3.366 diff --git a/resis/ResPrint.c b/resis/ResPrint.c index b9a797b7..2f24b632 100644 --- a/resis/ResPrint.c +++ b/resis/ResPrint.c @@ -114,7 +114,7 @@ ResPrintExtDev(outextfile, devices) { TileType t; char *subsName; - ExtDevice *devptr; + ExtDevice *devptr, *devtest; for (; devices != NULL; devices = devices->nextDev) { @@ -124,6 +124,37 @@ ResPrintExtDev(outextfile, devices) { t = devices->layout->rd_devtype; devptr = ExtCurStyle->exts_device[t]; + + /* Make sure the number of S/D terminals matches for */ + /* the device record. */ + + if ((devices->drain == NULL) && (devptr->exts_deviceSDCount == 2)) + { + /* Check if there is a compatible device */ + /* with 2 terminals */ + + for (devtest = devptr->exts_next; devtest; + devtest = devtest->exts_next) + if (devtest->exts_deviceSDCount == 1) + { + devptr = devtest; + break; + } + } + else if ((devices->drain != NULL) && (devptr->exts_deviceSDCount == 1)) + { + /* Check if there is a compatible device */ + /* with 3 terminals */ + + for (devtest = devptr->exts_next; devtest; + devtest = devtest->exts_next) + if (devtest->exts_deviceSDCount == 2) + { + devptr = devtest; + break; + } + } + subsName = devptr->exts_deviceSubstrateName; #ifdef MAGIC_WRAPPER