From 02bbb1064e436be4a5a3c037f28c9e1365e763da Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 6 Dec 2022 21:55:01 -0500 Subject: [PATCH] Corrected an error in "extresist" that can output an incorrect number of terminals for devices that don't have the usual gate/ source/drain terminals (e.g., diodes, resistors, capacitors) when writing the devices with re-mapped terminals into the .res.ext file. Also: Changed the size of the word containing the name refcount for "equiv" statements, since an accidental shorting of pins can cause a large number of "equiv" statements in a .ext file, causing an overrun of the previously 1-byte refcount (this probably does not make the structure any longer, since it likely has to fit to a word boundary). --- VERSION | 2 +- extflat/EFflat.c | 2 ++ extflat/extflat.h | 2 +- resis/ResPrint.c | 12 +++++++----- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 82152347..c9e14d03 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.348 +8.3.349 diff --git a/extflat/EFflat.c b/extflat/EFflat.c index 10250868..6e253af8 100644 --- a/extflat/EFflat.c +++ b/extflat/EFflat.c @@ -763,6 +763,8 @@ efFlatGlob() HashSetValue(heGlob, (ClientData) nameGlob); nameGlob->efnn_node = nodeFlat; nameGlob->efnn_hier = (HierName *) heGlob->h_key.h_ptr; + nameGlob->efnn_port = -1; + nameGlob->efnn_refc = 0; } else if (nameGlob->efnn_node != nodeFlat) { diff --git a/extflat/extflat.h b/extflat/extflat.h index 6d767c94..ef475d3e 100644 --- a/extflat/extflat.h +++ b/extflat/extflat.h @@ -126,7 +126,7 @@ typedef struct efnn struct efnn *efnn_next; /* Next name for this node */ HierName *efnn_hier; /* HierName for this node */ int efnn_port; /* Port number for this node */ - unsigned char efnn_refc; /* #times referenced in hash */ + unsigned short efnn_refc; /* #times referenced in hash */ } EFNodeName; /* diff --git a/resis/ResPrint.c b/resis/ResPrint.c index 9adb9c7a..b9a797b7 100644 --- a/resis/ResPrint.c +++ b/resis/ResPrint.c @@ -185,11 +185,13 @@ ResPrintExtDev(outextfile, devices) devices->layout->rd_width, devices->rs_sattr); - if (devices->drain != NULL) - fprintf(outextfile, " \"%s\" %d %s", - devices->drain->name, - devices->layout->rd_width, - devices->rs_dattr); + /* Don't write drain values for 2-terminal devices */ + if (devptr->exts_deviceSDCount > 1) + if (devices->drain != NULL) + fprintf(outextfile, " \"%s\" %d %s", + devices->drain->name, + devices->layout->rd_width, + devices->rs_dattr); fprintf(outextfile, "\n"); }