From d6d8620a7c4264de579c37ee516685ae8a83f43f Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Mon, 6 Oct 2025 11:50:38 -0400 Subject: [PATCH] Added new statements "connect" and "disconnect" to the extract section of the tech file, which can be used to alter the layer connectivity tables from the default. This can be used, for example, to disconnect substrate and well from taps, to generate a netlist that checks for soft-connect errors. --- VERSION | 2 +- doc/html/ext2spice.html | 11 ++++--- extract/ExtTech.c | 63 +++++++++++++++++++++++++++++++++++------ 3 files changed, 62 insertions(+), 14 deletions(-) diff --git a/VERSION b/VERSION index e4d0a60c..f2396895 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.556 +8.3.557 diff --git a/doc/html/ext2spice.html b/doc/html/ext2spice.html index 639ea441..c20b3b36 100644 --- a/doc/html/ext2spice.html +++ b/doc/html/ext2spice.html @@ -34,11 +34,15 @@ Convert extracted file(s) to a SPICE format file. (see Summary, below).
default
Reset to default values -
format hspice|spice2|spice3|ngspice +
format hspice|spice2|spice3|ngspice|cdl
Set output format. spice3 is the default, for compatibility with tclspice. This is a change from previous versions of magic, where the - default was hspice. + default was hspice. ngspice is set as + default by the ext2spice lvs option. cdl + format incorporates some common syntax used by CDL format + files, including placing a slash between a subcircuit's + pins and the subcircuit name.
rthresh [value]
Set resistance threshold value. Lumped resistances below this value will not be written to the output. The @@ -46,7 +50,6 @@ Convert extracted file(s) to a SPICE format file. to prohibit writing any lumped resistances to the output.
cthresh [value]
Set capacitance threshold value. The value is in femtofarads, - or may be the keyword infinite to prohibit writing any parasitic capacitances to the output.
merge [merge_option]
Merge parallel devices/transistors. The valid merge options are: @@ -235,7 +238,7 @@ Convert extracted file(s) to a SPICE format file. class, and substrate node name for device type device. Resistance classes are indexed by number and must match the definition in the technology file's extract section. -
-f spice2|spice3|hspice|ngspice +
-f spice2|spice3|hspice|ngspice|cdl
Choose the output SPICE format for compatibility with different versions of SPICE.
-d diff --git a/extract/ExtTech.c b/extract/ExtTech.c index 60a906d0..fb47d718 100644 --- a/extract/ExtTech.c +++ b/extract/ExtTech.c @@ -78,10 +78,10 @@ void ExtTechScale(int, int); typedef enum { - AREAC, CONTACT, CSCALE, + AREAC, CONNECT, CONTACT, CSCALE, DEFAULTAREACAP, DEFAULTOVERLAP, DEFAULTPERIMETER, DEFAULTSIDEOVERLAP, DEFAULTSIDEWALL, - DEVICE, DEVRESIST, FET, FETRESIST, FRINGESHIELDHALO, + DEVICE, DEVRESIST, DISCONNECT, FET, FETRESIST, FRINGESHIELDHALO, HEIGHT, ANTENNA, MODEL, TIEDOWN, LAMBDA, OVERC, PERIMC, PLANEORDER, NOPLANEORDER, RESIST, RSCALE, SIDEHALO, SIDEOVERLAP, SIDEWALL, STEP, STYLE, SUBSTRATE, UNITS, VARIANT @@ -100,6 +100,9 @@ static const keydesc keyTable[] = { {"areacap", AREAC, 3, 3, "types capacitance"}, + {"connect", CONNECT, 3, 3, +"types1 types1"}, + {"contact", CONTACT, 3, 6, "type resistance"}, @@ -127,6 +130,9 @@ static const keydesc keyTable[] = { {"devresist", DEVRESIST, 4, 4, "type region ohms-per-square"}, + {"disconnect", DISCONNECT, 3, 3, +"types1 types1"}, + {"fet", FET, 8, 9, "types terminal-types min-#-terminals name [subs-types] subs-node gscap gate-chan-cap"}, @@ -935,16 +941,24 @@ extTechStyleInit(style) } doConvert = FALSE; - // The exts_globSubstratePlane setting of -1 will be used to set a - // backwards-compatibility mode matching previous behavior with - // respect to the substrate when there is no "substrate" line in - // the techfile. + /* The exts_globSubstratePlane setting of -1 will be used to set a + * backwards-compatibility mode matching previous behavior with + * respect to the substrate when there is no "substrate" line in + * the techfile. + */ style->exts_globSubstratePlane = -1; style->exts_globSubstrateDefaultType = -1; TTMaskZero(&style->exts_globSubstrateTypes); TTMaskZero(&style->exts_globSubstrateShieldTypes); style->exts_globSubstrateName = (char *)NULL; + + /* Initialize exts_nodeConn to match DBConnectTbl, so that "connect" + * and "disconnect" statements in the extract section can be used to + * modify the defaults. + */ + for (r = 0; r < NT; r++) + style->exts_nodeConn[r] = DBConnectTbl[r]; } @@ -1959,7 +1973,7 @@ ExtTechLine(sectionName, argc, argv) TileTypeBitMask types1, types2, termtypes[MAXSD]; TileTypeBitMask near, far, ov, shield, subsTypes, idTypes; char *subsName, *transName, *cp, *endptr, *paramName; - TileType s, t, r, o; + TileType s, t, t2, r, o; const keydesc *kp, *dv; HashEntry *he; EdgeCap *cnew; @@ -2182,10 +2196,12 @@ ExtTechLine(sectionName, argc, argv) switch (kp->k_key) { case AREAC: + case CONNECT: case CONTACT: + case DEVRESIST: + case DISCONNECT: case FET: case FETRESIST: - case DEVRESIST: case HEIGHT: case ANTENNA: case TIEDOWN: @@ -2220,6 +2236,19 @@ ExtTechLine(sectionName, argc, argv) ExtCurStyle->exts_overlapMult[0][t] = (float) capVal * FRINGE_MULT; } break; + case CONNECT: + /* Parse like a line from the "connect" section */ + DBTechNoisyNameMask(argv[2], &types2); + TTMaskSetMask(allExtractTypes, &types2); + for (t = 0; t < DBNumTypes; t++) + if (TTMaskHasType(&types1, t)) + for (t2 = 0; t2 < DBNumTypes; t2++) + if (TTMaskHasType(&types2, t2)) + { + TTMaskSetType(&ExtCurStyle->exts_nodeConn[t], t2); + TTMaskSetType(&ExtCurStyle->exts_nodeConn[t2], t); + } + break; case CONTACT: /* Contact size, border, spacing deprecated (now taken from */ /* cifoutput "squares" generation parameters). */ @@ -2252,6 +2281,22 @@ ExtTechLine(sectionName, argc, argv) ExtCurStyle->exts_capScale = 1; } break; + case DISCONNECT: + /* Parse like a line from the "connect" section; however, */ + /* "disconnect" overrides an existing connection in the */ + /* DBConnectTbl array by removing the connection between */ + /* layers. */ + DBTechNoisyNameMask(argv[2], &types2); + TTMaskSetMask(allExtractTypes, &types2); + for (t = 0; t < DBNumTypes; t++) + if (TTMaskHasType(&types1, t)) + for (t2 = 0; t2 < DBNumTypes; t2++) + if (TTMaskHasType(&types2, t2)) + { + TTMaskClearType(&ExtCurStyle->exts_nodeConn[t], t2); + TTMaskClearType(&ExtCurStyle->exts_nodeConn[t2], t); + } + break; case FET: /* Original FET format, kept for backwards compatibility */ @@ -3492,7 +3537,7 @@ extTechFinalStyle(style) for (r = TT_TECHDEPBASE; r < DBNumTypes; r++) { - maskBits = style->exts_nodeConn[r] = DBConnectTbl[r]; + maskBits = style->exts_nodeConn[r]; if (!TTMaskHasType(&style->exts_deviceMask, r)) { TTMaskZero(&style->exts_deviceConn[r]);