Reimported mos9 after running dos2unix, there were some ^M inherited
from dos.
This commit is contained in:
parent
b07e35d150
commit
01186f3556
|
|
@ -1,174 +1,174 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1987 Thomas L. Quarles
|
Author: 1987 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "devdefs.h"
|
#include "devdefs.h"
|
||||||
#include "ifsim.h"
|
#include "ifsim.h"
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
IFparm MOS9pTable[] = { /* parameters */
|
IFparm MOS9pTable[] = { /* parameters */
|
||||||
|
|
||||||
IOPU("m", MOS9_M, IF_REAL , "Multiplier"),
|
IOPU("m", MOS9_M, IF_REAL , "Multiplier"),
|
||||||
IOPU("l", MOS9_L, IF_REAL , "Length"),
|
IOPU("l", MOS9_L, IF_REAL , "Length"),
|
||||||
IOPU("w", MOS9_W, IF_REAL , "Width"),
|
IOPU("w", MOS9_W, IF_REAL , "Width"),
|
||||||
IOPU("ad", MOS9_AD, IF_REAL , "Drain area"),
|
IOPU("ad", MOS9_AD, IF_REAL , "Drain area"),
|
||||||
IOPU("as", MOS9_AS, IF_REAL , "Source area"),
|
IOPU("as", MOS9_AS, IF_REAL , "Source area"),
|
||||||
IOPU("pd", MOS9_PD, IF_REAL , "Drain perimeter"),
|
IOPU("pd", MOS9_PD, IF_REAL , "Drain perimeter"),
|
||||||
IOPU("ps", MOS9_PS, IF_REAL , "Source perimeter"),
|
IOPU("ps", MOS9_PS, IF_REAL , "Source perimeter"),
|
||||||
OP("id", MOS9_CD, IF_REAL, "Drain current"),
|
OP("id", MOS9_CD, IF_REAL, "Drain current"),
|
||||||
OPR("cd", MOS9_CD, IF_REAL, "Drain current"),
|
OPR("cd", MOS9_CD, IF_REAL, "Drain current"),
|
||||||
OPU("ibd", MOS9_CBD, IF_REAL, "B-D junction current"),
|
OPU("ibd", MOS9_CBD, IF_REAL, "B-D junction current"),
|
||||||
OPU("ibs", MOS9_CBS, IF_REAL, "B-S junction current"),
|
OPU("ibs", MOS9_CBS, IF_REAL, "B-S junction current"),
|
||||||
OPU("is", MOS9_CS, IF_REAL, "Source current"),
|
OPU("is", MOS9_CS, IF_REAL, "Source current"),
|
||||||
OPU("ig", MOS9_CG, IF_REAL, "Gate current"),
|
OPU("ig", MOS9_CG, IF_REAL, "Gate current"),
|
||||||
OPU("ib", MOS9_CB, IF_REAL, "Bulk current"),
|
OPU("ib", MOS9_CB, IF_REAL, "Bulk current"),
|
||||||
OP("vgs", MOS9_VGS, IF_REAL, "Gate-Source voltage"),
|
OP("vgs", MOS9_VGS, IF_REAL, "Gate-Source voltage"),
|
||||||
OP("vds", MOS9_VDS, IF_REAL, "Drain-Source voltage"),
|
OP("vds", MOS9_VDS, IF_REAL, "Drain-Source voltage"),
|
||||||
OP("vbs", MOS9_VBS, IF_REAL, "Bulk-Source voltage"),
|
OP("vbs", MOS9_VBS, IF_REAL, "Bulk-Source voltage"),
|
||||||
OPU("vbd", MOS9_VBD, IF_REAL, "Bulk-Drain voltage"),
|
OPU("vbd", MOS9_VBD, IF_REAL, "Bulk-Drain voltage"),
|
||||||
IOPU("nrd", MOS9_NRD, IF_REAL , "Drain squares"),
|
IOPU("nrd", MOS9_NRD, IF_REAL , "Drain squares"),
|
||||||
IOPU("nrs", MOS9_NRS, IF_REAL , "Source squares"),
|
IOPU("nrs", MOS9_NRS, IF_REAL , "Source squares"),
|
||||||
IP("off", MOS9_OFF, IF_FLAG , "Device initially off"),
|
IP("off", MOS9_OFF, IF_FLAG , "Device initially off"),
|
||||||
IOPAU("icvds", MOS9_IC_VDS, IF_REAL , "Initial D-S voltage"),
|
IOPAU("icvds", MOS9_IC_VDS, IF_REAL , "Initial D-S voltage"),
|
||||||
IOPAU("icvgs", MOS9_IC_VGS, IF_REAL , "Initial G-S voltage"),
|
IOPAU("icvgs", MOS9_IC_VGS, IF_REAL , "Initial G-S voltage"),
|
||||||
IOPAU("icvbs", MOS9_IC_VBS, IF_REAL , "Initial B-S voltage"),
|
IOPAU("icvbs", MOS9_IC_VBS, IF_REAL , "Initial B-S voltage"),
|
||||||
IOPU("ic", MOS9_IC, IF_REALVEC, "Vector of D-S, G-S, B-S voltages"),
|
IOPU("ic", MOS9_IC, IF_REALVEC, "Vector of D-S, G-S, B-S voltages"),
|
||||||
IOPU("temp", MOS9_TEMP, IF_REAL , "Instance operating temperature"),
|
IOPU("temp", MOS9_TEMP, IF_REAL , "Instance operating temperature"),
|
||||||
IP("sens_l", MOS9_L_SENS, IF_FLAG, "flag to request sensitivity WRT length"),
|
IP("sens_l", MOS9_L_SENS, IF_FLAG, "flag to request sensitivity WRT length"),
|
||||||
IP("sens_w", MOS9_W_SENS, IF_FLAG, "flag to request sensitivity WRT width"),
|
IP("sens_w", MOS9_W_SENS, IF_FLAG, "flag to request sensitivity WRT width"),
|
||||||
OPU("dnode", MOS9_DNODE, IF_INTEGER, "Number of drain node"),
|
OPU("dnode", MOS9_DNODE, IF_INTEGER, "Number of drain node"),
|
||||||
OPU("gnode", MOS9_GNODE, IF_INTEGER, "Number of gate node"),
|
OPU("gnode", MOS9_GNODE, IF_INTEGER, "Number of gate node"),
|
||||||
OPU("snode", MOS9_SNODE, IF_INTEGER, "Number of source node"),
|
OPU("snode", MOS9_SNODE, IF_INTEGER, "Number of source node"),
|
||||||
OPU("bnode", MOS9_BNODE, IF_INTEGER, "Number of bulk node"),
|
OPU("bnode", MOS9_BNODE, IF_INTEGER, "Number of bulk node"),
|
||||||
OPU("dnodeprime", MOS9_DNODEPRIME,IF_INTEGER,"Number of internal drain node"),
|
OPU("dnodeprime", MOS9_DNODEPRIME,IF_INTEGER,"Number of internal drain node"),
|
||||||
OPU("snodeprime", MOS9_SNODEPRIME,IF_INTEGER,"Number of internal source node"),
|
OPU("snodeprime", MOS9_SNODEPRIME,IF_INTEGER,"Number of internal source node"),
|
||||||
OP("von", MOS9_VON, IF_REAL, "Turn-on voltage"),
|
OP("von", MOS9_VON, IF_REAL, "Turn-on voltage"),
|
||||||
OP("vdsat", MOS9_VDSAT, IF_REAL, "Saturation drain voltage"),
|
OP("vdsat", MOS9_VDSAT, IF_REAL, "Saturation drain voltage"),
|
||||||
OPU("sourcevcrit", MOS9_SOURCEVCRIT, IF_REAL, "Critical source voltage"),
|
OPU("sourcevcrit", MOS9_SOURCEVCRIT, IF_REAL, "Critical source voltage"),
|
||||||
OPU("drainvcrit", MOS9_DRAINVCRIT, IF_REAL, "Critical drain voltage"),
|
OPU("drainvcrit", MOS9_DRAINVCRIT, IF_REAL, "Critical drain voltage"),
|
||||||
OP("rs", MOS9_SOURCERESIST, IF_REAL, "Source resistance"),
|
OP("rs", MOS9_SOURCERESIST, IF_REAL, "Source resistance"),
|
||||||
OPU("sourceconductance", MOS9_SOURCECONDUCT, IF_REAL, "Source conductance"),
|
OPU("sourceconductance", MOS9_SOURCECONDUCT, IF_REAL, "Source conductance"),
|
||||||
OP("rd", MOS9_DRAINRESIST, IF_REAL, "Drain resistance"),
|
OP("rd", MOS9_DRAINRESIST, IF_REAL, "Drain resistance"),
|
||||||
OPU("drainconductance", MOS9_DRAINCONDUCT, IF_REAL, "Drain conductance"),
|
OPU("drainconductance", MOS9_DRAINCONDUCT, IF_REAL, "Drain conductance"),
|
||||||
OP("gm", MOS9_GM, IF_REAL, "Transconductance"),
|
OP("gm", MOS9_GM, IF_REAL, "Transconductance"),
|
||||||
OP("gds", MOS9_GDS, IF_REAL, "Drain-Source conductance"),
|
OP("gds", MOS9_GDS, IF_REAL, "Drain-Source conductance"),
|
||||||
OP("gmb", MOS9_GMBS, IF_REAL, "Bulk-Source transconductance"),
|
OP("gmb", MOS9_GMBS, IF_REAL, "Bulk-Source transconductance"),
|
||||||
OPR("gmbs", MOS9_GMBS, IF_REAL, "Bulk-Source transconductance"),
|
OPR("gmbs", MOS9_GMBS, IF_REAL, "Bulk-Source transconductance"),
|
||||||
OPU("gbd", MOS9_GBD, IF_REAL, "Bulk-Drain conductance"),
|
OPU("gbd", MOS9_GBD, IF_REAL, "Bulk-Drain conductance"),
|
||||||
OPU("gbs", MOS9_GBS, IF_REAL, "Bulk-Source conductance"),
|
OPU("gbs", MOS9_GBS, IF_REAL, "Bulk-Source conductance"),
|
||||||
|
|
||||||
OP("cbd", MOS9_CAPBD, IF_REAL, "Bulk-Drain capacitance"),
|
OP("cbd", MOS9_CAPBD, IF_REAL, "Bulk-Drain capacitance"),
|
||||||
OP("cbs", MOS9_CAPBS, IF_REAL, "Bulk-Source capacitance"),
|
OP("cbs", MOS9_CAPBS, IF_REAL, "Bulk-Source capacitance"),
|
||||||
OP("cgs", MOS9_CAPGS, IF_REAL, "Gate-Source capacitance"),
|
OP("cgs", MOS9_CAPGS, IF_REAL, "Gate-Source capacitance"),
|
||||||
/* OPR("cgs", MOS9_CGS, IF_REAL , "Gate-Source capacitance"),*/
|
/* OPR("cgs", MOS9_CGS, IF_REAL , "Gate-Source capacitance"),*/
|
||||||
OP("cgd", MOS9_CAPGD, IF_REAL, "Gate-Drain capacitance"),
|
OP("cgd", MOS9_CAPGD, IF_REAL, "Gate-Drain capacitance"),
|
||||||
/* OPR("cgd", MOS9_CGD, IF_REAL , "Gate-Drain capacitance"),*/
|
/* OPR("cgd", MOS9_CGD, IF_REAL , "Gate-Drain capacitance"),*/
|
||||||
OP("cgb", MOS9_CAPGB, IF_REAL, "Gate-Bulk capacitance"),
|
OP("cgb", MOS9_CAPGB, IF_REAL, "Gate-Bulk capacitance"),
|
||||||
|
|
||||||
OPU("cqgs",MOS9_CQGS,IF_REAL,"Capacitance due to gate-source charge storage"),
|
OPU("cqgs",MOS9_CQGS,IF_REAL,"Capacitance due to gate-source charge storage"),
|
||||||
OPU("cqgd",MOS9_CQGD, IF_REAL,"Capacitance due to gate-drain charge storage"),
|
OPU("cqgd",MOS9_CQGD, IF_REAL,"Capacitance due to gate-drain charge storage"),
|
||||||
OPU("cqgb",MOS9_CQGB, IF_REAL,"Capacitance due to gate-bulk charge storage"),
|
OPU("cqgb",MOS9_CQGB, IF_REAL,"Capacitance due to gate-bulk charge storage"),
|
||||||
OPU("cqbd",MOS9_CQBD,IF_REAL,"Capacitance due to bulk-drain charge storage"),
|
OPU("cqbd",MOS9_CQBD,IF_REAL,"Capacitance due to bulk-drain charge storage"),
|
||||||
OPU("cqbs",MOS9_CQBS,IF_REAL,"Capacitance due to bulk-source charge storage"),
|
OPU("cqbs",MOS9_CQBS,IF_REAL,"Capacitance due to bulk-source charge storage"),
|
||||||
|
|
||||||
OPU("cbd0",MOS9_CAPZEROBIASBD,IF_REAL,"Zero-Bias B-D junction capacitance"),
|
OPU("cbd0",MOS9_CAPZEROBIASBD,IF_REAL,"Zero-Bias B-D junction capacitance"),
|
||||||
OPU("cbdsw0",MOS9_CAPZEROBIASBDSW,IF_REAL,
|
OPU("cbdsw0",MOS9_CAPZEROBIASBDSW,IF_REAL,
|
||||||
"Zero-Bias B-D sidewall capacitance"),
|
"Zero-Bias B-D sidewall capacitance"),
|
||||||
OPU("cbs0",MOS9_CAPZEROBIASBS,IF_REAL,"Zero-Bias B-S junction capacitance"),
|
OPU("cbs0",MOS9_CAPZEROBIASBS,IF_REAL,"Zero-Bias B-S junction capacitance"),
|
||||||
OPU("cbssw0",MOS9_CAPZEROBIASBSSW,IF_REAL,
|
OPU("cbssw0",MOS9_CAPZEROBIASBSSW,IF_REAL,
|
||||||
"Zero-Bias B-S sidewall capacitance"),
|
"Zero-Bias B-S sidewall capacitance"),
|
||||||
OPU("qbs", MOS9_QBS, IF_REAL, "Bulk-Source charge storage"),
|
OPU("qbs", MOS9_QBS, IF_REAL, "Bulk-Source charge storage"),
|
||||||
OPU("qgs", MOS9_QGS, IF_REAL, "Gate-Source charge storage"),
|
OPU("qgs", MOS9_QGS, IF_REAL, "Gate-Source charge storage"),
|
||||||
OPU("qgd", MOS9_QGD, IF_REAL, "Gate-Drain charge storage"),
|
OPU("qgd", MOS9_QGD, IF_REAL, "Gate-Drain charge storage"),
|
||||||
OPU("qgb", MOS9_QGB, IF_REAL, "Gate-Bulk charge storage"),
|
OPU("qgb", MOS9_QGB, IF_REAL, "Gate-Bulk charge storage"),
|
||||||
OPU("qbd", MOS9_QBD, IF_REAL, "Bulk-Drain charge storage"),
|
OPU("qbd", MOS9_QBD, IF_REAL, "Bulk-Drain charge storage"),
|
||||||
OPU("p", MOS9_POWER, IF_REAL, "Instantaneous power"),
|
OPU("p", MOS9_POWER, IF_REAL, "Instantaneous power"),
|
||||||
OPU("sens_l_dc", MOS9_L_SENS_DC, IF_REAL, "dc sensitivity wrt length"),
|
OPU("sens_l_dc", MOS9_L_SENS_DC, IF_REAL, "dc sensitivity wrt length"),
|
||||||
OPU("sens_l_real",MOS9_L_SENS_REAL, IF_REAL,
|
OPU("sens_l_real",MOS9_L_SENS_REAL, IF_REAL,
|
||||||
"real part of ac sensitivity wrt length"),
|
"real part of ac sensitivity wrt length"),
|
||||||
OPU("sens_l_imag",MOS9_L_SENS_IMAG, IF_REAL,
|
OPU("sens_l_imag",MOS9_L_SENS_IMAG, IF_REAL,
|
||||||
"imag part of ac sensitivity wrt length"),
|
"imag part of ac sensitivity wrt length"),
|
||||||
OPU("sens_l_cplx",MOS9_L_SENS_CPLX, IF_COMPLEX, "ac sensitivity wrt length"),
|
OPU("sens_l_cplx",MOS9_L_SENS_CPLX, IF_COMPLEX, "ac sensitivity wrt length"),
|
||||||
OPU("sens_l_mag", MOS9_L_SENS_MAG, IF_REAL,
|
OPU("sens_l_mag", MOS9_L_SENS_MAG, IF_REAL,
|
||||||
"sensitivity wrt l of ac magnitude"),
|
"sensitivity wrt l of ac magnitude"),
|
||||||
OPU("sens_l_ph", MOS9_L_SENS_PH, IF_REAL, "sensitivity wrt l of ac phase"),
|
OPU("sens_l_ph", MOS9_L_SENS_PH, IF_REAL, "sensitivity wrt l of ac phase"),
|
||||||
OPU("sens_w_dc", MOS9_W_SENS_DC, IF_REAL, "dc sensitivity wrt width"),
|
OPU("sens_w_dc", MOS9_W_SENS_DC, IF_REAL, "dc sensitivity wrt width"),
|
||||||
OPU("sens_w_real",MOS9_W_SENS_REAL, IF_REAL,
|
OPU("sens_w_real",MOS9_W_SENS_REAL, IF_REAL,
|
||||||
"real part of ac sensitivity wrt width"),
|
"real part of ac sensitivity wrt width"),
|
||||||
OPU("sens_w_imag",MOS9_W_SENS_IMAG, IF_REAL,
|
OPU("sens_w_imag",MOS9_W_SENS_IMAG, IF_REAL,
|
||||||
"imag part of ac sensitivity wrt width"),
|
"imag part of ac sensitivity wrt width"),
|
||||||
OPU("sens_w_mag", MOS9_W_SENS_MAG, IF_REAL,
|
OPU("sens_w_mag", MOS9_W_SENS_MAG, IF_REAL,
|
||||||
"sensitivity wrt w of ac magnitude"),
|
"sensitivity wrt w of ac magnitude"),
|
||||||
OPU("sens_w_ph", MOS9_W_SENS_PH, IF_REAL, "sensitivity wrt w of ac phase"),
|
OPU("sens_w_ph", MOS9_W_SENS_PH, IF_REAL, "sensitivity wrt w of ac phase"),
|
||||||
OPU("sens_w_cplx",MOS9_W_SENS_CPLX, IF_COMPLEX, "ac sensitivity wrt width")
|
OPU("sens_w_cplx",MOS9_W_SENS_CPLX, IF_COMPLEX, "ac sensitivity wrt width")
|
||||||
};
|
};
|
||||||
|
|
||||||
IFparm MOS9mPTable[] = { /* model parameters */
|
IFparm MOS9mPTable[] = { /* model parameters */
|
||||||
OP("type", MOS9_MOD_TYPE, IF_STRING ,"N-channel or P-channel MOS"),
|
OP("type", MOS9_MOD_TYPE, IF_STRING ,"N-channel or P-channel MOS"),
|
||||||
IP("nmos", MOS9_MOD_NMOS, IF_FLAG ,"N type MOSfet model"),
|
IP("nmos", MOS9_MOD_NMOS, IF_FLAG ,"N type MOSfet model"),
|
||||||
IP("pmos", MOS9_MOD_PMOS, IF_FLAG ,"P type MOSfet model"),
|
IP("pmos", MOS9_MOD_PMOS, IF_FLAG ,"P type MOSfet model"),
|
||||||
IOP("vto", MOS9_MOD_VTO, IF_REAL ,"Threshold voltage"),
|
IOP("vto", MOS9_MOD_VTO, IF_REAL ,"Threshold voltage"),
|
||||||
IOPR("vt0", MOS9_MOD_VTO, IF_REAL ,"Threshold voltage"),
|
IOPR("vt0", MOS9_MOD_VTO, IF_REAL ,"Threshold voltage"),
|
||||||
IOP("kp", MOS9_MOD_KP, IF_REAL ,"Transconductance parameter"),
|
IOP("kp", MOS9_MOD_KP, IF_REAL ,"Transconductance parameter"),
|
||||||
IOP("gamma", MOS9_MOD_GAMMA, IF_REAL ,"Bulk threshold parameter"),
|
IOP("gamma", MOS9_MOD_GAMMA, IF_REAL ,"Bulk threshold parameter"),
|
||||||
IOP("phi", MOS9_MOD_PHI, IF_REAL ,"Surface potential"),
|
IOP("phi", MOS9_MOD_PHI, IF_REAL ,"Surface potential"),
|
||||||
IOP("rd", MOS9_MOD_RD, IF_REAL ,"Drain ohmic resistance"),
|
IOP("rd", MOS9_MOD_RD, IF_REAL ,"Drain ohmic resistance"),
|
||||||
IOP("rs", MOS9_MOD_RS, IF_REAL ,"Source ohmic resistance"),
|
IOP("rs", MOS9_MOD_RS, IF_REAL ,"Source ohmic resistance"),
|
||||||
IOPA("cbd", MOS9_MOD_CBD, IF_REAL ,"B-D junction capacitance"),
|
IOPA("cbd", MOS9_MOD_CBD, IF_REAL ,"B-D junction capacitance"),
|
||||||
IOPA("cbs", MOS9_MOD_CBS, IF_REAL ,"B-S junction capacitance"),
|
IOPA("cbs", MOS9_MOD_CBS, IF_REAL ,"B-S junction capacitance"),
|
||||||
IOP("is", MOS9_MOD_IS, IF_REAL ,"Bulk junction sat. current"),
|
IOP("is", MOS9_MOD_IS, IF_REAL ,"Bulk junction sat. current"),
|
||||||
IOP("pb", MOS9_MOD_PB, IF_REAL ,"Bulk junction potential"),
|
IOP("pb", MOS9_MOD_PB, IF_REAL ,"Bulk junction potential"),
|
||||||
IOPA("cgso", MOS9_MOD_CGSO, IF_REAL ,"Gate-source overlap cap."),
|
IOPA("cgso", MOS9_MOD_CGSO, IF_REAL ,"Gate-source overlap cap."),
|
||||||
IOPA("cgdo", MOS9_MOD_CGDO, IF_REAL ,"Gate-drain overlap cap."),
|
IOPA("cgdo", MOS9_MOD_CGDO, IF_REAL ,"Gate-drain overlap cap."),
|
||||||
IOPA("cgbo", MOS9_MOD_CGBO, IF_REAL ,"Gate-bulk overlap cap."),
|
IOPA("cgbo", MOS9_MOD_CGBO, IF_REAL ,"Gate-bulk overlap cap."),
|
||||||
IOP("rsh", MOS9_MOD_RSH, IF_REAL ,"Sheet resistance"),
|
IOP("rsh", MOS9_MOD_RSH, IF_REAL ,"Sheet resistance"),
|
||||||
IOPA("cj", MOS9_MOD_CJ, IF_REAL ,"Bottom junction cap per area"),
|
IOPA("cj", MOS9_MOD_CJ, IF_REAL ,"Bottom junction cap per area"),
|
||||||
IOP("mj", MOS9_MOD_MJ, IF_REAL ,"Bottom grading coefficient"),
|
IOP("mj", MOS9_MOD_MJ, IF_REAL ,"Bottom grading coefficient"),
|
||||||
IOPA("cjsw", MOS9_MOD_CJSW, IF_REAL ,"Side junction cap per area"),
|
IOPA("cjsw", MOS9_MOD_CJSW, IF_REAL ,"Side junction cap per area"),
|
||||||
IOP("mjsw", MOS9_MOD_MJSW, IF_REAL ,"Side grading coefficient"),
|
IOP("mjsw", MOS9_MOD_MJSW, IF_REAL ,"Side grading coefficient"),
|
||||||
IOPU("js", MOS9_MOD_JS, IF_REAL ,"Bulk jct. sat. current density"),
|
IOPU("js", MOS9_MOD_JS, IF_REAL ,"Bulk jct. sat. current density"),
|
||||||
IOP("tox", MOS9_MOD_TOX, IF_REAL ,"Oxide thickness"),
|
IOP("tox", MOS9_MOD_TOX, IF_REAL ,"Oxide thickness"),
|
||||||
IOP("ld", MOS9_MOD_LD, IF_REAL ,"Lateral diffusion"),
|
IOP("ld", MOS9_MOD_LD, IF_REAL ,"Lateral diffusion"),
|
||||||
IOP("xl", MOS9_MOD_XL, IF_REAL ,"Length mask adjustment"),
|
IOP("xl", MOS9_MOD_XL, IF_REAL ,"Length mask adjustment"),
|
||||||
IOP("wd", MOS9_MOD_WD, IF_REAL ,"Width Narrowing (Diffusion)"),
|
IOP("wd", MOS9_MOD_WD, IF_REAL ,"Width Narrowing (Diffusion)"),
|
||||||
IOP("xw", MOS9_MOD_XW, IF_REAL ,"Width mask adjustment"),
|
IOP("xw", MOS9_MOD_XW, IF_REAL ,"Width mask adjustment"),
|
||||||
IOPU("delvto", MOS9_MOD_DELVTO, IF_REAL ,"Threshold voltage Adjust"),
|
IOPU("delvto", MOS9_MOD_DELVTO, IF_REAL ,"Threshold voltage Adjust"),
|
||||||
IOPR("delvt0", MOS9_MOD_DELVTO, IF_REAL ,"Threshold voltage Adjust"),
|
IOPR("delvt0", MOS9_MOD_DELVTO, IF_REAL ,"Threshold voltage Adjust"),
|
||||||
IOP("u0", MOS9_MOD_U0, IF_REAL ,"Surface mobility"),
|
IOP("u0", MOS9_MOD_U0, IF_REAL ,"Surface mobility"),
|
||||||
IOPR("uo", MOS9_MOD_U0, IF_REAL ,"Surface mobility"),
|
IOPR("uo", MOS9_MOD_U0, IF_REAL ,"Surface mobility"),
|
||||||
IOP("fc", MOS9_MOD_FC, IF_REAL ,"Forward bias jct. fit parm."),
|
IOP("fc", MOS9_MOD_FC, IF_REAL ,"Forward bias jct. fit parm."),
|
||||||
IOP("nsub", MOS9_MOD_NSUB, IF_REAL ,"Substrate doping"),
|
IOP("nsub", MOS9_MOD_NSUB, IF_REAL ,"Substrate doping"),
|
||||||
IOP("tpg", MOS9_MOD_TPG, IF_INTEGER,"Gate type"),
|
IOP("tpg", MOS9_MOD_TPG, IF_INTEGER,"Gate type"),
|
||||||
IOP("nss", MOS9_MOD_NSS, IF_REAL ,"Surface state density"),
|
IOP("nss", MOS9_MOD_NSS, IF_REAL ,"Surface state density"),
|
||||||
IOP("vmax", MOS9_MOD_VMAX, IF_REAL ,"Maximum carrier drift velocity"),
|
IOP("vmax", MOS9_MOD_VMAX, IF_REAL ,"Maximum carrier drift velocity"),
|
||||||
IOP("xj", MOS9_MOD_XJ, IF_REAL ,"Junction depth"),
|
IOP("xj", MOS9_MOD_XJ, IF_REAL ,"Junction depth"),
|
||||||
IOP("nfs", MOS9_MOD_NFS, IF_REAL ,"Fast surface state density"),
|
IOP("nfs", MOS9_MOD_NFS, IF_REAL ,"Fast surface state density"),
|
||||||
IOP("xd", MOS9_MOD_XD, IF_REAL ,"Depletion layer width"),
|
IOP("xd", MOS9_MOD_XD, IF_REAL ,"Depletion layer width"),
|
||||||
IOP("alpha", MOS9_MOD_ALPHA, IF_REAL ,"Alpha"),
|
IOP("alpha", MOS9_MOD_ALPHA, IF_REAL ,"Alpha"),
|
||||||
IOP("eta", MOS9_MOD_ETA, IF_REAL ,"Vds dependence of threshold voltage"),
|
IOP("eta", MOS9_MOD_ETA, IF_REAL ,"Vds dependence of threshold voltage"),
|
||||||
IOP("delta", MOS9_MOD_DELTA, IF_REAL ,"Width effect on threshold"),
|
IOP("delta", MOS9_MOD_DELTA, IF_REAL ,"Width effect on threshold"),
|
||||||
IOPR("input_delta", MOS9_DELTA, IF_REAL ,""),
|
IOPR("input_delta", MOS9_DELTA, IF_REAL ,""),
|
||||||
IOP("theta", MOS9_MOD_THETA, IF_REAL ,"Vgs dependence on mobility"),
|
IOP("theta", MOS9_MOD_THETA, IF_REAL ,"Vgs dependence on mobility"),
|
||||||
IOP("kappa", MOS9_MOD_KAPPA, IF_REAL ,"Kappa"),
|
IOP("kappa", MOS9_MOD_KAPPA, IF_REAL ,"Kappa"),
|
||||||
IOPU("tnom", MOS9_MOD_TNOM, IF_REAL ,"Parameter measurement temperature"),
|
IOPU("tnom", MOS9_MOD_TNOM, IF_REAL ,"Parameter measurement temperature"),
|
||||||
IOP("kf", MOS9_MOD_KF, IF_REAL ,"Flicker noise coefficient"),
|
IOP("kf", MOS9_MOD_KF, IF_REAL ,"Flicker noise coefficient"),
|
||||||
IOP("af", MOS9_MOD_AF, IF_REAL ,"Flicker noise exponent")
|
IOP("af", MOS9_MOD_AF, IF_REAL ,"Flicker noise exponent")
|
||||||
};
|
};
|
||||||
|
|
||||||
char *MOS9names[] = {
|
char *MOS9names[] = {
|
||||||
"Drain",
|
"Drain",
|
||||||
"Gate",
|
"Gate",
|
||||||
"Source",
|
"Source",
|
||||||
"Bulk"
|
"Bulk"
|
||||||
};
|
};
|
||||||
|
|
||||||
int MOS9nSize = NUMELEMS(MOS9names);
|
int MOS9nSize = NUMELEMS(MOS9names);
|
||||||
int MOS9pTSize = NUMELEMS(MOS9pTable);
|
int MOS9pTSize = NUMELEMS(MOS9pTable);
|
||||||
int MOS9mPTSize = NUMELEMS(MOS9mPTable);
|
int MOS9mPTSize = NUMELEMS(MOS9mPTable);
|
||||||
int MOS9iSize = sizeof(MOS9instance);
|
int MOS9iSize = sizeof(MOS9instance);
|
||||||
int MOS9mSize = sizeof(MOS9model);
|
int MOS9mSize = sizeof(MOS9model);
|
||||||
|
|
|
||||||
|
|
@ -1,128 +1,128 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ngspice.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "cktdefs.h"
|
|
||||||
#include "mos9defs.h"
|
|
||||||
#include "sperror.h"
|
|
||||||
#include "suffix.h"
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
MOS9acLoad(inModel,ckt)
|
|
||||||
GENmodel *inModel;
|
|
||||||
CKTcircuit *ckt;
|
|
||||||
{
|
|
||||||
MOS9model *model = (MOS9model *)inModel;
|
|
||||||
MOS9instance *here;
|
|
||||||
int xnrm;
|
|
||||||
int xrev;
|
|
||||||
double EffectiveLength;
|
|
||||||
double EffectiveWidth;
|
|
||||||
double xgs;
|
|
||||||
double xgd;
|
|
||||||
double xgb;
|
|
||||||
double xbd;
|
|
||||||
double xbs;
|
|
||||||
double capgs;
|
|
||||||
double capgd;
|
|
||||||
double capgb;
|
|
||||||
double GateBulkOverlapCap;
|
|
||||||
double GateDrainOverlapCap;
|
|
||||||
double GateSourceOverlapCap;
|
|
||||||
|
|
||||||
for( ; model != NULL; model = model->MOS9nextModel) {
|
|
||||||
for(here = model->MOS9instances; here!= NULL;
|
|
||||||
here = here->MOS9nextInstance) {
|
|
||||||
|
|
||||||
if (here->MOS9mode < 0) {
|
|
||||||
xnrm=0;
|
|
||||||
xrev=1;
|
|
||||||
} else {
|
|
||||||
xnrm=1;
|
|
||||||
xrev=0;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* charge oriented model parameters
|
|
||||||
*/
|
|
||||||
EffectiveWidth=here->MOS9w-2*model->MOS9widthNarrow+
|
|
||||||
model->MOS9widthAdjust;
|
|
||||||
EffectiveLength=here->MOS9l - 2*model->MOS9latDiff+
|
|
||||||
model->MOS9lengthAdjust;
|
|
||||||
GateSourceOverlapCap = model->MOS9gateSourceOverlapCapFactor *
|
|
||||||
here->MOS9m * EffectiveWidth;
|
|
||||||
GateDrainOverlapCap = model->MOS9gateDrainOverlapCapFactor *
|
|
||||||
here->MOS9m * EffectiveWidth;
|
|
||||||
GateBulkOverlapCap = model->MOS9gateBulkOverlapCapFactor *
|
|
||||||
here->MOS9m * EffectiveLength;
|
|
||||||
|
|
||||||
|
#include "ngspice.h"
|
||||||
/*
|
#include <stdio.h>
|
||||||
* meyer"s model parameters
|
#include "cktdefs.h"
|
||||||
*/
|
#include "mos9defs.h"
|
||||||
capgs = ( *(ckt->CKTstate0+here->MOS9capgs)+
|
#include "sperror.h"
|
||||||
*(ckt->CKTstate0+here->MOS9capgs) +
|
#include "suffix.h"
|
||||||
GateSourceOverlapCap );
|
|
||||||
capgd = ( *(ckt->CKTstate0+here->MOS9capgd)+
|
|
||||||
*(ckt->CKTstate0+here->MOS9capgd) +
|
int
|
||||||
GateDrainOverlapCap );
|
MOS9acLoad(inModel,ckt)
|
||||||
capgb = ( *(ckt->CKTstate0+here->MOS9capgb)+
|
GENmodel *inModel;
|
||||||
*(ckt->CKTstate0+here->MOS9capgb) +
|
CKTcircuit *ckt;
|
||||||
GateBulkOverlapCap );
|
{
|
||||||
xgs = capgs * ckt->CKTomega;
|
MOS9model *model = (MOS9model *)inModel;
|
||||||
xgd = capgd * ckt->CKTomega;
|
MOS9instance *here;
|
||||||
xgb = capgb * ckt->CKTomega;
|
int xnrm;
|
||||||
xbd = here->MOS9capbd * ckt->CKTomega;
|
int xrev;
|
||||||
xbs = here->MOS9capbs * ckt->CKTomega;
|
double EffectiveLength;
|
||||||
|
double EffectiveWidth;
|
||||||
/*
|
double xgs;
|
||||||
* load matrix
|
double xgd;
|
||||||
*/
|
double xgb;
|
||||||
|
double xbd;
|
||||||
*(here->MOS9GgPtr +1) += xgd+xgs+xgb;
|
double xbs;
|
||||||
*(here->MOS9BbPtr +1) += xgb+xbd+xbs;
|
double capgs;
|
||||||
*(here->MOS9DPdpPtr +1) += xgd+xbd;
|
double capgd;
|
||||||
*(here->MOS9SPspPtr +1) += xgs+xbs;
|
double capgb;
|
||||||
*(here->MOS9GbPtr +1) -= xgb;
|
double GateBulkOverlapCap;
|
||||||
*(here->MOS9GdpPtr +1) -= xgd;
|
double GateDrainOverlapCap;
|
||||||
*(here->MOS9GspPtr +1) -= xgs;
|
double GateSourceOverlapCap;
|
||||||
*(here->MOS9BgPtr +1) -= xgb;
|
|
||||||
*(here->MOS9BdpPtr +1) -= xbd;
|
for( ; model != NULL; model = model->MOS9nextModel) {
|
||||||
*(here->MOS9BspPtr +1) -= xbs;
|
for(here = model->MOS9instances; here!= NULL;
|
||||||
*(here->MOS9DPgPtr +1) -= xgd;
|
here = here->MOS9nextInstance) {
|
||||||
*(here->MOS9DPbPtr +1) -= xbd;
|
|
||||||
*(here->MOS9SPgPtr +1) -= xgs;
|
if (here->MOS9mode < 0) {
|
||||||
*(here->MOS9SPbPtr +1) -= xbs;
|
xnrm=0;
|
||||||
*(here->MOS9DdPtr) += here->MOS9drainConductance;
|
xrev=1;
|
||||||
*(here->MOS9SsPtr) += here->MOS9sourceConductance;
|
} else {
|
||||||
*(here->MOS9BbPtr) += here->MOS9gbd+here->MOS9gbs;
|
xnrm=1;
|
||||||
*(here->MOS9DPdpPtr) += here->MOS9drainConductance+
|
xrev=0;
|
||||||
here->MOS9gds+here->MOS9gbd+
|
}
|
||||||
xrev*(here->MOS9gm+here->MOS9gmbs);
|
/*
|
||||||
*(here->MOS9SPspPtr) += here->MOS9sourceConductance+
|
* charge oriented model parameters
|
||||||
here->MOS9gds+here->MOS9gbs+
|
*/
|
||||||
xnrm*(here->MOS9gm+here->MOS9gmbs);
|
EffectiveWidth=here->MOS9w-2*model->MOS9widthNarrow+
|
||||||
*(here->MOS9DdpPtr) -= here->MOS9drainConductance;
|
model->MOS9widthAdjust;
|
||||||
*(here->MOS9SspPtr) -= here->MOS9sourceConductance;
|
EffectiveLength=here->MOS9l - 2*model->MOS9latDiff+
|
||||||
*(here->MOS9BdpPtr) -= here->MOS9gbd;
|
model->MOS9lengthAdjust;
|
||||||
*(here->MOS9BspPtr) -= here->MOS9gbs;
|
GateSourceOverlapCap = model->MOS9gateSourceOverlapCapFactor *
|
||||||
*(here->MOS9DPdPtr) -= here->MOS9drainConductance;
|
here->MOS9m * EffectiveWidth;
|
||||||
*(here->MOS9DPgPtr) += (xnrm-xrev)*here->MOS9gm;
|
GateDrainOverlapCap = model->MOS9gateDrainOverlapCapFactor *
|
||||||
*(here->MOS9DPbPtr) += -here->MOS9gbd+(xnrm-xrev)*here->MOS9gmbs;
|
here->MOS9m * EffectiveWidth;
|
||||||
*(here->MOS9DPspPtr) -= here->MOS9gds+
|
GateBulkOverlapCap = model->MOS9gateBulkOverlapCapFactor *
|
||||||
xnrm*(here->MOS9gm+here->MOS9gmbs);
|
here->MOS9m * EffectiveLength;
|
||||||
*(here->MOS9SPgPtr) -= (xnrm-xrev)*here->MOS9gm;
|
|
||||||
*(here->MOS9SPsPtr) -= here->MOS9sourceConductance;
|
|
||||||
*(here->MOS9SPbPtr) -= here->MOS9gbs+(xnrm-xrev)*here->MOS9gmbs;
|
/*
|
||||||
*(here->MOS9SPdpPtr) -= here->MOS9gds+
|
* meyer"s model parameters
|
||||||
xrev*(here->MOS9gm+here->MOS9gmbs);
|
*/
|
||||||
}
|
capgs = ( *(ckt->CKTstate0+here->MOS9capgs)+
|
||||||
}
|
*(ckt->CKTstate0+here->MOS9capgs) +
|
||||||
return(OK);
|
GateSourceOverlapCap );
|
||||||
}
|
capgd = ( *(ckt->CKTstate0+here->MOS9capgd)+
|
||||||
|
*(ckt->CKTstate0+here->MOS9capgd) +
|
||||||
|
GateDrainOverlapCap );
|
||||||
|
capgb = ( *(ckt->CKTstate0+here->MOS9capgb)+
|
||||||
|
*(ckt->CKTstate0+here->MOS9capgb) +
|
||||||
|
GateBulkOverlapCap );
|
||||||
|
xgs = capgs * ckt->CKTomega;
|
||||||
|
xgd = capgd * ckt->CKTomega;
|
||||||
|
xgb = capgb * ckt->CKTomega;
|
||||||
|
xbd = here->MOS9capbd * ckt->CKTomega;
|
||||||
|
xbs = here->MOS9capbs * ckt->CKTomega;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* load matrix
|
||||||
|
*/
|
||||||
|
|
||||||
|
*(here->MOS9GgPtr +1) += xgd+xgs+xgb;
|
||||||
|
*(here->MOS9BbPtr +1) += xgb+xbd+xbs;
|
||||||
|
*(here->MOS9DPdpPtr +1) += xgd+xbd;
|
||||||
|
*(here->MOS9SPspPtr +1) += xgs+xbs;
|
||||||
|
*(here->MOS9GbPtr +1) -= xgb;
|
||||||
|
*(here->MOS9GdpPtr +1) -= xgd;
|
||||||
|
*(here->MOS9GspPtr +1) -= xgs;
|
||||||
|
*(here->MOS9BgPtr +1) -= xgb;
|
||||||
|
*(here->MOS9BdpPtr +1) -= xbd;
|
||||||
|
*(here->MOS9BspPtr +1) -= xbs;
|
||||||
|
*(here->MOS9DPgPtr +1) -= xgd;
|
||||||
|
*(here->MOS9DPbPtr +1) -= xbd;
|
||||||
|
*(here->MOS9SPgPtr +1) -= xgs;
|
||||||
|
*(here->MOS9SPbPtr +1) -= xbs;
|
||||||
|
*(here->MOS9DdPtr) += here->MOS9drainConductance;
|
||||||
|
*(here->MOS9SsPtr) += here->MOS9sourceConductance;
|
||||||
|
*(here->MOS9BbPtr) += here->MOS9gbd+here->MOS9gbs;
|
||||||
|
*(here->MOS9DPdpPtr) += here->MOS9drainConductance+
|
||||||
|
here->MOS9gds+here->MOS9gbd+
|
||||||
|
xrev*(here->MOS9gm+here->MOS9gmbs);
|
||||||
|
*(here->MOS9SPspPtr) += here->MOS9sourceConductance+
|
||||||
|
here->MOS9gds+here->MOS9gbs+
|
||||||
|
xnrm*(here->MOS9gm+here->MOS9gmbs);
|
||||||
|
*(here->MOS9DdpPtr) -= here->MOS9drainConductance;
|
||||||
|
*(here->MOS9SspPtr) -= here->MOS9sourceConductance;
|
||||||
|
*(here->MOS9BdpPtr) -= here->MOS9gbd;
|
||||||
|
*(here->MOS9BspPtr) -= here->MOS9gbs;
|
||||||
|
*(here->MOS9DPdPtr) -= here->MOS9drainConductance;
|
||||||
|
*(here->MOS9DPgPtr) += (xnrm-xrev)*here->MOS9gm;
|
||||||
|
*(here->MOS9DPbPtr) += -here->MOS9gbd+(xnrm-xrev)*here->MOS9gmbs;
|
||||||
|
*(here->MOS9DPspPtr) -= here->MOS9gds+
|
||||||
|
xnrm*(here->MOS9gm+here->MOS9gmbs);
|
||||||
|
*(here->MOS9SPgPtr) -= (xnrm-xrev)*here->MOS9gm;
|
||||||
|
*(here->MOS9SPsPtr) -= here->MOS9sourceConductance;
|
||||||
|
*(here->MOS9SPbPtr) -= here->MOS9gbs+(xnrm-xrev)*here->MOS9gmbs;
|
||||||
|
*(here->MOS9SPdpPtr) -= here->MOS9gds+
|
||||||
|
xrev*(here->MOS9gm+here->MOS9gmbs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(OK);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,444 +1,444 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1987 Mathew Lew and Thomas L. Quarles
|
Author: 1987 Mathew Lew and Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "ifsim.h"
|
#include "ifsim.h"
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "devdefs.h"
|
#include "devdefs.h"
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
int
|
int
|
||||||
MOS9ask(ckt,inst,which,value,select)
|
MOS9ask(ckt,inst,which,value,select)
|
||||||
CKTcircuit *ckt;
|
CKTcircuit *ckt;
|
||||||
GENinstance *inst;
|
GENinstance *inst;
|
||||||
int which;
|
int which;
|
||||||
IFvalue *value;
|
IFvalue *value;
|
||||||
IFvalue *select;
|
IFvalue *select;
|
||||||
{
|
{
|
||||||
MOS9instance *here = (MOS9instance *)inst;
|
MOS9instance *here = (MOS9instance *)inst;
|
||||||
double vr;
|
double vr;
|
||||||
double vi;
|
double vi;
|
||||||
double sr;
|
double sr;
|
||||||
double si;
|
double si;
|
||||||
double vm;
|
double vm;
|
||||||
static char *msg = "Current and power not available for ac analysis";
|
static char *msg = "Current and power not available for ac analysis";
|
||||||
switch(which) {
|
switch(which) {
|
||||||
case MOS9_TEMP:
|
case MOS9_TEMP:
|
||||||
value->rValue = here->MOS9temp-CONSTCtoK;
|
value->rValue = here->MOS9temp-CONSTCtoK;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CGS:
|
case MOS9_CGS:
|
||||||
value->rValue = 2* *(ckt->CKTstate0 + here->MOS9capgs);
|
value->rValue = 2* *(ckt->CKTstate0 + here->MOS9capgs);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CGD:
|
case MOS9_CGD:
|
||||||
value->rValue = 2* *(ckt->CKTstate0 + here->MOS9capgd);
|
value->rValue = 2* *(ckt->CKTstate0 + here->MOS9capgd);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_M:
|
case MOS9_M:
|
||||||
value->rValue = here->MOS9m;
|
value->rValue = here->MOS9m;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_L:
|
case MOS9_L:
|
||||||
value->rValue = here->MOS9l;
|
value->rValue = here->MOS9l;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_W:
|
case MOS9_W:
|
||||||
value->rValue = here->MOS9w;
|
value->rValue = here->MOS9w;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_AS:
|
case MOS9_AS:
|
||||||
value->rValue = here->MOS9sourceArea;
|
value->rValue = here->MOS9sourceArea;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_AD:
|
case MOS9_AD:
|
||||||
value->rValue = here->MOS9drainArea;
|
value->rValue = here->MOS9drainArea;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_PS:
|
case MOS9_PS:
|
||||||
value->rValue = here->MOS9sourcePerimiter;
|
value->rValue = here->MOS9sourcePerimiter;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_PD:
|
case MOS9_PD:
|
||||||
value->rValue = here->MOS9drainPerimiter;
|
value->rValue = here->MOS9drainPerimiter;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_NRS:
|
case MOS9_NRS:
|
||||||
value->rValue = here->MOS9sourceSquares;
|
value->rValue = here->MOS9sourceSquares;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_NRD:
|
case MOS9_NRD:
|
||||||
value->rValue = here->MOS9drainSquares;
|
value->rValue = here->MOS9drainSquares;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_OFF:
|
case MOS9_OFF:
|
||||||
value->rValue = here->MOS9off;
|
value->rValue = here->MOS9off;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_IC_VBS:
|
case MOS9_IC_VBS:
|
||||||
value->rValue = here->MOS9icVBS;
|
value->rValue = here->MOS9icVBS;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_IC_VDS:
|
case MOS9_IC_VDS:
|
||||||
value->rValue = here->MOS9icVDS;
|
value->rValue = here->MOS9icVDS;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_IC_VGS:
|
case MOS9_IC_VGS:
|
||||||
value->rValue = here->MOS9icVGS;
|
value->rValue = here->MOS9icVGS;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_DNODE:
|
case MOS9_DNODE:
|
||||||
value->iValue = here->MOS9dNode;
|
value->iValue = here->MOS9dNode;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_GNODE:
|
case MOS9_GNODE:
|
||||||
value->iValue = here->MOS9gNode;
|
value->iValue = here->MOS9gNode;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_SNODE:
|
case MOS9_SNODE:
|
||||||
value->iValue = here->MOS9sNode;
|
value->iValue = here->MOS9sNode;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_BNODE:
|
case MOS9_BNODE:
|
||||||
value->iValue = here->MOS9bNode;
|
value->iValue = here->MOS9bNode;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_DNODEPRIME:
|
case MOS9_DNODEPRIME:
|
||||||
value->iValue = here->MOS9dNodePrime;
|
value->iValue = here->MOS9dNodePrime;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_SNODEPRIME:
|
case MOS9_SNODEPRIME:
|
||||||
value->iValue = here->MOS9sNodePrime;
|
value->iValue = here->MOS9sNodePrime;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_SOURCECONDUCT:
|
case MOS9_SOURCECONDUCT:
|
||||||
value->rValue = here->MOS9sourceConductance;
|
value->rValue = here->MOS9sourceConductance;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_DRAINCONDUCT:
|
case MOS9_DRAINCONDUCT:
|
||||||
value->rValue = here->MOS9drainConductance;
|
value->rValue = here->MOS9drainConductance;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_SOURCERESIST:
|
case MOS9_SOURCERESIST:
|
||||||
if (here->MOS9sNodePrime != here->MOS9sNode)
|
if (here->MOS9sNodePrime != here->MOS9sNode)
|
||||||
value->rValue = 1.0 / here->MOS9sourceConductance;
|
value->rValue = 1.0 / here->MOS9sourceConductance;
|
||||||
else
|
else
|
||||||
value->rValue = 0.0;
|
value->rValue = 0.0;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_DRAINRESIST:
|
case MOS9_DRAINRESIST:
|
||||||
if (here->MOS9dNodePrime != here->MOS9dNode)
|
if (here->MOS9dNodePrime != here->MOS9dNode)
|
||||||
value->rValue = 1.0 / here->MOS9drainConductance;
|
value->rValue = 1.0 / here->MOS9drainConductance;
|
||||||
else
|
else
|
||||||
value->rValue = 0.0;
|
value->rValue = 0.0;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_VON:
|
case MOS9_VON:
|
||||||
value->rValue = here->MOS9von;
|
value->rValue = here->MOS9von;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_VDSAT:
|
case MOS9_VDSAT:
|
||||||
value->rValue = here->MOS9vdsat;
|
value->rValue = here->MOS9vdsat;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_SOURCEVCRIT:
|
case MOS9_SOURCEVCRIT:
|
||||||
value->rValue = here->MOS9sourceVcrit;
|
value->rValue = here->MOS9sourceVcrit;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_DRAINVCRIT:
|
case MOS9_DRAINVCRIT:
|
||||||
value->rValue = here->MOS9drainVcrit;
|
value->rValue = here->MOS9drainVcrit;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CD:
|
case MOS9_CD:
|
||||||
value->rValue = here->MOS9cd;
|
value->rValue = here->MOS9cd;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CBS:
|
case MOS9_CBS:
|
||||||
value->rValue = here->MOS9cbs;
|
value->rValue = here->MOS9cbs;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CBD:
|
case MOS9_CBD:
|
||||||
value->rValue = here->MOS9cbd;
|
value->rValue = here->MOS9cbd;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_GMBS:
|
case MOS9_GMBS:
|
||||||
value->rValue = here->MOS9gmbs;
|
value->rValue = here->MOS9gmbs;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_GM:
|
case MOS9_GM:
|
||||||
value->rValue = here->MOS9gm;
|
value->rValue = here->MOS9gm;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_GDS:
|
case MOS9_GDS:
|
||||||
value->rValue = here->MOS9gds;
|
value->rValue = here->MOS9gds;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_GBD:
|
case MOS9_GBD:
|
||||||
value->rValue = here->MOS9gbd;
|
value->rValue = here->MOS9gbd;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_GBS:
|
case MOS9_GBS:
|
||||||
value->rValue = here->MOS9gbs;
|
value->rValue = here->MOS9gbs;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CAPBD:
|
case MOS9_CAPBD:
|
||||||
value->rValue = here->MOS9capbd;
|
value->rValue = here->MOS9capbd;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CAPBS:
|
case MOS9_CAPBS:
|
||||||
value->rValue = here->MOS9capbs;
|
value->rValue = here->MOS9capbs;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CAPZEROBIASBD:
|
case MOS9_CAPZEROBIASBD:
|
||||||
value->rValue = here->MOS9Cbd;
|
value->rValue = here->MOS9Cbd;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CAPZEROBIASBDSW:
|
case MOS9_CAPZEROBIASBDSW:
|
||||||
value->rValue = here->MOS9Cbdsw;
|
value->rValue = here->MOS9Cbdsw;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CAPZEROBIASBS:
|
case MOS9_CAPZEROBIASBS:
|
||||||
value->rValue = here->MOS9Cbs;
|
value->rValue = here->MOS9Cbs;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CAPZEROBIASBSSW:
|
case MOS9_CAPZEROBIASBSSW:
|
||||||
value->rValue = here->MOS9Cbssw;
|
value->rValue = here->MOS9Cbssw;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_VBD:
|
case MOS9_VBD:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9vbd);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9vbd);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_VBS:
|
case MOS9_VBS:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9vbs);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9vbs);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_VGS:
|
case MOS9_VGS:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9vgs);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9vgs);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_VDS:
|
case MOS9_VDS:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9vds);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9vds);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CAPGS:
|
case MOS9_CAPGS:
|
||||||
value->rValue = 2* *(ckt->CKTstate0 + here->MOS9capgs);
|
value->rValue = 2* *(ckt->CKTstate0 + here->MOS9capgs);
|
||||||
/* add overlap capacitance */
|
/* add overlap capacitance */
|
||||||
value->rValue += (here->MOS9modPtr->MOS9gateSourceOverlapCapFactor)
|
value->rValue += (here->MOS9modPtr->MOS9gateSourceOverlapCapFactor)
|
||||||
* here->MOS9m
|
* here->MOS9m
|
||||||
* (here->MOS9w
|
* (here->MOS9w
|
||||||
+here->MOS9modPtr->MOS9widthAdjust
|
+here->MOS9modPtr->MOS9widthAdjust
|
||||||
-2*(here->MOS9modPtr->MOS9widthNarrow));
|
-2*(here->MOS9modPtr->MOS9widthNarrow));
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_QGS:
|
case MOS9_QGS:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9qgs);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9qgs);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CQGS:
|
case MOS9_CQGS:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9cqgs);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9cqgs);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CAPGD:
|
case MOS9_CAPGD:
|
||||||
value->rValue = 2* *(ckt->CKTstate0 + here->MOS9capgd);
|
value->rValue = 2* *(ckt->CKTstate0 + here->MOS9capgd);
|
||||||
/* add overlap capacitance */
|
/* add overlap capacitance */
|
||||||
value->rValue += (here->MOS9modPtr->MOS9gateDrainOverlapCapFactor)
|
value->rValue += (here->MOS9modPtr->MOS9gateDrainOverlapCapFactor)
|
||||||
* here->MOS9m
|
* here->MOS9m
|
||||||
* (here->MOS9w
|
* (here->MOS9w
|
||||||
+here->MOS9modPtr->MOS9widthAdjust
|
+here->MOS9modPtr->MOS9widthAdjust
|
||||||
-2*(here->MOS9modPtr->MOS9widthNarrow));
|
-2*(here->MOS9modPtr->MOS9widthNarrow));
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_QGD:
|
case MOS9_QGD:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9qgd);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9qgd);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CQGD:
|
case MOS9_CQGD:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9cqgd);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9cqgd);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CAPGB:
|
case MOS9_CAPGB:
|
||||||
value->rValue = 2* *(ckt->CKTstate0 + here->MOS9capgb);
|
value->rValue = 2* *(ckt->CKTstate0 + here->MOS9capgb);
|
||||||
/* add overlap capacitance */
|
/* add overlap capacitance */
|
||||||
value->rValue += (here->MOS9modPtr->MOS9gateBulkOverlapCapFactor)
|
value->rValue += (here->MOS9modPtr->MOS9gateBulkOverlapCapFactor)
|
||||||
* here->MOS9m
|
* here->MOS9m
|
||||||
* (here->MOS9l
|
* (here->MOS9l
|
||||||
+here->MOS9modPtr->MOS9lengthAdjust
|
+here->MOS9modPtr->MOS9lengthAdjust
|
||||||
-2*(here->MOS9modPtr->MOS9latDiff));
|
-2*(here->MOS9modPtr->MOS9latDiff));
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_QGB:
|
case MOS9_QGB:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9qgb);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9qgb);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CQGB:
|
case MOS9_CQGB:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9cqgb);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9cqgb);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_QBD:
|
case MOS9_QBD:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9qbd);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9qbd);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CQBD:
|
case MOS9_CQBD:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9cqbd);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9cqbd);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_QBS:
|
case MOS9_QBS:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9qbs);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9qbs);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CQBS:
|
case MOS9_CQBS:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9cqbs);
|
value->rValue = *(ckt->CKTstate0 + here->MOS9cqbs);
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_L_SENS_DC:
|
case MOS9_L_SENS_DC:
|
||||||
if(ckt->CKTsenInfo){
|
if(ckt->CKTsenInfo){
|
||||||
value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
|
value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
|
||||||
here->MOS9senParmNo);
|
here->MOS9senParmNo);
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_L_SENS_REAL:
|
case MOS9_L_SENS_REAL:
|
||||||
if(ckt->CKTsenInfo){
|
if(ckt->CKTsenInfo){
|
||||||
value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo);
|
here->MOS9senParmNo);
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_L_SENS_IMAG:
|
case MOS9_L_SENS_IMAG:
|
||||||
if(ckt->CKTsenInfo){
|
if(ckt->CKTsenInfo){
|
||||||
value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo);
|
here->MOS9senParmNo);
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_L_SENS_MAG:
|
case MOS9_L_SENS_MAG:
|
||||||
if(ckt->CKTsenInfo){
|
if(ckt->CKTsenInfo){
|
||||||
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
||||||
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
||||||
vm = sqrt(vr*vr + vi*vi);
|
vm = sqrt(vr*vr + vi*vi);
|
||||||
if(vm == 0){
|
if(vm == 0){
|
||||||
value->rValue = 0;
|
value->rValue = 0;
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo);
|
here->MOS9senParmNo);
|
||||||
si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo);
|
here->MOS9senParmNo);
|
||||||
value->rValue = (vr * sr + vi * si)/vm;
|
value->rValue = (vr * sr + vi * si)/vm;
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_L_SENS_PH:
|
case MOS9_L_SENS_PH:
|
||||||
if(ckt->CKTsenInfo){
|
if(ckt->CKTsenInfo){
|
||||||
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
||||||
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
||||||
vm = vr*vr + vi*vi;
|
vm = vr*vr + vi*vi;
|
||||||
if(vm == 0){
|
if(vm == 0){
|
||||||
value->rValue = 0;
|
value->rValue = 0;
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo);
|
here->MOS9senParmNo);
|
||||||
si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo);
|
here->MOS9senParmNo);
|
||||||
value->rValue = (vr * si - vi * sr)/vm;
|
value->rValue = (vr * si - vi * sr)/vm;
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_L_SENS_CPLX:
|
case MOS9_L_SENS_CPLX:
|
||||||
if(ckt->CKTsenInfo){
|
if(ckt->CKTsenInfo){
|
||||||
value->cValue.real=
|
value->cValue.real=
|
||||||
*(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
*(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo);
|
here->MOS9senParmNo);
|
||||||
value->cValue.imag=
|
value->cValue.imag=
|
||||||
*(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
*(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo);
|
here->MOS9senParmNo);
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_W_SENS_DC:
|
case MOS9_W_SENS_DC:
|
||||||
if(ckt->CKTsenInfo){
|
if(ckt->CKTsenInfo){
|
||||||
value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
|
value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
|
||||||
here->MOS9senParmNo + here->MOS9sens_l);
|
here->MOS9senParmNo + here->MOS9sens_l);
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_W_SENS_REAL:
|
case MOS9_W_SENS_REAL:
|
||||||
if(ckt->CKTsenInfo){
|
if(ckt->CKTsenInfo){
|
||||||
value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo + here->MOS9sens_l);
|
here->MOS9senParmNo + here->MOS9sens_l);
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_W_SENS_IMAG:
|
case MOS9_W_SENS_IMAG:
|
||||||
if(ckt->CKTsenInfo){
|
if(ckt->CKTsenInfo){
|
||||||
value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo + here->MOS9sens_l);
|
here->MOS9senParmNo + here->MOS9sens_l);
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_W_SENS_MAG:
|
case MOS9_W_SENS_MAG:
|
||||||
if(ckt->CKTsenInfo){
|
if(ckt->CKTsenInfo){
|
||||||
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
||||||
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
||||||
vm = sqrt(vr*vr + vi*vi);
|
vm = sqrt(vr*vr + vi*vi);
|
||||||
if(vm == 0){
|
if(vm == 0){
|
||||||
value->rValue = 0;
|
value->rValue = 0;
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo + here->MOS9sens_l);
|
here->MOS9senParmNo + here->MOS9sens_l);
|
||||||
si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo + here->MOS9sens_l);
|
here->MOS9senParmNo + here->MOS9sens_l);
|
||||||
value->rValue = (vr * sr + vi * si)/vm;
|
value->rValue = (vr * sr + vi * si)/vm;
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_W_SENS_PH:
|
case MOS9_W_SENS_PH:
|
||||||
if(ckt->CKTsenInfo){
|
if(ckt->CKTsenInfo){
|
||||||
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
||||||
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
||||||
vm = vr*vr + vi*vi;
|
vm = vr*vr + vi*vi;
|
||||||
if(vm == 0){
|
if(vm == 0){
|
||||||
value->rValue = 0;
|
value->rValue = 0;
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo + here->MOS9sens_l);
|
here->MOS9senParmNo + here->MOS9sens_l);
|
||||||
si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo + here->MOS9sens_l);
|
here->MOS9senParmNo + here->MOS9sens_l);
|
||||||
value->rValue = (vr * si - vi * sr)/vm;
|
value->rValue = (vr * si - vi * sr)/vm;
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_W_SENS_CPLX:
|
case MOS9_W_SENS_CPLX:
|
||||||
if(ckt->CKTsenInfo){
|
if(ckt->CKTsenInfo){
|
||||||
value->cValue.real=
|
value->cValue.real=
|
||||||
*(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
*(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo + here->MOS9sens_l);
|
here->MOS9senParmNo + here->MOS9sens_l);
|
||||||
value->cValue.imag=
|
value->cValue.imag=
|
||||||
*(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
*(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
||||||
here->MOS9senParmNo + here->MOS9sens_l);
|
here->MOS9senParmNo + here->MOS9sens_l);
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CB :
|
case MOS9_CB :
|
||||||
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
||||||
errMsg = MALLOC(strlen(msg)+1);
|
errMsg = MALLOC(strlen(msg)+1);
|
||||||
errRtn = "MOS9ask.c";
|
errRtn = "MOS9ask.c";
|
||||||
strcpy(errMsg,msg);
|
strcpy(errMsg,msg);
|
||||||
return(E_ASKCURRENT);
|
return(E_ASKCURRENT);
|
||||||
} else {
|
} else {
|
||||||
value->rValue = here->MOS9cbd + here->MOS9cbs - *(ckt->CKTstate0
|
value->rValue = here->MOS9cbd + here->MOS9cbs - *(ckt->CKTstate0
|
||||||
+ here->MOS9cqgb);
|
+ here->MOS9cqgb);
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CG :
|
case MOS9_CG :
|
||||||
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
||||||
errMsg = MALLOC(strlen(msg)+1);
|
errMsg = MALLOC(strlen(msg)+1);
|
||||||
errRtn = "MOS9ask.c";
|
errRtn = "MOS9ask.c";
|
||||||
strcpy(errMsg,msg);
|
strcpy(errMsg,msg);
|
||||||
return(E_ASKCURRENT);
|
return(E_ASKCURRENT);
|
||||||
} else if (ckt->CKTcurrentAnalysis & (DOING_DCOP | DOING_TRCV)) {
|
} else if (ckt->CKTcurrentAnalysis & (DOING_DCOP | DOING_TRCV)) {
|
||||||
value->rValue = 0;
|
value->rValue = 0;
|
||||||
} else if ((ckt->CKTcurrentAnalysis & DOING_TRAN) &&
|
} else if ((ckt->CKTcurrentAnalysis & DOING_TRAN) &&
|
||||||
(ckt->CKTmode & MODETRANOP)) {
|
(ckt->CKTmode & MODETRANOP)) {
|
||||||
value->rValue = 0;
|
value->rValue = 0;
|
||||||
} else {
|
} else {
|
||||||
value->rValue = *(ckt->CKTstate0 + here->MOS9cqgb) +
|
value->rValue = *(ckt->CKTstate0 + here->MOS9cqgb) +
|
||||||
*(ckt->CKTstate0 + here->MOS9cqgd) + *(ckt->CKTstate0 +
|
*(ckt->CKTstate0 + here->MOS9cqgd) + *(ckt->CKTstate0 +
|
||||||
here->MOS9cqgs);
|
here->MOS9cqgs);
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_CS :
|
case MOS9_CS :
|
||||||
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
||||||
errMsg = MALLOC(strlen(msg)+1);
|
errMsg = MALLOC(strlen(msg)+1);
|
||||||
errRtn = "MOS9ask.c";
|
errRtn = "MOS9ask.c";
|
||||||
strcpy(errMsg,msg);
|
strcpy(errMsg,msg);
|
||||||
return(E_ASKCURRENT);
|
return(E_ASKCURRENT);
|
||||||
} else {
|
} else {
|
||||||
value->rValue = -here->MOS9cd;
|
value->rValue = -here->MOS9cd;
|
||||||
value->rValue -= here->MOS9cbd + here->MOS9cbs -
|
value->rValue -= here->MOS9cbd + here->MOS9cbs -
|
||||||
*(ckt->CKTstate0 + here->MOS9cqgb);
|
*(ckt->CKTstate0 + here->MOS9cqgb);
|
||||||
if ((ckt->CKTcurrentAnalysis & DOING_TRAN) &&
|
if ((ckt->CKTcurrentAnalysis & DOING_TRAN) &&
|
||||||
!(ckt->CKTmode & MODETRANOP)) {
|
!(ckt->CKTmode & MODETRANOP)) {
|
||||||
value->rValue -= *(ckt->CKTstate0 + here->MOS9cqgb) +
|
value->rValue -= *(ckt->CKTstate0 + here->MOS9cqgb) +
|
||||||
*(ckt->CKTstate0 + here->MOS9cqgd) +
|
*(ckt->CKTstate0 + here->MOS9cqgd) +
|
||||||
*(ckt->CKTstate0 + here->MOS9cqgs);
|
*(ckt->CKTstate0 + here->MOS9cqgs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_POWER :
|
case MOS9_POWER :
|
||||||
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
||||||
errMsg = MALLOC(strlen(msg)+1);
|
errMsg = MALLOC(strlen(msg)+1);
|
||||||
errRtn = "MOS9ask.c";
|
errRtn = "MOS9ask.c";
|
||||||
strcpy(errMsg,msg);
|
strcpy(errMsg,msg);
|
||||||
return(E_ASKPOWER);
|
return(E_ASKPOWER);
|
||||||
} else {
|
} else {
|
||||||
double temp;
|
double temp;
|
||||||
|
|
||||||
value->rValue = here->MOS9cd *
|
value->rValue = here->MOS9cd *
|
||||||
*(ckt->CKTrhsOld + here->MOS9dNode);
|
*(ckt->CKTrhsOld + here->MOS9dNode);
|
||||||
value->rValue += (here->MOS9cbd + here->MOS9cbs -
|
value->rValue += (here->MOS9cbd + here->MOS9cbs -
|
||||||
*(ckt->CKTstate0 + here->MOS9cqgb)) *
|
*(ckt->CKTstate0 + here->MOS9cqgb)) *
|
||||||
*(ckt->CKTrhsOld + here->MOS9bNode);
|
*(ckt->CKTrhsOld + here->MOS9bNode);
|
||||||
if ((ckt->CKTcurrentAnalysis & DOING_TRAN) &&
|
if ((ckt->CKTcurrentAnalysis & DOING_TRAN) &&
|
||||||
!(ckt->CKTmode & MODETRANOP)) {
|
!(ckt->CKTmode & MODETRANOP)) {
|
||||||
value->rValue += (*(ckt->CKTstate0 + here->MOS9cqgb) +
|
value->rValue += (*(ckt->CKTstate0 + here->MOS9cqgb) +
|
||||||
*(ckt->CKTstate0 + here->MOS9cqgd) +
|
*(ckt->CKTstate0 + here->MOS9cqgd) +
|
||||||
*(ckt->CKTstate0 + here->MOS9cqgs)) *
|
*(ckt->CKTstate0 + here->MOS9cqgs)) *
|
||||||
*(ckt->CKTrhsOld + here->MOS9gNode);
|
*(ckt->CKTrhsOld + here->MOS9gNode);
|
||||||
}
|
}
|
||||||
temp = -here->MOS9cd;
|
temp = -here->MOS9cd;
|
||||||
temp -= here->MOS9cbd + here->MOS9cbs ;
|
temp -= here->MOS9cbd + here->MOS9cbs ;
|
||||||
if ((ckt->CKTcurrentAnalysis & DOING_TRAN) &&
|
if ((ckt->CKTcurrentAnalysis & DOING_TRAN) &&
|
||||||
!(ckt->CKTmode & MODETRANOP)) {
|
!(ckt->CKTmode & MODETRANOP)) {
|
||||||
temp -= *(ckt->CKTstate0 + here->MOS9cqgb) +
|
temp -= *(ckt->CKTstate0 + here->MOS9cqgb) +
|
||||||
*(ckt->CKTstate0 + here->MOS9cqgd) +
|
*(ckt->CKTstate0 + here->MOS9cqgd) +
|
||||||
*(ckt->CKTstate0 + here->MOS9cqgs);
|
*(ckt->CKTstate0 + here->MOS9cqgs);
|
||||||
}
|
}
|
||||||
value->rValue += temp * *(ckt->CKTrhsOld + here->MOS9sNode);
|
value->rValue += temp * *(ckt->CKTrhsOld + here->MOS9sNode);
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
default:
|
default:
|
||||||
return(E_BADPARM);
|
return(E_BADPARM);
|
||||||
}
|
}
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,104 +1,104 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
|
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
MOS9convTest(inModel,ckt)
|
MOS9convTest(inModel,ckt)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
CKTcircuit *ckt;
|
||||||
{
|
{
|
||||||
MOS9model *model = (MOS9model *)inModel;
|
MOS9model *model = (MOS9model *)inModel;
|
||||||
MOS9instance *here;
|
MOS9instance *here;
|
||||||
double delvbs;
|
double delvbs;
|
||||||
double delvbd;
|
double delvbd;
|
||||||
double delvgs;
|
double delvgs;
|
||||||
double delvds;
|
double delvds;
|
||||||
double delvgd;
|
double delvgd;
|
||||||
double cbhat;
|
double cbhat;
|
||||||
double cdhat;
|
double cdhat;
|
||||||
double vbs;
|
double vbs;
|
||||||
double vbd;
|
double vbd;
|
||||||
double vgs;
|
double vgs;
|
||||||
double vds;
|
double vds;
|
||||||
double vgd;
|
double vgd;
|
||||||
double vgdo;
|
double vgdo;
|
||||||
double tol;
|
double tol;
|
||||||
|
|
||||||
for( ; model != NULL; model = model->MOS9nextModel) {
|
for( ; model != NULL; model = model->MOS9nextModel) {
|
||||||
for(here = model->MOS9instances; here!= NULL;
|
for(here = model->MOS9instances; here!= NULL;
|
||||||
here = here->MOS9nextInstance) {
|
here = here->MOS9nextInstance) {
|
||||||
|
|
||||||
vbs = model->MOS9type * (
|
vbs = model->MOS9type * (
|
||||||
*(ckt->CKTrhs+here->MOS9bNode) -
|
*(ckt->CKTrhs+here->MOS9bNode) -
|
||||||
*(ckt->CKTrhs+here->MOS9sNodePrime));
|
*(ckt->CKTrhs+here->MOS9sNodePrime));
|
||||||
vgs = model->MOS9type * (
|
vgs = model->MOS9type * (
|
||||||
*(ckt->CKTrhs+here->MOS9gNode) -
|
*(ckt->CKTrhs+here->MOS9gNode) -
|
||||||
*(ckt->CKTrhs+here->MOS9sNodePrime));
|
*(ckt->CKTrhs+here->MOS9sNodePrime));
|
||||||
vds = model->MOS9type * (
|
vds = model->MOS9type * (
|
||||||
*(ckt->CKTrhs+here->MOS9dNodePrime) -
|
*(ckt->CKTrhs+here->MOS9dNodePrime) -
|
||||||
*(ckt->CKTrhs+here->MOS9sNodePrime));
|
*(ckt->CKTrhs+here->MOS9sNodePrime));
|
||||||
vbd=vbs-vds;
|
vbd=vbs-vds;
|
||||||
vgd=vgs-vds;
|
vgd=vgs-vds;
|
||||||
vgdo = *(ckt->CKTstate0 + here->MOS9vgs) -
|
vgdo = *(ckt->CKTstate0 + here->MOS9vgs) -
|
||||||
*(ckt->CKTstate0 + here->MOS9vds);
|
*(ckt->CKTstate0 + here->MOS9vds);
|
||||||
delvbs = vbs - *(ckt->CKTstate0 + here->MOS9vbs);
|
delvbs = vbs - *(ckt->CKTstate0 + here->MOS9vbs);
|
||||||
delvbd = vbd - *(ckt->CKTstate0 + here->MOS9vbd);
|
delvbd = vbd - *(ckt->CKTstate0 + here->MOS9vbd);
|
||||||
delvgs = vgs - *(ckt->CKTstate0 + here->MOS9vgs);
|
delvgs = vgs - *(ckt->CKTstate0 + here->MOS9vgs);
|
||||||
delvds = vds - *(ckt->CKTstate0 + here->MOS9vds);
|
delvds = vds - *(ckt->CKTstate0 + here->MOS9vds);
|
||||||
delvgd = vgd-vgdo;
|
delvgd = vgd-vgdo;
|
||||||
|
|
||||||
/* these are needed for convergence testing */
|
/* these are needed for convergence testing */
|
||||||
|
|
||||||
if (here->MOS9mode >= 0) {
|
if (here->MOS9mode >= 0) {
|
||||||
cdhat=
|
cdhat=
|
||||||
here->MOS9cd-
|
here->MOS9cd-
|
||||||
here->MOS9gbd * delvbd +
|
here->MOS9gbd * delvbd +
|
||||||
here->MOS9gmbs * delvbs +
|
here->MOS9gmbs * delvbs +
|
||||||
here->MOS9gm * delvgs +
|
here->MOS9gm * delvgs +
|
||||||
here->MOS9gds * delvds ;
|
here->MOS9gds * delvds ;
|
||||||
} else {
|
} else {
|
||||||
cdhat=
|
cdhat=
|
||||||
here->MOS9cd -
|
here->MOS9cd -
|
||||||
( here->MOS9gbd -
|
( here->MOS9gbd -
|
||||||
here->MOS9gmbs) * delvbd -
|
here->MOS9gmbs) * delvbd -
|
||||||
here->MOS9gm * delvgd +
|
here->MOS9gm * delvgd +
|
||||||
here->MOS9gds * delvds ;
|
here->MOS9gds * delvds ;
|
||||||
}
|
}
|
||||||
cbhat=
|
cbhat=
|
||||||
here->MOS9cbs +
|
here->MOS9cbs +
|
||||||
here->MOS9cbd +
|
here->MOS9cbd +
|
||||||
here->MOS9gbd * delvbd +
|
here->MOS9gbd * delvbd +
|
||||||
here->MOS9gbs * delvbs ;
|
here->MOS9gbs * delvbs ;
|
||||||
/*
|
/*
|
||||||
* check convergence
|
* check convergence
|
||||||
*/
|
*/
|
||||||
tol=ckt->CKTreltol*MAX(fabs(cdhat),fabs(here->MOS9cd))+
|
tol=ckt->CKTreltol*MAX(fabs(cdhat),fabs(here->MOS9cd))+
|
||||||
ckt->CKTabstol;
|
ckt->CKTabstol;
|
||||||
if (fabs(cdhat-here->MOS9cd) >= tol) {
|
if (fabs(cdhat-here->MOS9cd) >= tol) {
|
||||||
ckt->CKTnoncon++;
|
ckt->CKTnoncon++;
|
||||||
ckt->CKTtroubleElt = (GENinstance *) here;
|
ckt->CKTtroubleElt = (GENinstance *) here;
|
||||||
return(OK); /* no reason to continue, we haven't converged */
|
return(OK); /* no reason to continue, we haven't converged */
|
||||||
} else {
|
} else {
|
||||||
tol=ckt->CKTreltol*
|
tol=ckt->CKTreltol*
|
||||||
MAX(fabs(cbhat),fabs(here->MOS9cbs+here->MOS9cbd))
|
MAX(fabs(cbhat),fabs(here->MOS9cbs+here->MOS9cbd))
|
||||||
+ ckt->CKTabstol;
|
+ ckt->CKTabstol;
|
||||||
if (fabs(cbhat-(here->MOS9cbs+here->MOS9cbd)) > tol) {
|
if (fabs(cbhat-(here->MOS9cbs+here->MOS9cbd)) > tol) {
|
||||||
ckt->CKTnoncon++;
|
ckt->CKTnoncon++;
|
||||||
ckt->CKTtroubleElt = (GENinstance *) here;
|
ckt->CKTtroubleElt = (GENinstance *) here;
|
||||||
return(OK); /* no reason to continue, we haven't converged*/
|
return(OK); /* no reason to continue, we haven't converged*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,39 +1,39 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
MOS9delete(inModel,name,inst)
|
MOS9delete(inModel,name,inst)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
IFuid name;
|
IFuid name;
|
||||||
GENinstance **inst;
|
GENinstance **inst;
|
||||||
{
|
{
|
||||||
MOS9model *model = (MOS9model *)inModel;
|
MOS9model *model = (MOS9model *)inModel;
|
||||||
MOS9instance **fast = (MOS9instance **)inst;
|
MOS9instance **fast = (MOS9instance **)inst;
|
||||||
MOS9instance **prev = NULL;
|
MOS9instance **prev = NULL;
|
||||||
MOS9instance *here;
|
MOS9instance *here;
|
||||||
|
|
||||||
for( ; model ; model = model->MOS9nextModel) {
|
for( ; model ; model = model->MOS9nextModel) {
|
||||||
prev = &(model->MOS9instances);
|
prev = &(model->MOS9instances);
|
||||||
for(here = *prev; here ; here = *prev) {
|
for(here = *prev; here ; here = *prev) {
|
||||||
if(here->MOS9name == name || (fast && here==*fast) ) {
|
if(here->MOS9name == name || (fast && here==*fast) ) {
|
||||||
*prev= here->MOS9nextInstance;
|
*prev= here->MOS9nextInstance;
|
||||||
FREE(here);
|
FREE(here);
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
prev = &(here->MOS9nextInstance);
|
prev = &(here->MOS9nextInstance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(E_NODEV);
|
return(E_NODEV);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,40 +1,40 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MOS9destroy(inModel)
|
MOS9destroy(inModel)
|
||||||
GENmodel **inModel;
|
GENmodel **inModel;
|
||||||
{
|
{
|
||||||
MOS9model **model = (MOS9model **)inModel;
|
MOS9model **model = (MOS9model **)inModel;
|
||||||
MOS9instance *here;
|
MOS9instance *here;
|
||||||
MOS9instance *prev = NULL;
|
MOS9instance *prev = NULL;
|
||||||
MOS9model *mod = *model;
|
MOS9model *mod = *model;
|
||||||
MOS9model *oldmod = NULL;
|
MOS9model *oldmod = NULL;
|
||||||
|
|
||||||
for( ; mod ; mod = mod->MOS9nextModel) {
|
for( ; mod ; mod = mod->MOS9nextModel) {
|
||||||
if(oldmod) FREE(oldmod);
|
if(oldmod) FREE(oldmod);
|
||||||
oldmod = mod;
|
oldmod = mod;
|
||||||
prev = (MOS9instance *)NULL;
|
prev = (MOS9instance *)NULL;
|
||||||
for(here = mod->MOS9instances ; here ; here = here->MOS9nextInstance) {
|
for(here = mod->MOS9instances ; here ; here = here->MOS9nextInstance) {
|
||||||
if(prev){
|
if(prev){
|
||||||
if(prev->MOS9sens) FREE(prev->MOS9sens);
|
if(prev->MOS9sens) FREE(prev->MOS9sens);
|
||||||
FREE(prev);
|
FREE(prev);
|
||||||
}
|
}
|
||||||
prev = here;
|
prev = here;
|
||||||
}
|
}
|
||||||
if(prev) FREE(prev);
|
if(prev) FREE(prev);
|
||||||
}
|
}
|
||||||
if(oldmod) FREE(oldmod);
|
if(oldmod) FREE(oldmod);
|
||||||
*model = NULL;
|
*model = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,30 +1,30 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
extern int MOS9acLoad(GENmodel*,CKTcircuit*);
|
extern int MOS9acLoad(GENmodel*,CKTcircuit*);
|
||||||
extern int MOS9ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*);
|
extern int MOS9ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*);
|
||||||
extern int MOS9convTest(GENmodel *,CKTcircuit *);
|
extern int MOS9convTest(GENmodel *,CKTcircuit *);
|
||||||
extern int MOS9delete(GENmodel*,IFuid,GENinstance**);
|
extern int MOS9delete(GENmodel*,IFuid,GENinstance**);
|
||||||
extern void MOS9destroy(GENmodel**);
|
extern void MOS9destroy(GENmodel**);
|
||||||
extern int MOS9getic(GENmodel*,CKTcircuit*);
|
extern int MOS9getic(GENmodel*,CKTcircuit*);
|
||||||
extern int MOS9load(GENmodel*,CKTcircuit*);
|
extern int MOS9load(GENmodel*,CKTcircuit*);
|
||||||
extern int MOS9mAsk(CKTcircuit*,GENmodel*,int,IFvalue*);
|
extern int MOS9mAsk(CKTcircuit*,GENmodel*,int,IFvalue*);
|
||||||
extern int MOS9mDelete(GENmodel**,IFuid,GENmodel*);
|
extern int MOS9mDelete(GENmodel**,IFuid,GENmodel*);
|
||||||
extern int MOS9mParam(int,IFvalue*,GENmodel*);
|
extern int MOS9mParam(int,IFvalue*,GENmodel*);
|
||||||
extern int MOS9param(int,IFvalue*,GENinstance*,IFvalue*);
|
extern int MOS9param(int,IFvalue*,GENinstance*,IFvalue*);
|
||||||
extern int MOS9pzLoad(GENmodel*,CKTcircuit*,SPcomplex*);
|
extern int MOS9pzLoad(GENmodel*,CKTcircuit*,SPcomplex*);
|
||||||
extern int MOS9sAcLoad(GENmodel*,CKTcircuit*);
|
extern int MOS9sAcLoad(GENmodel*,CKTcircuit*);
|
||||||
extern int MOS9sLoad(GENmodel*,CKTcircuit*);
|
extern int MOS9sLoad(GENmodel*,CKTcircuit*);
|
||||||
extern void MOS9sPrint(GENmodel*,CKTcircuit*);
|
extern void MOS9sPrint(GENmodel*,CKTcircuit*);
|
||||||
extern int MOS9sSetup(SENstruct*,GENmodel*);
|
extern int MOS9sSetup(SENstruct*,GENmodel*);
|
||||||
extern int MOS9sUpdate(GENmodel*,CKTcircuit*);
|
extern int MOS9sUpdate(GENmodel*,CKTcircuit*);
|
||||||
extern int MOS9setup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
|
extern int MOS9setup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
|
||||||
extern int MOS9unsetup(GENmodel*,CKTcircuit*);
|
extern int MOS9unsetup(GENmodel*,CKTcircuit*);
|
||||||
extern int MOS9temp(GENmodel*,CKTcircuit*);
|
extern int MOS9temp(GENmodel*,CKTcircuit*);
|
||||||
extern int MOS9trunc(GENmodel*,CKTcircuit*,double*);
|
extern int MOS9trunc(GENmodel*,CKTcircuit*,double*);
|
||||||
extern int MOS9disto(int,GENmodel*,CKTcircuit*);
|
extern int MOS9disto(int,GENmodel*,CKTcircuit*);
|
||||||
extern int MOS9noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
extern int MOS9noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||||
extern int MOS9dSetup(GENmodel*,CKTcircuit*);
|
extern int MOS9dSetup(GENmodel*,CKTcircuit*);
|
||||||
|
|
@ -1,49 +1,49 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
MOS9getic(inModel,ckt)
|
MOS9getic(inModel,ckt)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
CKTcircuit *ckt;
|
||||||
{
|
{
|
||||||
MOS9model *model = (MOS9model *)inModel;
|
MOS9model *model = (MOS9model *)inModel;
|
||||||
MOS9instance *here;
|
MOS9instance *here;
|
||||||
/*
|
/*
|
||||||
* grab initial conditions out of rhs array. User specified, so use
|
* grab initial conditions out of rhs array. User specified, so use
|
||||||
* external nodes to get values
|
* external nodes to get values
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for( ; model ; model = model->MOS9nextModel) {
|
for( ; model ; model = model->MOS9nextModel) {
|
||||||
for(here = model->MOS9instances; here ; here = here->MOS9nextInstance) {
|
for(here = model->MOS9instances; here ; here = here->MOS9nextInstance) {
|
||||||
if(!here->MOS9icVBSGiven) {
|
if(!here->MOS9icVBSGiven) {
|
||||||
here->MOS9icVBS =
|
here->MOS9icVBS =
|
||||||
*(ckt->CKTrhs + here->MOS9bNode) -
|
*(ckt->CKTrhs + here->MOS9bNode) -
|
||||||
*(ckt->CKTrhs + here->MOS9sNode);
|
*(ckt->CKTrhs + here->MOS9sNode);
|
||||||
}
|
}
|
||||||
if(!here->MOS9icVDSGiven) {
|
if(!here->MOS9icVDSGiven) {
|
||||||
here->MOS9icVDS =
|
here->MOS9icVDS =
|
||||||
*(ckt->CKTrhs + here->MOS9dNode) -
|
*(ckt->CKTrhs + here->MOS9dNode) -
|
||||||
*(ckt->CKTrhs + here->MOS9sNode);
|
*(ckt->CKTrhs + here->MOS9sNode);
|
||||||
}
|
}
|
||||||
if(!here->MOS9icVGSGiven) {
|
if(!here->MOS9icVGSGiven) {
|
||||||
here->MOS9icVGS =
|
here->MOS9icVGS =
|
||||||
*(ckt->CKTrhs + here->MOS9gNode) -
|
*(ckt->CKTrhs + here->MOS9gNode) -
|
||||||
*(ckt->CKTrhs + here->MOS9sNode);
|
*(ckt->CKTrhs + here->MOS9sNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#ifndef DEV_MOS9
|
#ifndef DEV_MOS9
|
||||||
#define DEV_MOS9
|
#define DEV_MOS9
|
||||||
|
|
||||||
SPICEdev *get_mos9_info(void);
|
SPICEdev *get_mos9_info(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,171 +1,171 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1987 Thomas L. Quarles
|
Author: 1987 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "ifsim.h"
|
#include "ifsim.h"
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "devdefs.h"
|
#include "devdefs.h"
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
int
|
int
|
||||||
MOS9mAsk(ckt,inst,which,value)
|
MOS9mAsk(ckt,inst,which,value)
|
||||||
CKTcircuit *ckt;
|
CKTcircuit *ckt;
|
||||||
GENmodel *inst;
|
GENmodel *inst;
|
||||||
int which;
|
int which;
|
||||||
IFvalue *value;
|
IFvalue *value;
|
||||||
{
|
{
|
||||||
MOS9model *here = (MOS9model *)inst;
|
MOS9model *here = (MOS9model *)inst;
|
||||||
switch(which) {
|
switch(which) {
|
||||||
case MOS9_MOD_TNOM:
|
case MOS9_MOD_TNOM:
|
||||||
value->rValue = here->MOS9tnom-CONSTCtoK;
|
value->rValue = here->MOS9tnom-CONSTCtoK;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_VTO:
|
case MOS9_MOD_VTO:
|
||||||
value->rValue = here->MOS9vt0;
|
value->rValue = here->MOS9vt0;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_KP:
|
case MOS9_MOD_KP:
|
||||||
value->rValue = here->MOS9transconductance;
|
value->rValue = here->MOS9transconductance;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_GAMMA:
|
case MOS9_MOD_GAMMA:
|
||||||
value->rValue = here->MOS9gamma;
|
value->rValue = here->MOS9gamma;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_PHI:
|
case MOS9_MOD_PHI:
|
||||||
value->rValue = here->MOS9phi;
|
value->rValue = here->MOS9phi;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_RD:
|
case MOS9_MOD_RD:
|
||||||
value->rValue = here->MOS9drainResistance;
|
value->rValue = here->MOS9drainResistance;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_RS:
|
case MOS9_MOD_RS:
|
||||||
value->rValue = here->MOS9sourceResistance;
|
value->rValue = here->MOS9sourceResistance;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_CBD:
|
case MOS9_MOD_CBD:
|
||||||
value->rValue = here->MOS9capBD;
|
value->rValue = here->MOS9capBD;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_CBS:
|
case MOS9_MOD_CBS:
|
||||||
value->rValue = here->MOS9capBS;
|
value->rValue = here->MOS9capBS;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_IS:
|
case MOS9_MOD_IS:
|
||||||
value->rValue = here->MOS9jctSatCur;
|
value->rValue = here->MOS9jctSatCur;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_PB:
|
case MOS9_MOD_PB:
|
||||||
value->rValue = here->MOS9bulkJctPotential;
|
value->rValue = here->MOS9bulkJctPotential;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_CGSO:
|
case MOS9_MOD_CGSO:
|
||||||
value->rValue = here->MOS9gateSourceOverlapCapFactor;
|
value->rValue = here->MOS9gateSourceOverlapCapFactor;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_CGDO:
|
case MOS9_MOD_CGDO:
|
||||||
value->rValue = here->MOS9gateDrainOverlapCapFactor;
|
value->rValue = here->MOS9gateDrainOverlapCapFactor;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_CGBO:
|
case MOS9_MOD_CGBO:
|
||||||
value->rValue = here->MOS9gateBulkOverlapCapFactor;
|
value->rValue = here->MOS9gateBulkOverlapCapFactor;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_CJ:
|
case MOS9_MOD_CJ:
|
||||||
value->rValue = here->MOS9bulkCapFactor;
|
value->rValue = here->MOS9bulkCapFactor;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_MJ:
|
case MOS9_MOD_MJ:
|
||||||
value->rValue = here->MOS9bulkJctBotGradingCoeff;
|
value->rValue = here->MOS9bulkJctBotGradingCoeff;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_CJSW:
|
case MOS9_MOD_CJSW:
|
||||||
value->rValue = here->MOS9sideWallCapFactor;
|
value->rValue = here->MOS9sideWallCapFactor;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_MJSW:
|
case MOS9_MOD_MJSW:
|
||||||
value->rValue = here->MOS9bulkJctSideGradingCoeff;
|
value->rValue = here->MOS9bulkJctSideGradingCoeff;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_JS:
|
case MOS9_MOD_JS:
|
||||||
value->rValue = here->MOS9jctSatCurDensity;
|
value->rValue = here->MOS9jctSatCurDensity;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_TOX:
|
case MOS9_MOD_TOX:
|
||||||
value->rValue = here->MOS9oxideThickness;
|
value->rValue = here->MOS9oxideThickness;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_LD:
|
case MOS9_MOD_LD:
|
||||||
value->rValue = here->MOS9latDiff;
|
value->rValue = here->MOS9latDiff;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_XL:
|
case MOS9_MOD_XL:
|
||||||
value->rValue = here->MOS9lengthAdjust;
|
value->rValue = here->MOS9lengthAdjust;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_WD:
|
case MOS9_MOD_WD:
|
||||||
value->rValue = here->MOS9widthNarrow;
|
value->rValue = here->MOS9widthNarrow;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_XW:
|
case MOS9_MOD_XW:
|
||||||
value->rValue = here->MOS9widthAdjust;
|
value->rValue = here->MOS9widthAdjust;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_DELVTO:
|
case MOS9_MOD_DELVTO:
|
||||||
value->rValue = here->MOS9delvt0;
|
value->rValue = here->MOS9delvt0;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_RSH:
|
case MOS9_MOD_RSH:
|
||||||
value->rValue = here->MOS9sheetResistance;
|
value->rValue = here->MOS9sheetResistance;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_U0:
|
case MOS9_MOD_U0:
|
||||||
value->rValue = here->MOS9surfaceMobility;
|
value->rValue = here->MOS9surfaceMobility;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_FC:
|
case MOS9_MOD_FC:
|
||||||
value->rValue = here->MOS9fwdCapDepCoeff;
|
value->rValue = here->MOS9fwdCapDepCoeff;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_NSUB:
|
case MOS9_MOD_NSUB:
|
||||||
value->rValue = here->MOS9substrateDoping;
|
value->rValue = here->MOS9substrateDoping;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_TPG:
|
case MOS9_MOD_TPG:
|
||||||
value->iValue = here->MOS9gateType;
|
value->iValue = here->MOS9gateType;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_NSS:
|
case MOS9_MOD_NSS:
|
||||||
value->rValue = here->MOS9surfaceStateDensity;
|
value->rValue = here->MOS9surfaceStateDensity;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_NFS:
|
case MOS9_MOD_NFS:
|
||||||
value->rValue = here->MOS9fastSurfaceStateDensity;
|
value->rValue = here->MOS9fastSurfaceStateDensity;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_DELTA:
|
case MOS9_MOD_DELTA:
|
||||||
value->rValue = here->MOS9narrowFactor;
|
value->rValue = here->MOS9narrowFactor;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_VMAX:
|
case MOS9_MOD_VMAX:
|
||||||
value->rValue = here->MOS9maxDriftVel;
|
value->rValue = here->MOS9maxDriftVel;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_XJ:
|
case MOS9_MOD_XJ:
|
||||||
value->rValue = here->MOS9junctionDepth;
|
value->rValue = here->MOS9junctionDepth;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_ETA:
|
case MOS9_MOD_ETA:
|
||||||
value->rValue = here->MOS9eta;
|
value->rValue = here->MOS9eta;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_XD:
|
case MOS9_MOD_XD:
|
||||||
value->rValue = here->MOS9coeffDepLayWidth;
|
value->rValue = here->MOS9coeffDepLayWidth;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_DELTA:
|
case MOS9_DELTA:
|
||||||
value->rValue = here->MOS9delta;
|
value->rValue = here->MOS9delta;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_THETA:
|
case MOS9_MOD_THETA:
|
||||||
value->rValue = here->MOS9theta;
|
value->rValue = here->MOS9theta;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_ALPHA:
|
case MOS9_MOD_ALPHA:
|
||||||
value->rValue = here->MOS9alpha;
|
value->rValue = here->MOS9alpha;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_KAPPA:
|
case MOS9_MOD_KAPPA:
|
||||||
value->rValue = here->MOS9kappa;
|
value->rValue = here->MOS9kappa;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_KF:
|
case MOS9_MOD_KF:
|
||||||
value->rValue = here->MOS9fNcoef;
|
value->rValue = here->MOS9fNcoef;
|
||||||
return(OK);
|
return(OK);
|
||||||
case MOS9_MOD_AF:
|
case MOS9_MOD_AF:
|
||||||
value->rValue = here->MOS9fNexp;
|
value->rValue = here->MOS9fNexp;
|
||||||
return(OK);
|
return(OK);
|
||||||
|
|
||||||
case MOS9_MOD_TYPE:
|
case MOS9_MOD_TYPE:
|
||||||
if (here->MOS9type > 0)
|
if (here->MOS9type > 0)
|
||||||
value->sValue = "nmos";
|
value->sValue = "nmos";
|
||||||
else
|
else
|
||||||
value->sValue = "pmos";
|
value->sValue = "pmos";
|
||||||
return(OK);
|
return(OK);
|
||||||
default:
|
default:
|
||||||
return(E_BADPARM);
|
return(E_BADPARM);
|
||||||
}
|
}
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,45 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
MOS9mDelete(inModel,modname,kill)
|
MOS9mDelete(inModel,modname,kill)
|
||||||
GENmodel **inModel;
|
GENmodel **inModel;
|
||||||
IFuid modname;
|
IFuid modname;
|
||||||
GENmodel *kill;
|
GENmodel *kill;
|
||||||
{
|
{
|
||||||
MOS9model **model = (MOS9model **)inModel;
|
MOS9model **model = (MOS9model **)inModel;
|
||||||
MOS9model *modfast = (MOS9model *)kill;
|
MOS9model *modfast = (MOS9model *)kill;
|
||||||
MOS9instance *here;
|
MOS9instance *here;
|
||||||
MOS9instance *prev = NULL;
|
MOS9instance *prev = NULL;
|
||||||
MOS9model **oldmod;
|
MOS9model **oldmod;
|
||||||
oldmod = model;
|
oldmod = model;
|
||||||
for( ; *model ; model = &((*model)->MOS9nextModel)) {
|
for( ; *model ; model = &((*model)->MOS9nextModel)) {
|
||||||
if( (*model)->MOS9modName == modname ||
|
if( (*model)->MOS9modName == modname ||
|
||||||
(modfast && *model == modfast) ) goto delgot;
|
(modfast && *model == modfast) ) goto delgot;
|
||||||
oldmod = model;
|
oldmod = model;
|
||||||
}
|
}
|
||||||
return(E_NOMOD);
|
return(E_NOMOD);
|
||||||
|
|
||||||
delgot:
|
delgot:
|
||||||
*oldmod = (*model)->MOS9nextModel; /* cut deleted device out of list */
|
*oldmod = (*model)->MOS9nextModel; /* cut deleted device out of list */
|
||||||
for(here = (*model)->MOS9instances ; here ; here = here->MOS9nextInstance) {
|
for(here = (*model)->MOS9instances ; here ; here = here->MOS9nextInstance) {
|
||||||
if(prev) FREE(prev);
|
if(prev) FREE(prev);
|
||||||
prev = here;
|
prev = here;
|
||||||
}
|
}
|
||||||
if(prev) FREE(prev);
|
if(prev) FREE(prev);
|
||||||
FREE(*model);
|
FREE(*model);
|
||||||
return(OK);
|
return(OK);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,202 +1,202 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "ifsim.h"
|
#include "ifsim.h"
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
MOS9mParam(param,value,inModel)
|
MOS9mParam(param,value,inModel)
|
||||||
int param;
|
int param;
|
||||||
IFvalue *value;
|
IFvalue *value;
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
{
|
{
|
||||||
register MOS9model *model = (MOS9model *)inModel;
|
register MOS9model *model = (MOS9model *)inModel;
|
||||||
switch(param) {
|
switch(param) {
|
||||||
case MOS9_MOD_VTO:
|
case MOS9_MOD_VTO:
|
||||||
model->MOS9vt0 = value->rValue;
|
model->MOS9vt0 = value->rValue;
|
||||||
model->MOS9vt0Given = TRUE;
|
model->MOS9vt0Given = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_KP:
|
case MOS9_MOD_KP:
|
||||||
model->MOS9transconductance = value->rValue;
|
model->MOS9transconductance = value->rValue;
|
||||||
model->MOS9transconductanceGiven = TRUE;
|
model->MOS9transconductanceGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_GAMMA:
|
case MOS9_MOD_GAMMA:
|
||||||
model->MOS9gamma = value->rValue;
|
model->MOS9gamma = value->rValue;
|
||||||
model->MOS9gammaGiven = TRUE;
|
model->MOS9gammaGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_PHI:
|
case MOS9_MOD_PHI:
|
||||||
model->MOS9phi = value->rValue;
|
model->MOS9phi = value->rValue;
|
||||||
model->MOS9phiGiven = TRUE;
|
model->MOS9phiGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_RD:
|
case MOS9_MOD_RD:
|
||||||
model->MOS9drainResistance = value->rValue;
|
model->MOS9drainResistance = value->rValue;
|
||||||
model->MOS9drainResistanceGiven = TRUE;
|
model->MOS9drainResistanceGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_RS:
|
case MOS9_MOD_RS:
|
||||||
model->MOS9sourceResistance = value->rValue;
|
model->MOS9sourceResistance = value->rValue;
|
||||||
model->MOS9sourceResistanceGiven = TRUE;
|
model->MOS9sourceResistanceGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_CBD:
|
case MOS9_MOD_CBD:
|
||||||
model->MOS9capBD = value->rValue;
|
model->MOS9capBD = value->rValue;
|
||||||
model->MOS9capBDGiven = TRUE;
|
model->MOS9capBDGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_CBS:
|
case MOS9_MOD_CBS:
|
||||||
model->MOS9capBS = value->rValue;
|
model->MOS9capBS = value->rValue;
|
||||||
model->MOS9capBSGiven = TRUE;
|
model->MOS9capBSGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_IS:
|
case MOS9_MOD_IS:
|
||||||
model->MOS9jctSatCur = value->rValue;
|
model->MOS9jctSatCur = value->rValue;
|
||||||
model->MOS9jctSatCurGiven = TRUE;
|
model->MOS9jctSatCurGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_PB:
|
case MOS9_MOD_PB:
|
||||||
model->MOS9bulkJctPotential = value->rValue;
|
model->MOS9bulkJctPotential = value->rValue;
|
||||||
model->MOS9bulkJctPotentialGiven = TRUE;
|
model->MOS9bulkJctPotentialGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_CGSO:
|
case MOS9_MOD_CGSO:
|
||||||
model->MOS9gateSourceOverlapCapFactor = value->rValue;
|
model->MOS9gateSourceOverlapCapFactor = value->rValue;
|
||||||
model->MOS9gateSourceOverlapCapFactorGiven = TRUE;
|
model->MOS9gateSourceOverlapCapFactorGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_CGDO:
|
case MOS9_MOD_CGDO:
|
||||||
model->MOS9gateDrainOverlapCapFactor = value->rValue;
|
model->MOS9gateDrainOverlapCapFactor = value->rValue;
|
||||||
model->MOS9gateDrainOverlapCapFactorGiven = TRUE;
|
model->MOS9gateDrainOverlapCapFactorGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_CGBO:
|
case MOS9_MOD_CGBO:
|
||||||
model->MOS9gateBulkOverlapCapFactor = value->rValue;
|
model->MOS9gateBulkOverlapCapFactor = value->rValue;
|
||||||
model->MOS9gateBulkOverlapCapFactorGiven = TRUE;
|
model->MOS9gateBulkOverlapCapFactorGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_RSH:
|
case MOS9_MOD_RSH:
|
||||||
model->MOS9sheetResistance = value->rValue;
|
model->MOS9sheetResistance = value->rValue;
|
||||||
model->MOS9sheetResistanceGiven = TRUE;
|
model->MOS9sheetResistanceGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_CJ:
|
case MOS9_MOD_CJ:
|
||||||
model->MOS9bulkCapFactor = value->rValue;
|
model->MOS9bulkCapFactor = value->rValue;
|
||||||
model->MOS9bulkCapFactorGiven = TRUE;
|
model->MOS9bulkCapFactorGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_MJ:
|
case MOS9_MOD_MJ:
|
||||||
model->MOS9bulkJctBotGradingCoeff = value->rValue;
|
model->MOS9bulkJctBotGradingCoeff = value->rValue;
|
||||||
model->MOS9bulkJctBotGradingCoeffGiven = TRUE;
|
model->MOS9bulkJctBotGradingCoeffGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_CJSW:
|
case MOS9_MOD_CJSW:
|
||||||
model->MOS9sideWallCapFactor = value->rValue;
|
model->MOS9sideWallCapFactor = value->rValue;
|
||||||
model->MOS9sideWallCapFactorGiven = TRUE;
|
model->MOS9sideWallCapFactorGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_MJSW:
|
case MOS9_MOD_MJSW:
|
||||||
model->MOS9bulkJctSideGradingCoeff = value->rValue;
|
model->MOS9bulkJctSideGradingCoeff = value->rValue;
|
||||||
model->MOS9bulkJctSideGradingCoeffGiven = TRUE;
|
model->MOS9bulkJctSideGradingCoeffGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_JS:
|
case MOS9_MOD_JS:
|
||||||
model->MOS9jctSatCurDensity = value->rValue;
|
model->MOS9jctSatCurDensity = value->rValue;
|
||||||
model->MOS9jctSatCurDensityGiven = TRUE;
|
model->MOS9jctSatCurDensityGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_TOX:
|
case MOS9_MOD_TOX:
|
||||||
model->MOS9oxideThickness = value->rValue;
|
model->MOS9oxideThickness = value->rValue;
|
||||||
model->MOS9oxideThicknessGiven = TRUE;
|
model->MOS9oxideThicknessGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_LD:
|
case MOS9_MOD_LD:
|
||||||
model->MOS9latDiff = value->rValue;
|
model->MOS9latDiff = value->rValue;
|
||||||
model->MOS9latDiffGiven = TRUE;
|
model->MOS9latDiffGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_XL:
|
case MOS9_MOD_XL:
|
||||||
model->MOS9lengthAdjust = value->rValue;
|
model->MOS9lengthAdjust = value->rValue;
|
||||||
model->MOS9lengthAdjustGiven = TRUE;
|
model->MOS9lengthAdjustGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_WD:
|
case MOS9_MOD_WD:
|
||||||
model->MOS9widthNarrow = value->rValue;
|
model->MOS9widthNarrow = value->rValue;
|
||||||
model->MOS9widthNarrowGiven = TRUE;
|
model->MOS9widthNarrowGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_XW:
|
case MOS9_MOD_XW:
|
||||||
model->MOS9widthAdjust = value->rValue;
|
model->MOS9widthAdjust = value->rValue;
|
||||||
model->MOS9widthAdjustGiven = TRUE;
|
model->MOS9widthAdjustGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_DELVTO:
|
case MOS9_MOD_DELVTO:
|
||||||
model->MOS9delvt0 = value->rValue;
|
model->MOS9delvt0 = value->rValue;
|
||||||
model->MOS9delvt0Given = TRUE;
|
model->MOS9delvt0Given = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_U0:
|
case MOS9_MOD_U0:
|
||||||
model->MOS9surfaceMobility = value->rValue;
|
model->MOS9surfaceMobility = value->rValue;
|
||||||
model->MOS9surfaceMobilityGiven = TRUE;
|
model->MOS9surfaceMobilityGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_FC:
|
case MOS9_MOD_FC:
|
||||||
model->MOS9fwdCapDepCoeff = value->rValue;
|
model->MOS9fwdCapDepCoeff = value->rValue;
|
||||||
model->MOS9fwdCapDepCoeffGiven = TRUE;
|
model->MOS9fwdCapDepCoeffGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_NSUB:
|
case MOS9_MOD_NSUB:
|
||||||
model->MOS9substrateDoping = value->rValue;
|
model->MOS9substrateDoping = value->rValue;
|
||||||
model->MOS9substrateDopingGiven = TRUE;
|
model->MOS9substrateDopingGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_TPG:
|
case MOS9_MOD_TPG:
|
||||||
model->MOS9gateType = value->iValue;
|
model->MOS9gateType = value->iValue;
|
||||||
model->MOS9gateTypeGiven = TRUE;
|
model->MOS9gateTypeGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_NSS:
|
case MOS9_MOD_NSS:
|
||||||
model->MOS9surfaceStateDensity = value->rValue;
|
model->MOS9surfaceStateDensity = value->rValue;
|
||||||
model->MOS9surfaceStateDensityGiven = TRUE;
|
model->MOS9surfaceStateDensityGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_ETA:
|
case MOS9_MOD_ETA:
|
||||||
model->MOS9eta = value->rValue;
|
model->MOS9eta = value->rValue;
|
||||||
model->MOS9etaGiven = TRUE;
|
model->MOS9etaGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_DELTA:
|
case MOS9_MOD_DELTA:
|
||||||
model->MOS9delta = value->rValue;
|
model->MOS9delta = value->rValue;
|
||||||
model->MOS9deltaGiven = TRUE;
|
model->MOS9deltaGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_NFS:
|
case MOS9_MOD_NFS:
|
||||||
model->MOS9fastSurfaceStateDensity = value->rValue;
|
model->MOS9fastSurfaceStateDensity = value->rValue;
|
||||||
model->MOS9fastSurfaceStateDensityGiven = TRUE;
|
model->MOS9fastSurfaceStateDensityGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_THETA:
|
case MOS9_MOD_THETA:
|
||||||
model->MOS9theta = value->rValue;
|
model->MOS9theta = value->rValue;
|
||||||
model->MOS9thetaGiven = TRUE;
|
model->MOS9thetaGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_VMAX:
|
case MOS9_MOD_VMAX:
|
||||||
model->MOS9maxDriftVel = value->rValue;
|
model->MOS9maxDriftVel = value->rValue;
|
||||||
model->MOS9maxDriftVelGiven = TRUE;
|
model->MOS9maxDriftVelGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_KAPPA:
|
case MOS9_MOD_KAPPA:
|
||||||
model->MOS9kappa = value->rValue;
|
model->MOS9kappa = value->rValue;
|
||||||
model->MOS9kappaGiven = TRUE;
|
model->MOS9kappaGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_NMOS:
|
case MOS9_MOD_NMOS:
|
||||||
if(value->iValue) {
|
if(value->iValue) {
|
||||||
model->MOS9type = 1;
|
model->MOS9type = 1;
|
||||||
model->MOS9typeGiven = TRUE;
|
model->MOS9typeGiven = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_PMOS:
|
case MOS9_MOD_PMOS:
|
||||||
if(value->iValue) {
|
if(value->iValue) {
|
||||||
model->MOS9type = -1;
|
model->MOS9type = -1;
|
||||||
model->MOS9typeGiven = TRUE;
|
model->MOS9typeGiven = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_XJ:
|
case MOS9_MOD_XJ:
|
||||||
model->MOS9junctionDepth = value->rValue;
|
model->MOS9junctionDepth = value->rValue;
|
||||||
model->MOS9junctionDepthGiven = TRUE;
|
model->MOS9junctionDepthGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_TNOM:
|
case MOS9_MOD_TNOM:
|
||||||
model->MOS9tnom = value->rValue+CONSTCtoK;
|
model->MOS9tnom = value->rValue+CONSTCtoK;
|
||||||
model->MOS9tnomGiven = TRUE;
|
model->MOS9tnomGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_KF:
|
case MOS9_MOD_KF:
|
||||||
model->MOS9fNcoef = value->rValue;
|
model->MOS9fNcoef = value->rValue;
|
||||||
model->MOS9fNcoefGiven = TRUE;
|
model->MOS9fNcoefGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_MOD_AF:
|
case MOS9_MOD_AF:
|
||||||
model->MOS9fNexp = value->rValue;
|
model->MOS9fNexp = value->rValue;
|
||||||
model->MOS9fNexpGiven = TRUE;
|
model->MOS9fNexpGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return(E_BADPARM);
|
return(E_BADPARM);
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,219 +1,219 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1987 Gary W. Ng
|
Author: 1987 Gary W. Ng
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "iferrmsg.h"
|
#include "iferrmsg.h"
|
||||||
#include "noisedef.h"
|
#include "noisedef.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MOS9noise (mode, operation, firstModel, ckt, data, OnDens)
|
* MOS9noise (mode, operation, firstModel, ckt, data, OnDens)
|
||||||
* This routine names and evaluates all of the noise sources
|
* This routine names and evaluates all of the noise sources
|
||||||
* associated with MOSFET's. It starts with the model *firstModel and
|
* associated with MOSFET's. It starts with the model *firstModel and
|
||||||
* traverses all of its insts. It then proceeds to any other models
|
* traverses all of its insts. It then proceeds to any other models
|
||||||
* on the linked list. The total output noise density generated by
|
* on the linked list. The total output noise density generated by
|
||||||
* all of the MOSFET's is summed with the variable "OnDens".
|
* all of the MOSFET's is summed with the variable "OnDens".
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern void NevalSrc();
|
extern void NevalSrc();
|
||||||
extern double Nintegrate();
|
extern double Nintegrate();
|
||||||
|
|
||||||
int
|
int
|
||||||
MOS9noise (mode, operation, genmodel, ckt, data, OnDens)
|
MOS9noise (mode, operation, genmodel, ckt, data, OnDens)
|
||||||
int mode;
|
int mode;
|
||||||
int operation;
|
int operation;
|
||||||
GENmodel *genmodel;
|
GENmodel *genmodel;
|
||||||
CKTcircuit *ckt;
|
CKTcircuit *ckt;
|
||||||
Ndata *data;
|
Ndata *data;
|
||||||
double *OnDens;
|
double *OnDens;
|
||||||
{
|
{
|
||||||
MOS9model *firstModel = (MOS9model *) genmodel;
|
MOS9model *firstModel = (MOS9model *) genmodel;
|
||||||
MOS9model *model;
|
MOS9model *model;
|
||||||
MOS9instance *inst;
|
MOS9instance *inst;
|
||||||
char name[N_MXVLNTH];
|
char name[N_MXVLNTH];
|
||||||
double tempOnoise;
|
double tempOnoise;
|
||||||
double tempInoise;
|
double tempInoise;
|
||||||
double noizDens[MOS9NSRCS];
|
double noizDens[MOS9NSRCS];
|
||||||
double lnNdens[MOS9NSRCS];
|
double lnNdens[MOS9NSRCS];
|
||||||
int error;
|
int error;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* define the names of the noise sources */
|
/* define the names of the noise sources */
|
||||||
|
|
||||||
static char *MOS9nNames[MOS9NSRCS] = { /* Note that we have to keep the order */
|
static char *MOS9nNames[MOS9NSRCS] = { /* Note that we have to keep the order */
|
||||||
"_rd", /* noise due to rd */ /* consistent with the index definitions */
|
"_rd", /* noise due to rd */ /* consistent with the index definitions */
|
||||||
"_rs", /* noise due to rs */ /* in MOS9defs.h */
|
"_rs", /* noise due to rs */ /* in MOS9defs.h */
|
||||||
"_id", /* noise due to id */
|
"_id", /* noise due to id */
|
||||||
"_1overf", /* flicker (1/f) noise */
|
"_1overf", /* flicker (1/f) noise */
|
||||||
"" /* total transistor noise */
|
"" /* total transistor noise */
|
||||||
};
|
};
|
||||||
|
|
||||||
for (model=firstModel; model != NULL; model=model->MOS9nextModel) {
|
for (model=firstModel; model != NULL; model=model->MOS9nextModel) {
|
||||||
for (inst=model->MOS9instances; inst != NULL; inst=inst->MOS9nextInstance) {
|
for (inst=model->MOS9instances; inst != NULL; inst=inst->MOS9nextInstance) {
|
||||||
switch (operation) {
|
switch (operation) {
|
||||||
|
|
||||||
case N_OPEN:
|
case N_OPEN:
|
||||||
|
|
||||||
/* see if we have to to produce a summary report */
|
/* see if we have to to produce a summary report */
|
||||||
/* if so, name all the noise generators */
|
/* if so, name all the noise generators */
|
||||||
|
|
||||||
if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0) {
|
if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0) {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
|
||||||
case N_DENS:
|
case N_DENS:
|
||||||
for (i=0; i < MOS9NSRCS; i++) {
|
for (i=0; i < MOS9NSRCS; i++) {
|
||||||
(void)sprintf(name,"onoise_%s%s",inst->MOS9name,MOS9nNames[i]);
|
(void)sprintf(name,"onoise_%s%s",inst->MOS9name,MOS9nNames[i]);
|
||||||
|
|
||||||
|
|
||||||
data->namelist = (IFuid *)trealloc((char *)data->namelist,(data->numPlots + 1)*sizeof(IFuid));
|
data->namelist = (IFuid *)trealloc((char *)data->namelist,(data->numPlots + 1)*sizeof(IFuid));
|
||||||
if (!data->namelist) return(E_NOMEM);
|
if (!data->namelist) return(E_NOMEM);
|
||||||
(*(SPfrontEnd->IFnewUid))(ckt,
|
(*(SPfrontEnd->IFnewUid))(ckt,
|
||||||
&(data->namelist[data->numPlots++]),
|
&(data->namelist[data->numPlots++]),
|
||||||
(IFuid)NULL,name,UID_OTHER,(void **)NULL);
|
(IFuid)NULL,name,UID_OTHER,(void **)NULL);
|
||||||
/* we've added one more plot */
|
/* we've added one more plot */
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INT_NOIZ:
|
case INT_NOIZ:
|
||||||
for (i=0; i < MOS9NSRCS; i++) {
|
for (i=0; i < MOS9NSRCS; i++) {
|
||||||
(void)sprintf(name,"onoise_total_%s%s",inst->MOS9name,MOS9nNames[i]);
|
(void)sprintf(name,"onoise_total_%s%s",inst->MOS9name,MOS9nNames[i]);
|
||||||
|
|
||||||
|
|
||||||
data->namelist = (IFuid *)trealloc((char *)data->namelist,(data->numPlots + 1)*sizeof(IFuid));
|
data->namelist = (IFuid *)trealloc((char *)data->namelist,(data->numPlots + 1)*sizeof(IFuid));
|
||||||
if (!data->namelist) return(E_NOMEM);
|
if (!data->namelist) return(E_NOMEM);
|
||||||
(*(SPfrontEnd->IFnewUid))(ckt,
|
(*(SPfrontEnd->IFnewUid))(ckt,
|
||||||
&(data->namelist[data->numPlots++]),
|
&(data->namelist[data->numPlots++]),
|
||||||
(IFuid)NULL,name,UID_OTHER,(void **)NULL);
|
(IFuid)NULL,name,UID_OTHER,(void **)NULL);
|
||||||
/* we've added one more plot */
|
/* we've added one more plot */
|
||||||
|
|
||||||
|
|
||||||
(void)sprintf(name,"inoise_total_%s%s",inst->MOS9name,MOS9nNames[i]);
|
(void)sprintf(name,"inoise_total_%s%s",inst->MOS9name,MOS9nNames[i]);
|
||||||
|
|
||||||
|
|
||||||
data->namelist = (IFuid *)trealloc((char *)data->namelist,(data->numPlots + 1)*sizeof(IFuid));
|
data->namelist = (IFuid *)trealloc((char *)data->namelist,(data->numPlots + 1)*sizeof(IFuid));
|
||||||
if (!data->namelist) return(E_NOMEM);
|
if (!data->namelist) return(E_NOMEM);
|
||||||
(*(SPfrontEnd->IFnewUid))(ckt,
|
(*(SPfrontEnd->IFnewUid))(ckt,
|
||||||
&(data->namelist[data->numPlots++]),
|
&(data->namelist[data->numPlots++]),
|
||||||
(IFuid)NULL,name,UID_OTHER,(void **)NULL);
|
(IFuid)NULL,name,UID_OTHER,(void **)NULL);
|
||||||
/* we've added one more plot */
|
/* we've added one more plot */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case N_CALC:
|
case N_CALC:
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
|
||||||
case N_DENS:
|
case N_DENS:
|
||||||
NevalSrc(&noizDens[MOS9RDNOIZ],&lnNdens[MOS9RDNOIZ],
|
NevalSrc(&noizDens[MOS9RDNOIZ],&lnNdens[MOS9RDNOIZ],
|
||||||
ckt,THERMNOISE,inst->MOS9dNodePrime,inst->MOS9dNode,
|
ckt,THERMNOISE,inst->MOS9dNodePrime,inst->MOS9dNode,
|
||||||
inst->MOS9drainConductance);
|
inst->MOS9drainConductance);
|
||||||
|
|
||||||
NevalSrc(&noizDens[MOS9RSNOIZ],&lnNdens[MOS9RSNOIZ],
|
NevalSrc(&noizDens[MOS9RSNOIZ],&lnNdens[MOS9RSNOIZ],
|
||||||
ckt,THERMNOISE,inst->MOS9sNodePrime,inst->MOS9sNode,
|
ckt,THERMNOISE,inst->MOS9sNodePrime,inst->MOS9sNode,
|
||||||
inst->MOS9sourceConductance);
|
inst->MOS9sourceConductance);
|
||||||
|
|
||||||
NevalSrc(&noizDens[MOS9IDNOIZ],&lnNdens[MOS9IDNOIZ],
|
NevalSrc(&noizDens[MOS9IDNOIZ],&lnNdens[MOS9IDNOIZ],
|
||||||
ckt,THERMNOISE,inst->MOS9dNodePrime,inst->MOS9sNodePrime,
|
ckt,THERMNOISE,inst->MOS9dNodePrime,inst->MOS9sNodePrime,
|
||||||
(2.0/3.0 * fabs(inst->MOS9gm)));
|
(2.0/3.0 * fabs(inst->MOS9gm)));
|
||||||
|
|
||||||
NevalSrc(&noizDens[MOS9FLNOIZ],(double*)NULL,ckt,
|
NevalSrc(&noizDens[MOS9FLNOIZ],(double*)NULL,ckt,
|
||||||
N_GAIN,inst->MOS9dNodePrime, inst->MOS9sNodePrime,
|
N_GAIN,inst->MOS9dNodePrime, inst->MOS9sNodePrime,
|
||||||
(double)0.0);
|
(double)0.0);
|
||||||
noizDens[MOS9FLNOIZ] *= model->MOS9fNcoef *
|
noizDens[MOS9FLNOIZ] *= model->MOS9fNcoef *
|
||||||
exp(model->MOS9fNexp *
|
exp(model->MOS9fNexp *
|
||||||
log(MAX(fabs(inst->MOS9cd),N_MINLOG))) /
|
log(MAX(fabs(inst->MOS9cd),N_MINLOG))) /
|
||||||
(data->freq *
|
(data->freq *
|
||||||
(inst->MOS9w - 2*model->MOS9widthNarrow) *
|
(inst->MOS9w - 2*model->MOS9widthNarrow) *
|
||||||
inst->MOS9m *
|
inst->MOS9m *
|
||||||
(inst->MOS9l - 2*model->MOS9latDiff) *
|
(inst->MOS9l - 2*model->MOS9latDiff) *
|
||||||
model->MOS9oxideCapFactor * model->MOS9oxideCapFactor);
|
model->MOS9oxideCapFactor * model->MOS9oxideCapFactor);
|
||||||
lnNdens[MOS9FLNOIZ] =
|
lnNdens[MOS9FLNOIZ] =
|
||||||
log(MAX(noizDens[MOS9FLNOIZ],N_MINLOG));
|
log(MAX(noizDens[MOS9FLNOIZ],N_MINLOG));
|
||||||
|
|
||||||
noizDens[MOS9TOTNOIZ] = noizDens[MOS9RDNOIZ] +
|
noizDens[MOS9TOTNOIZ] = noizDens[MOS9RDNOIZ] +
|
||||||
noizDens[MOS9RSNOIZ] +
|
noizDens[MOS9RSNOIZ] +
|
||||||
noizDens[MOS9IDNOIZ] +
|
noizDens[MOS9IDNOIZ] +
|
||||||
noizDens[MOS9FLNOIZ];
|
noizDens[MOS9FLNOIZ];
|
||||||
lnNdens[MOS9TOTNOIZ] =
|
lnNdens[MOS9TOTNOIZ] =
|
||||||
log(MAX(noizDens[MOS9TOTNOIZ], N_MINLOG));
|
log(MAX(noizDens[MOS9TOTNOIZ], N_MINLOG));
|
||||||
|
|
||||||
*OnDens += noizDens[MOS9TOTNOIZ];
|
*OnDens += noizDens[MOS9TOTNOIZ];
|
||||||
|
|
||||||
if (data->delFreq == 0.0) {
|
if (data->delFreq == 0.0) {
|
||||||
|
|
||||||
/* if we haven't done any previous integration, we need to */
|
/* if we haven't done any previous integration, we need to */
|
||||||
/* initialize our "history" variables */
|
/* initialize our "history" variables */
|
||||||
|
|
||||||
for (i=0; i < MOS9NSRCS; i++) {
|
for (i=0; i < MOS9NSRCS; i++) {
|
||||||
inst->MOS9nVar[LNLSTDENS][i] = lnNdens[i];
|
inst->MOS9nVar[LNLSTDENS][i] = lnNdens[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clear out our integration variables if it's the first pass */
|
/* clear out our integration variables if it's the first pass */
|
||||||
|
|
||||||
if (data->freq == ((NOISEAN*)ckt->CKTcurJob)->NstartFreq) {
|
if (data->freq == ((NOISEAN*)ckt->CKTcurJob)->NstartFreq) {
|
||||||
for (i=0; i < MOS9NSRCS; i++) {
|
for (i=0; i < MOS9NSRCS; i++) {
|
||||||
inst->MOS9nVar[OUTNOIZ][i] = 0.0;
|
inst->MOS9nVar[OUTNOIZ][i] = 0.0;
|
||||||
inst->MOS9nVar[INNOIZ][i] = 0.0;
|
inst->MOS9nVar[INNOIZ][i] = 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { /* data->delFreq != 0.0 (we have to integrate) */
|
} else { /* data->delFreq != 0.0 (we have to integrate) */
|
||||||
for (i=0; i < MOS9NSRCS; i++) {
|
for (i=0; i < MOS9NSRCS; i++) {
|
||||||
if (i != MOS9TOTNOIZ) {
|
if (i != MOS9TOTNOIZ) {
|
||||||
tempOnoise = Nintegrate(noizDens[i], lnNdens[i],
|
tempOnoise = Nintegrate(noizDens[i], lnNdens[i],
|
||||||
inst->MOS9nVar[LNLSTDENS][i], data);
|
inst->MOS9nVar[LNLSTDENS][i], data);
|
||||||
tempInoise = Nintegrate(noizDens[i] * data->GainSqInv ,
|
tempInoise = Nintegrate(noizDens[i] * data->GainSqInv ,
|
||||||
lnNdens[i] + data->lnGainInv,
|
lnNdens[i] + data->lnGainInv,
|
||||||
inst->MOS9nVar[LNLSTDENS][i] + data->lnGainInv,
|
inst->MOS9nVar[LNLSTDENS][i] + data->lnGainInv,
|
||||||
data);
|
data);
|
||||||
inst->MOS9nVar[LNLSTDENS][i] = lnNdens[i];
|
inst->MOS9nVar[LNLSTDENS][i] = lnNdens[i];
|
||||||
data->outNoiz += tempOnoise;
|
data->outNoiz += tempOnoise;
|
||||||
data->inNoise += tempInoise;
|
data->inNoise += tempInoise;
|
||||||
if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0) {
|
if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0) {
|
||||||
inst->MOS9nVar[OUTNOIZ][i] += tempOnoise;
|
inst->MOS9nVar[OUTNOIZ][i] += tempOnoise;
|
||||||
inst->MOS9nVar[OUTNOIZ][MOS9TOTNOIZ] += tempOnoise;
|
inst->MOS9nVar[OUTNOIZ][MOS9TOTNOIZ] += tempOnoise;
|
||||||
inst->MOS9nVar[INNOIZ][i] += tempInoise;
|
inst->MOS9nVar[INNOIZ][i] += tempInoise;
|
||||||
inst->MOS9nVar[INNOIZ][MOS9TOTNOIZ] += tempInoise;
|
inst->MOS9nVar[INNOIZ][MOS9TOTNOIZ] += tempInoise;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (data->prtSummary) {
|
if (data->prtSummary) {
|
||||||
for (i=0; i < MOS9NSRCS; i++) { /* print a summary report */
|
for (i=0; i < MOS9NSRCS; i++) { /* print a summary report */
|
||||||
data->outpVector[data->outNumber++] = noizDens[i];
|
data->outpVector[data->outNumber++] = noizDens[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INT_NOIZ: /* already calculated, just output */
|
case INT_NOIZ: /* already calculated, just output */
|
||||||
if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0) {
|
if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0) {
|
||||||
for (i=0; i < MOS9NSRCS; i++) {
|
for (i=0; i < MOS9NSRCS; i++) {
|
||||||
data->outpVector[data->outNumber++] = inst->MOS9nVar[OUTNOIZ][i];
|
data->outpVector[data->outNumber++] = inst->MOS9nVar[OUTNOIZ][i];
|
||||||
data->outpVector[data->outNumber++] = inst->MOS9nVar[INNOIZ][i];
|
data->outpVector[data->outNumber++] = inst->MOS9nVar[INNOIZ][i];
|
||||||
}
|
}
|
||||||
} /* if */
|
} /* if */
|
||||||
break;
|
break;
|
||||||
} /* switch (mode) */
|
} /* switch (mode) */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case N_CLOSE:
|
case N_CLOSE:
|
||||||
return (OK); /* do nothing, the main calling routine will close */
|
return (OK); /* do nothing, the main calling routine will close */
|
||||||
break; /* the plots */
|
break; /* the plots */
|
||||||
} /* switch (operation) */
|
} /* switch (operation) */
|
||||||
} /* for inst */
|
} /* for inst */
|
||||||
} /* for model */
|
} /* for model */
|
||||||
|
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,116 +1,116 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "ifsim.h"
|
#include "ifsim.h"
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
int
|
int
|
||||||
MOS9param(param,value,inst,select)
|
MOS9param(param,value,inst,select)
|
||||||
int param;
|
int param;
|
||||||
IFvalue *value;
|
IFvalue *value;
|
||||||
GENinstance *inst;
|
GENinstance *inst;
|
||||||
IFvalue *select;
|
IFvalue *select;
|
||||||
{
|
{
|
||||||
MOS9instance *here = (MOS9instance *)inst;
|
MOS9instance *here = (MOS9instance *)inst;
|
||||||
switch(param) {
|
switch(param) {
|
||||||
|
|
||||||
case MOS9_M:
|
case MOS9_M:
|
||||||
here->MOS9m = value->rValue;
|
here->MOS9m = value->rValue;
|
||||||
here->MOS9mGiven = TRUE;
|
here->MOS9mGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_W:
|
case MOS9_W:
|
||||||
here->MOS9w = value->rValue;
|
here->MOS9w = value->rValue;
|
||||||
here->MOS9wGiven = TRUE;
|
here->MOS9wGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_L:
|
case MOS9_L:
|
||||||
here->MOS9l = value->rValue;
|
here->MOS9l = value->rValue;
|
||||||
here->MOS9lGiven = TRUE;
|
here->MOS9lGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_AS:
|
case MOS9_AS:
|
||||||
here->MOS9sourceArea = value->rValue;
|
here->MOS9sourceArea = value->rValue;
|
||||||
here->MOS9sourceAreaGiven = TRUE;
|
here->MOS9sourceAreaGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_AD:
|
case MOS9_AD:
|
||||||
here->MOS9drainArea = value->rValue;
|
here->MOS9drainArea = value->rValue;
|
||||||
here->MOS9drainAreaGiven = TRUE;
|
here->MOS9drainAreaGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_PS:
|
case MOS9_PS:
|
||||||
here->MOS9sourcePerimiter = value->rValue;
|
here->MOS9sourcePerimiter = value->rValue;
|
||||||
here->MOS9sourcePerimiterGiven = TRUE;
|
here->MOS9sourcePerimiterGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_PD:
|
case MOS9_PD:
|
||||||
here->MOS9drainPerimiter = value->rValue;
|
here->MOS9drainPerimiter = value->rValue;
|
||||||
here->MOS9drainPerimiterGiven = TRUE;
|
here->MOS9drainPerimiterGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_NRS:
|
case MOS9_NRS:
|
||||||
here->MOS9sourceSquares = value->rValue;
|
here->MOS9sourceSquares = value->rValue;
|
||||||
here->MOS9sourceSquaresGiven = TRUE;
|
here->MOS9sourceSquaresGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_NRD:
|
case MOS9_NRD:
|
||||||
here->MOS9drainSquares = value->rValue;
|
here->MOS9drainSquares = value->rValue;
|
||||||
here->MOS9drainSquaresGiven = TRUE;
|
here->MOS9drainSquaresGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_OFF:
|
case MOS9_OFF:
|
||||||
here->MOS9off = value->iValue;
|
here->MOS9off = value->iValue;
|
||||||
break;
|
break;
|
||||||
case MOS9_IC_VBS:
|
case MOS9_IC_VBS:
|
||||||
here->MOS9icVBS = value->rValue;
|
here->MOS9icVBS = value->rValue;
|
||||||
here->MOS9icVBSGiven = TRUE;
|
here->MOS9icVBSGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_IC_VDS:
|
case MOS9_IC_VDS:
|
||||||
here->MOS9icVDS = value->rValue;
|
here->MOS9icVDS = value->rValue;
|
||||||
here->MOS9icVDSGiven = TRUE;
|
here->MOS9icVDSGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_IC_VGS:
|
case MOS9_IC_VGS:
|
||||||
here->MOS9icVGS = value->rValue;
|
here->MOS9icVGS = value->rValue;
|
||||||
here->MOS9icVGSGiven = TRUE;
|
here->MOS9icVGSGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_TEMP:
|
case MOS9_TEMP:
|
||||||
here->MOS9temp = value->rValue+CONSTCtoK;
|
here->MOS9temp = value->rValue+CONSTCtoK;
|
||||||
here->MOS9tempGiven = TRUE;
|
here->MOS9tempGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
case MOS9_IC:
|
case MOS9_IC:
|
||||||
switch(value->v.numValue){
|
switch(value->v.numValue){
|
||||||
case 3:
|
case 3:
|
||||||
here->MOS9icVBS = *(value->v.vec.rVec+2);
|
here->MOS9icVBS = *(value->v.vec.rVec+2);
|
||||||
here->MOS9icVBSGiven = TRUE;
|
here->MOS9icVBSGiven = TRUE;
|
||||||
case 2:
|
case 2:
|
||||||
here->MOS9icVGS = *(value->v.vec.rVec+1);
|
here->MOS9icVGS = *(value->v.vec.rVec+1);
|
||||||
here->MOS9icVGSGiven = TRUE;
|
here->MOS9icVGSGiven = TRUE;
|
||||||
case 1:
|
case 1:
|
||||||
here->MOS9icVDS = *(value->v.vec.rVec);
|
here->MOS9icVDS = *(value->v.vec.rVec);
|
||||||
here->MOS9icVDSGiven = TRUE;
|
here->MOS9icVDSGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return(E_BADPARM);
|
return(E_BADPARM);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MOS9_L_SENS:
|
case MOS9_L_SENS:
|
||||||
if(value->iValue) {
|
if(value->iValue) {
|
||||||
here->MOS9senParmNo = 1;
|
here->MOS9senParmNo = 1;
|
||||||
here->MOS9sens_l = 1;
|
here->MOS9sens_l = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MOS9_W_SENS:
|
case MOS9_W_SENS:
|
||||||
if(value->iValue) {
|
if(value->iValue) {
|
||||||
here->MOS9senParmNo = 1;
|
here->MOS9senParmNo = 1;
|
||||||
here->MOS9sens_w = 1;
|
here->MOS9sens_w = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return(E_BADPARM);
|
return(E_BADPARM);
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,141 +1,141 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ngspice.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "cktdefs.h"
|
|
||||||
#include "complex.h"
|
|
||||||
#include "mos9defs.h"
|
|
||||||
#include "sperror.h"
|
|
||||||
#include "suffix.h"
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
MOS9pzLoad(inModel,ckt,s)
|
|
||||||
GENmodel *inModel;
|
|
||||||
CKTcircuit *ckt;
|
|
||||||
SPcomplex *s;
|
|
||||||
{
|
|
||||||
MOS9model *model = (MOS9model *)inModel;
|
|
||||||
MOS9instance *here;
|
|
||||||
int xnrm;
|
|
||||||
int xrev;
|
|
||||||
double xgs;
|
|
||||||
double xgd;
|
|
||||||
double xgb;
|
|
||||||
double xbd;
|
|
||||||
double xbs;
|
|
||||||
double capgs;
|
|
||||||
double capgd;
|
|
||||||
double capgb;
|
|
||||||
double GateBulkOverlapCap;
|
|
||||||
double GateDrainOverlapCap;
|
|
||||||
double GateSourceOverlapCap;
|
|
||||||
double EffectiveLength;
|
|
||||||
double EffectiveWidth;
|
|
||||||
|
|
||||||
for( ; model != NULL; model = model->MOS9nextModel) {
|
|
||||||
for(here = model->MOS9instances; here!= NULL;
|
|
||||||
here = here->MOS9nextInstance) {
|
|
||||||
|
|
||||||
if (here->MOS9mode < 0) {
|
|
||||||
xnrm=0;
|
|
||||||
xrev=1;
|
|
||||||
} else {
|
|
||||||
xnrm=1;
|
|
||||||
xrev=0;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* meyer's model parameters
|
|
||||||
*/
|
|
||||||
|
|
||||||
EffectiveWidth=here->MOS9w-2*model->MOS9widthNarrow+
|
|
||||||
model->MOS9widthAdjust;
|
|
||||||
EffectiveLength=here->MOS9l - 2*model->MOS9latDiff+
|
|
||||||
model->MOS9lengthAdjust;
|
|
||||||
|
|
||||||
GateSourceOverlapCap = model->MOS9gateSourceOverlapCapFactor *
|
|
||||||
here->MOS9m * EffectiveWidth;
|
|
||||||
GateDrainOverlapCap = model->MOS9gateDrainOverlapCapFactor *
|
|
||||||
here->MOS9m * EffectiveWidth;
|
|
||||||
GateBulkOverlapCap = model->MOS9gateBulkOverlapCapFactor *
|
|
||||||
here->MOS9m * EffectiveLength;
|
|
||||||
|
|
||||||
capgs = ( 2* *(ckt->CKTstate0+here->MOS9capgs)+
|
#include "ngspice.h"
|
||||||
GateSourceOverlapCap );
|
#include <stdio.h>
|
||||||
capgd = ( 2* *(ckt->CKTstate0+here->MOS9capgd)+
|
#include "cktdefs.h"
|
||||||
GateDrainOverlapCap );
|
#include "complex.h"
|
||||||
capgb = ( 2* *(ckt->CKTstate0+here->MOS9capgb)+
|
#include "mos9defs.h"
|
||||||
GateBulkOverlapCap );
|
#include "sperror.h"
|
||||||
xgs = capgs;
|
#include "suffix.h"
|
||||||
xgd = capgd;
|
|
||||||
xgb = capgb;
|
|
||||||
xbd = here->MOS9capbd;
|
int
|
||||||
xbs = here->MOS9capbs;
|
MOS9pzLoad(inModel,ckt,s)
|
||||||
/*printf("mos2: xgs=%g, xgd=%g, xgb=%g, xbd=%g, xbs=%g\n",
|
GENmodel *inModel;
|
||||||
xgs,xgd,xgb,xbd,xbs);*/
|
CKTcircuit *ckt;
|
||||||
/*
|
SPcomplex *s;
|
||||||
* load matrix
|
{
|
||||||
*/
|
MOS9model *model = (MOS9model *)inModel;
|
||||||
|
MOS9instance *here;
|
||||||
*(here->MOS9GgPtr ) += (xgd+xgs+xgb)*s->real;
|
int xnrm;
|
||||||
*(here->MOS9GgPtr +1) += (xgd+xgs+xgb)*s->imag;
|
int xrev;
|
||||||
*(here->MOS9BbPtr ) += (xgb+xbd+xbs)*s->real;
|
double xgs;
|
||||||
*(here->MOS9BbPtr +1) += (xgb+xbd+xbs)*s->imag;
|
double xgd;
|
||||||
*(here->MOS9DPdpPtr ) += (xgd+xbd)*s->real;
|
double xgb;
|
||||||
*(here->MOS9DPdpPtr +1) += (xgd+xbd)*s->imag;
|
double xbd;
|
||||||
*(here->MOS9SPspPtr ) += (xgs+xbs)*s->real;
|
double xbs;
|
||||||
*(here->MOS9SPspPtr +1) += (xgs+xbs)*s->imag;
|
double capgs;
|
||||||
*(here->MOS9GbPtr ) -= xgb*s->real;
|
double capgd;
|
||||||
*(here->MOS9GbPtr +1) -= xgb*s->imag;
|
double capgb;
|
||||||
*(here->MOS9GdpPtr ) -= xgd*s->real;
|
double GateBulkOverlapCap;
|
||||||
*(here->MOS9GdpPtr +1) -= xgd*s->imag;
|
double GateDrainOverlapCap;
|
||||||
*(here->MOS9GspPtr ) -= xgs*s->real;
|
double GateSourceOverlapCap;
|
||||||
*(here->MOS9GspPtr +1) -= xgs*s->imag;
|
double EffectiveLength;
|
||||||
*(here->MOS9BgPtr ) -= xgb*s->real;
|
double EffectiveWidth;
|
||||||
*(here->MOS9BgPtr +1) -= xgb*s->imag;
|
|
||||||
*(here->MOS9BdpPtr ) -= xbd*s->real;
|
for( ; model != NULL; model = model->MOS9nextModel) {
|
||||||
*(here->MOS9BdpPtr +1) -= xbd*s->imag;
|
for(here = model->MOS9instances; here!= NULL;
|
||||||
*(here->MOS9BspPtr ) -= xbs*s->real;
|
here = here->MOS9nextInstance) {
|
||||||
*(here->MOS9BspPtr +1) -= xbs*s->imag;
|
|
||||||
*(here->MOS9DPgPtr ) -= xgd*s->real;
|
if (here->MOS9mode < 0) {
|
||||||
*(here->MOS9DPgPtr +1) -= xgd*s->imag;
|
xnrm=0;
|
||||||
*(here->MOS9DPbPtr ) -= xbd*s->real;
|
xrev=1;
|
||||||
*(here->MOS9DPbPtr +1) -= xbd*s->imag;
|
} else {
|
||||||
*(here->MOS9SPgPtr ) -= xgs*s->real;
|
xnrm=1;
|
||||||
*(here->MOS9SPgPtr +1) -= xgs*s->imag;
|
xrev=0;
|
||||||
*(here->MOS9SPbPtr ) -= xbs*s->real;
|
}
|
||||||
*(here->MOS9SPbPtr +1) -= xbs*s->imag;
|
/*
|
||||||
*(here->MOS9DdPtr) += here->MOS9drainConductance;
|
* meyer's model parameters
|
||||||
*(here->MOS9SsPtr) += here->MOS9sourceConductance;
|
*/
|
||||||
*(here->MOS9BbPtr) += here->MOS9gbd+here->MOS9gbs;
|
|
||||||
*(here->MOS9DPdpPtr) += here->MOS9drainConductance+
|
EffectiveWidth=here->MOS9w-2*model->MOS9widthNarrow+
|
||||||
here->MOS9gds+here->MOS9gbd+
|
model->MOS9widthAdjust;
|
||||||
xrev*(here->MOS9gm+here->MOS9gmbs);
|
EffectiveLength=here->MOS9l - 2*model->MOS9latDiff+
|
||||||
*(here->MOS9SPspPtr) += here->MOS9sourceConductance+
|
model->MOS9lengthAdjust;
|
||||||
here->MOS9gds+here->MOS9gbs+
|
|
||||||
xnrm*(here->MOS9gm+here->MOS9gmbs);
|
GateSourceOverlapCap = model->MOS9gateSourceOverlapCapFactor *
|
||||||
*(here->MOS9DdpPtr) -= here->MOS9drainConductance;
|
here->MOS9m * EffectiveWidth;
|
||||||
*(here->MOS9SspPtr) -= here->MOS9sourceConductance;
|
GateDrainOverlapCap = model->MOS9gateDrainOverlapCapFactor *
|
||||||
*(here->MOS9BdpPtr) -= here->MOS9gbd;
|
here->MOS9m * EffectiveWidth;
|
||||||
*(here->MOS9BspPtr) -= here->MOS9gbs;
|
GateBulkOverlapCap = model->MOS9gateBulkOverlapCapFactor *
|
||||||
*(here->MOS9DPdPtr) -= here->MOS9drainConductance;
|
here->MOS9m * EffectiveLength;
|
||||||
*(here->MOS9DPgPtr) += (xnrm-xrev)*here->MOS9gm;
|
|
||||||
*(here->MOS9DPbPtr) += -here->MOS9gbd+(xnrm-xrev)*here->MOS9gmbs;
|
capgs = ( 2* *(ckt->CKTstate0+here->MOS9capgs)+
|
||||||
*(here->MOS9DPspPtr) -= here->MOS9gds+
|
GateSourceOverlapCap );
|
||||||
xnrm*(here->MOS9gm+here->MOS9gmbs);
|
capgd = ( 2* *(ckt->CKTstate0+here->MOS9capgd)+
|
||||||
*(here->MOS9SPgPtr) -= (xnrm-xrev)*here->MOS9gm;
|
GateDrainOverlapCap );
|
||||||
*(here->MOS9SPsPtr) -= here->MOS9sourceConductance;
|
capgb = ( 2* *(ckt->CKTstate0+here->MOS9capgb)+
|
||||||
*(here->MOS9SPbPtr) -= here->MOS9gbs+(xnrm-xrev)*here->MOS9gmbs;
|
GateBulkOverlapCap );
|
||||||
*(here->MOS9SPdpPtr) -= here->MOS9gds+
|
xgs = capgs;
|
||||||
xrev*(here->MOS9gm+here->MOS9gmbs);
|
xgd = capgd;
|
||||||
|
xgb = capgb;
|
||||||
}
|
xbd = here->MOS9capbd;
|
||||||
}
|
xbs = here->MOS9capbs;
|
||||||
return(OK);
|
/*printf("mos2: xgs=%g, xgd=%g, xgb=%g, xbd=%g, xbs=%g\n",
|
||||||
}
|
xgs,xgd,xgb,xbd,xbs);*/
|
||||||
|
/*
|
||||||
|
* load matrix
|
||||||
|
*/
|
||||||
|
|
||||||
|
*(here->MOS9GgPtr ) += (xgd+xgs+xgb)*s->real;
|
||||||
|
*(here->MOS9GgPtr +1) += (xgd+xgs+xgb)*s->imag;
|
||||||
|
*(here->MOS9BbPtr ) += (xgb+xbd+xbs)*s->real;
|
||||||
|
*(here->MOS9BbPtr +1) += (xgb+xbd+xbs)*s->imag;
|
||||||
|
*(here->MOS9DPdpPtr ) += (xgd+xbd)*s->real;
|
||||||
|
*(here->MOS9DPdpPtr +1) += (xgd+xbd)*s->imag;
|
||||||
|
*(here->MOS9SPspPtr ) += (xgs+xbs)*s->real;
|
||||||
|
*(here->MOS9SPspPtr +1) += (xgs+xbs)*s->imag;
|
||||||
|
*(here->MOS9GbPtr ) -= xgb*s->real;
|
||||||
|
*(here->MOS9GbPtr +1) -= xgb*s->imag;
|
||||||
|
*(here->MOS9GdpPtr ) -= xgd*s->real;
|
||||||
|
*(here->MOS9GdpPtr +1) -= xgd*s->imag;
|
||||||
|
*(here->MOS9GspPtr ) -= xgs*s->real;
|
||||||
|
*(here->MOS9GspPtr +1) -= xgs*s->imag;
|
||||||
|
*(here->MOS9BgPtr ) -= xgb*s->real;
|
||||||
|
*(here->MOS9BgPtr +1) -= xgb*s->imag;
|
||||||
|
*(here->MOS9BdpPtr ) -= xbd*s->real;
|
||||||
|
*(here->MOS9BdpPtr +1) -= xbd*s->imag;
|
||||||
|
*(here->MOS9BspPtr ) -= xbs*s->real;
|
||||||
|
*(here->MOS9BspPtr +1) -= xbs*s->imag;
|
||||||
|
*(here->MOS9DPgPtr ) -= xgd*s->real;
|
||||||
|
*(here->MOS9DPgPtr +1) -= xgd*s->imag;
|
||||||
|
*(here->MOS9DPbPtr ) -= xbd*s->real;
|
||||||
|
*(here->MOS9DPbPtr +1) -= xbd*s->imag;
|
||||||
|
*(here->MOS9SPgPtr ) -= xgs*s->real;
|
||||||
|
*(here->MOS9SPgPtr +1) -= xgs*s->imag;
|
||||||
|
*(here->MOS9SPbPtr ) -= xbs*s->real;
|
||||||
|
*(here->MOS9SPbPtr +1) -= xbs*s->imag;
|
||||||
|
*(here->MOS9DdPtr) += here->MOS9drainConductance;
|
||||||
|
*(here->MOS9SsPtr) += here->MOS9sourceConductance;
|
||||||
|
*(here->MOS9BbPtr) += here->MOS9gbd+here->MOS9gbs;
|
||||||
|
*(here->MOS9DPdpPtr) += here->MOS9drainConductance+
|
||||||
|
here->MOS9gds+here->MOS9gbd+
|
||||||
|
xrev*(here->MOS9gm+here->MOS9gmbs);
|
||||||
|
*(here->MOS9SPspPtr) += here->MOS9sourceConductance+
|
||||||
|
here->MOS9gds+here->MOS9gbs+
|
||||||
|
xnrm*(here->MOS9gm+here->MOS9gmbs);
|
||||||
|
*(here->MOS9DdpPtr) -= here->MOS9drainConductance;
|
||||||
|
*(here->MOS9SspPtr) -= here->MOS9sourceConductance;
|
||||||
|
*(here->MOS9BdpPtr) -= here->MOS9gbd;
|
||||||
|
*(here->MOS9BspPtr) -= here->MOS9gbs;
|
||||||
|
*(here->MOS9DPdPtr) -= here->MOS9drainConductance;
|
||||||
|
*(here->MOS9DPgPtr) += (xnrm-xrev)*here->MOS9gm;
|
||||||
|
*(here->MOS9DPbPtr) += -here->MOS9gbd+(xnrm-xrev)*here->MOS9gmbs;
|
||||||
|
*(here->MOS9DPspPtr) -= here->MOS9gds+
|
||||||
|
xnrm*(here->MOS9gm+here->MOS9gmbs);
|
||||||
|
*(here->MOS9SPgPtr) -= (xnrm-xrev)*here->MOS9gm;
|
||||||
|
*(here->MOS9SPsPtr) -= here->MOS9sourceConductance;
|
||||||
|
*(here->MOS9SPbPtr) -= here->MOS9gbs+(xnrm-xrev)*here->MOS9gmbs;
|
||||||
|
*(here->MOS9SPdpPtr) -= here->MOS9gds+
|
||||||
|
xrev*(here->MOS9gm+here->MOS9gmbs);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(OK);
|
||||||
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,294 +1,294 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "smpdefs.h"
|
#include "smpdefs.h"
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
/* assuming silicon - make definition for epsilon of silicon */
|
/* assuming silicon - make definition for epsilon of silicon */
|
||||||
#define EPSSIL (11.7 * 8.854214871e-12)
|
#define EPSSIL (11.7 * 8.854214871e-12)
|
||||||
|
|
||||||
int
|
int
|
||||||
MOS9setup(matrix,inModel,ckt,states)
|
MOS9setup(matrix,inModel,ckt,states)
|
||||||
SMPmatrix *matrix;
|
SMPmatrix *matrix;
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
CKTcircuit *ckt;
|
||||||
int *states;
|
int *states;
|
||||||
/* load the MOS9 device structure with those pointers needed later
|
/* load the MOS9 device structure with those pointers needed later
|
||||||
* for fast matrix loading
|
* for fast matrix loading
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{
|
{
|
||||||
register MOS9model *model = (MOS9model *)inModel;
|
register MOS9model *model = (MOS9model *)inModel;
|
||||||
register MOS9instance *here;
|
register MOS9instance *here;
|
||||||
int error;
|
int error;
|
||||||
CKTnode *tmp;
|
CKTnode *tmp;
|
||||||
|
|
||||||
/* loop through all the MOS9 device models */
|
/* loop through all the MOS9 device models */
|
||||||
for( ; model != NULL; model = model->MOS9nextModel ) {
|
for( ; model != NULL; model = model->MOS9nextModel ) {
|
||||||
|
|
||||||
/* perform model defaulting */
|
/* perform model defaulting */
|
||||||
if(!model->MOS9typeGiven) {
|
if(!model->MOS9typeGiven) {
|
||||||
model->MOS9type = NMOS;
|
model->MOS9type = NMOS;
|
||||||
}
|
}
|
||||||
if(!model->MOS9latDiffGiven) {
|
if(!model->MOS9latDiffGiven) {
|
||||||
model->MOS9latDiff = 0;
|
model->MOS9latDiff = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9lengthAdjustGiven) {
|
if(!model->MOS9lengthAdjustGiven) {
|
||||||
model->MOS9lengthAdjust = 0;
|
model->MOS9lengthAdjust = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9widthNarrowGiven) {
|
if(!model->MOS9widthNarrowGiven) {
|
||||||
model->MOS9widthNarrow = 0;
|
model->MOS9widthNarrow = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9widthAdjustGiven) {
|
if(!model->MOS9widthAdjustGiven) {
|
||||||
model->MOS9widthAdjust = 0;
|
model->MOS9widthAdjust = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9delvt0Given) {
|
if(!model->MOS9delvt0Given) {
|
||||||
model->MOS9delvt0 = 0;
|
model->MOS9delvt0 = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9jctSatCurDensityGiven) {
|
if(!model->MOS9jctSatCurDensityGiven) {
|
||||||
model->MOS9jctSatCurDensity = 0;
|
model->MOS9jctSatCurDensity = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9jctSatCurGiven) {
|
if(!model->MOS9jctSatCurGiven) {
|
||||||
model->MOS9jctSatCur = 1e-14;
|
model->MOS9jctSatCur = 1e-14;
|
||||||
}
|
}
|
||||||
if(!model->MOS9drainResistanceGiven) {
|
if(!model->MOS9drainResistanceGiven) {
|
||||||
model->MOS9drainResistance = 0;
|
model->MOS9drainResistance = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9sourceResistanceGiven) {
|
if(!model->MOS9sourceResistanceGiven) {
|
||||||
model->MOS9sourceResistance = 0;
|
model->MOS9sourceResistance = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9sheetResistanceGiven) {
|
if(!model->MOS9sheetResistanceGiven) {
|
||||||
model->MOS9sheetResistance = 0;
|
model->MOS9sheetResistance = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9transconductanceGiven) {
|
if(!model->MOS9transconductanceGiven) {
|
||||||
model->MOS9transconductance = 2e-5;
|
model->MOS9transconductance = 2e-5;
|
||||||
}
|
}
|
||||||
if(!model->MOS9gateSourceOverlapCapFactorGiven) {
|
if(!model->MOS9gateSourceOverlapCapFactorGiven) {
|
||||||
model->MOS9gateSourceOverlapCapFactor = 0;
|
model->MOS9gateSourceOverlapCapFactor = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9gateDrainOverlapCapFactorGiven) {
|
if(!model->MOS9gateDrainOverlapCapFactorGiven) {
|
||||||
model->MOS9gateDrainOverlapCapFactor = 0;
|
model->MOS9gateDrainOverlapCapFactor = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9gateBulkOverlapCapFactorGiven) {
|
if(!model->MOS9gateBulkOverlapCapFactorGiven) {
|
||||||
model->MOS9gateBulkOverlapCapFactor = 0;
|
model->MOS9gateBulkOverlapCapFactor = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9vt0Given) {
|
if(!model->MOS9vt0Given) {
|
||||||
model->MOS9vt0 = 0;
|
model->MOS9vt0 = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9capBDGiven) {
|
if(!model->MOS9capBDGiven) {
|
||||||
model->MOS9capBD = 0;
|
model->MOS9capBD = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9capBSGiven) {
|
if(!model->MOS9capBSGiven) {
|
||||||
model->MOS9capBS = 0;
|
model->MOS9capBS = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9bulkCapFactorGiven) {
|
if(!model->MOS9bulkCapFactorGiven) {
|
||||||
model->MOS9bulkCapFactor = 0;
|
model->MOS9bulkCapFactor = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9sideWallCapFactorGiven) {
|
if(!model->MOS9sideWallCapFactorGiven) {
|
||||||
model->MOS9sideWallCapFactor = 0;
|
model->MOS9sideWallCapFactor = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9bulkJctPotentialGiven) {
|
if(!model->MOS9bulkJctPotentialGiven) {
|
||||||
model->MOS9bulkJctPotential = .8;
|
model->MOS9bulkJctPotential = .8;
|
||||||
}
|
}
|
||||||
if(!model->MOS9bulkJctBotGradingCoeffGiven) {
|
if(!model->MOS9bulkJctBotGradingCoeffGiven) {
|
||||||
model->MOS9bulkJctBotGradingCoeff = .5;
|
model->MOS9bulkJctBotGradingCoeff = .5;
|
||||||
}
|
}
|
||||||
if(!model->MOS9bulkJctSideGradingCoeffGiven) {
|
if(!model->MOS9bulkJctSideGradingCoeffGiven) {
|
||||||
model->MOS9bulkJctSideGradingCoeff = .33;
|
model->MOS9bulkJctSideGradingCoeff = .33;
|
||||||
}
|
}
|
||||||
if(!model->MOS9fwdCapDepCoeffGiven) {
|
if(!model->MOS9fwdCapDepCoeffGiven) {
|
||||||
model->MOS9fwdCapDepCoeff = .5;
|
model->MOS9fwdCapDepCoeff = .5;
|
||||||
}
|
}
|
||||||
if(!model->MOS9phiGiven) {
|
if(!model->MOS9phiGiven) {
|
||||||
model->MOS9phi = .6;
|
model->MOS9phi = .6;
|
||||||
}
|
}
|
||||||
if(!model->MOS9gammaGiven) {
|
if(!model->MOS9gammaGiven) {
|
||||||
model->MOS9gamma = 0;
|
model->MOS9gamma = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9deltaGiven) {
|
if(!model->MOS9deltaGiven) {
|
||||||
model->MOS9delta = 0;
|
model->MOS9delta = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9maxDriftVelGiven) {
|
if(!model->MOS9maxDriftVelGiven) {
|
||||||
model->MOS9maxDriftVel = 0;
|
model->MOS9maxDriftVel = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9junctionDepthGiven) {
|
if(!model->MOS9junctionDepthGiven) {
|
||||||
model->MOS9junctionDepth = 0;
|
model->MOS9junctionDepth = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9fastSurfaceStateDensityGiven) {
|
if(!model->MOS9fastSurfaceStateDensityGiven) {
|
||||||
model->MOS9fastSurfaceStateDensity = 0;
|
model->MOS9fastSurfaceStateDensity = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9etaGiven) {
|
if(!model->MOS9etaGiven) {
|
||||||
model->MOS9eta = 0;
|
model->MOS9eta = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9thetaGiven) {
|
if(!model->MOS9thetaGiven) {
|
||||||
model->MOS9theta = 0;
|
model->MOS9theta = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9kappaGiven) {
|
if(!model->MOS9kappaGiven) {
|
||||||
model->MOS9kappa = .2;
|
model->MOS9kappa = .2;
|
||||||
}
|
}
|
||||||
if(!model->MOS9oxideThicknessGiven) {
|
if(!model->MOS9oxideThicknessGiven) {
|
||||||
model->MOS9oxideThickness = 1e-7;
|
model->MOS9oxideThickness = 1e-7;
|
||||||
}
|
}
|
||||||
if(!model->MOS9fNcoefGiven) {
|
if(!model->MOS9fNcoefGiven) {
|
||||||
model->MOS9fNcoef = 0;
|
model->MOS9fNcoef = 0;
|
||||||
}
|
}
|
||||||
if(!model->MOS9fNexpGiven) {
|
if(!model->MOS9fNexpGiven) {
|
||||||
model->MOS9fNexp = 1;
|
model->MOS9fNexp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->MOS9instances; here != NULL ;
|
for (here = model->MOS9instances; here != NULL ;
|
||||||
here=here->MOS9nextInstance) {
|
here=here->MOS9nextInstance) {
|
||||||
|
|
||||||
CKTnode *tmpNode;
|
CKTnode *tmpNode;
|
||||||
IFuid tmpName;
|
IFuid tmpName;
|
||||||
|
|
||||||
/* allocate a chunk of the state vector */
|
/* allocate a chunk of the state vector */
|
||||||
here->MOS9states = *states;
|
here->MOS9states = *states;
|
||||||
*states += MOS9NUMSTATES;
|
*states += MOS9NUMSTATES;
|
||||||
|
|
||||||
if(!here->MOS9drainAreaGiven) {
|
if(!here->MOS9drainAreaGiven) {
|
||||||
here->MOS9drainArea = ckt->CKTdefaultMosAD;
|
here->MOS9drainArea = ckt->CKTdefaultMosAD;
|
||||||
}
|
}
|
||||||
if(!here->MOS9drainPerimiterGiven) {
|
if(!here->MOS9drainPerimiterGiven) {
|
||||||
here->MOS9drainPerimiter = 0;
|
here->MOS9drainPerimiter = 0;
|
||||||
}
|
}
|
||||||
if(!here->MOS9drainSquaresGiven) {
|
if(!here->MOS9drainSquaresGiven) {
|
||||||
here->MOS9drainSquares = 1;
|
here->MOS9drainSquares = 1;
|
||||||
}
|
}
|
||||||
if(!here->MOS9icVBSGiven) {
|
if(!here->MOS9icVBSGiven) {
|
||||||
here->MOS9icVBS = 0;
|
here->MOS9icVBS = 0;
|
||||||
}
|
}
|
||||||
if(!here->MOS9icVDSGiven) {
|
if(!here->MOS9icVDSGiven) {
|
||||||
here->MOS9icVDS = 0;
|
here->MOS9icVDS = 0;
|
||||||
}
|
}
|
||||||
if(!here->MOS9icVGSGiven) {
|
if(!here->MOS9icVGSGiven) {
|
||||||
here->MOS9icVGS = 0;
|
here->MOS9icVGS = 0;
|
||||||
}
|
}
|
||||||
if(!here->MOS9sourcePerimiterGiven) {
|
if(!here->MOS9sourcePerimiterGiven) {
|
||||||
here->MOS9sourcePerimiter = 0;
|
here->MOS9sourcePerimiter = 0;
|
||||||
}
|
}
|
||||||
if(!here->MOS9sourceSquaresGiven) {
|
if(!here->MOS9sourceSquaresGiven) {
|
||||||
here->MOS9sourceSquares = 1;
|
here->MOS9sourceSquares = 1;
|
||||||
}
|
}
|
||||||
if(!here->MOS9vdsatGiven) {
|
if(!here->MOS9vdsatGiven) {
|
||||||
here->MOS9vdsat = 0;
|
here->MOS9vdsat = 0;
|
||||||
}
|
}
|
||||||
if(!here->MOS9vonGiven) {
|
if(!here->MOS9vonGiven) {
|
||||||
here->MOS9von = 0;
|
here->MOS9von = 0;
|
||||||
}
|
}
|
||||||
if(!here->MOS9modeGiven) {
|
if(!here->MOS9modeGiven) {
|
||||||
here->MOS9mode = 1;
|
here->MOS9mode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((model->MOS9drainResistance != 0 ||
|
if((model->MOS9drainResistance != 0 ||
|
||||||
(model->MOS9sheetResistance != 0 &&
|
(model->MOS9sheetResistance != 0 &&
|
||||||
here->MOS9drainSquares != 0 ) ) &&
|
here->MOS9drainSquares != 0 ) ) &&
|
||||||
here->MOS9dNodePrime==0) {
|
here->MOS9dNodePrime==0) {
|
||||||
error = CKTmkVolt(ckt,&tmp,here->MOS9name,"internal#drain");
|
error = CKTmkVolt(ckt,&tmp,here->MOS9name,"internal#drain");
|
||||||
if(error) return(error);
|
if(error) return(error);
|
||||||
here->MOS9dNodePrime = tmp->number;
|
here->MOS9dNodePrime = tmp->number;
|
||||||
if (ckt->CKTcopyNodesets) {
|
if (ckt->CKTcopyNodesets) {
|
||||||
if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) {
|
if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) {
|
||||||
if (tmpNode->nsGiven) {
|
if (tmpNode->nsGiven) {
|
||||||
tmp->nodeset=tmpNode->nodeset;
|
tmp->nodeset=tmpNode->nodeset;
|
||||||
tmp->nsGiven=tmpNode->nsGiven;
|
tmp->nsGiven=tmpNode->nsGiven;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
here->MOS9dNodePrime = here->MOS9dNode;
|
here->MOS9dNodePrime = here->MOS9dNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((model->MOS9sourceResistance != 0 ||
|
if((model->MOS9sourceResistance != 0 ||
|
||||||
(model->MOS9sheetResistance != 0 &&
|
(model->MOS9sheetResistance != 0 &&
|
||||||
here->MOS9sourceSquares != 0 ) ) &&
|
here->MOS9sourceSquares != 0 ) ) &&
|
||||||
here->MOS9sNodePrime==0) {
|
here->MOS9sNodePrime==0) {
|
||||||
error = CKTmkVolt(ckt,&tmp,here->MOS9name,"internal#source");
|
error = CKTmkVolt(ckt,&tmp,here->MOS9name,"internal#source");
|
||||||
if(error) return(error);
|
if(error) return(error);
|
||||||
here->MOS9sNodePrime = tmp->number;
|
here->MOS9sNodePrime = tmp->number;
|
||||||
if (ckt->CKTcopyNodesets) {
|
if (ckt->CKTcopyNodesets) {
|
||||||
if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) {
|
if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) {
|
||||||
if (tmpNode->nsGiven) {
|
if (tmpNode->nsGiven) {
|
||||||
tmp->nodeset=tmpNode->nodeset;
|
tmp->nodeset=tmpNode->nodeset;
|
||||||
tmp->nsGiven=tmpNode->nsGiven;
|
tmp->nsGiven=tmpNode->nsGiven;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
here->MOS9sNodePrime = here->MOS9sNode;
|
here->MOS9sNodePrime = here->MOS9sNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* macro to make elements with built in test for out of memory */
|
/* macro to make elements with built in test for out of memory */
|
||||||
#define TSTALLOC(ptr,first,second) \
|
#define TSTALLOC(ptr,first,second) \
|
||||||
if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\
|
if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\
|
||||||
return(E_NOMEM);\
|
return(E_NOMEM);\
|
||||||
}
|
}
|
||||||
|
|
||||||
TSTALLOC(MOS9DdPtr, MOS9dNode, MOS9dNode)
|
TSTALLOC(MOS9DdPtr, MOS9dNode, MOS9dNode)
|
||||||
TSTALLOC(MOS9GgPtr, MOS9gNode, MOS9gNode)
|
TSTALLOC(MOS9GgPtr, MOS9gNode, MOS9gNode)
|
||||||
TSTALLOC(MOS9SsPtr, MOS9sNode, MOS9sNode)
|
TSTALLOC(MOS9SsPtr, MOS9sNode, MOS9sNode)
|
||||||
TSTALLOC(MOS9BbPtr, MOS9bNode, MOS9bNode)
|
TSTALLOC(MOS9BbPtr, MOS9bNode, MOS9bNode)
|
||||||
TSTALLOC(MOS9DPdpPtr, MOS9dNodePrime, MOS9dNodePrime)
|
TSTALLOC(MOS9DPdpPtr, MOS9dNodePrime, MOS9dNodePrime)
|
||||||
TSTALLOC(MOS9SPspPtr, MOS9sNodePrime, MOS9sNodePrime)
|
TSTALLOC(MOS9SPspPtr, MOS9sNodePrime, MOS9sNodePrime)
|
||||||
TSTALLOC(MOS9DdpPtr, MOS9dNode, MOS9dNodePrime)
|
TSTALLOC(MOS9DdpPtr, MOS9dNode, MOS9dNodePrime)
|
||||||
TSTALLOC(MOS9GbPtr, MOS9gNode, MOS9bNode)
|
TSTALLOC(MOS9GbPtr, MOS9gNode, MOS9bNode)
|
||||||
TSTALLOC(MOS9GdpPtr, MOS9gNode, MOS9dNodePrime)
|
TSTALLOC(MOS9GdpPtr, MOS9gNode, MOS9dNodePrime)
|
||||||
TSTALLOC(MOS9GspPtr, MOS9gNode, MOS9sNodePrime)
|
TSTALLOC(MOS9GspPtr, MOS9gNode, MOS9sNodePrime)
|
||||||
TSTALLOC(MOS9SspPtr, MOS9sNode, MOS9sNodePrime)
|
TSTALLOC(MOS9SspPtr, MOS9sNode, MOS9sNodePrime)
|
||||||
TSTALLOC(MOS9BdpPtr, MOS9bNode, MOS9dNodePrime)
|
TSTALLOC(MOS9BdpPtr, MOS9bNode, MOS9dNodePrime)
|
||||||
TSTALLOC(MOS9BspPtr, MOS9bNode, MOS9sNodePrime)
|
TSTALLOC(MOS9BspPtr, MOS9bNode, MOS9sNodePrime)
|
||||||
TSTALLOC(MOS9DPspPtr, MOS9dNodePrime, MOS9sNodePrime)
|
TSTALLOC(MOS9DPspPtr, MOS9dNodePrime, MOS9sNodePrime)
|
||||||
TSTALLOC(MOS9DPdPtr, MOS9dNodePrime, MOS9dNode)
|
TSTALLOC(MOS9DPdPtr, MOS9dNodePrime, MOS9dNode)
|
||||||
TSTALLOC(MOS9BgPtr, MOS9bNode, MOS9gNode)
|
TSTALLOC(MOS9BgPtr, MOS9bNode, MOS9gNode)
|
||||||
TSTALLOC(MOS9DPgPtr, MOS9dNodePrime, MOS9gNode)
|
TSTALLOC(MOS9DPgPtr, MOS9dNodePrime, MOS9gNode)
|
||||||
TSTALLOC(MOS9SPgPtr, MOS9sNodePrime, MOS9gNode)
|
TSTALLOC(MOS9SPgPtr, MOS9sNodePrime, MOS9gNode)
|
||||||
TSTALLOC(MOS9SPsPtr, MOS9sNodePrime, MOS9sNode)
|
TSTALLOC(MOS9SPsPtr, MOS9sNodePrime, MOS9sNode)
|
||||||
TSTALLOC(MOS9DPbPtr, MOS9dNodePrime, MOS9bNode)
|
TSTALLOC(MOS9DPbPtr, MOS9dNodePrime, MOS9bNode)
|
||||||
TSTALLOC(MOS9SPbPtr, MOS9sNodePrime, MOS9bNode)
|
TSTALLOC(MOS9SPbPtr, MOS9sNodePrime, MOS9bNode)
|
||||||
TSTALLOC(MOS9SPdpPtr, MOS9sNodePrime, MOS9dNodePrime)
|
TSTALLOC(MOS9SPdpPtr, MOS9sNodePrime, MOS9dNodePrime)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
MOS9unsetup(inModel,ckt)
|
MOS9unsetup(inModel,ckt)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
CKTcircuit *ckt;
|
||||||
{
|
{
|
||||||
MOS9model *model;
|
MOS9model *model;
|
||||||
MOS9instance *here;
|
MOS9instance *here;
|
||||||
|
|
||||||
for (model = (MOS9model *)inModel; model != NULL;
|
for (model = (MOS9model *)inModel; model != NULL;
|
||||||
model = model->MOS9nextModel)
|
model = model->MOS9nextModel)
|
||||||
{
|
{
|
||||||
for (here = model->MOS9instances; here != NULL;
|
for (here = model->MOS9instances; here != NULL;
|
||||||
here=here->MOS9nextInstance)
|
here=here->MOS9nextInstance)
|
||||||
{
|
{
|
||||||
if (here->MOS9dNodePrime
|
if (here->MOS9dNodePrime
|
||||||
&& here->MOS9dNodePrime != here->MOS9dNode)
|
&& here->MOS9dNodePrime != here->MOS9dNode)
|
||||||
{
|
{
|
||||||
CKTdltNNum(ckt, here->MOS9dNodePrime);
|
CKTdltNNum(ckt, here->MOS9dNodePrime);
|
||||||
here->MOS9dNodePrime= 0;
|
here->MOS9dNodePrime= 0;
|
||||||
}
|
}
|
||||||
if (here->MOS9sNodePrime
|
if (here->MOS9sNodePrime
|
||||||
&& here->MOS9sNodePrime != here->MOS9sNode)
|
&& here->MOS9sNodePrime != here->MOS9sNode)
|
||||||
{
|
{
|
||||||
CKTdltNNum(ckt, here->MOS9sNodePrime);
|
CKTdltNNum(ckt, here->MOS9sNodePrime);
|
||||||
here->MOS9sNodePrime= 0;
|
here->MOS9sNodePrime= 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,65 +1,65 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
/* Pretty print the sensitivity info for all the MOS9
|
/* Pretty print the sensitivity info for all the MOS9
|
||||||
* devices in the circuit.
|
* devices in the circuit.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "smpdefs.h"
|
#include "smpdefs.h"
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
MOS9sPrint(inModel,ckt)
|
MOS9sPrint(inModel,ckt)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
register CKTcircuit *ckt;
|
register CKTcircuit *ckt;
|
||||||
{
|
{
|
||||||
register MOS9model *model = (MOS9model *)inModel;
|
register MOS9model *model = (MOS9model *)inModel;
|
||||||
register MOS9instance *here;
|
register MOS9instance *here;
|
||||||
|
|
||||||
printf("LEVEL 3 MOSFETS (AG) -----------------\n");
|
printf("LEVEL 3 MOSFETS (AG) -----------------\n");
|
||||||
/* loop through all the MOS9 models */
|
/* loop through all the MOS9 models */
|
||||||
for( ; model != NULL; model = model->MOS9nextModel ) {
|
for( ; model != NULL; model = model->MOS9nextModel ) {
|
||||||
|
|
||||||
printf("Model name:%s\n",model->MOS9modName);
|
printf("Model name:%s\n",model->MOS9modName);
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->MOS9instances; here != NULL ;
|
for (here = model->MOS9instances; here != NULL ;
|
||||||
here=here->MOS9nextInstance) {
|
here=here->MOS9nextInstance) {
|
||||||
|
|
||||||
printf(" Instance name:%s\n",here->MOS9name);
|
printf(" Instance name:%s\n",here->MOS9name);
|
||||||
printf(" Drain, Gate , Source nodes: %s, %s ,%s\n",
|
printf(" Drain, Gate , Source nodes: %s, %s ,%s\n",
|
||||||
CKTnodName(ckt,here->MOS9dNode),CKTnodName(ckt,here->MOS9gNode),
|
CKTnodName(ckt,here->MOS9dNode),CKTnodName(ckt,here->MOS9gNode),
|
||||||
CKTnodName(ckt,here->MOS9sNode));
|
CKTnodName(ckt,here->MOS9sNode));
|
||||||
|
|
||||||
printf(" Multiplier: %g ",here->MOS9m);
|
printf(" Multiplier: %g ",here->MOS9m);
|
||||||
printf(here->MOS9mGiven ? "(specified)\n" : "(default)\n");
|
printf(here->MOS9mGiven ? "(specified)\n" : "(default)\n");
|
||||||
printf(" Length: %g ",here->MOS9l);
|
printf(" Length: %g ",here->MOS9l);
|
||||||
printf(here->MOS9lGiven ? "(specified)\n" : "(default)\n");
|
printf(here->MOS9lGiven ? "(specified)\n" : "(default)\n");
|
||||||
printf(" Width: %g ",here->MOS9w);
|
printf(" Width: %g ",here->MOS9w);
|
||||||
printf(here->MOS9wGiven ? "(specified)\n" : "(default)\n");
|
printf(here->MOS9wGiven ? "(specified)\n" : "(default)\n");
|
||||||
if(here->MOS9sens_l == 1){
|
if(here->MOS9sens_l == 1){
|
||||||
printf(" MOS9senParmNo:l = %d ",here->MOS9senParmNo);
|
printf(" MOS9senParmNo:l = %d ",here->MOS9senParmNo);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
printf(" MOS9senParmNo:l = 0 ");
|
printf(" MOS9senParmNo:l = 0 ");
|
||||||
}
|
}
|
||||||
if(here->MOS9sens_w == 1){
|
if(here->MOS9sens_w == 1){
|
||||||
printf(" w = %d \n",here->MOS9senParmNo + here->MOS9sens_l);
|
printf(" w = %d \n",here->MOS9senParmNo + here->MOS9sens_l);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
printf(" w = 0 \n");
|
printf(" w = 0 \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,54 +1,54 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
/* loop through all the devices and
|
/* loop through all the devices and
|
||||||
* allocate parameter #s to design parameters
|
* allocate parameter #s to design parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "smpdefs.h"
|
#include "smpdefs.h"
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
MOS9sSetup(info,inModel)
|
MOS9sSetup(info,inModel)
|
||||||
SENstruct *info;
|
SENstruct *info;
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
{
|
{
|
||||||
MOS9model *model = (MOS9model *)inModel;
|
MOS9model *model = (MOS9model *)inModel;
|
||||||
MOS9instance *here;
|
MOS9instance *here;
|
||||||
|
|
||||||
/* loop through all the models */
|
/* loop through all the models */
|
||||||
for( ; model != NULL; model = model->MOS9nextModel ) {
|
for( ; model != NULL; model = model->MOS9nextModel ) {
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->MOS9instances; here != NULL ;
|
for (here = model->MOS9instances; here != NULL ;
|
||||||
here=here->MOS9nextInstance) {
|
here=here->MOS9nextInstance) {
|
||||||
|
|
||||||
|
|
||||||
if(here->MOS9senParmNo){
|
if(here->MOS9senParmNo){
|
||||||
if((here->MOS9sens_l)&&(here->MOS9sens_w)){
|
if((here->MOS9sens_l)&&(here->MOS9sens_w)){
|
||||||
here->MOS9senParmNo = ++(info->SENparms);
|
here->MOS9senParmNo = ++(info->SENparms);
|
||||||
++(info->SENparms);/* MOS has two design parameters */
|
++(info->SENparms);/* MOS has two design parameters */
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
here->MOS9senParmNo = ++(info->SENparms);
|
here->MOS9senParmNo = ++(info->SENparms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
here->MOS9senPertFlag = OFF;
|
here->MOS9senPertFlag = OFF;
|
||||||
if((here->MOS9sens = (double *)MALLOC(72*sizeof(double))) == NULL) {
|
if((here->MOS9sens = (double *)MALLOC(72*sizeof(double))) == NULL) {
|
||||||
return(E_NOMEM);
|
return(E_NOMEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,182 +1,182 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include "smpdefs.h"
|
#include "smpdefs.h"
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
MOS9sUpdate(inModel,ckt)
|
MOS9sUpdate(inModel,ckt)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
CKTcircuit *ckt;
|
||||||
{
|
{
|
||||||
MOS9model *model = (MOS9model *)inModel;
|
MOS9model *model = (MOS9model *)inModel;
|
||||||
MOS9instance *here;
|
MOS9instance *here;
|
||||||
int iparmno;
|
int iparmno;
|
||||||
double sb;
|
double sb;
|
||||||
double sg;
|
double sg;
|
||||||
double sdprm;
|
double sdprm;
|
||||||
double ssprm;
|
double ssprm;
|
||||||
double sxpgs;
|
double sxpgs;
|
||||||
double sxpgd;
|
double sxpgd;
|
||||||
double sxpbs;
|
double sxpbs;
|
||||||
double sxpbd;
|
double sxpbd;
|
||||||
double sxpgb;
|
double sxpgb;
|
||||||
double dummy1;
|
double dummy1;
|
||||||
double dummy2;
|
double dummy2;
|
||||||
SENstruct *info;
|
SENstruct *info;
|
||||||
|
|
||||||
|
|
||||||
if(ckt->CKTtime == 0) return(OK);
|
if(ckt->CKTtime == 0) return(OK);
|
||||||
info = ckt->CKTsenInfo;
|
info = ckt->CKTsenInfo;
|
||||||
|
|
||||||
#ifdef SENSDEBUG
|
#ifdef SENSDEBUG
|
||||||
printf("MOS9senupdate\n");
|
printf("MOS9senupdate\n");
|
||||||
printf("CKTtime = %.5e\n",ckt->CKTtime);
|
printf("CKTtime = %.5e\n",ckt->CKTtime);
|
||||||
#endif /* SENSDEBUG */
|
#endif /* SENSDEBUG */
|
||||||
|
|
||||||
sxpgs = 0;
|
sxpgs = 0;
|
||||||
sxpgd = 0;
|
sxpgd = 0;
|
||||||
sxpbs = 0;
|
sxpbs = 0;
|
||||||
sxpbd = 0;
|
sxpbd = 0;
|
||||||
sxpgb = 0;
|
sxpgb = 0;
|
||||||
dummy1 = 0;
|
dummy1 = 0;
|
||||||
dummy2 = 0;
|
dummy2 = 0;
|
||||||
|
|
||||||
/* loop through all the MOS9 models */
|
/* loop through all the MOS9 models */
|
||||||
for( ; model != NULL; model = model->MOS9nextModel ) {
|
for( ; model != NULL; model = model->MOS9nextModel ) {
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->MOS9instances; here != NULL ;
|
for (here = model->MOS9instances; here != NULL ;
|
||||||
here=here->MOS9nextInstance) {
|
here=here->MOS9nextInstance) {
|
||||||
|
|
||||||
|
|
||||||
#ifdef SENSDEBUG
|
#ifdef SENSDEBUG
|
||||||
printf("senupdate instance name %s\n",here->MOS9name);
|
printf("senupdate instance name %s\n",here->MOS9name);
|
||||||
printf("before loading\n");
|
printf("before loading\n");
|
||||||
printf("CKTag[0] = %.2e,CKTag[1] = %.2e\n",
|
printf("CKTag[0] = %.2e,CKTag[1] = %.2e\n",
|
||||||
ckt->CKTag[0],ckt->CKTag[1]);
|
ckt->CKTag[0],ckt->CKTag[1]);
|
||||||
printf("capgs = %.7e\n",here->MOS9cgs);
|
printf("capgs = %.7e\n",here->MOS9cgs);
|
||||||
printf("capgd = %.7e\n",here->MOS9cgd);
|
printf("capgd = %.7e\n",here->MOS9cgd);
|
||||||
printf("capgb = %.7e\n",here->MOS9cgb);
|
printf("capgb = %.7e\n",here->MOS9cgb);
|
||||||
printf("capbs = %.7e\n",here->MOS9capbs);
|
printf("capbs = %.7e\n",here->MOS9capbs);
|
||||||
printf("capbd = %.7e\n",here->MOS9capbd);
|
printf("capbd = %.7e\n",here->MOS9capbd);
|
||||||
#endif /* SENSDEBUG */
|
#endif /* SENSDEBUG */
|
||||||
|
|
||||||
for(iparmno = 1;iparmno<=info->SENparms;iparmno++){
|
for(iparmno = 1;iparmno<=info->SENparms;iparmno++){
|
||||||
|
|
||||||
sb = *(info->SEN_Sap[here->MOS9bNode] + iparmno);
|
sb = *(info->SEN_Sap[here->MOS9bNode] + iparmno);
|
||||||
sg = *(info->SEN_Sap[here->MOS9gNode] + iparmno);
|
sg = *(info->SEN_Sap[here->MOS9gNode] + iparmno);
|
||||||
ssprm = *(info->SEN_Sap[here->MOS9sNodePrime] + iparmno);
|
ssprm = *(info->SEN_Sap[here->MOS9sNodePrime] + iparmno);
|
||||||
sdprm = *(info->SEN_Sap[here->MOS9dNodePrime] + iparmno);
|
sdprm = *(info->SEN_Sap[here->MOS9dNodePrime] + iparmno);
|
||||||
#ifdef SENSDEBUG
|
#ifdef SENSDEBUG
|
||||||
printf("iparmno = %d\n",iparmno);
|
printf("iparmno = %d\n",iparmno);
|
||||||
printf("sb = %.7e,sg = %.7e\n",sb,sg);
|
printf("sb = %.7e,sg = %.7e\n",sb,sg);
|
||||||
printf("ssprm = %.7e,sdprm = %.7e\n",ssprm,sdprm);
|
printf("ssprm = %.7e,sdprm = %.7e\n",ssprm,sdprm);
|
||||||
#endif /* SENSDEBUG */
|
#endif /* SENSDEBUG */
|
||||||
|
|
||||||
sxpgs = (sg - ssprm) * here->MOS9cgs ;
|
sxpgs = (sg - ssprm) * here->MOS9cgs ;
|
||||||
sxpgd = (sg - sdprm) * here->MOS9cgd ;
|
sxpgd = (sg - sdprm) * here->MOS9cgd ;
|
||||||
sxpgb = (sg - sb) * here->MOS9cgb ;
|
sxpgb = (sg - sb) * here->MOS9cgb ;
|
||||||
sxpbs = (sb - ssprm) * here->MOS9capbs ;
|
sxpbs = (sb - ssprm) * here->MOS9capbs ;
|
||||||
sxpbd = (sb - sdprm) * here->MOS9capbd ;
|
sxpbd = (sb - sdprm) * here->MOS9capbd ;
|
||||||
|
|
||||||
if(here->MOS9sens_l && (iparmno == here->MOS9senParmNo)){
|
if(here->MOS9sens_l && (iparmno == here->MOS9senParmNo)){
|
||||||
sxpgs += *(here->MOS9dphigs_dl);
|
sxpgs += *(here->MOS9dphigs_dl);
|
||||||
sxpgd += *(here->MOS9dphigd_dl);
|
sxpgd += *(here->MOS9dphigd_dl);
|
||||||
sxpbs += *(here->MOS9dphibs_dl);
|
sxpbs += *(here->MOS9dphibs_dl);
|
||||||
sxpbd += *(here->MOS9dphibd_dl);
|
sxpbd += *(here->MOS9dphibd_dl);
|
||||||
sxpgb += *(here->MOS9dphigb_dl);
|
sxpgb += *(here->MOS9dphigb_dl);
|
||||||
}
|
}
|
||||||
if(here->MOS9sens_w &&
|
if(here->MOS9sens_w &&
|
||||||
(iparmno == (here->MOS9senParmNo+here->MOS9sens_l))){
|
(iparmno == (here->MOS9senParmNo+here->MOS9sens_l))){
|
||||||
sxpgs += *(here->MOS9dphigs_dw);
|
sxpgs += *(here->MOS9dphigs_dw);
|
||||||
sxpgd += *(here->MOS9dphigd_dw);
|
sxpgd += *(here->MOS9dphigd_dw);
|
||||||
sxpbs += *(here->MOS9dphibs_dw);
|
sxpbs += *(here->MOS9dphibs_dw);
|
||||||
sxpbd += *(here->MOS9dphibd_dw);
|
sxpbd += *(here->MOS9dphibd_dw);
|
||||||
sxpgb += *(here->MOS9dphigb_dw);
|
sxpgb += *(here->MOS9dphigb_dw);
|
||||||
}
|
}
|
||||||
if(ckt->CKTmode & MODEINITTRAN) {
|
if(ckt->CKTmode & MODEINITTRAN) {
|
||||||
*(ckt->CKTstate1 + here->MOS9sensxpgs +
|
*(ckt->CKTstate1 + here->MOS9sensxpgs +
|
||||||
10 * (iparmno - 1)) = sxpgs;
|
10 * (iparmno - 1)) = sxpgs;
|
||||||
*(ckt->CKTstate1 + here->MOS9sensxpgd +
|
*(ckt->CKTstate1 + here->MOS9sensxpgd +
|
||||||
10 * (iparmno - 1)) = sxpgd;
|
10 * (iparmno - 1)) = sxpgd;
|
||||||
*(ckt->CKTstate1 + here->MOS9sensxpbs +
|
*(ckt->CKTstate1 + here->MOS9sensxpbs +
|
||||||
10 * (iparmno - 1)) = sxpbs;
|
10 * (iparmno - 1)) = sxpbs;
|
||||||
*(ckt->CKTstate1 + here->MOS9sensxpbd +
|
*(ckt->CKTstate1 + here->MOS9sensxpbd +
|
||||||
10 * (iparmno - 1)) = sxpbd;
|
10 * (iparmno - 1)) = sxpbd;
|
||||||
*(ckt->CKTstate1 + here->MOS9sensxpgb +
|
*(ckt->CKTstate1 + here->MOS9sensxpgb +
|
||||||
10 * (iparmno - 1)) = sxpgb;
|
10 * (iparmno - 1)) = sxpgb;
|
||||||
*(ckt->CKTstate1 + here->MOS9sensxpgs +
|
*(ckt->CKTstate1 + here->MOS9sensxpgs +
|
||||||
10 * (iparmno - 1) + 1) = 0;
|
10 * (iparmno - 1) + 1) = 0;
|
||||||
*(ckt->CKTstate1 + here->MOS9sensxpgd +
|
*(ckt->CKTstate1 + here->MOS9sensxpgd +
|
||||||
10 * (iparmno - 1) + 1) = 0;
|
10 * (iparmno - 1) + 1) = 0;
|
||||||
*(ckt->CKTstate1 + here->MOS9sensxpbs +
|
*(ckt->CKTstate1 + here->MOS9sensxpbs +
|
||||||
10 * (iparmno - 1) + 1) = 0;
|
10 * (iparmno - 1) + 1) = 0;
|
||||||
*(ckt->CKTstate1 + here->MOS9sensxpbd +
|
*(ckt->CKTstate1 + here->MOS9sensxpbd +
|
||||||
10 * (iparmno - 1) + 1) = 0;
|
10 * (iparmno - 1) + 1) = 0;
|
||||||
*(ckt->CKTstate1 + here->MOS9sensxpgb +
|
*(ckt->CKTstate1 + here->MOS9sensxpgb +
|
||||||
10 * (iparmno - 1) + 1) = 0;
|
10 * (iparmno - 1) + 1) = 0;
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(ckt->CKTstate0 + here->MOS9sensxpgs +
|
*(ckt->CKTstate0 + here->MOS9sensxpgs +
|
||||||
10 * (iparmno - 1)) = sxpgs;
|
10 * (iparmno - 1)) = sxpgs;
|
||||||
*(ckt->CKTstate0 + here->MOS9sensxpgd +
|
*(ckt->CKTstate0 + here->MOS9sensxpgd +
|
||||||
10 * (iparmno - 1)) = sxpgd;
|
10 * (iparmno - 1)) = sxpgd;
|
||||||
*(ckt->CKTstate0 + here->MOS9sensxpbs +
|
*(ckt->CKTstate0 + here->MOS9sensxpbs +
|
||||||
10 * (iparmno - 1)) = sxpbs;
|
10 * (iparmno - 1)) = sxpbs;
|
||||||
*(ckt->CKTstate0 + here->MOS9sensxpbd +
|
*(ckt->CKTstate0 + here->MOS9sensxpbd +
|
||||||
10 * (iparmno - 1)) = sxpbd;
|
10 * (iparmno - 1)) = sxpbd;
|
||||||
*(ckt->CKTstate0 + here->MOS9sensxpgb +
|
*(ckt->CKTstate0 + here->MOS9sensxpgb +
|
||||||
10 * (iparmno - 1)) = sxpgb;
|
10 * (iparmno - 1)) = sxpgb;
|
||||||
|
|
||||||
NIintegrate(ckt,&dummy1,&dummy2,here->MOS9cgs,
|
NIintegrate(ckt,&dummy1,&dummy2,here->MOS9cgs,
|
||||||
here->MOS9sensxpgs + 10*(iparmno -1));
|
here->MOS9sensxpgs + 10*(iparmno -1));
|
||||||
NIintegrate(ckt,&dummy1,&dummy2,here->MOS9cgd,
|
NIintegrate(ckt,&dummy1,&dummy2,here->MOS9cgd,
|
||||||
here->MOS9sensxpgd + 10*(iparmno -1));
|
here->MOS9sensxpgd + 10*(iparmno -1));
|
||||||
NIintegrate(ckt,&dummy1,&dummy2,here->MOS9cgb,
|
NIintegrate(ckt,&dummy1,&dummy2,here->MOS9cgb,
|
||||||
here->MOS9sensxpgb + 10*(iparmno -1));
|
here->MOS9sensxpgb + 10*(iparmno -1));
|
||||||
NIintegrate(ckt,&dummy1,&dummy2,here->MOS9capbs,
|
NIintegrate(ckt,&dummy1,&dummy2,here->MOS9capbs,
|
||||||
here->MOS9sensxpbs + 10*(iparmno -1));
|
here->MOS9sensxpbs + 10*(iparmno -1));
|
||||||
NIintegrate(ckt,&dummy1,&dummy2,here->MOS9capbd,
|
NIintegrate(ckt,&dummy1,&dummy2,here->MOS9capbd,
|
||||||
here->MOS9sensxpbd + 10*(iparmno -1));
|
here->MOS9sensxpbd + 10*(iparmno -1));
|
||||||
|
|
||||||
|
|
||||||
next:
|
next:
|
||||||
;
|
;
|
||||||
#ifdef SENSDEBUG
|
#ifdef SENSDEBUG
|
||||||
printf("after loading\n");
|
printf("after loading\n");
|
||||||
printf("sxpgs = %.7e,sdotxpgs = %.7e\n",
|
printf("sxpgs = %.7e,sdotxpgs = %.7e\n",
|
||||||
sxpgs,*(ckt->CKTstate0 + here->MOS9sensxpgs +
|
sxpgs,*(ckt->CKTstate0 + here->MOS9sensxpgs +
|
||||||
10 * (iparmno - 1) + 1));
|
10 * (iparmno - 1) + 1));
|
||||||
printf("sxpgd = %.7e,sdotxpgd = %.7e\n",
|
printf("sxpgd = %.7e,sdotxpgd = %.7e\n",
|
||||||
sxpgd,*(ckt->CKTstate0 + here->MOS9sensxpgd +
|
sxpgd,*(ckt->CKTstate0 + here->MOS9sensxpgd +
|
||||||
10 * (iparmno - 1) + 1));
|
10 * (iparmno - 1) + 1));
|
||||||
printf("sxpgb = %.7e,sdotxpgb = %.7e\n",
|
printf("sxpgb = %.7e,sdotxpgb = %.7e\n",
|
||||||
sxpgb,*(ckt->CKTstate0 + here->MOS9sensxpgb +
|
sxpgb,*(ckt->CKTstate0 + here->MOS9sensxpgb +
|
||||||
10 * (iparmno - 1) + 1));
|
10 * (iparmno - 1) + 1));
|
||||||
printf("sxpbs = %.7e,sdotxpbs = %.7e\n",
|
printf("sxpbs = %.7e,sdotxpbs = %.7e\n",
|
||||||
sxpbs,*(ckt->CKTstate0 + here->MOS9sensxpbs +
|
sxpbs,*(ckt->CKTstate0 + here->MOS9sensxpbs +
|
||||||
10 * (iparmno - 1) + 1));
|
10 * (iparmno - 1) + 1));
|
||||||
printf("sxpbd = %.7e,sdotxpbd = %.7e\n",
|
printf("sxpbd = %.7e,sdotxpbd = %.7e\n",
|
||||||
sxpbd,*(ckt->CKTstate0 + here->MOS9sensxpbd +
|
sxpbd,*(ckt->CKTstate0 + here->MOS9sensxpbd +
|
||||||
10 * (iparmno - 1) + 1));
|
10 * (iparmno - 1) + 1));
|
||||||
#endif /* SENSDEBUG */
|
#endif /* SENSDEBUG */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef SENSDEBUG
|
#ifdef SENSDEBUG
|
||||||
printf("MOS9senupdate end\n");
|
printf("MOS9senupdate end\n");
|
||||||
#endif /* SENSDEBUG */
|
#endif /* SENSDEBUG */
|
||||||
return(OK);
|
return(OK);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,343 +1,343 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "cktdefs.h"
|
|
||||||
#include "mos9defs.h"
|
|
||||||
#include "const.h"
|
|
||||||
#include "sperror.h"
|
|
||||||
#include "suffix.h"
|
|
||||||
|
|
||||||
/* assuming silicon - make definition for epsilon of silicon */
|
|
||||||
#define EPSSIL (11.7 * 8.854214871e-12)
|
|
||||||
|
|
||||||
int
|
|
||||||
MOS9temp(inModel,ckt)
|
|
||||||
GENmodel *inModel;
|
|
||||||
CKTcircuit *ckt;
|
|
||||||
{
|
|
||||||
MOS9model *model = (MOS9model *)inModel;
|
|
||||||
MOS9instance *here;
|
|
||||||
double wkfngs;
|
|
||||||
double wkfng;
|
|
||||||
double fermig;
|
|
||||||
double fermis;
|
|
||||||
double vfb;
|
|
||||||
double fact1,fact2;
|
|
||||||
double vt,vtnom;
|
|
||||||
double kt,kt1;
|
|
||||||
double ratio,ratio4;
|
|
||||||
double egfet,egfet1;
|
|
||||||
double pbfact,pbfact1,pbo;
|
|
||||||
double phio;
|
|
||||||
double arg1;
|
|
||||||
double capfact;
|
|
||||||
double gmanew,gmaold;
|
|
||||||
double ni_temp, nifact;
|
|
||||||
/* loop through all the mosfet models */
|
|
||||||
for( ; model != NULL; model = model->MOS9nextModel) {
|
|
||||||
|
|
||||||
if(!model->MOS9tnomGiven) {
|
|
||||||
model->MOS9tnom = ckt->CKTnomTemp;
|
|
||||||
}
|
|
||||||
fact1 = model->MOS9tnom/REFTEMP;
|
|
||||||
vtnom = model->MOS9tnom*CONSTKoverQ;
|
|
||||||
kt1 = CONSTboltz * model->MOS9tnom;
|
|
||||||
egfet1 = 1.16-(7.02e-4*model->MOS9tnom*model->MOS9tnom)/
|
|
||||||
(model->MOS9tnom+1108);
|
|
||||||
arg1 = -egfet1/(kt1+kt1)+1.1150877/(CONSTboltz*(REFTEMP+REFTEMP));
|
|
||||||
pbfact1 = -2*vtnom *(1.5*log(fact1)+CHARGE*arg1);
|
|
||||||
|
|
||||||
nifact=(model->MOS9tnom/300)*sqrt(model->MOS9tnom/300);
|
|
||||||
nifact*=exp(0.5*egfet1*((1/(double)300)-(1/model->MOS9tnom))/
|
|
||||||
CONSTKoverQ);
|
|
||||||
ni_temp=1.45e16*nifact;
|
|
||||||
|
|
||||||
|
|
||||||
model->MOS9oxideCapFactor = 3.9 * 8.854214871e-12/
|
|
||||||
model->MOS9oxideThickness;
|
|
||||||
if(!model->MOS9surfaceMobilityGiven) model->MOS9surfaceMobility=600;
|
|
||||||
if(!model->MOS9transconductanceGiven) {
|
|
||||||
model->MOS9transconductance = model->MOS9surfaceMobility *
|
|
||||||
model->MOS9oxideCapFactor * 1e-4;
|
|
||||||
}
|
|
||||||
if(model->MOS9substrateDopingGiven) {
|
|
||||||
if(model->MOS9substrateDoping*1e6 /*(cm**3/m**3)*/ >ni_temp) {
|
|
||||||
|
|
||||||
if(!model->MOS9phiGiven) {
|
#include "ngspice.h"
|
||||||
model->MOS9phi = 2*vtnom*
|
#include <stdio.h>
|
||||||
log(model->MOS9substrateDoping*
|
#include "cktdefs.h"
|
||||||
|
#include "mos9defs.h"
|
||||||
1e6/*(cm**3/m**3)*//ni_temp);
|
#include "const.h"
|
||||||
|
#include "sperror.h"
|
||||||
model->MOS9phi = MAX(.1,model->MOS9phi);
|
#include "suffix.h"
|
||||||
}
|
|
||||||
fermis = model->MOS9type * .5 * model->MOS9phi;
|
/* assuming silicon - make definition for epsilon of silicon */
|
||||||
wkfng = 3.2;
|
#define EPSSIL (11.7 * 8.854214871e-12)
|
||||||
if(!model->MOS9gateTypeGiven) model->MOS9gateType=1;
|
|
||||||
if(model->MOS9gateType != 0) {
|
int
|
||||||
fermig = model->MOS9type * model->MOS9gateType*.5*egfet1;
|
MOS9temp(inModel,ckt)
|
||||||
wkfng = 3.25 + .5 * egfet1 - fermig;
|
GENmodel *inModel;
|
||||||
}
|
CKTcircuit *ckt;
|
||||||
wkfngs = wkfng - (3.25 + .5 * egfet1 +fermis);
|
{
|
||||||
if(!model->MOS9gammaGiven) {
|
MOS9model *model = (MOS9model *)inModel;
|
||||||
model->MOS9gamma = sqrt(2 * EPSSIL *
|
MOS9instance *here;
|
||||||
CHARGE * model->MOS9substrateDoping*
|
double wkfngs;
|
||||||
1e6 /*(cm**3/m**3)*/ )/ model->MOS9oxideCapFactor;
|
double wkfng;
|
||||||
}
|
double fermig;
|
||||||
if(!model->MOS9vt0Given) {
|
double fermis;
|
||||||
if(!model->MOS9surfaceStateDensityGiven)
|
double vfb;
|
||||||
model->MOS9surfaceStateDensity=0;
|
double fact1,fact2;
|
||||||
vfb = wkfngs - model->MOS9surfaceStateDensity * 1e4
|
double vt,vtnom;
|
||||||
* CHARGE/model->MOS9oxideCapFactor;
|
double kt,kt1;
|
||||||
model->MOS9vt0 = vfb + model->MOS9type *
|
double ratio,ratio4;
|
||||||
(model->MOS9gamma * sqrt(model->MOS9phi)+
|
double egfet,egfet1;
|
||||||
model->MOS9phi);
|
double pbfact,pbfact1,pbo;
|
||||||
} else {
|
double phio;
|
||||||
vfb = model->MOS9vt0 - model->MOS9type * (model->MOS9gamma*
|
double arg1;
|
||||||
sqrt(model->MOS9phi)+model->MOS9phi);
|
double capfact;
|
||||||
}
|
double gmanew,gmaold;
|
||||||
model->MOS9alpha = (EPSSIL+EPSSIL)/
|
double ni_temp, nifact;
|
||||||
(CHARGE*model->MOS9substrateDoping*1e6 /*(cm**3/m**3)*/ );
|
/* loop through all the mosfet models */
|
||||||
model->MOS9coeffDepLayWidth = sqrt(model->MOS9alpha);
|
for( ; model != NULL; model = model->MOS9nextModel) {
|
||||||
} else {
|
|
||||||
model->MOS9substrateDoping = 0;
|
if(!model->MOS9tnomGiven) {
|
||||||
(*(SPfrontEnd->IFerror))(ERR_FATAL,
|
model->MOS9tnom = ckt->CKTnomTemp;
|
||||||
"%s: Nsub < Ni ",&(model->MOS9modName));
|
}
|
||||||
return(E_BADPARM);
|
fact1 = model->MOS9tnom/REFTEMP;
|
||||||
}
|
vtnom = model->MOS9tnom*CONSTKoverQ;
|
||||||
}
|
kt1 = CONSTboltz * model->MOS9tnom;
|
||||||
/* now model parameter preprocessing */
|
egfet1 = 1.16-(7.02e-4*model->MOS9tnom*model->MOS9tnom)/
|
||||||
model->MOS9narrowFactor = model->MOS9delta * 0.5 * M_PI * EPSSIL /
|
(model->MOS9tnom+1108);
|
||||||
model->MOS9oxideCapFactor ;
|
arg1 = -egfet1/(kt1+kt1)+1.1150877/(CONSTboltz*(REFTEMP+REFTEMP));
|
||||||
|
pbfact1 = -2*vtnom *(1.5*log(fact1)+CHARGE*arg1);
|
||||||
|
|
||||||
/* loop through all instances of the model */
|
nifact=(model->MOS9tnom/300)*sqrt(model->MOS9tnom/300);
|
||||||
for(here = model->MOS9instances; here!= NULL;
|
nifact*=exp(0.5*egfet1*((1/(double)300)-(1/model->MOS9tnom))/
|
||||||
here = here->MOS9nextInstance) {
|
CONSTKoverQ);
|
||||||
|
ni_temp=1.45e16*nifact;
|
||||||
double czbd; /* zero voltage bulk-drain capacitance */
|
|
||||||
double czbdsw; /* zero voltage bulk-drain sidewall capacitance */
|
|
||||||
double czbs; /* zero voltage bulk-source capacitance */
|
model->MOS9oxideCapFactor = 3.9 * 8.854214871e-12/
|
||||||
double czbssw; /* zero voltage bulk-source sidewall capacitance */
|
model->MOS9oxideThickness;
|
||||||
double arg; /* 1 - fc */
|
if(!model->MOS9surfaceMobilityGiven) model->MOS9surfaceMobility=600;
|
||||||
double sarg; /* (1-fc) ^^ (-mj) */
|
if(!model->MOS9transconductanceGiven) {
|
||||||
double sargsw; /* (1-fc) ^^ (-mjsw) */
|
model->MOS9transconductance = model->MOS9surfaceMobility *
|
||||||
|
model->MOS9oxideCapFactor * 1e-4;
|
||||||
/* perform the parameter defaulting */
|
}
|
||||||
|
if(model->MOS9substrateDopingGiven) {
|
||||||
if(!here->MOS9tempGiven) {
|
if(model->MOS9substrateDoping*1e6 /*(cm**3/m**3)*/ >ni_temp) {
|
||||||
here->MOS9temp = ckt->CKTtemp;
|
|
||||||
}
|
if(!model->MOS9phiGiven) {
|
||||||
vt = here->MOS9temp * CONSTKoverQ;
|
model->MOS9phi = 2*vtnom*
|
||||||
ratio = here->MOS9temp/model->MOS9tnom;
|
log(model->MOS9substrateDoping*
|
||||||
fact2 = here->MOS9temp/REFTEMP;
|
|
||||||
kt = here->MOS9temp * CONSTboltz;
|
1e6/*(cm**3/m**3)*//ni_temp);
|
||||||
egfet = 1.16-(7.02e-4*here->MOS9temp*here->MOS9temp)/
|
|
||||||
(here->MOS9temp+1108);
|
model->MOS9phi = MAX(.1,model->MOS9phi);
|
||||||
arg = -egfet/(kt+kt)+1.1150877/(CONSTboltz*(REFTEMP+REFTEMP));
|
}
|
||||||
pbfact = -2*vt *(1.5*log(fact2)+CHARGE*arg);
|
fermis = model->MOS9type * .5 * model->MOS9phi;
|
||||||
|
wkfng = 3.2;
|
||||||
if(!here->MOS9mGiven) {
|
if(!model->MOS9gateTypeGiven) model->MOS9gateType=1;
|
||||||
here->MOS9m = ckt->CKTdefaultMosM;
|
if(model->MOS9gateType != 0) {
|
||||||
}
|
fermig = model->MOS9type * model->MOS9gateType*.5*egfet1;
|
||||||
|
wkfng = 3.25 + .5 * egfet1 - fermig;
|
||||||
if(!here->MOS9lGiven) {
|
}
|
||||||
here->MOS9l = ckt->CKTdefaultMosL;
|
wkfngs = wkfng - (3.25 + .5 * egfet1 +fermis);
|
||||||
}
|
if(!model->MOS9gammaGiven) {
|
||||||
if(!here->MOS9sourceAreaGiven) {
|
model->MOS9gamma = sqrt(2 * EPSSIL *
|
||||||
here->MOS9sourceArea = ckt->CKTdefaultMosAS;
|
CHARGE * model->MOS9substrateDoping*
|
||||||
}
|
1e6 /*(cm**3/m**3)*/ )/ model->MOS9oxideCapFactor;
|
||||||
if(!here->MOS9wGiven) {
|
}
|
||||||
here->MOS9w = ckt->CKTdefaultMosW;
|
if(!model->MOS9vt0Given) {
|
||||||
}
|
if(!model->MOS9surfaceStateDensityGiven)
|
||||||
if(model->MOS9drainResistanceGiven) {
|
model->MOS9surfaceStateDensity=0;
|
||||||
if(model->MOS9drainResistance != 0) {
|
vfb = wkfngs - model->MOS9surfaceStateDensity * 1e4
|
||||||
here->MOS9drainConductance = here->MOS9m /
|
* CHARGE/model->MOS9oxideCapFactor;
|
||||||
model->MOS9drainResistance;
|
model->MOS9vt0 = vfb + model->MOS9type *
|
||||||
} else {
|
(model->MOS9gamma * sqrt(model->MOS9phi)+
|
||||||
here->MOS9drainConductance = 0;
|
model->MOS9phi);
|
||||||
}
|
} else {
|
||||||
} else if (model->MOS9sheetResistanceGiven) {
|
vfb = model->MOS9vt0 - model->MOS9type * (model->MOS9gamma*
|
||||||
if ((model->MOS9sheetResistance != 0) &&
|
sqrt(model->MOS9phi)+model->MOS9phi);
|
||||||
(here->MOS9drainSquares != 0)) {
|
}
|
||||||
here->MOS9drainConductance =
|
model->MOS9alpha = (EPSSIL+EPSSIL)/
|
||||||
here->MOS9m /
|
(CHARGE*model->MOS9substrateDoping*1e6 /*(cm**3/m**3)*/ );
|
||||||
(model->MOS9sheetResistance*here->MOS9drainSquares);
|
model->MOS9coeffDepLayWidth = sqrt(model->MOS9alpha);
|
||||||
} else {
|
} else {
|
||||||
here->MOS9drainConductance = 0;
|
model->MOS9substrateDoping = 0;
|
||||||
}
|
(*(SPfrontEnd->IFerror))(ERR_FATAL,
|
||||||
} else {
|
"%s: Nsub < Ni ",&(model->MOS9modName));
|
||||||
here->MOS9drainConductance = 0;
|
return(E_BADPARM);
|
||||||
}
|
}
|
||||||
if(model->MOS9sourceResistanceGiven) {
|
}
|
||||||
if(model->MOS9sourceResistance != 0) {
|
/* now model parameter preprocessing */
|
||||||
here->MOS9sourceConductance = here->MOS9m /
|
model->MOS9narrowFactor = model->MOS9delta * 0.5 * M_PI * EPSSIL /
|
||||||
model->MOS9sourceResistance;
|
model->MOS9oxideCapFactor ;
|
||||||
} else {
|
|
||||||
here->MOS9sourceConductance = 0;
|
|
||||||
}
|
/* loop through all instances of the model */
|
||||||
} else if (model->MOS9sheetResistanceGiven) {
|
for(here = model->MOS9instances; here!= NULL;
|
||||||
if ((model->MOS9sheetResistance != 0) &&
|
here = here->MOS9nextInstance) {
|
||||||
(here->MOS9sourceSquares != 0)) {
|
|
||||||
here->MOS9sourceConductance =
|
double czbd; /* zero voltage bulk-drain capacitance */
|
||||||
here->MOS9m /
|
double czbdsw; /* zero voltage bulk-drain sidewall capacitance */
|
||||||
(model->MOS9sheetResistance*here->MOS9sourceSquares);
|
double czbs; /* zero voltage bulk-source capacitance */
|
||||||
} else {
|
double czbssw; /* zero voltage bulk-source sidewall capacitance */
|
||||||
here->MOS9sourceConductance = 0;
|
double arg; /* 1 - fc */
|
||||||
}
|
double sarg; /* (1-fc) ^^ (-mj) */
|
||||||
} else {
|
double sargsw; /* (1-fc) ^^ (-mjsw) */
|
||||||
here->MOS9sourceConductance = 0;
|
|
||||||
}
|
/* perform the parameter defaulting */
|
||||||
|
|
||||||
if(here->MOS9l - 2 * model->MOS9latDiff +
|
if(!here->MOS9tempGiven) {
|
||||||
model->MOS9lengthAdjust <1e-6) {
|
here->MOS9temp = ckt->CKTtemp;
|
||||||
(*(SPfrontEnd->IFerror))(ERR_FATAL,
|
}
|
||||||
"%s: effective channel length less than zero",
|
vt = here->MOS9temp * CONSTKoverQ;
|
||||||
&(here->MOS9name));
|
ratio = here->MOS9temp/model->MOS9tnom;
|
||||||
return(E_PARMVAL);
|
fact2 = here->MOS9temp/REFTEMP;
|
||||||
}
|
kt = here->MOS9temp * CONSTboltz;
|
||||||
|
egfet = 1.16-(7.02e-4*here->MOS9temp*here->MOS9temp)/
|
||||||
if(here->MOS9w - 2 * model->MOS9widthNarrow +
|
(here->MOS9temp+1108);
|
||||||
model->MOS9widthAdjust <1e-6) {
|
arg = -egfet/(kt+kt)+1.1150877/(CONSTboltz*(REFTEMP+REFTEMP));
|
||||||
(*(SPfrontEnd->IFerror))(ERR_FATAL,
|
pbfact = -2*vt *(1.5*log(fact2)+CHARGE*arg);
|
||||||
"%s: effective channel width less than zero",
|
|
||||||
&(here->MOS9name));
|
if(!here->MOS9mGiven) {
|
||||||
return(E_PARMVAL);
|
here->MOS9m = ckt->CKTdefaultMosM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!here->MOS9lGiven) {
|
||||||
ratio4 = ratio * sqrt(ratio);
|
here->MOS9l = ckt->CKTdefaultMosL;
|
||||||
here->MOS9tTransconductance = model->MOS9transconductance / ratio4;
|
}
|
||||||
here->MOS9tSurfMob = model->MOS9surfaceMobility/ratio4;
|
if(!here->MOS9sourceAreaGiven) {
|
||||||
phio= (model->MOS9phi-pbfact1)/fact1;
|
here->MOS9sourceArea = ckt->CKTdefaultMosAS;
|
||||||
here->MOS9tPhi = fact2 * phio + pbfact;
|
}
|
||||||
here->MOS9tVbi =
|
if(!here->MOS9wGiven) {
|
||||||
model->MOS9delvt0 +
|
here->MOS9w = ckt->CKTdefaultMosW;
|
||||||
model->MOS9vt0 - model->MOS9type *
|
}
|
||||||
(model->MOS9gamma* sqrt(model->MOS9phi))
|
if(model->MOS9drainResistanceGiven) {
|
||||||
+.5*(egfet1-egfet)
|
if(model->MOS9drainResistance != 0) {
|
||||||
+ model->MOS9type*.5* (here->MOS9tPhi-model->MOS9phi);
|
here->MOS9drainConductance = here->MOS9m /
|
||||||
here->MOS9tVto = here->MOS9tVbi + model->MOS9type *
|
model->MOS9drainResistance;
|
||||||
model->MOS9gamma * sqrt(here->MOS9tPhi);
|
} else {
|
||||||
here->MOS9tSatCur = model->MOS9jctSatCur*
|
here->MOS9drainConductance = 0;
|
||||||
exp(-egfet/vt+egfet1/vtnom);
|
}
|
||||||
here->MOS9tSatCurDens = model->MOS9jctSatCurDensity *
|
} else if (model->MOS9sheetResistanceGiven) {
|
||||||
exp(-egfet/vt+egfet1/vtnom);
|
if ((model->MOS9sheetResistance != 0) &&
|
||||||
pbo = (model->MOS9bulkJctPotential - pbfact1)/fact1;
|
(here->MOS9drainSquares != 0)) {
|
||||||
gmaold = (model->MOS9bulkJctPotential-pbo)/pbo;
|
here->MOS9drainConductance =
|
||||||
capfact = 1/(1+model->MOS9bulkJctBotGradingCoeff*
|
here->MOS9m /
|
||||||
(4e-4*(model->MOS9tnom-REFTEMP)-gmaold));
|
(model->MOS9sheetResistance*here->MOS9drainSquares);
|
||||||
here->MOS9tCbd = model->MOS9capBD * capfact;
|
} else {
|
||||||
here->MOS9tCbs = model->MOS9capBS * capfact;
|
here->MOS9drainConductance = 0;
|
||||||
here->MOS9tCj = model->MOS9bulkCapFactor * capfact;
|
}
|
||||||
capfact = 1/(1+model->MOS9bulkJctSideGradingCoeff*
|
} else {
|
||||||
(4e-4*(model->MOS9tnom-REFTEMP)-gmaold));
|
here->MOS9drainConductance = 0;
|
||||||
here->MOS9tCjsw = model->MOS9sideWallCapFactor * capfact;
|
}
|
||||||
here->MOS9tBulkPot = fact2 * pbo+pbfact;
|
if(model->MOS9sourceResistanceGiven) {
|
||||||
gmanew = (here->MOS9tBulkPot-pbo)/pbo;
|
if(model->MOS9sourceResistance != 0) {
|
||||||
capfact = (1+model->MOS9bulkJctBotGradingCoeff*
|
here->MOS9sourceConductance = here->MOS9m /
|
||||||
(4e-4*(here->MOS9temp-REFTEMP)-gmanew));
|
model->MOS9sourceResistance;
|
||||||
here->MOS9tCbd *= capfact;
|
} else {
|
||||||
here->MOS9tCbs *= capfact;
|
here->MOS9sourceConductance = 0;
|
||||||
here->MOS9tCj *= capfact;
|
}
|
||||||
capfact = (1+model->MOS9bulkJctSideGradingCoeff*
|
} else if (model->MOS9sheetResistanceGiven) {
|
||||||
(4e-4*(here->MOS9temp-REFTEMP)-gmanew));
|
if ((model->MOS9sheetResistance != 0) &&
|
||||||
here->MOS9tCjsw *= capfact;
|
(here->MOS9sourceSquares != 0)) {
|
||||||
here->MOS9tDepCap = model->MOS9fwdCapDepCoeff * here->MOS9tBulkPot;
|
here->MOS9sourceConductance =
|
||||||
|
here->MOS9m /
|
||||||
if( (model->MOS9jctSatCurDensity == 0) ||
|
(model->MOS9sheetResistance*here->MOS9sourceSquares);
|
||||||
(here->MOS9drainArea == 0) ||
|
} else {
|
||||||
(here->MOS9sourceArea == 0) ) {
|
here->MOS9sourceConductance = 0;
|
||||||
here->MOS9sourceVcrit = here->MOS9drainVcrit =
|
}
|
||||||
vt*log(vt/(CONSTroot2*here->MOS9m*here->MOS9tSatCur));
|
} else {
|
||||||
} else {
|
here->MOS9sourceConductance = 0;
|
||||||
here->MOS9drainVcrit =
|
}
|
||||||
vt * log( vt / (CONSTroot2 *
|
|
||||||
here->MOS9m *
|
if(here->MOS9l - 2 * model->MOS9latDiff +
|
||||||
here->MOS9tSatCurDens * here->MOS9drainArea));
|
model->MOS9lengthAdjust <1e-6) {
|
||||||
here->MOS9sourceVcrit =
|
(*(SPfrontEnd->IFerror))(ERR_FATAL,
|
||||||
vt * log( vt / (CONSTroot2 *
|
"%s: effective channel length less than zero",
|
||||||
here->MOS9m *
|
&(here->MOS9name));
|
||||||
here->MOS9tSatCurDens * here->MOS9sourceArea));
|
return(E_PARMVAL);
|
||||||
}
|
}
|
||||||
if(model->MOS9capBDGiven) {
|
|
||||||
czbd = here->MOS9tCbd * here->MOS9m;
|
if(here->MOS9w - 2 * model->MOS9widthNarrow +
|
||||||
} else {
|
model->MOS9widthAdjust <1e-6) {
|
||||||
if(model->MOS9bulkCapFactorGiven) {
|
(*(SPfrontEnd->IFerror))(ERR_FATAL,
|
||||||
czbd=here->MOS9tCj*here->MOS9drainArea * here->MOS9m;
|
"%s: effective channel width less than zero",
|
||||||
} else {
|
&(here->MOS9name));
|
||||||
czbd=0;
|
return(E_PARMVAL);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(model->MOS9sideWallCapFactorGiven) {
|
|
||||||
czbdsw= here->MOS9tCjsw * here->MOS9drainPerimiter *
|
ratio4 = ratio * sqrt(ratio);
|
||||||
here->MOS9m;
|
here->MOS9tTransconductance = model->MOS9transconductance / ratio4;
|
||||||
} else {
|
here->MOS9tSurfMob = model->MOS9surfaceMobility/ratio4;
|
||||||
czbdsw=0;
|
phio= (model->MOS9phi-pbfact1)/fact1;
|
||||||
}
|
here->MOS9tPhi = fact2 * phio + pbfact;
|
||||||
arg = 1-model->MOS9fwdCapDepCoeff;
|
here->MOS9tVbi =
|
||||||
sarg = exp( (-model->MOS9bulkJctBotGradingCoeff) * log(arg) );
|
model->MOS9delvt0 +
|
||||||
sargsw = exp( (-model->MOS9bulkJctSideGradingCoeff) * log(arg) );
|
model->MOS9vt0 - model->MOS9type *
|
||||||
here->MOS9Cbd = czbd;
|
(model->MOS9gamma* sqrt(model->MOS9phi))
|
||||||
here->MOS9Cbdsw = czbdsw;
|
+.5*(egfet1-egfet)
|
||||||
here->MOS9f2d = czbd*(1-model->MOS9fwdCapDepCoeff*
|
+ model->MOS9type*.5* (here->MOS9tPhi-model->MOS9phi);
|
||||||
(1+model->MOS9bulkJctBotGradingCoeff))* sarg/arg
|
here->MOS9tVto = here->MOS9tVbi + model->MOS9type *
|
||||||
+ czbdsw*(1-model->MOS9fwdCapDepCoeff*
|
model->MOS9gamma * sqrt(here->MOS9tPhi);
|
||||||
(1+model->MOS9bulkJctSideGradingCoeff))*
|
here->MOS9tSatCur = model->MOS9jctSatCur*
|
||||||
sargsw/arg;
|
exp(-egfet/vt+egfet1/vtnom);
|
||||||
here->MOS9f3d = czbd * model->MOS9bulkJctBotGradingCoeff * sarg/arg/
|
here->MOS9tSatCurDens = model->MOS9jctSatCurDensity *
|
||||||
here->MOS9tBulkPot
|
exp(-egfet/vt+egfet1/vtnom);
|
||||||
+ czbdsw * model->MOS9bulkJctSideGradingCoeff * sargsw/arg /
|
pbo = (model->MOS9bulkJctPotential - pbfact1)/fact1;
|
||||||
here->MOS9tBulkPot;
|
gmaold = (model->MOS9bulkJctPotential-pbo)/pbo;
|
||||||
here->MOS9f4d = czbd*here->MOS9tBulkPot*(1-arg*sarg)/
|
capfact = 1/(1+model->MOS9bulkJctBotGradingCoeff*
|
||||||
(1-model->MOS9bulkJctBotGradingCoeff)
|
(4e-4*(model->MOS9tnom-REFTEMP)-gmaold));
|
||||||
+ czbdsw*here->MOS9tBulkPot*(1-arg*sargsw)/
|
here->MOS9tCbd = model->MOS9capBD * capfact;
|
||||||
(1-model->MOS9bulkJctSideGradingCoeff)
|
here->MOS9tCbs = model->MOS9capBS * capfact;
|
||||||
-here->MOS9f3d/2*
|
here->MOS9tCj = model->MOS9bulkCapFactor * capfact;
|
||||||
(here->MOS9tDepCap*here->MOS9tDepCap)
|
capfact = 1/(1+model->MOS9bulkJctSideGradingCoeff*
|
||||||
-here->MOS9tDepCap * here->MOS9f2d;
|
(4e-4*(model->MOS9tnom-REFTEMP)-gmaold));
|
||||||
if(model->MOS9capBSGiven) {
|
here->MOS9tCjsw = model->MOS9sideWallCapFactor * capfact;
|
||||||
czbs = here->MOS9tCbs * here->MOS9m;
|
here->MOS9tBulkPot = fact2 * pbo+pbfact;
|
||||||
} else {
|
gmanew = (here->MOS9tBulkPot-pbo)/pbo;
|
||||||
if(model->MOS9bulkCapFactorGiven) {
|
capfact = (1+model->MOS9bulkJctBotGradingCoeff*
|
||||||
czbs=here->MOS9tCj*here->MOS9sourceArea * here->MOS9m;
|
(4e-4*(here->MOS9temp-REFTEMP)-gmanew));
|
||||||
} else {
|
here->MOS9tCbd *= capfact;
|
||||||
czbs=0;
|
here->MOS9tCbs *= capfact;
|
||||||
}
|
here->MOS9tCj *= capfact;
|
||||||
}
|
capfact = (1+model->MOS9bulkJctSideGradingCoeff*
|
||||||
if(model->MOS9sideWallCapFactorGiven) {
|
(4e-4*(here->MOS9temp-REFTEMP)-gmanew));
|
||||||
czbssw = here->MOS9tCjsw * here->MOS9sourcePerimiter *
|
here->MOS9tCjsw *= capfact;
|
||||||
here->MOS9m;
|
here->MOS9tDepCap = model->MOS9fwdCapDepCoeff * here->MOS9tBulkPot;
|
||||||
} else {
|
|
||||||
czbssw=0;
|
if( (model->MOS9jctSatCurDensity == 0) ||
|
||||||
}
|
(here->MOS9drainArea == 0) ||
|
||||||
arg = 1-model->MOS9fwdCapDepCoeff;
|
(here->MOS9sourceArea == 0) ) {
|
||||||
sarg = exp( (-model->MOS9bulkJctBotGradingCoeff) * log(arg) );
|
here->MOS9sourceVcrit = here->MOS9drainVcrit =
|
||||||
sargsw = exp( (-model->MOS9bulkJctSideGradingCoeff) * log(arg) );
|
vt*log(vt/(CONSTroot2*here->MOS9m*here->MOS9tSatCur));
|
||||||
here->MOS9Cbs = czbs;
|
} else {
|
||||||
here->MOS9Cbssw = czbssw;
|
here->MOS9drainVcrit =
|
||||||
here->MOS9f2s = czbs*(1-model->MOS9fwdCapDepCoeff*
|
vt * log( vt / (CONSTroot2 *
|
||||||
(1+model->MOS9bulkJctBotGradingCoeff))* sarg/arg
|
here->MOS9m *
|
||||||
+ czbssw*(1-model->MOS9fwdCapDepCoeff*
|
here->MOS9tSatCurDens * here->MOS9drainArea));
|
||||||
(1+model->MOS9bulkJctSideGradingCoeff))*
|
here->MOS9sourceVcrit =
|
||||||
sargsw/arg;
|
vt * log( vt / (CONSTroot2 *
|
||||||
here->MOS9f3s = czbs * model->MOS9bulkJctBotGradingCoeff * sarg/arg/
|
here->MOS9m *
|
||||||
here->MOS9tBulkPot
|
here->MOS9tSatCurDens * here->MOS9sourceArea));
|
||||||
+ czbssw * model->MOS9bulkJctSideGradingCoeff * sargsw/arg /
|
}
|
||||||
here->MOS9tBulkPot;
|
if(model->MOS9capBDGiven) {
|
||||||
here->MOS9f4s = czbs*here->MOS9tBulkPot*(1-arg*sarg)/
|
czbd = here->MOS9tCbd * here->MOS9m;
|
||||||
(1-model->MOS9bulkJctBotGradingCoeff)
|
} else {
|
||||||
+ czbssw*here->MOS9tBulkPot*(1-arg*sargsw)/
|
if(model->MOS9bulkCapFactorGiven) {
|
||||||
(1-model->MOS9bulkJctSideGradingCoeff)
|
czbd=here->MOS9tCj*here->MOS9drainArea * here->MOS9m;
|
||||||
-here->MOS9f3s/2*
|
} else {
|
||||||
(here->MOS9tDepCap*here->MOS9tDepCap)
|
czbd=0;
|
||||||
-here->MOS9tDepCap * here->MOS9f2s;
|
}
|
||||||
}
|
}
|
||||||
}
|
if(model->MOS9sideWallCapFactorGiven) {
|
||||||
return(OK);
|
czbdsw= here->MOS9tCjsw * here->MOS9drainPerimiter *
|
||||||
}
|
here->MOS9m;
|
||||||
|
} else {
|
||||||
|
czbdsw=0;
|
||||||
|
}
|
||||||
|
arg = 1-model->MOS9fwdCapDepCoeff;
|
||||||
|
sarg = exp( (-model->MOS9bulkJctBotGradingCoeff) * log(arg) );
|
||||||
|
sargsw = exp( (-model->MOS9bulkJctSideGradingCoeff) * log(arg) );
|
||||||
|
here->MOS9Cbd = czbd;
|
||||||
|
here->MOS9Cbdsw = czbdsw;
|
||||||
|
here->MOS9f2d = czbd*(1-model->MOS9fwdCapDepCoeff*
|
||||||
|
(1+model->MOS9bulkJctBotGradingCoeff))* sarg/arg
|
||||||
|
+ czbdsw*(1-model->MOS9fwdCapDepCoeff*
|
||||||
|
(1+model->MOS9bulkJctSideGradingCoeff))*
|
||||||
|
sargsw/arg;
|
||||||
|
here->MOS9f3d = czbd * model->MOS9bulkJctBotGradingCoeff * sarg/arg/
|
||||||
|
here->MOS9tBulkPot
|
||||||
|
+ czbdsw * model->MOS9bulkJctSideGradingCoeff * sargsw/arg /
|
||||||
|
here->MOS9tBulkPot;
|
||||||
|
here->MOS9f4d = czbd*here->MOS9tBulkPot*(1-arg*sarg)/
|
||||||
|
(1-model->MOS9bulkJctBotGradingCoeff)
|
||||||
|
+ czbdsw*here->MOS9tBulkPot*(1-arg*sargsw)/
|
||||||
|
(1-model->MOS9bulkJctSideGradingCoeff)
|
||||||
|
-here->MOS9f3d/2*
|
||||||
|
(here->MOS9tDepCap*here->MOS9tDepCap)
|
||||||
|
-here->MOS9tDepCap * here->MOS9f2d;
|
||||||
|
if(model->MOS9capBSGiven) {
|
||||||
|
czbs = here->MOS9tCbs * here->MOS9m;
|
||||||
|
} else {
|
||||||
|
if(model->MOS9bulkCapFactorGiven) {
|
||||||
|
czbs=here->MOS9tCj*here->MOS9sourceArea * here->MOS9m;
|
||||||
|
} else {
|
||||||
|
czbs=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(model->MOS9sideWallCapFactorGiven) {
|
||||||
|
czbssw = here->MOS9tCjsw * here->MOS9sourcePerimiter *
|
||||||
|
here->MOS9m;
|
||||||
|
} else {
|
||||||
|
czbssw=0;
|
||||||
|
}
|
||||||
|
arg = 1-model->MOS9fwdCapDepCoeff;
|
||||||
|
sarg = exp( (-model->MOS9bulkJctBotGradingCoeff) * log(arg) );
|
||||||
|
sargsw = exp( (-model->MOS9bulkJctSideGradingCoeff) * log(arg) );
|
||||||
|
here->MOS9Cbs = czbs;
|
||||||
|
here->MOS9Cbssw = czbssw;
|
||||||
|
here->MOS9f2s = czbs*(1-model->MOS9fwdCapDepCoeff*
|
||||||
|
(1+model->MOS9bulkJctBotGradingCoeff))* sarg/arg
|
||||||
|
+ czbssw*(1-model->MOS9fwdCapDepCoeff*
|
||||||
|
(1+model->MOS9bulkJctSideGradingCoeff))*
|
||||||
|
sargsw/arg;
|
||||||
|
here->MOS9f3s = czbs * model->MOS9bulkJctBotGradingCoeff * sarg/arg/
|
||||||
|
here->MOS9tBulkPot
|
||||||
|
+ czbssw * model->MOS9bulkJctSideGradingCoeff * sargsw/arg /
|
||||||
|
here->MOS9tBulkPot;
|
||||||
|
here->MOS9f4s = czbs*here->MOS9tBulkPot*(1-arg*sarg)/
|
||||||
|
(1-model->MOS9bulkJctBotGradingCoeff)
|
||||||
|
+ czbssw*here->MOS9tBulkPot*(1-arg*sargsw)/
|
||||||
|
(1-model->MOS9bulkJctSideGradingCoeff)
|
||||||
|
-here->MOS9f3s/2*
|
||||||
|
(here->MOS9tDepCap*here->MOS9tDepCap)
|
||||||
|
-here->MOS9tDepCap * here->MOS9f2s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(OK);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,31 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
Modified: Alan Gillespie
|
Modified: Alan Gillespie
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "mos9defs.h"
|
#include "mos9defs.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "suffix.h"
|
#include "suffix.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
MOS9trunc(inModel,ckt,timeStep)
|
MOS9trunc(inModel,ckt,timeStep)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
CKTcircuit *ckt;
|
||||||
double *timeStep;
|
double *timeStep;
|
||||||
{
|
{
|
||||||
MOS9model *model = (MOS9model *)inModel;
|
MOS9model *model = (MOS9model *)inModel;
|
||||||
MOS9instance *here;
|
MOS9instance *here;
|
||||||
|
|
||||||
for( ; model != NULL; model = model->MOS9nextModel) {
|
for( ; model != NULL; model = model->MOS9nextModel) {
|
||||||
for(here=model->MOS9instances;here!=NULL;here = here->MOS9nextInstance){
|
for(here=model->MOS9instances;here!=NULL;here = here->MOS9nextInstance){
|
||||||
CKTterr(here->MOS9qgs,ckt,timeStep);
|
CKTterr(here->MOS9qgs,ckt,timeStep);
|
||||||
CKTterr(here->MOS9qgd,ckt,timeStep);
|
CKTterr(here->MOS9qgd,ckt,timeStep);
|
||||||
CKTterr(here->MOS9qgb,ckt,timeStep);
|
CKTterr(here->MOS9qgb,ckt,timeStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue