Added extraction device type "csubcircuit", which should have been
added a long time ago, since capacitors use a different method for calculating width and length than either transistors or resistors, so subcircuits need a special class designator or else the extraction may calculate the wrong dimensions for device width by totalling the perimeter between the device and terminal types, as it would for a MOSFET.
This commit is contained in:
parent
0944b02f5f
commit
7dc15a7d28
|
|
@ -588,6 +588,7 @@ spcdevHierVisit(hc, dev, scale)
|
||||||
break;
|
break;
|
||||||
case DEV_SUBCKT:
|
case DEV_SUBCKT:
|
||||||
case DEV_RSUBCKT:
|
case DEV_RSUBCKT:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
case DEV_MSUBCKT:
|
case DEV_MSUBCKT:
|
||||||
devchar = 'X';
|
devchar = 'X';
|
||||||
break;
|
break;
|
||||||
|
|
@ -620,6 +621,7 @@ spcdevHierVisit(hc, dev, scale)
|
||||||
break;
|
break;
|
||||||
case DEV_SUBCKT:
|
case DEV_SUBCKT:
|
||||||
case DEV_RSUBCKT:
|
case DEV_RSUBCKT:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
case DEV_MSUBCKT:
|
case DEV_MSUBCKT:
|
||||||
fprintf(esSpiceF, "%d", esSbckNum++);
|
fprintf(esSpiceF, "%d", esSbckNum++);
|
||||||
break;
|
break;
|
||||||
|
|
@ -681,6 +683,7 @@ spcdevHierVisit(hc, dev, scale)
|
||||||
/* Drop through to below (no break statement) */
|
/* Drop through to below (no break statement) */
|
||||||
|
|
||||||
case DEV_RSUBCKT:
|
case DEV_RSUBCKT:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
/* RC-like subcircuits are exactly like other subcircuits */
|
/* RC-like subcircuits are exactly like other subcircuits */
|
||||||
/* except that the "gate" node is treated as an identifier */
|
/* except that the "gate" node is treated as an identifier */
|
||||||
/* only and is not output. */
|
/* only and is not output. */
|
||||||
|
|
@ -1051,6 +1054,7 @@ spcdevHierMergeVisit(hc, dev, scale)
|
||||||
else
|
else
|
||||||
m = esFMult[cfp->esFMIndex] + (fp->l / cfp->l);
|
m = esFMult[cfp->esFMIndex] + (fp->l / cfp->l);
|
||||||
break;
|
break;
|
||||||
|
case DEV_CSUBCKT:
|
||||||
case DEV_CAP:
|
case DEV_CAP:
|
||||||
case DEV_CAPREV:
|
case DEV_CAPREV:
|
||||||
if (fp->dev->dev_type == esNoModelType)
|
if (fp->dev->dev_type == esNoModelType)
|
||||||
|
|
@ -1451,6 +1455,7 @@ mergeThem:
|
||||||
else
|
else
|
||||||
m = esFMult[cfp->esFMIndex] + (fp->l / cfp->l);
|
m = esFMult[cfp->esFMIndex] + (fp->l / cfp->l);
|
||||||
break;
|
break;
|
||||||
|
case DEV_CSUBCKT:
|
||||||
case DEV_CAP:
|
case DEV_CAP:
|
||||||
case DEV_CAPREV:
|
case DEV_CAPREV:
|
||||||
if (fp->dev->dev_type == esNoModelType)
|
if (fp->dev->dev_type == esNoModelType)
|
||||||
|
|
|
||||||
|
|
@ -2145,6 +2145,7 @@ spcdevVisit(dev, hierName, scale, trans)
|
||||||
{
|
{
|
||||||
case DEV_SUBCKT:
|
case DEV_SUBCKT:
|
||||||
case DEV_RSUBCKT:
|
case DEV_RSUBCKT:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
case DEV_MSUBCKT:
|
case DEV_MSUBCKT:
|
||||||
break;
|
break;
|
||||||
case DEV_DIODE:
|
case DEV_DIODE:
|
||||||
|
|
@ -2234,6 +2235,7 @@ spcdevVisit(dev, hierName, scale, trans)
|
||||||
break;
|
break;
|
||||||
case DEV_SUBCKT:
|
case DEV_SUBCKT:
|
||||||
case DEV_RSUBCKT:
|
case DEV_RSUBCKT:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
case DEV_MSUBCKT:
|
case DEV_MSUBCKT:
|
||||||
devchar = 'X';
|
devchar = 'X';
|
||||||
break;
|
break;
|
||||||
|
|
@ -2270,6 +2272,7 @@ spcdevVisit(dev, hierName, scale, trans)
|
||||||
break;
|
break;
|
||||||
case DEV_SUBCKT:
|
case DEV_SUBCKT:
|
||||||
case DEV_RSUBCKT:
|
case DEV_RSUBCKT:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
case DEV_MSUBCKT:
|
case DEV_MSUBCKT:
|
||||||
fprintf(esSpiceF, "%d", esSbckNum++);
|
fprintf(esSpiceF, "%d", esSbckNum++);
|
||||||
break;
|
break;
|
||||||
|
|
@ -2327,6 +2330,7 @@ spcdevVisit(dev, hierName, scale, trans)
|
||||||
/* Drop through to below (no break statement) */
|
/* Drop through to below (no break statement) */
|
||||||
|
|
||||||
case DEV_RSUBCKT:
|
case DEV_RSUBCKT:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
/* RC-like subcircuits are exactly like other subcircuits */
|
/* RC-like subcircuits are exactly like other subcircuits */
|
||||||
/* except that the "gate" node is treated as an identifier */
|
/* except that the "gate" node is treated as an identifier */
|
||||||
/* only and is not output. */
|
/* only and is not output. */
|
||||||
|
|
@ -3488,6 +3492,7 @@ parallelDevs(f1, f2)
|
||||||
|
|
||||||
case DEV_SUBCKT:
|
case DEV_SUBCKT:
|
||||||
case DEV_RSUBCKT:
|
case DEV_RSUBCKT:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return NOT_PARALLEL;
|
return NOT_PARALLEL;
|
||||||
|
|
@ -3665,6 +3670,7 @@ mergeThem:
|
||||||
else
|
else
|
||||||
m = esFMult[cfp->esFMIndex] + (fp->l / cfp->l);
|
m = esFMult[cfp->esFMIndex] + (fp->l / cfp->l);
|
||||||
break;
|
break;
|
||||||
|
case DEV_CSUBCKT:
|
||||||
case DEV_CAP:
|
case DEV_CAP:
|
||||||
case DEV_CAPREV:
|
case DEV_CAPREV:
|
||||||
if (fp->dev->dev_type == esNoModelType)
|
if (fp->dev->dev_type == esNoModelType)
|
||||||
|
|
|
||||||
|
|
@ -639,6 +639,7 @@ efBuildDevice(def, class, type, r, argc, argv)
|
||||||
case DEV_SUBCKT:
|
case DEV_SUBCKT:
|
||||||
case DEV_MSUBCKT:
|
case DEV_MSUBCKT:
|
||||||
case DEV_RSUBCKT:
|
case DEV_RSUBCKT:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
argstart = 0;
|
argstart = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -719,6 +720,7 @@ efBuildDevice(def, class, type, r, argc, argv)
|
||||||
case DEV_CAP:
|
case DEV_CAP:
|
||||||
case DEV_CAPREV:
|
case DEV_CAPREV:
|
||||||
case DEV_RSUBCKT:
|
case DEV_RSUBCKT:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
case DEV_MSUBCKT:
|
case DEV_MSUBCKT:
|
||||||
case DEV_SUBCKT:
|
case DEV_SUBCKT:
|
||||||
case DEV_DIODE:
|
case DEV_DIODE:
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
/* This must match the definition for extDevTable in extract/ExtBasic.c */
|
||||||
char *extDevTable[] = {"fet", "mosfet", "asymmetric", "bjt", "devres",
|
char *extDevTable[] = {"fet", "mosfet", "asymmetric", "bjt", "devres",
|
||||||
"devcap", "devcaprev", "diode", "pdiode", "ndiode",
|
"devcap", "devcaprev", "diode", "pdiode", "ndiode",
|
||||||
"subckt", "rsubckt", "msubckt", NULL};
|
"subckt", "rsubckt", "msubckt", "csubckt", NULL};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -344,6 +344,7 @@ readfile:
|
||||||
case DEV_SUBCKT:
|
case DEV_SUBCKT:
|
||||||
case DEV_MSUBCKT:
|
case DEV_MSUBCKT:
|
||||||
case DEV_RSUBCKT:
|
case DEV_RSUBCKT:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
ac = 7; /* Actually can have many arguments, which */
|
ac = 7; /* Actually can have many arguments, which */
|
||||||
break; /* we will deal with in efBuildDevice(). */
|
break; /* we will deal with in efBuildDevice(). */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,7 @@ EFGetLengthAndWidth(dev, lptr, wptr)
|
||||||
case DEV_SUBCKT:
|
case DEV_SUBCKT:
|
||||||
case DEV_MSUBCKT:
|
case DEV_MSUBCKT:
|
||||||
case DEV_RSUBCKT:
|
case DEV_RSUBCKT:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
case DEV_DIODE:
|
case DEV_DIODE:
|
||||||
case DEV_PDIODE:
|
case DEV_PDIODE:
|
||||||
case DEV_NDIODE:
|
case DEV_NDIODE:
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ static char sccsid[] = "@(#)ExtBasic.c 4.13 MAGIC (Berkeley) 12/5/85";
|
||||||
#ifdef MAGIC_WRAPPER
|
#ifdef MAGIC_WRAPPER
|
||||||
char *extDevTable[] = {"fet", "mosfet", "asymmetric", "bjt", "devres",
|
char *extDevTable[] = {"fet", "mosfet", "asymmetric", "bjt", "devres",
|
||||||
"devcap", "devcaprev", "diode", "pdiode", "ndiode", "subckt",
|
"devcap", "devcaprev", "diode", "pdiode", "ndiode", "subckt",
|
||||||
"rsubckt", "msubckt", NULL};
|
"rsubckt", "msubckt", "csubckt", NULL};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* --------------------- Data local to this file ---------------------- */
|
/* --------------------- Data local to this file ---------------------- */
|
||||||
|
|
@ -2076,6 +2076,7 @@ extOutputDevices(def, transList, outFile)
|
||||||
|
|
||||||
case DEV_CAP:
|
case DEV_CAP:
|
||||||
case DEV_CAPREV:
|
case DEV_CAPREV:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
hasModel = strcmp(ExtCurStyle->exts_transName[t], "None");
|
hasModel = strcmp(ExtCurStyle->exts_transName[t], "None");
|
||||||
if (hasModel)
|
if (hasModel)
|
||||||
{
|
{
|
||||||
|
|
@ -2144,8 +2145,17 @@ extOutputDevices(def, transList, outFile)
|
||||||
(void) ExtFindNeighbors(reg->treg_tile, arg.fra_pNum, &arg);
|
(void) ExtFindNeighbors(reg->treg_tile, arg.fra_pNum, &arg);
|
||||||
}
|
}
|
||||||
extOutputDevParams(reg, t, outFile, length, width);
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -212,6 +212,9 @@ static keydesc devTable[] = {
|
||||||
"msubcircuit", DEV_MSUBCKT, 3, 11,
|
"msubcircuit", DEV_MSUBCKT, 3, 11,
|
||||||
"name dev-types [N] [term1-types ... termN-types [sub-types|None sub-node]] [options]",
|
"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
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2177,6 +2180,7 @@ ExtTechLine(sectionName, argc, argv)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEV_RSUBCKT:
|
case DEV_RSUBCKT:
|
||||||
|
case DEV_CSUBCKT:
|
||||||
nterm = 2;
|
nterm = 2;
|
||||||
DBTechNoisyNameMask(argv[4], &termtypes[0]); /* terminals */
|
DBTechNoisyNameMask(argv[4], &termtypes[0]); /* terminals */
|
||||||
termtypes[1] = DBZeroTypeBits;
|
termtypes[1] = DBZeroTypeBits;
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ extern int ExtDoWarn; /* Bitmask of above */
|
||||||
#define DEV_SUBCKT 10 /* general-purpose subcircuit */
|
#define DEV_SUBCKT 10 /* general-purpose subcircuit */
|
||||||
#define DEV_RSUBCKT 11 /* Resistor-like subcircuit. */
|
#define DEV_RSUBCKT 11 /* Resistor-like subcircuit. */
|
||||||
#define DEV_MSUBCKT 12 /* MOSFET-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) */
|
/* Device names for .ext file output (new in version 7.2) */
|
||||||
/* (defined in extract/ExtBasic.c *and* extflat/EFread.c) */
|
/* (defined in extract/ExtBasic.c *and* extflat/EFread.c) */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue