diff --git a/ext2spice/ext2hier.c b/ext2spice/ext2hier.c index 4c8de5d5..88c005e2 100644 --- a/ext2spice/ext2hier.c +++ b/ext2spice/ext2hier.c @@ -588,6 +588,7 @@ spcdevHierVisit(hc, dev, scale) break; case DEV_SUBCKT: case DEV_RSUBCKT: + case DEV_CSUBCKT: case DEV_MSUBCKT: devchar = 'X'; break; @@ -620,6 +621,7 @@ spcdevHierVisit(hc, dev, scale) break; case DEV_SUBCKT: case DEV_RSUBCKT: + case DEV_CSUBCKT: case DEV_MSUBCKT: fprintf(esSpiceF, "%d", esSbckNum++); break; @@ -681,6 +683,7 @@ spcdevHierVisit(hc, dev, scale) /* Drop through to below (no break statement) */ case DEV_RSUBCKT: + case DEV_CSUBCKT: /* RC-like subcircuits are exactly like other subcircuits */ /* except that the "gate" node is treated as an identifier */ /* only and is not output. */ @@ -1051,6 +1054,7 @@ spcdevHierMergeVisit(hc, dev, scale) else m = esFMult[cfp->esFMIndex] + (fp->l / cfp->l); break; + case DEV_CSUBCKT: case DEV_CAP: case DEV_CAPREV: if (fp->dev->dev_type == esNoModelType) @@ -1451,6 +1455,7 @@ mergeThem: else m = esFMult[cfp->esFMIndex] + (fp->l / cfp->l); break; + case DEV_CSUBCKT: case DEV_CAP: case DEV_CAPREV: if (fp->dev->dev_type == esNoModelType) diff --git a/ext2spice/ext2spice.c b/ext2spice/ext2spice.c index 32a4ecf6..300585d8 100644 --- a/ext2spice/ext2spice.c +++ b/ext2spice/ext2spice.c @@ -2145,6 +2145,7 @@ spcdevVisit(dev, hierName, scale, trans) { case DEV_SUBCKT: case DEV_RSUBCKT: + case DEV_CSUBCKT: case DEV_MSUBCKT: break; case DEV_DIODE: @@ -2234,6 +2235,7 @@ spcdevVisit(dev, hierName, scale, trans) break; case DEV_SUBCKT: case DEV_RSUBCKT: + case DEV_CSUBCKT: case DEV_MSUBCKT: devchar = 'X'; break; @@ -2270,6 +2272,7 @@ spcdevVisit(dev, hierName, scale, trans) break; case DEV_SUBCKT: case DEV_RSUBCKT: + case DEV_CSUBCKT: case DEV_MSUBCKT: fprintf(esSpiceF, "%d", esSbckNum++); break; @@ -2327,6 +2330,7 @@ spcdevVisit(dev, hierName, scale, trans) /* Drop through to below (no break statement) */ case DEV_RSUBCKT: + case DEV_CSUBCKT: /* RC-like subcircuits are exactly like other subcircuits */ /* except that the "gate" node is treated as an identifier */ /* only and is not output. */ @@ -3488,6 +3492,7 @@ parallelDevs(f1, f2) case DEV_SUBCKT: case DEV_RSUBCKT: + case DEV_CSUBCKT: break; } return NOT_PARALLEL; @@ -3665,6 +3670,7 @@ mergeThem: else m = esFMult[cfp->esFMIndex] + (fp->l / cfp->l); break; + case DEV_CSUBCKT: case DEV_CAP: case DEV_CAPREV: if (fp->dev->dev_type == esNoModelType) diff --git a/extflat/EFbuild.c b/extflat/EFbuild.c index 5a5d3384..96148a66 100644 --- a/extflat/EFbuild.c +++ b/extflat/EFbuild.c @@ -639,6 +639,7 @@ efBuildDevice(def, class, type, r, argc, argv) case DEV_SUBCKT: case DEV_MSUBCKT: case DEV_RSUBCKT: + case DEV_CSUBCKT: argstart = 0; } @@ -719,6 +720,7 @@ efBuildDevice(def, class, type, r, argc, argv) case DEV_CAP: case DEV_CAPREV: case DEV_RSUBCKT: + case DEV_CSUBCKT: case DEV_MSUBCKT: case DEV_SUBCKT: case DEV_DIODE: diff --git a/extflat/EFread.c b/extflat/EFread.c index 0b13d268..4ad44062 100644 --- a/extflat/EFread.c +++ b/extflat/EFread.c @@ -44,7 +44,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/ /* This must match the definition for extDevTable in extract/ExtBasic.c */ char *extDevTable[] = {"fet", "mosfet", "asymmetric", "bjt", "devres", "devcap", "devcaprev", "diode", "pdiode", "ndiode", - "subckt", "rsubckt", "msubckt", NULL}; + "subckt", "rsubckt", "msubckt", "csubckt", NULL}; #endif /* @@ -344,6 +344,7 @@ readfile: case DEV_SUBCKT: case DEV_MSUBCKT: case DEV_RSUBCKT: + case DEV_CSUBCKT: ac = 7; /* Actually can have many arguments, which */ break; /* we will deal with in efBuildDevice(). */ } diff --git a/extflat/EFvisit.c b/extflat/EFvisit.c index 4e0f991e..aadb98ff 100644 --- a/extflat/EFvisit.c +++ b/extflat/EFvisit.c @@ -183,6 +183,7 @@ EFGetLengthAndWidth(dev, lptr, wptr) case DEV_SUBCKT: case DEV_MSUBCKT: case DEV_RSUBCKT: + case DEV_CSUBCKT: case DEV_DIODE: case DEV_PDIODE: case DEV_NDIODE: diff --git a/extract/ExtBasic.c b/extract/ExtBasic.c index 80993585..60f0b5b2 100644 --- a/extract/ExtBasic.c +++ b/extract/ExtBasic.c @@ -56,7 +56,7 @@ static char sccsid[] = "@(#)ExtBasic.c 4.13 MAGIC (Berkeley) 12/5/85"; #ifdef MAGIC_WRAPPER char *extDevTable[] = {"fet", "mosfet", "asymmetric", "bjt", "devres", "devcap", "devcaprev", "diode", "pdiode", "ndiode", "subckt", - "rsubckt", "msubckt", NULL}; + "rsubckt", "msubckt", "csubckt", NULL}; #endif /* --------------------- Data local to this file ---------------------- */ @@ -2076,6 +2076,7 @@ extOutputDevices(def, transList, outFile) case DEV_CAP: case DEV_CAPREV: + case DEV_CSUBCKT: hasModel = strcmp(ExtCurStyle->exts_transName[t], "None"); if (hasModel) { @@ -2144,8 +2145,17 @@ extOutputDevices(def, transList, outFile) (void) ExtFindNeighbors(reg->treg_tile, arg.fra_pNum, &arg); } extOutputDevParams(reg, t, outFile, length, width); - if (subsName != NULL) - fprintf(outFile, " \"%s\"", subsName); + + if (ExtCurStyle->exts_deviceClass[t] == DEV_CSUBCKT) + { + fprintf(outFile, " \"%s\"", (subsName == NULL) ? + "None" : subsName); + } + else /* SPICE semiconductor resistor */ + { + if (subsName != NULL) + fprintf(outFile, " \"%s\"", subsName); + } } else { diff --git a/extract/ExtTech.c b/extract/ExtTech.c index b663eb7a..db661cbf 100644 --- a/extract/ExtTech.c +++ b/extract/ExtTech.c @@ -212,6 +212,9 @@ static keydesc devTable[] = { "msubcircuit", DEV_MSUBCKT, 3, 11, "name dev-types [N] [term1-types ... termN-types [sub-types|None sub-node]] [options]", + "csubcircuit", DEV_CSUBCKT, 4, 7, +"name dev-types terminal-types [sub-types|None sub-node] [options]", + 0 }; @@ -2177,6 +2180,7 @@ ExtTechLine(sectionName, argc, argv) break; case DEV_RSUBCKT: + case DEV_CSUBCKT: nterm = 2; DBTechNoisyNameMask(argv[4], &termtypes[0]); /* terminals */ termtypes[1] = DBZeroTypeBits; diff --git a/extract/extract.h b/extract/extract.h index 4877491a..b63c4acc 100644 --- a/extract/extract.h +++ b/extract/extract.h @@ -52,6 +52,7 @@ extern int ExtDoWarn; /* Bitmask of above */ #define DEV_SUBCKT 10 /* general-purpose subcircuit */ #define DEV_RSUBCKT 11 /* Resistor-like subcircuit. */ #define DEV_MSUBCKT 12 /* MOSFET-like subcircuit. */ +#define DEV_CSUBCKT 13 /* Capacitor-like subcircuit. */ /* Device names for .ext file output (new in version 7.2) */ /* (defined in extract/ExtBasic.c *and* extflat/EFread.c) */