From 25304924b71299d18806612a664b3bb862c7a536 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Wed, 30 Jan 2019 17:16:50 -0500 Subject: [PATCH] Corrected an apparently long-standing (but relatively obscure) error where devices extracted as "device resistor" or "device capacitor" and defining parameters (e.g., area, perimeter) will generate the device arguments in the wrong order in the .ext file, resulting in incorrect readback when attempting to do ext2spice, resulting in the device being omitted from the resulting netlist. --- extract/ExtBasic.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/extract/ExtBasic.c b/extract/ExtBasic.c index 3b3bbdc3..381cdcf1 100644 --- a/extract/ExtBasic.c +++ b/extract/ExtBasic.c @@ -2059,12 +2059,9 @@ extOutputDevices(def, transList, outFile) "Resistor has zero width"); } - extOutputDevParams(reg, t, outFile, length, width); - if (ExtCurStyle->exts_deviceClass[t] == DEV_RSUBCKT) { - fprintf(outFile, " \"%s\"", (subsName == NULL) ? - "None" : subsName); + /* nothing */ } else if (hasModel) /* SPICE semiconductor resistor */ { @@ -2074,6 +2071,15 @@ extOutputDevices(def, transList, outFile) } else /* regular resistor */ fprintf(outFile, " %g", dres / 1000.0); /* mOhms -> Ohms */ + + extOutputDevParams(reg, t, outFile, length, width); + + if (ExtCurStyle->exts_deviceClass[t] == DEV_RSUBCKT) + { + fprintf(outFile, " \"%s\"", (subsName == NULL) ? + "None" : subsName); + } + break; case DEV_CAP: @@ -2136,12 +2142,10 @@ extOutputDevices(def, transList, outFile) arg.fra_each = (int (*)()) NULL; (void) ExtFindNeighbors(reg->treg_tile, arg.fra_pNum, &arg); } - extOutputDevParams(reg, t, outFile, length, width); if (ExtCurStyle->exts_deviceClass[t] == DEV_CSUBCKT) { - fprintf(outFile, " \"%s\"", (subsName == NULL) ? - "None" : subsName); + /* (Nothing) */ } else /* SPICE semiconductor resistor */ { @@ -2158,6 +2162,14 @@ extOutputDevices(def, transList, outFile) if (subsName != NULL) fprintf(outFile, " \"%s\"", subsName); } + + extOutputDevParams(reg, t, outFile, length, width); + + if (ExtCurStyle->exts_deviceClass[t] == DEV_CSUBCKT) + { + fprintf(outFile, " \"%s\"", (subsName == NULL) ? + "None" : subsName); + } } else {