Merge branch 'fixes' into testing-uf
[gnucap-felix.git] / modules / d_mos8.h
blob638734d9ca2c199f1a5197416dfd722e2395f010
1 /* $Id: d_mos8.h,v 1.7 2010-09-07 07:46:21 felix Exp $ -*- C++ -*-
2 * vim:ts=8:sw=2:et:
3 * Copyright (C) 2001 Albert Davis
4 * Author: Albert Davis <aldavis@gnu.org>
6 * This file is part of "Gnucap", the Gnu Circuit Analysis Package
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3, or (at your option)
11 * any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 * 02110-1301, USA.
22 *------------------------------------------------------------------
23 * Berkeley BSIM3v3.3 model
24 ********** derived from.........
25 * Copyright 2004 Regents of the University of California. All rights reserved.
26 * File: b3ld.c of BSIM3v3.3.0
27 * Author: 1991 JianHui Huang and Min-Chie Jeng.
28 * Modified by Mansun Chan (1995).
29 * Author: 1997-1999 Weidong Liu.
30 * Author: 2001 Xuemei Xi
31 * Modified by Xuemei Xi, 10/05, 12/21, 2001.
32 * Modified by Xuemei Xi, 07/29/2005.
33 **********
34 * Recoded for Gnucap model compiler, Al Davis, 2006
36 /* This file is automatically generated. DO NOT EDIT */
37 #ifndef D_MOS8_H_INCLUDED
38 #define D_MOS8_H_INCLUDED
40 #include "d_mos_base.h"
41 #include "e_adp_mos.h"
42 #include "u_sdp.h"
43 #include "e_node.h"
44 #include "e_subckt.h"
45 #include "e_model.h"
46 namespace UF{
47 /*--------------------------------------------------------------------------*/
48 class ADP_BUILT_IN_MOS8 :public ADP_BUILT_IN_MOS{
49 friend class MODEL_BUILT_IN_MOS8; // HACK
51 long double _hci_tr; //?
52 long double _hci_stress; //?
53 ADP_BUILT_IN_MOS8( const ADP_BUILT_IN_MOS8& a);
54 public:
55 explicit ADP_BUILT_IN_MOS8( COMPONENT* c, const std::string n):
56 ADP_BUILT_IN_MOS(c,n) // , _raw_hci_node(0)
58 init(c);
61 virtual ADP_CARD* clone()const{ return new ADP_BUILT_IN_MOS8(*this); }
62 protected:
63 void init(const COMPONENT*);
64 public:
65 hp_float_t vthscale_hci;
66 hp_float_t vthdelta_hci;
67 // hp_float_t vthdelta; (ADP_BUILT_IN_MOS)
69 virtual double tt_probe_num(const std::string& x)const;
70 virtual double tr_probe_num(const std::string& x)const;
71 void expand();
73 private:
74 // ADP_NODE* _raw_hci_node;
76 private: // overrides
77 void tt_begin();
78 void tt_accept();
79 void tt_advance();
80 void tr_accept();
81 void tr_stress_last();
82 void apply(const COMPONENT*);
85 /*--------------------------------------------------------------------------*/
86 class SDP_BUILT_IN_MOS8
87 :public SDP_BUILT_IN_MOS_BASE{
88 public:
89 explicit SDP_BUILT_IN_MOS8(const COMMON_COMPONENT* c) : SDP_BUILT_IN_MOS_BASE(c) {init(c);}
90 void init(const COMMON_COMPONENT*);
91 public:
92 // double h0; // some hci paramater
93 double cdsc; // Drain/Source and channel coupling capacitance Q/V/m^2
94 double cdscb; // Body-bias dependence of cdsc Q/V/m^2
95 double cdscd; // Drain-bias dependence of cdsc Q/V/m^2
96 double cit; // Interface state capacitance Q/V/m^2
97 double nfactor; // Subthreshold swing Coefficient
98 double xj; // Junction depth in meters
99 double vsat; // Saturation velocity at tnom m/s
100 double at; // Temperature coefficient of vsat m/s
101 double a0; // Non-uniform depletion width effect coefficient.
102 double ags; // Gate bias coefficient of Abulk.
103 double a1; // Non-saturation effect coefficient
104 double a2; // Non-saturation effect coefficient
105 double keta; // Body-bias coefficient of non-uniform depletion width effect. 1/v
106 double nsub; // Substrate doping concentration 1/cm3
107 double npeak; // Channel doping concentration 1/cm3
108 double ngate; // Poly-gate doping concentration 1/cm3
109 double gamma1; // Vth body coefficient
110 double gamma2; // Vth body coefficient
111 double vbx; // Vth transition body Voltage
112 double vbm; // Maximum body voltage
113 double xt; // Doping depth
114 double k1; // Bulk effect coefficient 1
115 double kt1; // Temperature coefficient of Vth
116 double kt1l; // Temperature coefficient of Vth
117 double kt2; // Body-coefficient of kt1
118 double k2; // Bulk effect coefficient 2
119 double k3; // Narrow width effect coefficient
120 double k3b; // Body effect coefficient of k3
121 double w0; // Narrow width effect parameter
122 double nlx; // Lateral non-uniform doping effect
123 double dvt0; // Short channel effect coeff. 0
124 double dvt1; // Short channel effect coeff. 1
125 double dvt2; // Short channel effect coeff. 2 1/v
126 double dvt0w; // Narrow Width coeff. 0
127 double dvt1w; // Narrow Width effect coeff. 1
128 double dvt2w; // Narrow Width effect coeff. 2
129 double drout; // DIBL coefficient of output resistance
130 double dsub; // DIBL coefficient in the subthreshold region
131 double vth0; // Threshold voltage
132 double ua1; // Temperature coefficient of ua m/v
133 double ua; // Linear gate dependence of mobility m/v
134 double ub1; // Temperature coefficient of ub (m/V)**2
135 double ub; // Quadratic gate dependence of mobility (m/V)**2
136 double uc1; // Temperature coefficient of uc
137 double uc; // Body-bias dependence of mobility
138 double u0; // Low-field mobility at Tnom
139 double ute; // Temperature coefficient of mobility
140 double voff; // Threshold voltage offset
141 double delta; // Effective Vds parameter
142 double rdsw; // Source-drain resistance per width
143 double prwg; // Gate-bias effect on parasitic resistance
144 double prwb; // Body-effect on parasitic resistance
145 double prt; // Temperature coefficient of parasitic resistance
146 double eta0; // Subthreshold region DIBL coefficient
147 double etab; // Subthreshold region DIBL coefficient 1/v
148 double pclm; // Channel length modulation Coefficient
149 double pdibl1; // Drain-induced barrier lowering coefficient
150 double pdibl2; // Drain-induced barrier lowering coefficient
151 double pdiblb; // Body-effect on drain-induced barrier lowering 1/v
152 double pscbe1; // Substrate current body-effect coefficient
153 double pscbe2; // Substrate current body-effect coefficient
154 double pvag; // Gate dependence of output resistance parameter
155 double wr; // Width dependence of rds
156 double dwg; // Width reduction parameter
157 double dwb; // Width reduction parameter
158 double b0; // Abulk narrow width parameter
159 double b1; // Abulk narrow width parameter
160 double alpha0; // substrate current model parameter
161 double beta0; // substrate current model parameter
162 double elm; // Non-quasi-static Elmore Constant Parameter
163 double vfbcv; // Flat Band Voltage parameter for capmod=0 only
164 double cgsl; // New C-V model parameter
165 double cgdl; // New C-V model parameter
166 double ckappa; // New C-V model parameter
167 double cf; // Fringe capacitance parameter
168 double clc; // Vdsat parameter for C-V model
169 double cle; // Vdsat parameter for C-V model
170 double vfb; // Flat Band Voltage
171 double acde; // Exponential coefficient for finite charge thickness, capmod=3
172 double moin; // Coefficient for gate-bias dependent surface potential, capmod=3
173 double noff; // C-V turn-on/off parameter, capmod=1,2,3
174 double voffcv; // C-V lateral-shift parameter, capmod=1,2,3
175 double alpha1; // substrate current model parameter
176 double dl; //
177 double dlc; //
178 double dw; //
179 double dwc; //
180 double leff; //
181 double weff; //
182 double leffCV; //
183 double weffCV; //
184 double abulkCVfactor; //
185 double litl; //
186 double ldeb; //
187 private:
188 double dw_effdw_in(const COMMON_COMPONENT*) const{return 1;}
189 double dl_effdl_in(const COMMON_COMPONENT*) const{return 1;}
191 /*--------------------------------------------------------------------------*/
192 /*--------------------------------------------------------------------------*/
194 class DEV_BUILT_IN_MOS;
195 class TDP_BUILT_IN_MOS8
196 :public TDP_BUILT_IN_MOS_BASE{
197 public:
198 explicit TDP_BUILT_IN_MOS8(const DEV_BUILT_IN_MOS*);
199 // double tr_probe_num(const std::string&)const;
200 public:
201 double temp; //
202 double tempratio; //
203 double tempratio_1; //
204 double vtm; // vtm
205 double ua; //
206 double dua_dW;
207 double dua_dL;
208 double ub; //
209 double dub_dW;
210 double dub_dL;
211 double uc; //
212 double duc_dW;
213 double duc_dL;
214 double u0temp; //
215 double vsattemp; //
216 double rds0; //
217 double drds0_dW; //
218 double drds0_dL; //
219 double phi; //
220 double sqrtPhi; //
221 double phis3; //
222 double Xdep0; //
223 double vbi; //
224 double cdep0; //
225 double k1; //
226 double k2; //
227 double vbsc; //
228 double vth0;
229 double dvth0_dW;
230 double dvth0_dL;
231 double vfb; //
232 double dvfb_dW;
233 double dvfb_dL;
234 double theta0vb0; //
235 double dtheta0vb0_dW;
236 double dtheta0vb0_dL;
237 double thetaRout; //
238 double dthetaRout_dW; //
239 double dthetaRout_dL; //
240 double k1ox; //
241 double k2ox; //
242 double vfbzb; //
244 /*--------------------------------------------------------------------------*/
245 class MODEL_BUILT_IN_MOS8
246 :public MODEL_BUILT_IN_MOS_BASE{
247 protected:
248 explicit MODEL_BUILT_IN_MOS8(const MODEL_BUILT_IN_MOS8& p);
249 public:
250 explicit MODEL_BUILT_IN_MOS8(const BASE_SUBCKT*);
251 ~MODEL_BUILT_IN_MOS8() {--_count;}
252 virtual ADP_CARD* new_adp( COMPONENT* c)const; //alles const. attach vielleicht !const
253 public: // override virtual
254 void do_stress_apply(COMPONENT* c)const;
255 void do_tr_stress( const COMPONENT* c ) const;
256 std::string dev_type()const;
257 void set_dev_type(const std::string& nt);
258 CARD* clone()const {return new MODEL_BUILT_IN_MOS8(*this);}
259 void precalc_first();
260 void precalc_last();
261 SDP_CARD* new_sdp(COMMON_COMPONENT* c)const;
262 void set_param_by_index(int, std::string&, int);
263 bool param_is_printable(int)const;
264 std::string param_name(int)const;
265 std::string param_name(int,int)const;
266 std::string param_value(int)const;
267 int param_count()const {return (395 + MODEL_BUILT_IN_MOS_BASE::param_count());}
268 bool is_valid(const COMPONENT*)const;
269 void tr_eval(COMPONENT*)const;
270 void sens_eval(COMPONENT*)const;
271 virtual const COMPONENT* hci_device()const;
272 public: // not virtual
273 static int count() {return _count;}
274 private: // strictly internal
275 static int _count;
276 public: // input parameters
277 // SDP h0;
278 SDP cdsc; // Drain/Source and channel coupling capacitance Q/V/m^2
279 SDP cdscb; // Body-bias dependence of cdsc Q/V/m^2
280 SDP cdscd; // Drain-bias dependence of cdsc Q/V/m^2
281 SDP cit; // Interface state capacitance Q/V/m^2
282 SDP nfactor; // Subthreshold swing Coefficient
283 SDP xj; // Junction depth in meters
284 SDP vsat; // Saturation velocity at tnom m/s
285 SDP at; // Temperature coefficient of vsat m/s
286 SDP a0; // Non-uniform depletion width effect coefficient.
287 SDP ags; // Gate bias coefficient of Abulk.
288 SDP a1; // Non-saturation effect coefficient
289 SDP a2; // Non-saturation effect coefficient
290 SDP keta; // Body-bias coefficient of non-uniform depletion width effect. 1/v
291 SDP nsub; // Substrate doping concentration 1/cm3
292 SDP npeak; // Channel doping concentration 1/cm3 // BUG? why SDP?!
293 SDP ngate; // Poly-gate doping concentration 1/cm3
294 SDP gamma1; // Vth body coefficient
295 SDP gamma2; // Vth body coefficient
296 SDP vbx; // Vth transition body Voltage
297 SDP vbm; // Maximum body voltage
298 SDP xt; // Doping depth
299 SDP k1; // Bulk effect coefficient 1
300 SDP kt1; // Temperature coefficient of Vth
301 SDP kt1l; // Temperature coefficient of Vth
302 SDP kt2; // Body-coefficient of kt1
303 SDP k2; // Bulk effect coefficient 2
304 SDP k3; // Narrow width effect coefficient
305 SDP k3b; // Body effect coefficient of k3
306 SDP w0; // Narrow width effect parameter
307 SDP nlx; // Lateral non-uniform doping effect
308 SDP dvt0; // Short channel effect coeff. 0
309 SDP dvt1; // Short channel effect coeff. 1
310 SDP dvt2; // Short channel effect coeff. 2 1/v
311 SDP dvt0w; // Narrow Width coeff. 0
312 SDP dvt1w; // Narrow Width effect coeff. 1
313 SDP dvt2w; // Narrow Width effect coeff. 2
314 SDP drout; // DIBL coefficient of output resistance
315 SDP dsub; // DIBL coefficient in the subthreshold region
316 SDP vth0; // Threshold voltage
317 SDP ua1; // Temperature coefficient of ua m/v
318 SDP ua; // Linear gate dependence of mobility m/v
319 SDP ub1; // Temperature coefficient of ub (m/V)**2
320 SDP ub; // Quadratic gate dependence of mobility (m/V)**2
321 SDP uc1; // Temperature coefficient of uc
322 SDP uc; // Body-bias dependence of mobility
323 SDP u0; // Low-field mobility at Tnom
324 SDP ute; // Temperature coefficient of mobility
325 SDP voff; // Threshold voltage offset
326 SDP delta; // Effective Vds parameter
327 SDP rdsw; // Source-drain resistance per width
328 SDP prwg; // Gate-bias effect on parasitic resistance
329 SDP prwb; // Body-effect on parasitic resistance
330 SDP prt; // Temperature coefficient of parasitic resistance
331 SDP eta0; // Subthreshold region DIBL coefficient
332 SDP etab; // Subthreshold region DIBL coefficient 1/v
333 SDP pclm; // Channel length modulation Coefficient
334 SDP pdibl1; // Drain-induced barrier lowering coefficient
335 SDP pdibl2; // Drain-induced barrier lowering coefficient
336 SDP pdiblb; // Body-effect on drain-induced barrier lowering 1/v
337 SDP pscbe1; // Substrate current body-effect coefficient
338 SDP pscbe2; // Substrate current body-effect coefficient
339 SDP pvag; // Gate dependence of output resistance parameter
340 SDP wr; // Width dependence of rds
341 SDP dwg; // Width reduction parameter
342 SDP dwb; // Width reduction parameter
343 SDP b0; // Abulk narrow width parameter
344 SDP b1; // Abulk narrow width parameter
345 SDP alpha0; // substrate current model parameter
346 SDP beta0; // substrate current model parameter
347 SDP elm; // Non-quasi-static Elmore Constant Parameter
348 SDP vfbcv; // Flat Band Voltage parameter for capmod=0 only
349 SDP cgsl; // New C-V model parameter
350 SDP cgdl; // New C-V model parameter
351 SDP ckappa; // New C-V model parameter
352 SDP cf; // Fringe capacitance parameter
353 SDP clc; // Vdsat parameter for C-V model
354 SDP cle; // Vdsat parameter for C-V model
355 SDP vfb; // Flat Band Voltage
356 SDP acde; // Exponential coefficient for finite charge thickness, capmod=3
357 SDP moin; // Coefficient for gate-bias dependent surface potential, capmod=3
358 SDP noff; // C-V turn-on/off parameter, capmod=1,2,3
359 SDP voffcv; // C-V lateral-shift parameter, capmod=1,2,3
360 SDP alpha1; // substrate current model parameter
361 PARAMETER<int> capMod; // Capacitance model selector (0, 1, 2, other?)
362 PARAMETER<int> nqsMod; // Non-quasi-static model selector (0, !0)
363 PARAMETER<int> mobMod; // Mobility model selector (1,2,3,other?)
364 PARAMETER<int> noiMod; // Noise model selector (not used)
365 PARAMETER<int> paramChk; // Model parameter checking selector (not used)
366 PARAMETER<int> binUnit; // Bin unit selector (1, !1)
367 PARAMETER<double> version; // parameter for model version (not used)
368 PARAMETER<double> tox; // Gate oxide thickness in meters
369 PARAMETER<double> xpart; // Channel charge partitioning
370 PARAMETER<double> jctSidewallSatCurDensity; // Sidewall junction reverse saturation current density
371 PARAMETER<double> mjswg; // Source/drain (gate side) sw junction capacitance grading coefficient
372 PARAMETER<double> pbswg; // Source/drain (gate side) sw junction capacitance built in potential
373 PARAMETER<double> unitLengthGateSidewallJctCap; // Source/drain (gate side) sidewall junction capacitance per unit width
374 PARAMETER<double> jctEmissionCoeff; // Source/drain junction emission coefficient
375 PARAMETER<double> jctTempExponent; // Junction current temperature exponent
376 PARAMETER<double> Lint; // Length reduction parameter
377 PARAMETER<double> Ll; // Length reduction parameter
378 PARAMETER<double> Lln; // Length reduction parameter
379 PARAMETER<double> Lw; // Length reduction parameter
380 PARAMETER<double> Lwn; // Length reduction parameter
381 PARAMETER<double> Lwl; // Length reduction parameter
382 PARAMETER<double> Wint; // Width reduction parameter
383 PARAMETER<double> Wl; // Width reduction parameter
384 PARAMETER<double> Wln; // Width reduction parameter
385 PARAMETER<double> Ww; // Width reduction parameter
386 PARAMETER<double> Wwn; // Width reduction parameter
387 PARAMETER<double> Wwl; // Width reduction parameter
388 PARAMETER<double> dwc; // Delta W for C-V model
389 PARAMETER<double> dlc; // Delta L for C-V model
390 PARAMETER<double> noia; // Flicker noise parameter, oxide trap density A
391 PARAMETER<double> noib; // Flicker noise parameter, oxide trap density B
392 PARAMETER<double> noic; // Flicker noise parameter, oxide trap density C
393 PARAMETER<double> em; // Flicker noise parameter V/m
394 PARAMETER<double> ef; // Flicker noise frequency exponent
395 PARAMETER<int> acnqsMod; // AC NQS model selector
396 PARAMETER<double> toxm; // Gate oxide thickness used in extraction
397 PARAMETER<double> lintnoi; // lint offset for noise calculation
398 PARAMETER<double> ijth; // Diode limiting current
399 PARAMETER<double> tpb; // Temperature coefficient of pb
400 PARAMETER<double> tcj; // Temperature coefficient of cj
401 PARAMETER<double> tpbsw; // Temperature coefficient of pbsw
402 PARAMETER<double> tcjsw; // Temperature coefficient of cjsw
403 PARAMETER<double> tpbswg; // Temperature coefficient of pbswg
404 PARAMETER<double> tcjswg; // Temperature coefficient of cjswg
405 PARAMETER<double> Llc; // Length reduction parameter for CV
406 PARAMETER<double> Lwc; // Length reduction parameter for CV
407 PARAMETER<double> Lwlc; // Length reduction parameter for CV
408 PARAMETER<double> Wlc; // Width reduction parameter for CV
409 PARAMETER<double> Wwc; // Width reduction parameter for CV
410 PARAMETER<double> Wwlc; // Width reduction parameter for CV
411 PARAMETER<int> acm; // area calculation method, ignored
412 PARAMETER<double> h0; // H for Hci
413 PARAMETER<double> hci_m; // H for Hci
414 PARAMETER<double> hci_n; // H for Hci
415 public: // calculated parameters
416 double cox; //
417 double factor1; //
418 double vt_at_tnom; //
419 double ni; //
421 double dgmdl_eff(const DEV_BUILT_IN_MOS*) const;
422 double dgmdw_eff(const DEV_BUILT_IN_MOS*) const;
425 /*--------------------------------------------------------------------------*/
426 /*--------------------------------------------------------------------------*/
427 # if nonsense
428 class DEV_BUILT_IN_MOS8 : public DEV_BUILT_IN_MOS {
429 protected: // override virtual
430 virtual double tr_probe_num(const std::string&)const;
431 virtual double tt_probe_num(const std::string& x)const;
432 double probe_num(const std::string& what)const
434 double x;
435 if (_sim->analysis_is_tt()) {
436 x = tt_probe_num(what);
437 }else if (_sim->analysis_is_ac()) {
438 x = ac_probe_num(what);
439 }else{
440 x = tr_probe_num(what);
442 return (std::abs(x)>=1) ? x : floor(x/OPT::floor + .5) * OPT::floor;
445 #endif
446 /*--------------------------------------------------------------------------*/
448 #endif