1 /**********
2 STAG version 2.7
3 Copyright 2000 owned by the United Kingdom Secretary of State for Defence
4 acting through the Defence Evaluation and Research Agency.
5 Developed by :     Jim Benson,
6                    Department of Electronics and Computer Science,
7                    University of Southampton,
8                    United Kingdom.
9 With help from :   Nele D'Halleweyn, Ketan Mistry, Bill Redman-White, and Craig Easson.
10 
11 Based on STAG version 2.1
12 Developed by :     Mike Lee,
13 With help from :   Bernard Tenbroek, Bill Redman-White, Mike Uren, Chris Edwards
14                    and John Bunyan.
15 Acknowledgements : Rupert Howes and Pete Mole.
16 **********/
17 
18 /**********
19 Modified by Paolo Nenzi 2002
20 ngspice integration
21 **********/
22 
23 #include "ngspice/ngspice.h"
24 #include "ngspice/const.h"
25 #include "ngspice/ifsim.h"
26 #include "ngspice/cktdefs.h"
27 #include "ngspice/devdefs.h"
28 #include "soi3defs.h"
29 #include "ngspice/sperror.h"
30 #include "ngspice/suffix.h"
31 
32 
33 /*ARGSUSED*/
34 int
SOI3mAsk(CKTcircuit * ckt,GENmodel * inst,int which,IFvalue * value)35 SOI3mAsk(CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
36 {
37     SOI3model *model = (SOI3model *)inst;
38 
39     NG_IGNORE(ckt);
40 
41     switch(which) {
42         case SOI3_MOD_VTO:
43             value->rValue = model->SOI3vt0;
44             return(OK);
45         case SOI3_MOD_VFBF:
46             value->rValue = model->SOI3vfbF;
47             return(OK);
48         case SOI3_MOD_KP:
49             value->rValue = model->SOI3transconductance;
50             return(OK);
51         case SOI3_MOD_GAMMA:
52             value->rValue = model->SOI3gamma;
53             return(OK);
54         case SOI3_MOD_PHI:
55             value->rValue = model->SOI3phi;
56             return(OK);
57         case SOI3_MOD_LAMBDA:
58             value->rValue = model->SOI3lambda;
59             return(OK);
60         case SOI3_MOD_THETA:
61             value->rValue = model->SOI3theta;
62             return(OK);
63         case SOI3_MOD_RD:
64             value->rValue = model->SOI3drainResistance;
65             return(OK);
66         case SOI3_MOD_RS:
67             value->rValue = model->SOI3sourceResistance;
68             return(OK);
69         case SOI3_MOD_CBD:
70             value->rValue = model->SOI3capBD;
71             return(OK);
72         case SOI3_MOD_CBS:
73             value->rValue = model->SOI3capBS;
74             return(OK);
75         case SOI3_MOD_IS:
76             value->rValue = model->SOI3jctSatCur;
77             return(OK);
78         case SOI3_MOD_IS1:
79             value->rValue = model->SOI3jctSatCur1;
80             return(OK);
81         case SOI3_MOD_PB:
82             value->rValue = model->SOI3bulkJctPotential;
83             return(OK);
84         case SOI3_MOD_CGFSO:
85             value->rValue = model->SOI3frontGateSourceOverlapCapFactor;
86             return(OK);
87         case SOI3_MOD_CGFDO:
88             value->rValue = model->SOI3frontGateDrainOverlapCapFactor;
89             return(OK);
90         case SOI3_MOD_CGFBO:
91             value->rValue = model->SOI3frontGateBulkOverlapCapFactor;
92             return(OK);
93         case SOI3_MOD_CGBSO:
94             value->rValue = model->SOI3backGateSourceOverlapCapAreaFactor;
95             return(OK);
96         case SOI3_MOD_CGBDO:
97             value->rValue = model->SOI3backGateDrainOverlapCapAreaFactor;
98             return(OK);
99         case SOI3_MOD_CGBBO:
100             value->rValue = model->SOI3backGateBulkOverlapCapAreaFactor;
101             return(OK);
102         case SOI3_MOD_RSH:
103             value->rValue = model->SOI3sheetResistance;
104             return(OK);
105         case SOI3_MOD_CJSW:
106             value->rValue = model->SOI3sideWallCapFactor;
107             return(OK);
108         case SOI3_MOD_MJSW:
109             value->rValue = model->SOI3bulkJctSideGradingCoeff;
110             return(OK);
111         case SOI3_MOD_JS:
112             value->rValue = model->SOI3jctSatCurDensity;
113             return(OK);
114         case SOI3_MOD_JS1:
115             value->rValue = model->SOI3jctSatCurDensity1;
116             return(OK);
117         case SOI3_MOD_TOF:
118             value->rValue = model->SOI3frontOxideThickness;
119             return(OK);
120         case SOI3_MOD_TOB:
121             value->rValue = model->SOI3backOxideThickness;
122             return(OK);
123         case SOI3_MOD_TB:
124             value->rValue = model->SOI3bodyThickness;
125             return(OK);
126         case SOI3_MOD_LD:
127             value->rValue = model->SOI3latDiff;
128             return(OK);
129         case SOI3_MOD_U0:
130             value->rValue = model->SOI3surfaceMobility;
131             return(OK);
132         case SOI3_MOD_FC:
133             value->rValue = model->SOI3fwdCapDepCoeff;
134             return(OK);
135         case SOI3_MOD_KOX:
136             value->rValue = model->SOI3oxideThermalConductivity;
137             return(OK);
138         case SOI3_MOD_SHSI:
139             value->rValue = model->SOI3siliconSpecificHeat;
140             return(OK);
141         case SOI3_MOD_DSI:
142             value->rValue = model->SOI3siliconDensity;
143             return(OK);
144         case SOI3_MOD_NSUB:
145             value->rValue = model->SOI3substrateDoping;
146             return(OK);
147         case SOI3_MOD_TPG:
148             value->iValue = model->SOI3gateType;
149             return(OK);
150         case SOI3_MOD_NQFF:
151             value->rValue = model->SOI3frontFixedChargeDensity;
152             return(OK);
153         case SOI3_MOD_NQFB:
154             value->rValue = model->SOI3backFixedChargeDensity;
155             return(OK);
156         case SOI3_MOD_NSSF:
157             value->rValue = model->SOI3frontSurfaceStateDensity;
158             return(OK);
159         case SOI3_MOD_NSSB:
160             value->rValue = model->SOI3backSurfaceStateDensity;
161             return(OK);
162         case SOI3_MOD_TNOM:
163             value->rValue = model->SOI3tnom-CONSTCtoK;
164             return(OK);
165 /* extra stuff for newer model - msll Jan96 */
166         case SOI3_MOD_SIGMA:
167             value->rValue = model->SOI3sigma;
168             return(OK);
169         case SOI3_MOD_CHIFB:
170             value->rValue = model->SOI3chiFB;
171             return(OK);
172         case SOI3_MOD_CHIPHI:
173             value->rValue = model->SOI3chiPHI;
174             return(OK);
175         case SOI3_MOD_DELTAW:
176             value->rValue = model->SOI3deltaW;
177             return(OK);
178         case SOI3_MOD_DELTAL:
179             value->rValue = model->SOI3deltaL;
180             return(OK);
181         case SOI3_MOD_VSAT:
182             value->rValue = model->SOI3vsat;
183             return(OK);
184         case SOI3_MOD_K:
185             value->rValue = model->SOI3k;
186             return(OK);
187         case SOI3_MOD_LX:
188             value->rValue = model->SOI3lx;
189             return(OK);
190         case SOI3_MOD_VP:
191             value->rValue = model->SOI3vp;
192             return(OK);
193         case SOI3_MOD_ETA:
194             value->rValue = model->SOI3eta;
195             return(OK);
196         case SOI3_MOD_ALPHA0:
197             value->rValue = model->SOI3alpha0;
198             return(OK);
199         case SOI3_MOD_BETA0:
200             value->rValue = model->SOI3beta0;
201             return(OK);
202         case SOI3_MOD_LM:
203             value->rValue = model->SOI3lm;
204             return(OK);
205         case SOI3_MOD_LM1:
206             value->rValue = model->SOI3lm1;
207             return(OK);
208         case SOI3_MOD_LM2:
209             value->rValue = model->SOI3lm2;
210             return(OK);
211         case SOI3_MOD_ETAD:
212             value->rValue = model->SOI3etad;
213             return(OK);
214         case SOI3_MOD_ETAD1:
215             value->rValue = model->SOI3etad1;
216             return(OK);
217         case SOI3_MOD_CHIBETA:
218             value->rValue = model->SOI3chibeta;
219             return(OK);
220         case SOI3_MOD_VFBB:
221             value->rValue = model->SOI3vfbB;
222             return(OK);
223         case SOI3_MOD_GAMMAB:
224             value->rValue = model->SOI3gammaB;
225             return(OK);
226         case SOI3_MOD_CHID:
227             value->rValue = model->SOI3chid;
228             return(OK);
229         case SOI3_MOD_CHID1:
230             value->rValue = model->SOI3chid1;
231             return(OK);
232         case SOI3_MOD_DVT:
233             value->iValue = model->SOI3dvt;
234             return(OK);
235         case SOI3_MOD_NLEV:
236             value->iValue = model->SOI3nLev;
237             return(OK);
238         case SOI3_MOD_BETABJT:
239             value->rValue = model->SOI3betaBJT;
240             return(OK);
241         case SOI3_MOD_TAUFBJT:
242             value->rValue = model->SOI3tauFBJT;
243             return(OK);
244         case SOI3_MOD_TAURBJT:
245             value->rValue = model->SOI3tauRBJT;
246             return(OK);
247         case SOI3_MOD_BETAEXP:
248             value->rValue = model->SOI3betaEXP;
249             return(OK);
250         case SOI3_MOD_TAUEXP:
251             value->rValue = model->SOI3tauEXP;
252             return(OK);
253         case SOI3_MOD_RSW:
254             value->rValue = model->SOI3rsw;
255             return(OK);
256         case SOI3_MOD_RDW:
257             value->rValue = model->SOI3rdw;
258             return(OK);
259         case SOI3_MOD_FMIN:
260             value->rValue = model->SOI3minimumFeatureSize;
261             return(OK);
262         case SOI3_MOD_VTEX:
263             value->rValue = model->SOI3vtex;
264             return(OK);
265         case SOI3_MOD_VDEX:
266             value->rValue = model->SOI3vdex;
267             return(OK);
268         case SOI3_MOD_DELTA0:
269             value->rValue = model->SOI3delta0;
270             return(OK);
271         case SOI3_MOD_CSF:
272             value->rValue = model->SOI3satChargeShareFactor;
273             return(OK);
274         case SOI3_MOD_NPLUS:
275             value->rValue = model->SOI3nplusDoping;
276             return(OK);
277         case SOI3_MOD_RTA:
278             value->rValue = model->SOI3rta;
279             return(OK);
280         case SOI3_MOD_CTA:
281             value->rValue = model->SOI3cta;
282             return(OK);
283 	case SOI3_MOD_MEXP:
284             value->rValue = model->SOI3mexp;
285             return(OK);
286         default:
287             return(E_BADPARM);
288     }
289     /* NOTREACHED */
290 }
291