1 /**********
2 Copyright 1990 Regents of the University of California.  All rights reserved.
3 Author: 1987 Thomas L. Quarles
4 Modified: 2000 AlansFixes
5 **********/
6 /*
7  */
8 
9 #include "ngspice/ngspice.h"
10 #include "ngspice/const.h"
11 #include "ngspice/ifsim.h"
12 #include "ngspice/cktdefs.h"
13 #include "ngspice/devdefs.h"
14 #include "mos3defs.h"
15 #include "ngspice/sperror.h"
16 #include "ngspice/suffix.h"
17 
18 
19 /*ARGSUSED*/
20 int
MOS3mAsk(CKTcircuit * ckt,GENmodel * inst,int which,IFvalue * value)21 MOS3mAsk(CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
22 {
23     MOS3model *here = (MOS3model *)inst;
24 
25     NG_IGNORE(ckt);
26 
27     switch(which) {
28         case MOS3_MOD_TNOM:
29             value->rValue = here->MOS3tnom-CONSTCtoK;
30             return(OK);
31         case MOS3_MOD_VTO:
32             value->rValue = here->MOS3vt0;
33             return(OK);
34         case MOS3_MOD_KP:
35             value->rValue = here->MOS3transconductance;
36             return(OK);
37         case MOS3_MOD_GAMMA:
38             value->rValue = here->MOS3gamma;
39             return(OK);
40         case MOS3_MOD_PHI:
41             value->rValue = here->MOS3phi;
42             return(OK);
43         case MOS3_MOD_RD:
44             value->rValue = here->MOS3drainResistance;
45             return(OK);
46         case MOS3_MOD_RS:
47             value->rValue = here->MOS3sourceResistance;
48             return(OK);
49         case MOS3_MOD_CBD:
50             value->rValue = here->MOS3capBD;
51             return(OK);
52         case MOS3_MOD_CBS:
53             value->rValue = here->MOS3capBS;
54             return(OK);
55         case MOS3_MOD_IS:
56             value->rValue = here->MOS3jctSatCur;
57             return(OK);
58         case MOS3_MOD_PB:
59             value->rValue = here->MOS3bulkJctPotential;
60             return(OK);
61         case MOS3_MOD_CGSO:
62             value->rValue = here->MOS3gateSourceOverlapCapFactor;
63             return(OK);
64         case MOS3_MOD_CGDO:
65             value->rValue = here->MOS3gateDrainOverlapCapFactor;
66             return(OK);
67         case MOS3_MOD_CGBO:
68             value->rValue = here->MOS3gateBulkOverlapCapFactor;
69             return(OK);
70         case MOS3_MOD_CJ:
71             value->rValue = here->MOS3bulkCapFactor;
72             return(OK);
73         case MOS3_MOD_MJ:
74             value->rValue = here->MOS3bulkJctBotGradingCoeff;
75             return(OK);
76         case MOS3_MOD_CJSW:
77             value->rValue = here->MOS3sideWallCapFactor;
78             return(OK);
79         case MOS3_MOD_MJSW:
80             value->rValue = here->MOS3bulkJctSideGradingCoeff;
81             return(OK);
82         case MOS3_MOD_JS:
83             value->rValue = here->MOS3jctSatCurDensity;
84             return(OK);
85         case MOS3_MOD_TOX:
86             value->rValue = here->MOS3oxideThickness;
87             return(OK);
88         case MOS3_MOD_LD:
89             value->rValue = here->MOS3latDiff;
90             return(OK);
91         case MOS3_MOD_XL:
92             value->rValue = here->MOS3lengthAdjust;
93             return(OK);
94         case MOS3_MOD_WD:
95             value->rValue = here->MOS3widthNarrow;
96             return(OK);
97         case MOS3_MOD_XW:
98             value->rValue = here->MOS3widthAdjust;
99             return(OK);
100         case MOS3_MOD_DELVTO:
101             value->rValue = here->MOS3delvt0;
102             return(OK);
103         case MOS3_MOD_RSH:
104             value->rValue = here->MOS3sheetResistance;
105             return(OK);
106         case MOS3_MOD_U0:
107             value->rValue = here->MOS3surfaceMobility;
108             return(OK);
109         case MOS3_MOD_FC:
110             value->rValue = here->MOS3fwdCapDepCoeff;
111             return(OK);
112         case MOS3_MOD_NSUB:
113             value->rValue = here->MOS3substrateDoping;
114             return(OK);
115         case MOS3_MOD_TPG:
116             value->iValue = here->MOS3gateType;
117             return(OK);
118         case MOS3_MOD_NSS:
119             value->rValue = here->MOS3surfaceStateDensity;
120             return(OK);
121         case MOS3_MOD_NFS:
122             value->rValue = here->MOS3fastSurfaceStateDensity;
123             return(OK);
124         case MOS3_MOD_DELTA:
125             value->rValue = here->MOS3narrowFactor;
126             return(OK);
127         case MOS3_MOD_VMAX:
128             value->rValue = here->MOS3maxDriftVel;
129             return(OK);
130         case MOS3_MOD_XJ:
131             value->rValue = here->MOS3junctionDepth;
132             return(OK);
133         case MOS3_MOD_ETA:
134             value->rValue = here->MOS3eta;
135             return(OK);
136         case MOS3_MOD_XD:
137             value->rValue = here->MOS3coeffDepLayWidth;
138             return(OK);
139         case MOS3_DELTA:
140             value->rValue = here->MOS3delta;
141             return(OK);
142         case MOS3_MOD_THETA:
143             value->rValue = here->MOS3theta;
144             return(OK);
145         case MOS3_MOD_ALPHA:
146             value->rValue = here->MOS3alpha;
147             return(OK);
148         case MOS3_MOD_KAPPA:
149             value->rValue = here->MOS3kappa;
150             return(OK);
151         case MOS3_MOD_KF:
152             value->rValue = here->MOS3fNcoef;
153             return(OK);
154         case MOS3_MOD_AF:
155             value->rValue = here->MOS3fNexp;
156             return(OK);
157 	case MOS3_MOD_TYPE:
158 	    if (here->MOS3type > 0)
159 	        value->sValue = "nmos";
160 	    else
161 	        value->sValue = "pmos";
162 	    return(OK);
163         default:
164             return(E_BADPARM);
165     }
166     /* NOTREACHED */
167 }
168 
169