├── FOSS_EKV26_Verilog-A.pdf
├── README.md
├── LICENSE
├── docs
└── readme.md
└── ekv26_SDext_Verilog-A.va
/FOSS_EKV26_Verilog-A.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ekv26/model/HEAD/FOSS_EKV26_Verilog-A.pdf
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # model
2 | FOSS EKV2.6 Compact Model
3 |
4 | The EKV2.6 MOSFET compact model has had a considerable impact on the academic and industrial community of analog integrated circuit design, since its inception in 1996. The model is available as a free open-source software (FOSS) tool coded in Verilog-A. The present depository provides a short review of foundations of the model and shows its capabilities via characterization and modeling based on a test chip in 180 nm CMOS fabricated via Europractice.
5 |
6 | [EKV26 Model Documentation](https://github.com/ekv26/model/tree/master/docs)
7 |
8 | Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
9 |
10 | http://opensource.org/licenses/ECL-2.0
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | /*
2 | EKV MOS model version 2.6 rev.15 with documentation at: http://ekv.epfl.ch
3 | Matthias Bucher, Christophe Lallement, Christian Enz, Fabien Theodoloz, Francois Krummenacher
4 | Electronics Laboratories, Swiss Federal Institute of Technology Lausanne, Switzerland
5 | This Verilog-A was developed by Wladek Grabinski with modifications
6 | by Tiburon Design Automation (www.tiburon-da.com).
7 | This software has been provided pursuant to a License Agreement containing restrictions on its use.
8 | It may not be copied or distributed in any form or medium, disclosed to third parties,
9 | reverse engineered or used in any manner not provided for in said License Agreement
10 | except with the prior written authorization.
11 | Licensed under the Educational Community License, Version 2.0 (the "License");
12 | you may not use this file except in compliance with the License.
13 |
14 | You may obtain a copy of the License at http://opensource.org/licenses/ECL-2.0
15 |
16 | Unless required by applicable law or agreed to in writing, software distributed under
17 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
18 | either express or implied. See the License for the specific language governing permissions
19 | and limitations under the License.
20 |
21 | $RCSfile: ekv.va,v $ $Revision: 1.9 $ $Date: 2003/12/17 01:20:10 $
22 | $RCSfile: ekv.va,v $ $Revision: 2.6.15 $ $Date: 2020/05/29 11:50:10 $
23 | */
24 |
--------------------------------------------------------------------------------
/docs/readme.md:
--------------------------------------------------------------------------------
1 | Model
2 | =====
3 |
4 | ### Documentation
5 |
6 | **EKV 2.6 Documentation**
7 |
8 | - "The EPFL-EKV MOSFET Model Equations for Simulation"; can be
9 | downloaded as [PDF
10 | file](https://www.epfl.ch/labs/iclab/wp-content/uploads/2019/02/ekv_v262.pdf)
11 | (133kB).
12 |
13 | **EKV 3.0 Documentation**
14 |
15 | - A. Bazigos, M. Bucher, F. Krummenacher, J.-M. Sallese, A.-S. Roy, C.
16 | Enz, *EKV3 MOSFET Compact Model Documentation, Model Version
17 | 301.02* , Technical Report, Technical University of Crete, 16
18 | July 2008.
19 | - S. Yoshitomi, A. Bazigos, M. Bucher, "EKV3 Parameter Extraction and
20 | Characterization of 90nm RF-CMOS Technology" 14th Int.Conf. on Mixed
21 | Design, (MIXDES 2007), Ciechocinek, 21-23 June 2007
22 | - S. Yoshitomi, "Challenges of Compact Modeling for Deep-Submicron
23 | RF-CMOS Devices" 12th Int.Conf. on Mixed Design (MIXDES 2005),
24 | Krakow, Poland, 22-25 June 2005
25 | - * A. Bazigos, M. Bucher,
26 | [EKV3.0 Model Code, Parameters & Case
27 | Studies](https://www.epfl.ch/labs/iclab/wp-content/uploads/2019/02/EKV3UMW2004_Bazigos_EKV3_code_parameter_extraction_2004.pdf)*
28 | ,
29 | Presentation at EKV Model Users’ Group Meeting and Workshop,
30 | November 4-5 2004, EPFL, Lausanne.
31 |
32 | **HV-EKV Presentation**
33 |
34 | - ["The HV-EKV MOSFET
35 | Model"](http://www.eigroup.org/cmc/minutes/2q06_presentations/hv-ekv_cmc_may2006.pdf)
36 | CMC Meeting, Boston 8th May 2006
37 | - W.Grabinski, T.Gneiting "Power/HVMOS Devices Compact Modeling";
38 | ISBN: 978-90-481-3045-0 (2010)
39 |
40 | ### Availability
41 |
42 | ** Availability:**
43 |
44 | - EKV in design libraries:
45 |
46 |
47 |
48 |
49 | | Vendor |
50 | Process |
51 | Docs |
52 |
53 |
54 | | Atmel |
55 | Complex Mixed-signal 1.0 um BiCMOS Technology |
56 | BiCMOS2 |
57 |
58 |
59 | | Atmel |
60 | Digital & Mixed-signal 0.5 um CMOS |
61 | SCMOS3EE |
62 |
63 |
64 | | Atmel |
65 | Digital & Mixed-signal 0.5 um CMOS EPROM/OTP |
66 | SCMOS3E |
67 |
68 |
69 | | Atmel |
70 | High Speed SiGe BiCMOS RF |
71 | UHF6S |
72 |
73 |
74 | | Atmel |
75 | Smart Power Bulk process |
76 | BCDMOS-III |
77 |
78 |
79 | | Atmel |
80 | Smart Power SOI process |
81 | SMARTIS1 |
82 |
83 |
84 | | Atmel |
85 | HVCMOS, embedded memory |
86 | at35.7k |
87 |
88 |
89 | | EM Marin |
90 | Low Power 0.5 um CMOS |
91 | |
92 |
93 |
94 | | EM Marin |
95 | Low Power 0.35 um CMOS |
96 | |
97 |
98 |
99 | | EM Marin |
100 | Low Power 0.18 um CMOS |
101 | |
102 |
103 |
104 | | MHS-Electronics |
105 | Complex Mixed-signal 1.0 um BiCMOS Technology |
106 | BICMOS2SC |
107 |
108 |
109 | | MHS-Electronics |
110 | Digital & Mixed-signal 0.5 um CMOS |
111 | SCMOS3EE |
112 |
113 |
114 | | MHS-Electronics |
115 | Digital & Mixed-signal 0.5 um CMOS (high temperature) |
116 | SCMOS3E |
117 |
118 |
119 | | MHS-Electronics |
120 | Digital & Mixed-signal 0.5 um CMOS (high radiation tolerance) |
121 | SCMOS3RT |
122 |
123 |
124 | | Telefunken Semi |
125 | High Speed BiCMOS RF |
126 | UHF6S (TS) |
127 |
128 |
129 | | Telefunken Semi |
130 | 0.8um Smart Power SOI SMARTIS1 (TS) |
131 | SMARTIS1 (TS) |
132 |
133 |
134 | | Telefunken Semi |
135 | 0.35um Smart Power SOI |
136 | AT76k (TS) |
137 |
138 |
139 | | Telefunken Semi |
140 | 0.8um, 700V Smart Power bulk |
141 | TS700V |
142 |
143 |
144 | | Toshiba |
145 | CMOS2 0.18um Logic Base eDRAM |
146 | internal use |
147 |
148 |
149 | | Toshiba |
150 | CMOS3 0.13um Cu Interconnect |
151 | internal use |
152 |
153 |
154 | | Toshiba |
155 | CMOS4 90nm Low-k |
156 | internal use |
157 |
158 |
159 | | Toshiba |
160 | CMOS5 65nm Stress control Low-k II |
161 | internal use |
162 |
163 |
164 |
165 |
166 | - EKV in
167 | simulators:
168 |
169 |
170 |
171 |
172 | | Simulator |
173 | Version* |
174 | EKV2.6 LEVEL |
175 | EKV3.0 LEVEL |
176 | Comments |
177 |
178 |
179 | | ADS |
180 | 2003C |
181 | Verilog-A |
182 | Verilog-A |
183 | example [ wg ] |
184 |
185 |
186 | | Altium |
187 | 6.5 |
188 | 8 |
189 | |
190 | Released Aug.30 2006 |
191 |
192 |
193 | | AMI-Spice |
194 | 3.7a |
195 | 23 |
196 | |
197 | released |
198 |
199 |
200 | | APLAC |
201 | 7.30h |
202 | EKVMOS |
203 | |
204 | to be announced |
205 |
206 |
207 | | AVOSpice |
208 | 1.82.0805 |
209 | Verilog-A |
210 | Verilog-A |
211 | |
212 |
213 |
214 | | ELDO |
215 | 4.6 |
216 | 44 (UPDATE=2.6) |
217 | 61 Verilog-A |
218 | in beta |
219 |
220 |
221 | | Golden Gate |
222 | 4.0 |
223 | ekv |
224 | ekv3 |
225 | |
226 |
227 |
228 | | HSIM |
229 | 2.0 |
230 | 55 |
231 | Verilog-A |
232 | |
233 |
234 |
235 | | IntuSoft |
236 | ICAP/4 |
237 | |
238 | |
239 | shipping |
240 |
241 |
242 | | LTspice/SwitcherCAD III |
243 | 1.09p |
244 | 12 |
245 | |
246 | free download |
247 |
248 |
249 | | MacSpice |
250 | 3f5p10 |
251 | 44 |
252 | |
253 | free download |
254 |
255 |
256 | | MI-SUGAR |
257 | 0.4.4 |
258 | 44 |
259 | |
260 | Mac OSX |
261 |
262 |
263 | | Micro-Cap |
264 | 8.0.0 |
265 | 44 |
266 | |
267 | available now |
268 |
269 |
270 | | MINIMOS-NT |
271 | 2.0 |
272 | Devices.{N;P}MosEkv |
273 | |
274 | with selfheating |
275 |
276 |
277 | | NanoSpice |
278 | 1.1 |
279 | 55 |
280 | |
281 | |
282 |
283 |
284 | | Nexxim |
285 | 1.0 |
286 | 55 |
287 | Verilog-A |
288 | |
289 |
290 |
291 | | NG-Spice |
292 | rev.17 |
293 | Verilog-A |
294 | Verilog-A |
295 | free download |
296 |
297 |
298 | | PSPICE [*] |
299 | 9.0 |
300 | 5 |
301 | thru XML-ADMS |
302 | |
303 |
304 |
305 | | Qucs |
306 | 0.0.14 |
307 | Verilog-A |
308 | Verilog-A |
309 | |
310 |
311 |
312 | | SABER |
313 | 4.3.2 |
314 | |
315 | |
316 | |
317 |
318 |
319 | | SIMetrix |
320 | 4.1 |
321 | 44 |
322 | |
323 | released Feb 2002 |
324 |
325 |
326 | | SmartSpice |
327 | 1.5.5.R |
328 | 55 |
329 | |
330 | |
331 |
332 |
333 | | SMASH |
334 | 4.1 |
335 | 5 |
336 | ekv3 and Verilog-A |
337 | released 5.13 |
338 |
339 |
340 | | Spectre |
341 | 4.43 |
342 | ekv |
343 | Verilog-A |
344 | tested at LEG |
345 |
346 |
347 | | SpectreRF |
348 | 6.0 |
349 | ekv |
350 | Verilog-A |
351 | |
352 |
353 |
354 | | Spice-Opus |
355 | 2.04 |
356 | 44 |
357 | |
358 | Documentation |
359 |
360 |
361 | | SPICE3 |
362 | 3f5 |
363 | Verilog-A |
364 | Verilog-A |
365 | tested [wg ] |
366 |
367 |
368 | | Star-Hspice |
369 | 98.4 |
370 | 55 |
371 | Verilog-A |
372 | also CML libs |
373 |
374 |
375 | | Synopsys |
376 | 98.4 |
377 | 55 |
378 | Verilog-A |
379 | also CML libs |
380 |
381 |
382 | | T-Spice |
383 | 11 |
384 | 44 or 55 |
385 | Verilog-A |
386 | also CML libs |
387 |
388 |
389 | | TopSPICE |
390 | 6.9 |
391 | 44 or 55 |
392 | |
393 | |
394 |
395 |
396 | | TRANZ-TRAN |
397 | 3.5 |
398 | |
399 | |
400 | |
401 |
402 |
403 | | WinSpice |
404 | 1.03.02 |
405 | 44 |
406 | |
407 | free download |
408 |
409 |
410 |
411 |
412 | (\*) first implementation
413 | We are supporting the model coded in VHDL-AMS and
414 | [Verilog-A](http://legwww.epfl.ch/ekv/verilog-a) . Using the EKV
415 | Verilog-A code the ekv 2.6/3.0 models have been implemented into number
416 | of the GNU and commercial simulations tools including listed above.
417 | The code is available on request, just [contact
418 | us!](http://legwww.epfl.ch/ekv/contact.html)
419 |
420 | ### Extractors
421 |
422 | EKV in parameter extraction systems:
423 |
424 |
470 |
471 | (\*) first implementation
472 |
473 |
474 | - [EKV 2.6 parameter extraction
475 | tutorial](https://www.epfl.ch/labs/iclab/wp-content/uploads/2019/02/EKV_ParEx_2001.pdf)
476 | - [example parameter set](https://www.epfl.ch/0_5um_cmos_par/)
477 | - [EKV 3.0 model code & parameter
478 | extraction](https://www.epfl.ch/labs/iclab/wp-content/uploads/2019/02/EKV3UMW2004_Bazigos_EKV3_code_parameter_extraction_2004.pdf)
479 | - [example parameter set](https://www.epfl.ch/page-44590-en-html/)
480 |
481 | **Links:**
482 |
483 | - Technology partners and web resources:
484 | - [Atmel](http://www.atmel.com/)
485 | - [Austriamicrosystems](http://www.austriamicrosystems.com/eng/Startpage-Home/Support/Foundry-Design-Support/HIT-Kit)
486 | - [CSEM](http://www.csem.ch/) Neuchatel
487 | - [CMC Microsystems](http://www.cmc-canada.ca/)
488 | - [CMP](https://mycmp.fr/) Circuits Multi-Projets
489 | - [COMON](http://compactmodelling.eu/) ( CO mpact MO delling N etwork): Marie Curie
494 | Actions—Industry-Academia Partnerships and Pathways (IAPP)
495 | - [Dolphin Integration](http://www.dolphin.fr/) : download ekv3 in
496 |
497 | [smash](http://www.dolphin.fr/medal/smash/smash_overview.php)
498 | - [EKV3 RFIC Group](http://www.ekv3.tuc.gr/) at
499 | [TUC](http://www.tuc.gr/)
500 | - [EM Marin](http://www.emmarin.com/)
501 | - [Europractice](http://www.imec.be/europractice/europractice.html)
502 | , [Eurotraining](http://www.eurotraining.net/)
503 | - [LOGMATIC](http://www.logmatic.ch/)
504 | , local pspice simulation and design support
505 | - [MOSIS](https://www.mosis.com/)
506 | - Procedural Analog Design (
507 | [PAD](http://legwww.epfl.ch/CSL/PAD/PAD_pages/DesignToolHome.html)
508 | )
509 | - [ROBUSPIC](http://www-g.eng.cam.ac.uk/robuspic/links.htm)
510 | (ROBUst mixed signal design methodologies for Smart Power ICs)
511 | - [Telefunken](http://telefunkensemi.com/)
512 | - [Toshiba](http://www.mos-ak.org/edinburgh/papers/01_Yoshitomi_MOS-AK_08.pdf)
513 |
--------------------------------------------------------------------------------
/ekv26_SDext_Verilog-A.va:
--------------------------------------------------------------------------------
1 | /*
2 | EKV MOS model version 2.6 rev.15 with documentation at: http://ekv.epfl.ch
3 | Matthias Bucher, Christophe Lallement, Christian Enz, Fabien Theodoloz, Francois Krummenacher
4 | Electronics Laboratories, Swiss Federal Institute of Technology Lausanne, Switzerland
5 | This Verilog-A was developed by Wladek Grabinski with modifications
6 | by Tiburon Design Automation (www.tiburon-da.com).
7 | This software has been provided pursuant to a License Agreement containing restrictions on its use.
8 | It may not be copied or distributed in any form or medium, disclosed to third parties,
9 | reverse engineered or used in any manner not provided for in said License Agreement
10 | except with the prior written authorization.
11 | Licensed under the Educational Community License, Version 2.0 (the "License");
12 | you may not use this file except in compliance with the License.
13 |
14 | You may obtain a copy of the License at http://opensource.org/licenses/ECL-2.0
15 |
16 | Unless required by applicable law or agreed to in writing, software distributed under
17 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
18 | either express or implied. See the License for the specific language governing permissions
19 | and limitations under the License.
20 |
21 | $RCSfile: ekv.va,v $ $Revision: 1.9 $ $Date: 2003/12/17 01:20:10 $
22 | $RCSfile: ekv.va,v $ $Revision: 2.6.15 $ $Date: 2020/05/29 11:50:10 $
23 | */
24 | /*
25 | `include "disciplines.vams"
26 | `include "constants.vams"
27 | `include "compact.vams"
28 | */
29 | // includes: in case we do not want to include any other file [AB:040902]
30 | // we can just add the following section in this file
31 | // AB: i hope this may help our code to be easily transported
32 | //----------------------------------------
33 | // from disciplines.h we need:
34 | // Electrical
35 | // Current in amperes
36 | nature Current
37 | units = "A";
38 | access = I;
39 | idt_nature = Charge;
40 | `ifdef CURRENT_ABSTOL
41 | abstol = `CURRENT_ABSTOL;
42 | `else
43 | abstol = 1e-12;
44 | `endif
45 | endnature
46 | // Charge in coulombs
47 | nature Charge
48 | units = "coul";
49 | access = Q;
50 | ddt_nature = Current;
51 | `ifdef CHARGE_ABSTOL
52 | abstol = `CHARGE_ABSTOL;
53 | `else
54 | abstol = 1e-14;
55 | `endif
56 | endnature
57 | // Potential in volts
58 | nature Voltage
59 | units = "V";
60 | access = V;
61 | idt_nature = Flux;
62 | `ifdef VOLTAGE_ABSTOL
63 | abstol = `VOLTAGE_ABSTOL;
64 | `else
65 | abstol = 1e-6;
66 | `endif
67 | endnature
68 | // Flux in Webers
69 | nature Flux
70 | units = "Wb";
71 | access = Phi;
72 | ddt_nature = Voltage;
73 | `ifdef FLUX_ABSTOL
74 | abstol = `FLUX_ABSTOL;
75 | `else
76 | abstol = 1e-9;
77 | `endif
78 | endnature
79 | // Conservative discipline
80 | discipline electrical
81 | potential Voltage;
82 | flow Current;
83 | enddiscipline
84 | // Signal flow disciplines
85 | discipline voltage
86 | potential Voltage;
87 | enddiscipline
88 | discipline current
89 | potential Current;
90 | enddiscipline
91 | //from constants.h we need
92 | `define C_EPSSIL 1.03594314e-10
93 | `define C_EPSOX 34.5e-12
94 | `define C_QE 1.602e-19
95 | `define C_K 1.3807e-23
96 | `define P_K 1.3806226e-23
97 | `define P_EPS0 8.85418792394420013968e-12
98 | `define P_CELSIUS0 273.15
99 | `define POS_MIN 1.0E-6
100 | `define SQRT2 1.4142135623730950488016887242097
101 | `define ONE3RD 0.33333333333333333333333333333333
102 | `define ONESQRT2 0.70710678118654752440084436210485
103 | //if any other constant is needed it may be copied from the constants.h and be put above.
104 | //------------------------------------------ end of includes
105 | `define FWD 1
106 | `define REV -1
107 | // AB 040902
108 | `define NOT_GIVEN -1.0e21
109 | `define DEFAULT_TNOM 25
110 | module ekv_va(d,g,s,b);
111 | // %%DEVICE_CLASS=MOS(NMOS:TYPE=1,PMOS:TYPE=-1)%%
112 | // Node definitions
113 | inout d,g,s,b; // external nodes
114 | electrical d,g,s,b; // external nodes
115 | // Branch definitions
116 | branch (d,s) ds;
117 | branch (d,b) db;
118 | branch (s,b) sb;
119 | branch (g,b) gb;
120 | // * Local variables
121 | real tmp1, tmp2, tmp3; // temporary variables
122 | real VGprime, GAMMAprime;// short and narrow channel effect
123 | real VP, VPprime; // pinch-off voltage
124 | real if_, ir, irprime; // normalized currents
125 | real VDSS, VDSSprime;// saturation voltage
126 | real deltaL, Leq; // channel length reduction
127 | real beta; // transconductance factor
128 | real n; // slope factor
129 | real Ispec; // specific current
130 | real Vt; // k*T/q
131 | real gm, gms, gmbs, gds;
132 | real isub, Isub;
133 | real inv_Vt, Vt_01, Vt_2, Vt_4, Vt_Vt, Vt_Vt_2, Vt_Vt_16;
134 | real eps_COX, eps_COX_W, eps_COX_L;
135 | real Lc, Lc_LAMBDA, IBN_2, T0, T1, eta_qi;
136 | real inv_UCRIT, Lc_UCRIT, Lc_IBB, IBA_IBB;
137 | integer Mode;
138 | real WETA_W, LETA_L;
139 | real E0_Q_1, AWL;
140 | real T, KP_Weff;
141 | real Eg, refEg, deltaT, ratioT, Tnom;
142 | real VTO_T, VTO_S, KP_T, UCRIT_T, IBB_T, PHI_T, GAMMA_S;
143 | real sqrt_Lprime_Lmin;
144 | real GAMMAstar, sqrt_GAMMAstar;
145 | real big_sqrt_VP;
146 | real big_sqrt_VP0, VP0;
147 | real PHI_VD, PHI_VS;
148 | real sqrt_PHI;
149 | real sqrt_PHI_VP, sqrt_PHI_VD, sqrt_PHI_VS;
150 | real sqrt_PHI_VD_Vt, sqrt_PHI_VS_Vt;
151 | real Vds, deltaV_2, Vip;
152 | real VDSS_sqrt, sqrt_VDSS_deltaV, sqrt_Vds_VDSS_deltaV;
153 | real VDSSprime_sqrt, sqrt_VDSSprime_deltaV, sqrt_Vds_VDSSprime_deltaV;
154 | real if_ir;
155 | real sqrt_if, sqrt_ir, sqrt_irprime;
156 | real dif_dv, dir_dv, dirprime_dv;
157 | // Charge related variables
158 | real sif, sir, sif2, sir2, sif3, sir3;
159 | real sif_sir_2;
160 | real qi, qb;
161 | real QD, QS, QI, QB, QG;
162 | real VP_PHI_eps, sqrt_PHI_VP_2, WLCox;
163 | real n_Vt_COX, n_1, n_1_n;
164 | // Variables used for derivatives computation
165 | real dVP_dVD, dVP_dVG, dVP_dVS;
166 | real dif_dVD, dif_dVS, dif_dVG;
167 | real dir_dVD, dir_dVS, dir_dVG;
168 | real dVDSS_dVD, dVDSS_dVG, dVDSS_dVS;
169 | real ddeltaV_dVD, ddeltaV_dVG, ddeltaV_dVS;
170 | real dVip_dVD, dVip_dVG, dVip_dVS;
171 | real dVDSSprime_dVD, dVDSSprime_dVG, dVDSSprime_dVS;
172 | real dirprime_dVD, dirprime_dVG, dirprime_dVS;
173 | real dLeq_dVD, dLeq_dVG, dLeq_dVS;
174 | real dbeta_dVD, dbeta_dVG, dbeta_dVS;
175 | real VGstar, sqrt_VGstar;
176 | real VG, VD, VS;
177 | real Von, Vdsat, Id, Ibd;
178 | real Gn;
179 | real GAMMA_sqrt_PHI, Lmin, Lprime, T0_GAMMA_1, THETA_VP_1, Vc;
180 | real Vdsprime, Vt_Vc, dGAMMAprime_dVD, dGAMMAprime_dVG, dGAMMAprime_dVS;
181 | real dVPprime_dVD, dVPprime_dVG, dVPprime_dVS, ddeltaL_dVD, ddeltaL_dVG;
182 | real ddeltaL_dVS, dn_dVD, dn_dVG, dn_dVS;
183 | real log_Vc_Vt, sqrt_PHI_VP0, sqrt_VP_Vt;
184 | real Lc_IBB_Vib, Vib, dIsub_factor, exp_ib;
185 | real inv_Vib, sqrt_PHI_VP2_2;
186 | real V0, deltaVFB, vL;
187 | real dQI_dVD, dQI_dVS, dQI_dVG;
188 | real dQB_dVD, dQB_dVS, dQB_dVG;
189 | real Leff, Weff;
190 | real RSeff, RDeff;
191 | real yk, z0, zk;
192 | real EPSOX, epssil;
193 | real ddt_QD, ddt_QS;
194 | //DIODES realted variables [AB: 040902]
195 | real as_i, ad_i, ps_i, pd_i, v_di_b, v_si_b;
196 | real temp_arg, tmp0;
197 | real js_t, jsw_t, jswg_t;
198 | real pb_t, pbsw_t, pbswg_t;
199 | real cj_t, cjsw_t, cjswg_t;
200 | real njts_t, njtssw_t, njtsswg_t;
201 | real is_d, arg_d, is_s, arg_s;
202 | real f_breakdown_d, f_breakdown_s, idb_tun, isb_tun;
203 | real csb_d, cssw_d, csswg_d;
204 | real csb_s, cssw_s, csswg_s;
205 | real qjd, qjs;
206 |
207 | // parameter definitions
208 | parameter integer TYPE = 1 from [-1:1] exclude 0; // NMOS=1, PMOS=-1
209 | parameter integer Noise = 1 from [0:1]; // Set to zero to prevent noise calculation
210 | parameter real Trise = 0.0 from [-inf:inf]; // Difference sim. temp and device temp [C deg]
211 | // parameter real Temp = -`NOT_GIVEN from [`P_CELSIUS0:inf]; // Device temp [C]
212 | //AB: the parameter name Temp is not working for no obvious reason; changed to TEMP
213 | parameter real TEMP = -`NOT_GIVEN from [`P_CELSIUS0:inf]; // Device temp [C]
214 | parameter real TNOM = -`NOT_GIVEN; // Temperature [C]
215 | parameter real L = 10E-6 from [0.0:inf]; // Channel length [m]
216 | parameter real W = 10E-6 from [0.0:inf]; // Channel width [m]
217 | parameter real M = 1.0 from [0.0:inf]; // Parallel multiple device number
218 | parameter real NS = 1.0 from [0.0:inf]; // Series multiple device number
219 | parameter real AS = 0.0 from [0.0:inf]; // Source area //AB: 040902
220 | parameter real AD = 0.0 from [0.0:inf]; // Drain area //AB: 040902
221 | parameter real PS = 0.0 from [0.0:inf]; // Source perimeter //AB: 040902
222 | parameter real PD = 0.0 from [0.0:inf]; // Drain perimeter //AB: 040902
223 | // *** Process related parameters
224 | parameter real COX = 2.0E-3 from [0.0:inf]; // Gate oxide capacitance per unit area [F]
225 | parameter real XJ = 300E-9 from [0.0:inf]; // Junction depth [m]
226 | //*** Threshold voltage/substrate effect parameters (long-channel)
227 | parameter real VTO = 0.5 from [-inf:inf]; // Long-channel threshold voltage [V]
228 | parameter real TCV = 1.0e-3; // Threshold voltage temperature coefficient [V/K]
229 | parameter real GAMMA = 0.7 from [0.0:inf]; // Body effect parameter
230 | parameter real PHI = 0.5 from [0.2:inf]; // Bulk Fermi potential [V]
231 | //*** Mobility parameters (long-channel) ***
232 | parameter real KP = 150E-6 from [0.0:inf]; // Transconductance parameter [A/V/V]
233 | parameter real BEX = -1.5; // Mobility temperature exponent
234 | parameter real THETA = 0.0 from [0.0:inf]; // Mobility reduction coefficient [1/V]
235 | parameter real E0 = 1.0E8; // Mobility reduction coefficient [V/m]
236 | //*** Velocity sat./channel length mod. parameters (short-channel)
237 | parameter real UCRIT = 2.0E6 from [0.0:inf]; // Longitudinal critical field [V/m]
238 | parameter real UCEX = 0.8; // Longitudinal critical field temperature exponent
239 | parameter real LAMBDA = 0.8 from [0.0:inf]; // Depletion length coefficient (channel length modulation)
240 | //*** Process related parameters
241 | parameter real DL = -0.01E-6; // Channel width correction [m]
242 | parameter real DW = -0.01E-6; // Channel length correction [m]
243 | //*** Threshold voltage/substrate effect parameter (narrow-channel)
244 | parameter real WETA = 0.2 from [0.0:inf]; // Narrow-channel effect coefficient
245 | //*** Threshold voltage/substrate effect parameters (short-channel)
246 | parameter real LETA = 0.3 from [0.0:inf]; // Short-channel effect coefficient
247 | parameter real Q0 = 230E-6 from [0.0:inf]; // Reverse short channel effect peak charge density
248 | parameter real LK = 0.4E-6 from [0.0:inf]; // Reverse short channel effect characteristic length [m]
249 | //*** Substrate current parameters
250 | parameter real IBA = 5.0E8 from [0.0:inf]; // First impact ionization coefficient [1/m]
251 | parameter real IBB = 4.0E8 from [0.0:inf]; // Second impact ionization coefficient [V/m]
252 | parameter real IBBT = 9.0e-4; // Temperature coefficient for IBB [1/K]
253 | parameter real IBN = 1.0 from [0.0:inf]; // Saturation voltage factor for impact ionization
254 | //*** Series resistance parameters
255 | parameter real RSH = 0.0 from [0.0:inf]; // Sheet resistance [Ohms]
256 | parameter real HDIF = 0.5E-6 from [0.0:inf]; // Sheet resistance multipler
257 | //*** for MC analysis fk 25/05/97
258 | parameter real AVTO = 1E-6 from [0.0:inf]; // Area related threshold voltage mismatch parameter [Vm]
259 | parameter real AKP = 1E-6 from [0.0:inf]; // Area related gain mismatch parameter [m]
260 | parameter real AGAMMA = 1E-6 from [0.0:inf]; // Area related body effect mismatch parameter [sqr(V) m]
261 | parameter real AF = 1.0 from (0:inf); // Flicker noise exponent
262 | parameter real KF = 0.0 from [0:inf); // Flicker noise coefficient
263 | //*** JUNCTION DRAIN-BULK AND SOURCE-BULK AREA, CURRENT, CAPACITANCE [AB:040902]
264 | parameter real xd_n = 1.0 from [0.0:inf);
265 | parameter real xd_js = 1.0E-09 from [0.0:inf);
266 | parameter real xd_jsw = 1.0E-12 from [0.0:inf);
267 | parameter real xd_jswg = 1.0E-12 from [0.0:inf);
268 | parameter real xd_mj = 0.900 from [0.0:1.0];
269 | parameter real xd_mjsw = 0.700 from [0.0:1.0];
270 | parameter real xd_mjswg = 0.700 from [0.0:1.0];
271 | parameter real xd_pb = 0.800 from (0.0:inf);
272 | parameter real xd_pbsw = 0.600 from (0.0:inf);
273 | parameter real xd_pbswg = 0.600 from (0.0:inf);
274 | parameter real xd_cj = 1.0E-09 from [0.0:inf);
275 | parameter real xd_cjsw = 1.0E-12 from [0.0:inf);
276 | parameter real xd_cjswg = 1.0E-12 from [0.0:inf);
277 | parameter real xd_gmin = 0.0 from [0.0:inf);
278 | parameter real xd_xjbv = 0.0 from [0.0:inf);
279 | parameter real xd_bv = 10.0 from [0.0:inf);
280 | parameter real xd_njts = 1.0 from [0.0:inf);
281 | parameter real xd_njtssw = 1.0 from [0.0:inf);
282 | parameter real xd_njtsswg = 1.0 from [0.0:inf);
283 | parameter real xd_vts = 0.0 from [0.0:inf);
284 | parameter real xd_vtssw = 0.0 from [0.0:inf);
285 | parameter real xd_vtsswg = 0.0 from [0.0:inf);
286 | parameter real tp_xti = 3.0 from (-inf:inf);
287 | parameter real tp_cj = 0.0 from (-inf:inf);
288 | parameter real tp_cjsw = 0.0 from (-inf:inf);
289 | parameter real tp_cjswg = 0.0 from (-inf:inf);
290 | parameter real tp_pb = 0.0 from (-inf:inf);
291 | parameter real tp_pbsw = 0.0 from (-inf:inf);
292 | parameter real tp_pbswg = 0.0 from (-inf:inf);
293 | parameter real tp_njts = 0.0 from [0.0:inf);
294 | parameter real tp_njtssw = 0.0 from [0.0:inf);
295 | parameter real tp_njtsswg = 0.0 from [0.0:inf);
296 | analog begin
297 | // Set constant
298 | EPSOX = 3.9 * `P_EPS0;
299 | epssil = 11.7 * `P_EPS0;
300 | Ibd = 0.0;
301 | // The following are necessary to prevent memory states being reserved:
302 | THETA_VP_1 = 0.0;
303 | VPprime = 0.0;
304 | sqrt_VP_Vt = 0.0;
305 | // Geometry, voltage and temperature independent model variables
306 | eps_COX = epssil/COX;
307 | Lc = sqrt(eps_COX*XJ);
308 | Lc_LAMBDA = Lc * LAMBDA;
309 | eps_COX_W = 3.0 * eps_COX * WETA;
310 | eps_COX_L = eps_COX * LETA;
311 | IBN_2 = IBN + IBN;
312 | T0 = COX / (epssil*E0);
313 | V0 = (Q0+Q0) / COX;
314 | eta_qi = TYPE > 0 ? 0.5 : 0.3333333333333;
315 | /* Model working variables, geometry and voltage independent,
316 | * which need to be updated after temperature change
317 | * EKV model internal variables depending on temperature.
318 | */
319 | /* If Temp is explicitly specified, use that value
320 | otherwise use Tckt+Trise */
321 | if (TEMP == -`NOT_GIVEN) //AB: 040902 Temp -> TEMP
322 | T = $temperature + Trise;
323 | else
324 | T = TEMP + `P_CELSIUS0; //AB: 040902 Temp -> TEMP
325 | if (TNOM == -`NOT_GIVEN)
326 | Tnom = `DEFAULT_TNOM + `P_CELSIUS0;
327 | else
328 | Tnom = TNOM + `P_CELSIUS0;
329 | Vt = $vt(T);
330 | Vt_01 = 0.1 * Vt;
331 | inv_Vt = 1.0 / Vt;
332 | Vt_2 = Vt + Vt;
333 | Vt_4 = Vt_2 + Vt_2;
334 | Vt_Vt = Vt * Vt;
335 | Vt_Vt_2 = Vt_Vt + Vt_Vt;
336 | Vt_Vt_16 = 16.0 * Vt_Vt;
337 |
338 | Eg = 1.16 - 7.02e-4 * T * T / (T + 1108.0);
339 | refEg = 1.16 - (7.02e-4*Tnom*Tnom) / (Tnom + 1108.0);
340 | deltaT = T - Tnom;
341 | ratioT = T / Tnom;
342 | VTO_T = VTO - TCV * deltaT;
343 | KP_T = KP * pow(ratioT, BEX);
344 | UCRIT_T = UCRIT * pow(ratioT, UCEX);
345 | IBB_T = IBB * (1.0 + IBBT * deltaT);
346 | PHI_T = PHI * ratioT - 3.0 * Vt * ln(ratioT) - refEg * ratioT + Eg;
347 | // !! mb 99/07/30 prevents PHI from becoming smaller than 0.2
348 | tmp1 = 0.2;
349 | tmp2 = PHI_T - tmp1;
350 | PHI_T = 0.5*(tmp2 + sqrt(tmp2*tmp2 + Vt*Vt)) + tmp1;
351 | sqrt_PHI = sqrt(PHI_T);
352 | inv_UCRIT = 1.0/UCRIT_T;
353 | Lc_UCRIT = Lc * UCRIT_T;
354 | Lc_IBB = Lc * IBB_T;
355 | IBA_IBB = IBA / IBB_T;
356 | /* VTO, KP and GAMMA with variation for MC analysis if required.
357 | * The default value for model parameters AVTO, AKP and AGAMMA
358 | * is set to 1e-6 to allow meaningful sensitivity analysis. Only
359 | * the deviation from this value has to be taken into account
360 | */
361 | // wg: for userc.c and verilog implementations
362 | Leff = L + DL;
363 | // wg: for userc.c and verilog implementations
364 | Weff = W + DW;
365 | Vc = UCRIT_T*Leff; // NOTE: use L if necessary
366 | log_Vc_Vt = Vt*(ln(0.5*Vc*inv_Vt)-0.6); // mb 98/02/05 (r1)
367 | // de-normalization
368 | AWL = 1.0/sqrt(Weff*Leff);
369 | if (TYPE > 0)
370 | VTO_S = ((AVTO != 1e-6) ? AWL*(AVTO - 1e-6) + VTO_T : VTO_T);
371 | else
372 | VTO_S = ((AVTO != 1e-6) ? AWL*(1e-6 - AVTO) - VTO_T: -VTO_T);
373 | KP_Weff = Weff * ((AKP != 1e-6) ? KP_T*(1 + (AKP - 1e-6)*AWL) : KP_T);
374 | GAMMA_S = ((AGAMMA !=1e-6) ? GAMMA + (AGAMMA - 1e-6)*AWL : GAMMA);
375 | GAMMA_sqrt_PHI = GAMMA_S*sqrt_PHI;
376 | /* ************************************
377 | * STATIC MODEL EQUATIONS
378 | * *************************************/
379 | // VGprime:
380 | if (V0 == 0.0)
381 | deltaVFB = 0.0;
382 | // else begin : VGprime //AB: 040902 VGPrime is also a variable and
383 | else begin : VGprime_block //AB: 040902 VGPrime -> VGprime_block
384 | real sqv;
385 | // mb 99/03/26 corrected for multiple device number
386 | vL = 0.28 * (Leff/(LK*NS) - 0.1);
387 | sqv = 1.0 / (1.0 + 0.5*(vL + sqrt(vL*vL + 1.936e-3)));
388 | deltaVFB = V0 * sqv * sqv;
389 | end
390 | VG = TYPE * V(g,b); // wg 22/04/08 corrected for device TYPE
391 | VS = TYPE * V(s,b);
392 | VD = TYPE * V(d,b);
393 | if (VD - VS < 0) begin
394 | Mode = `REV;
395 | T1 = VS;
396 | VS = VD;
397 | VD = T1;
398 | end
399 | else
400 | Mode = `FWD;
401 | // VGB = VGS - VBS;
402 | // VBD = VBS - VDS;
403 | VGstar = VG - VTO_S - deltaVFB + PHI_T + GAMMA_sqrt_PHI;
404 | sqrt_VGstar = sqrt(VGstar*VGstar + 2.0*Vt_Vt_16);
405 | VGprime = 0.5*(VGstar + sqrt_VGstar);
406 | // Pinch-off voltage VP, limited to VP >= -PHI
407 | PHI_VS = PHI_T+VS;
408 | sqrt_PHI_VS_Vt = sqrt(PHI_VS*PHI_VS+Vt_Vt_16);
409 | sqrt_PHI_VS = sqrt(0.5*(PHI_VS+sqrt_PHI_VS_Vt));
410 | PHI_VD = PHI_T+VD;
411 | sqrt_PHI_VD_Vt = sqrt(PHI_VD*PHI_VD+Vt_Vt_16);
412 | sqrt_PHI_VD = sqrt(0.5*(PHI_VD+sqrt_PHI_VD_Vt));
413 | WETA_W = eps_COX_W * M / Weff;
414 | LETA_L = eps_COX_L * NS / Leff;
415 | // mb: symmetric version of GAMMAprime necessary with charges model
416 | big_sqrt_VP0 = sqrt(VGprime + 0.25*GAMMA_S*GAMMA_S);
417 | VP0 = VGprime - PHI_T - GAMMA_S*(big_sqrt_VP0 - 0.5*GAMMA_S);
418 | sqrt_PHI_VP0 = sqrt(VP0+PHI_T+Vt_01);
419 | GAMMAstar = GAMMA_S - LETA_L * (sqrt_PHI_VS+sqrt_PHI_VD) +
420 | WETA_W * sqrt_PHI_VP0;
421 | // keep GAMMAprime from becoming negative
422 | sqrt_GAMMAstar = sqrt(GAMMAstar*GAMMAstar+Vt_01);
423 | GAMMAprime = 0.5*(GAMMAstar+sqrt_GAMMAstar);
424 | big_sqrt_VP = sqrt(VGprime+0.25*GAMMAprime*GAMMAprime);
425 | VP = VGprime-PHI_T-GAMMAprime*(big_sqrt_VP-0.5*GAMMAprime);
426 | // Forward normalized current:
427 | tmp1 = (VP - VS) * inv_Vt;
428 | if (tmp1 > -0.35) begin
429 | z0 = 2.0/(1.3 + tmp1 - ln(tmp1 + 1.6));
430 | zk = (2.0 + z0)/(1.0 + tmp1 + ln(z0));
431 | yk = (1.0 + tmp1 + ln(zk))/(2.0 + zk);
432 | end else begin
433 | if (tmp1 > -15.0) begin
434 | z0 = 1.55 + exp(-tmp1);
435 | zk = (2.0 + z0)/(1.0 + tmp1 + ln(z0));
436 | yk = (1.0 + tmp1 + ln(zk))/(2.0 + zk);
437 | end else begin
438 | if (tmp1 > -23.0) begin
439 | yk = 1.0/(2.0 + exp(-tmp1));
440 | end else begin
441 | yk = exp(tmp1) + 1E-64;
442 | end
443 | end
444 | end
445 | if_ = yk*(1.0 + yk);
446 | sqrt_if = sqrt(if_);
447 | dif_dv = yk;
448 | // Saturation voltage:
449 | Vt_Vc = Vt / Vc;
450 | VDSS_sqrt = sqrt(0.25+sqrt_if*Vt_Vc);
451 | VDSS = Vc*(VDSS_sqrt-0.5);
452 | Vds = 0.5*(VD-VS);
453 | deltaV_2 = Vt_Vt_16*(LAMBDA*(sqrt_if-
454 | VDSS*inv_Vt)+15.625e-3);
455 | sqrt_VDSS_deltaV = sqrt(VDSS*VDSS+deltaV_2);
456 | sqrt_Vds_VDSS_deltaV = sqrt((Vds-VDSS)*(Vds-VDSS)+deltaV_2);
457 | Vip = sqrt_VDSS_deltaV-sqrt_Vds_VDSS_deltaV;
458 | VDSSprime_sqrt = sqrt(0.25+(sqrt_if-0.75*ln(if_))*Vt_Vc);
459 | VDSSprime = Vc*(VDSSprime_sqrt-0.5)+log_Vc_Vt;
460 | // Reverse normalized current:
461 | Vdsprime = Vds-VDSSprime; // mb 97/07/18 introduced Vdsprime
462 | sqrt_VDSSprime_deltaV = sqrt(VDSSprime*VDSSprime+deltaV_2);
463 | sqrt_Vds_VDSSprime_deltaV = sqrt(Vdsprime*Vdsprime+deltaV_2);
464 | tmp1 = (VP-Vds-VS-sqrt_VDSSprime_deltaV+
465 | sqrt_Vds_VDSSprime_deltaV)*inv_Vt;
466 | // include -> Charge F(x) interpolate function
467 | if (tmp1 > -0.35) begin
468 | z0 = 2.0/(1.3 + tmp1 - ln(tmp1 + 1.6));
469 | zk = (2.0 + z0)/(1.0 + tmp1 + ln(z0));
470 | yk = (1.0 + tmp1 + ln(zk))/(2.0 + zk);
471 | end else begin
472 | if (tmp1 > -15.0) begin
473 | z0 = 1.55 + exp(-tmp1);
474 | zk = (2.0 + z0)/(1.0 + tmp1 + ln(z0));
475 | yk = (1.0 + tmp1 + ln(zk))/(2.0 + zk);
476 | end else begin
477 | if (tmp1 > -23.0) begin
478 | yk = 1.0/(2.0 + exp(-tmp1));
479 | end else begin
480 | yk = exp(tmp1) + 1E-64;
481 | end
482 | end
483 | end
484 | irprime = yk*(1.0 + yk);
485 | sqrt_irprime = sqrt(irprime);
486 | dirprime_dv = yk;
487 | /* Channel length modulation & mobility reduction due
488 | * to longitudinal field */
489 | deltaL = Lc_LAMBDA*ln(1.0+(Vds-Vip)/Lc_UCRIT);
490 | Lprime = Leff-deltaL+(Vds+Vip)*inv_UCRIT;
491 | Lmin = 0.1*Leff;
492 | sqrt_Lprime_Lmin = sqrt(Lprime*Lprime+Lmin*Lmin);
493 | Leq = 0.5*(Lprime+sqrt_Lprime_Lmin);
494 | // Transconductance factor:
495 | // Mobility reduction due to vertical field
496 | // Reverse normalized current:
497 | // ratioV_ir
498 | tmp1 = (VP - VD) * inv_Vt;
499 | if (tmp1 > -0.35) begin
500 | z0 = 2.0/(1.3 + tmp1 - ln(tmp1 + 1.6));
501 | zk = (2.0 + z0)/(1.0 + tmp1 + ln(z0));
502 | yk = (1.0 + tmp1 + ln(zk))/(2.0 + zk);
503 | end else begin
504 | if (tmp1 > -15.0) begin
505 | z0 = 1.55 + exp(-tmp1);
506 | zk = (2.0 + z0)/(1.0 + tmp1 + ln(z0));
507 | yk = (1.0 + tmp1 + ln(zk))/(2.0 + zk);
508 | end else begin
509 | if (tmp1 > -23.0) begin
510 | yk = 1.0/(2.0 + exp(-tmp1));
511 | end else begin
512 | yk = exp(tmp1) + 1E-64;
513 | end
514 | end
515 | end
516 | ir = yk*(1.0 + yk);
517 | sqrt_ir = sqrt(ir);
518 | dir_dv = yk;
519 | sif2 = 0.25+if_;
520 | sir2 = 0.25+ir;
521 | sif = sqrt(sif2);
522 | sir = sqrt(sir2);
523 | sif_sir_2 = (sif+sir)*(sif+sir);
524 | VP_PHI_eps = VP+PHI_T+1.0e-6;
525 | sqrt_PHI_VP_2 = 2.0*sqrt(VP_PHI_eps);
526 | n_1 = GAMMA_S/sqrt_PHI_VP_2;
527 | n_1_n = GAMMA_S/(sqrt_PHI_VP_2 + GAMMA_S);
528 | // Normalized inversion charge (qi=QI/WLCox)
529 | qi = -(1.0+n_1)*Vt*((0.66666666+0.66666666)*
530 | (sir2+sir*sif+sif2)/(sif+sir) - 1.0);
531 | // Normalized depletion charge (qb=QB/WLCox), for depletion to inversion
532 | qb = -0.5*GAMMA_S*sqrt_PHI_VP_2 - n_1_n*qi;
533 | if (E0 == 0.0) begin
534 | /* NOTE: this version of the simple mobility model from prior
535 | * versions of the EKV model is reinstated.
536 | * In case E0 is *not* specified, this
537 | * simple mobility model is used according to THETA, if specified.
538 | * VPprime:
539 | * mb eliminated discontinuity of derivative of 1+THETA*VP
540 | */
541 | sqrt_VP_Vt = sqrt(VP*VP + Vt_Vt_2);
542 | VPprime = 0.5 * (VP + sqrt_VP_Vt);
543 | THETA_VP_1 = 1.0+THETA*VPprime;
544 | beta = KP_Weff / (Leq * THETA_VP_1); // mb 97/07/18
545 | end
546 | else begin
547 | /* new model for mobility reduction, linked to the charges model
548 | * mb 98/10/11 (r10) introduced fabs(Eeff) (jpm)
549 | * E0_Q_1 = 1.0 + T0 * abs(qb+eta_qi*qi);
550 | */
551 | if ((qb + eta_qi*qi) > 0.0)
552 | E0_Q_1 = 1.0 + T0*(qb + eta_qi*qi);
553 | else
554 | E0_Q_1 = 1.0 - T0*(qb + eta_qi*qi);
555 | T0_GAMMA_1 = 1.0 + T0*GAMMA_sqrt_PHI;
556 | beta = KP_Weff * T0_GAMMA_1 / (Leq * E0_Q_1);
557 | end
558 | /* Slope factor: mb introduced new formula to avoid divergence
559 | * of n for VP->-PHI */
560 | sqrt_PHI_VP = sqrt(PHI_T+VP+Vt_4); // mb 95/12/19 introduced Vt_4
561 | n = 1.0 + GAMMA_S/(2.0*sqrt_PHI_VP);
562 | // Drain current:
563 | if_ir = if_-irprime;
564 | Ispec = Vt_Vt_2 * n * beta;
565 | Id = Ispec * if_ir;
566 | /* Return threshold voltage
567 | * Von = Vth(Vs) = Vto + Gamma*(sqrt(Phi + Vsb)-sqrt(Phi)) */
568 | Von = VTO_S + GAMMAprime*(sqrt_PHI_VS - sqrt_PHI);
569 | // Return saturation voltage (estimate)
570 | Vdsat = Vt * (2.0*sqrt_if + 4.0);
571 | // Return equivalent conductance for thermal noise calculation
572 | Gn = beta * abs(qi);
573 | /* Pinch-off voltage derivatives:
574 | * mb 97/09/14 symmetric version of GAMMAprime necessary with
575 | * charges model
576 | * mb 99/05/10 (r12) New VGprime formulation (REVISION III) allows
577 | * VP derivatives to be expressed with a single equation
578 | */
579 | tmp1 = GAMMAprime / (sqrt_GAMMAstar+sqrt_GAMMAstar);
580 | tmp2 = VGprime/sqrt_VGstar; // dVGprime_dVG
581 | dGAMMAprime_dVD = -LETA_L * tmp1 * sqrt_PHI_VD / sqrt_PHI_VD_Vt;
582 | dGAMMAprime_dVS = -LETA_L * tmp1 * sqrt_PHI_VS / sqrt_PHI_VS_Vt;
583 | dGAMMAprime_dVG = WETA_W * tmp1 * (big_sqrt_VP0-0.5*GAMMA_S) /
584 | (big_sqrt_VP0*sqrt_PHI_VP0) * tmp2;
585 | tmp3 = (VP+PHI_T) / big_sqrt_VP;
586 | dVP_dVD = -tmp3 * dGAMMAprime_dVD;
587 | dVP_dVS = -tmp3 * dGAMMAprime_dVS;
588 | dVP_dVG = -tmp3 * dGAMMAprime_dVG + (1.0 -
589 | GAMMAprime/(big_sqrt_VP+big_sqrt_VP)) * tmp2;
590 | // Forward normalized current derivatives:
591 | tmp1 = dif_dv * inv_Vt; // mb 95/08/28, 97/04/21
592 | dif_dVD = tmp1 * dVP_dVD;
593 | dif_dVS = tmp1 * (dVP_dVS-1.0);
594 | dif_dVG = tmp1 * dVP_dVG;
595 | // Saturation voltage derivatives:
596 | tmp1 = Vt / (4.0*VDSS_sqrt*sqrt_if);
597 | dVDSS_dVD = tmp1 * dif_dVD;
598 | dVDSS_dVS = tmp1 * dif_dVS;
599 | dVDSS_dVG = tmp1 * dif_dVG;
600 | // deltaV derivatives:
601 | tmp1 = (Vt_4+Vt_4) * LAMBDA;
602 | tmp2 = Vt / (sqrt_if+sqrt_if);
603 | ddeltaV_dVD = tmp1 * (dif_dVD*tmp2 - dVDSS_dVD);
604 | ddeltaV_dVS = tmp1 * (dif_dVS*tmp2 - dVDSS_dVS);
605 | ddeltaV_dVG = tmp1 * (dif_dVG*tmp2 - dVDSS_dVG);
606 | // Vip derivatives:
607 | tmp1 = 1.0 / sqrt_VDSS_deltaV;
608 | tmp2 = 1.0 / sqrt_Vds_VDSS_deltaV;
609 | tmp3 = Vds-VDSS;
610 | dVip_dVD = (VDSS*dVDSS_dVD + ddeltaV_dVD) * tmp1 -
611 | (tmp3 * (0.5-dVDSS_dVD) + ddeltaV_dVD) * tmp2;
612 | dVip_dVS = (VDSS*dVDSS_dVS + ddeltaV_dVS) * tmp1 -
613 | (tmp3 * (-0.5-dVDSS_dVS) + ddeltaV_dVS) * tmp2;
614 | dVip_dVG = (VDSS*dVDSS_dVG + ddeltaV_dVG) * tmp1 -
615 | (tmp3 * -dVDSS_dVG + ddeltaV_dVG) * tmp2;
616 | // VDSSprime derivatives:
617 | tmp1 = Vt * (sqrt_if-1.5)/(4.0*VDSSprime_sqrt*if_);
618 | dVDSSprime_dVD = tmp1 * dif_dVD;
619 | dVDSSprime_dVS = tmp1 * dif_dVS;
620 | dVDSSprime_dVG = tmp1 * dif_dVG;
621 | // Reverse normalized current derivatives:
622 | tmp1 = dirprime_dv * inv_Vt; // mb 95/08/28, 97/04/21
623 | tmp2 = 1.0 / sqrt_VDSSprime_deltaV; // mb 97/04/21
624 | tmp3 = 1.0 / sqrt_Vds_VDSSprime_deltaV;
625 | dirprime_dVD = tmp1 * (dVP_dVD-0.5 -
626 | (VDSSprime*dVDSSprime_dVD+ddeltaV_dVD) * tmp2 +
627 | (Vdsprime*(0.5-dVDSSprime_dVD)+ddeltaV_dVD) * tmp3);
628 | dirprime_dVS = tmp1 * (dVP_dVS-0.5 -
629 | (VDSSprime*dVDSSprime_dVS+ddeltaV_dVS) * tmp2 +
630 | (Vdsprime*(-0.5-dVDSSprime_dVS)+ddeltaV_dVS) * tmp3);
631 | dirprime_dVG = tmp1*(dVP_dVG -
632 | (VDSSprime*dVDSSprime_dVG+ddeltaV_dVG) * tmp2 +
633 | (Vdsprime*(-dVDSSprime_dVG)+ddeltaV_dVG) * tmp3);
634 | // Channel length modulation & mobility reduction derivatives:
635 | // deltaL derivatives:
636 | tmp1 = Lc_LAMBDA / (Lc_UCRIT+Vds-Vip);
637 | ddeltaL_dVD = tmp1 * (0.5-dVip_dVD);
638 | ddeltaL_dVS = tmp1 * (-0.5-dVip_dVS);
639 | ddeltaL_dVG = -tmp1 * dVip_dVG;
640 | // Leq derivatives:
641 | tmp1 = 1.0 / sqrt_Lprime_Lmin; // in fact dLeq_dVX/Leq
642 | dLeq_dVD = tmp1 * (-ddeltaL_dVD + (0.5+dVip_dVD)*inv_UCRIT);
643 | dLeq_dVS = tmp1 * (-ddeltaL_dVS + (-0.5+dVip_dVS)*inv_UCRIT);
644 | dLeq_dVG = tmp1 * (-ddeltaL_dVG + dVip_dVG*inv_UCRIT);
645 | // Transconductance factor derivatives:
646 | tmp1 = dir_dv*inv_Vt;
647 | dir_dVD = tmp1 * (dVP_dVD-1.0);
648 | dir_dVS = tmp1 * dVP_dVS;
649 | dir_dVG = tmp1 * dVP_dVG;
650 | tmp1 = -(1.0+n_1)*Vt*0.66666666/sif_sir_2;
651 | tmp2 = tmp1*(sif+2.0*sir);
652 | tmp3 = tmp1*(sir+2.0*sif);
653 | tmp1 = -n_1*qi/((2.0+n_1+n_1)*VP_PHI_eps);
654 | dQI_dVD = tmp1 * dVP_dVD + tmp2 * dif_dVD + tmp3 * dir_dVD;
655 | dQI_dVS = tmp1 * dVP_dVS + tmp2 * dif_dVS + tmp3 * dir_dVS;
656 | dQI_dVG = tmp1 * dVP_dVG + tmp2 * dif_dVG + tmp3 * dir_dVG;
657 | tmp1 = (1.0+n_1)-qi/(2.0*(1.0+n_1)*VP_PHI_eps);
658 | dQB_dVD = -n_1_n * (tmp1 * dVP_dVD + dQI_dVD);
659 | dQB_dVS = -n_1_n * (tmp1 * dVP_dVS + dQI_dVS);
660 | dQB_dVG = -n_1_n * (tmp1 * dVP_dVG + dQI_dVG);
661 | if (E0 == 0.0) begin
662 | tmp1 = THETA * VPprime / (THETA_VP_1 * sqrt_VP_Vt);
663 | // VPprime derivatives:
664 | dVPprime_dVD = tmp1 * dVP_dVD;
665 | dVPprime_dVS = tmp1 * dVP_dVS;
666 | dVPprime_dVG = tmp1 * dVP_dVG;
667 | dbeta_dVD = -dLeq_dVD - dVPprime_dVD; // in fact dbeta_dVX / beta
668 | dbeta_dVS = -dLeq_dVS - dVPprime_dVS;
669 | dbeta_dVG = -dLeq_dVG - dVPprime_dVG;
670 | end
671 | else begin
672 | tmp1 = T0 / E0_Q_1;
673 | dbeta_dVD = -dLeq_dVD + tmp1 * (dQB_dVD+eta_qi*dQI_dVD);
674 | dbeta_dVS = -dLeq_dVS + tmp1 * (dQB_dVS+eta_qi*dQI_dVS);
675 | dbeta_dVG = -dLeq_dVG + tmp1 * (dQB_dVG+eta_qi*dQI_dVG);
676 | end
677 | // Slope factor derivatives:
678 | tmp1 = -GAMMA_S/(4.0*n*sqrt_PHI_VP*(PHI_T+VP+Vt_4));// mb 95/12/19
679 | dn_dVD = tmp1 * dVP_dVD;
680 | dn_dVS = tmp1 * dVP_dVS;
681 | dn_dVG = tmp1 * dVP_dVG;
682 | // Transconductances:
683 | gds = Ispec*((dn_dVD + dbeta_dVD)*if_ir + dif_dVD - dirprime_dVD);
684 | gms = -Ispec*((dn_dVS + dbeta_dVS)*if_ir + dif_dVS - dirprime_dVS);
685 | gm = Ispec*((dn_dVG + dbeta_dVG)*if_ir + dif_dVG - dirprime_dVG);
686 | gmbs = gms - gm - gds;
687 | // S/D resistance corrections including W and DW
688 | RSeff = (RSH*HDIF)/(Weff-DW);
689 | RDeff = (RSH*HDIF)/(Weff-DW);
690 | tmp1 = 1.0/(1.0 + gms*RSeff + gds*RDeff);
691 | Id = Id*tmp1;
692 | /****** Impact ionization current ******
693 | * mb 95/12/19 introduced impact ionization
694 | * This current component is flowing from the intrinsic drain terminal
695 | * to the bulk (for NMOS) in parallel with the junction current.
696 | * The simulator should also take into account the corresponding
697 | * conductances.
698 | */
699 | // Substrate current:
700 | Vib = VD-VS-IBN_2*VDSS;
701 | if ((Vib > 0.0) && (IBA_IBB > 0.0)) begin
702 | inv_Vib = 1.0/Vib;
703 | Lc_IBB_Vib = -Lc_IBB*inv_Vib;
704 | if (Lc_IBB_Vib < -35.0) // math precision check
705 | Lc_IBB_Vib = -35.0;
706 | exp_ib = exp(Lc_IBB_Vib);
707 | isub = IBA_IBB*Vib*exp_ib;
708 | Isub = isub*Id;
709 | dIsub_factor = Isub*inv_Vib*(1.0-Lc_IBB_Vib);
710 | end
711 | else begin
712 | Lc_IBB_Vib = 0.0;
713 | Isub = 0.0;
714 | end
715 | // END: substrate current computation
716 | Ibd = Ibd - Isub;
717 | // --- Charge calculations ---
718 | WLCox = Weff * Leff * COX;
719 | sif3 = sif*sif2;
720 | sir3 = sir*sir2;
721 | tmp1 = sqrt(PHI_T + 0.5 * VP);
722 | sqrt_PHI_VP2_2 = tmp1+tmp1;
723 | n_Vt_COX = (1.0 + GAMMAprime/sqrt_PHI_VP2_2) * Vt*WLCox;
724 | QD = -n_Vt_COX*(0.266666666*(3.0*sir3+6.0*sir2*sif+4.0*
725 | sir*sif2+2.0*sif3)/sif_sir_2 - 0.5);
726 | QS = -n_Vt_COX*(0.266666666*(3.0*sif3+6.0*sif2*sir+4.0*
727 | sif*sir2+2.0*sir3)/sif_sir_2 - 0.5);
728 | QI = QS + QD;
729 | QB = WLCox * (-0.5*GAMMAprime*sqrt_PHI_VP_2 + VGprime - VGstar) -
730 | QI*GAMMAprime/(GAMMAprime+sqrt_PHI_VP2_2);
731 | QG = -QI -QB;
732 | I(ds) <+ TYPE * Mode * Id; // wg 22/04/08 corrected for device TYPE
733 | ddt_QD = ddt(QD);
734 | ddt_QS = ddt(QS);
735 | if (Mode == `FWD) begin
736 | I(db) <+ TYPE * ddt_QD; // wg 22/04/08 corrected for device TYPE
737 | I(sb) <+ TYPE * ddt_QS;
738 | I(db) <+ TYPE * Isub;
739 | end
740 | else begin
741 | I(sb) <+ TYPE * ddt_QD; // wg 22/04/08 corrected for device TYPE
742 | I(db) <+ TYPE * ddt_QS;
743 | I(sb) <+ TYPE * Isub;
744 | end
745 | I(gb) <+ TYPE * ddt(QG); // wg 22/04/08 corrected for device TYPE
746 | // if (Noise) begin : Noise //AB: 040902 Noise is also a variable and
747 | if (Noise) begin : Noise_block //AB: 040902 Noise -> Noise_block
748 | real S_flicker, S_thermal;
749 | S_thermal = 4 * `P_K * T * Gn;
750 | S_flicker = KF * gm * gm / (Weff * NS * Leff * COX);
751 | I(ds) <+ white_noise(S_thermal, "thermal") +
752 | flicker_noise(S_flicker, AF, "flicker");
753 | end
754 | ///////////////////////////////////
755 | //EXTRINSIC PART: JUNCTION DIODES//
756 | ///////////////////////////////////
757 | //diode area and perimeter computation
758 | if ((AS == 0.0) && (HDIF>0.0)) as_i = 2.0*HDIF*Weff;
759 | else as_i = AS;
760 | if ((PS == 0.0) && (HDIF>0.0)) ps_i = 4.0*HDIF+1.0*Weff;
761 | else ps_i = PS;
762 | if ((AD == 0.0) && (HDIF>0.0)) ad_i = 2.0*HDIF*Weff;
763 | else ad_i = AD;
764 | if ((PD == 0.0) && (HDIF>0.0)) pd_i = 4.0*HDIF+1.0*Weff;
765 | else pd_i = PD;
766 | //temperature update for diodes
767 | temp_arg = exp((refEg/$vt(Tnom) - Eg/Vt + tp_xti*ln(ratioT))/xd_n);
768 | js_t = xd_js*temp_arg;
769 | jsw_t = xd_jsw*temp_arg;
770 | jswg_t = xd_jswg*temp_arg;
771 | pb_t = xd_pb - tp_pb*deltaT;
772 | pbsw_t = xd_pbsw - tp_pbsw*deltaT;
773 | pbswg_t = xd_pbswg - tp_pbswg*deltaT;
774 | cj_t = xd_cj*(1.0+tp_cj*deltaT);
775 | cjsw_t = xd_cjsw*(1.0+tp_cjsw*deltaT);
776 | cjswg_t = xd_cjswg*(1.0+tp_cjswg*deltaT);
777 | njts_t = xd_njts*(1.0+(ratioT-1.0)*tp_njts);
778 | njtssw_t = xd_njtssw*(1.0+(ratioT-1.0)*tp_njtssw);
779 | njtsswg_t = xd_njtsswg*(1.0+(ratioT-1.0)*tp_njtsswg);
780 | //DC
781 | v_di_b = TYPE*V(d,b);
782 | v_si_b = TYPE*V(s,b);
783 | //DRAIN - BULK
784 | is_d = js_t*ad_i+jsw_t*pd_i+jswg_t*Weff;
785 | arg_d = -v_di_b*ratioT/(Vt*xd_n);
786 | if (arg_d < -40.0) arg_d = -40.0;
787 | tmp0 = (-v_di_b+xd_bv)*ratioT/(Vt*xd_n);
788 | if (tmp0>70) f_breakdown_d = 1.0;
789 | else f_breakdown_d = 1.0 + xd_xjbv*exp(-tmp0);
790 | // TRAP-ASSISTED TUNNELING CURRENT
791 | idb_tun = -Weff*jswg_t*(exp(v_di_b*ratioT/(Vt*njtsswg_t) * xd_vtsswg/max(xd_vtsswg+v_di_b,1.0e-3))-1.0);
792 | idb_tun = idb_tun - pd_i*jsw_t*(exp(v_di_b*ratioT/(Vt*njtssw_t) * xd_vtssw/max(xd_vtssw+v_di_b,1.0e-3))-1.0);
793 | idb_tun = idb_tun - ad_i*js_t*(exp(v_di_b*ratioT/(Vt*njts_t) * xd_vts/max(xd_vts+v_di_b,1.0e-3))-1.0);
794 | I(d,b) <+ (is_d * (1.0 - exp(arg_d))*f_breakdown_d+v_di_b*xd_gmin + idb_tun)*TYPE*M;
795 | //SOURCE - BULK
796 | is_s = js_t*as_i+jsw_t*ps_i+jswg_t*Weff;
797 | arg_s = -v_si_b*ratioT/(Vt*xd_n);
798 | if (arg_s < -40.0) arg_s = -40.0;
799 | tmp0 = (-v_si_b+xd_bv)*ratioT/(Vt*xd_n);
800 | if (tmp0>70) f_breakdown_s = 1.0;
801 | else f_breakdown_s = 1.0 + xd_xjbv*exp(-tmp0);
802 | // TRAP-ASSISTED TUNNELING CURRENT
803 | isb_tun = -Weff*jswg_t*(exp(v_si_b*ratioT/(Vt*njtsswg_t) * xd_vtsswg/max(xd_vtsswg+v_si_b,1.0e-3))-1.0);
804 | isb_tun = isb_tun - ps_i*jsw_t*(exp(v_si_b*ratioT/(Vt*njtssw_t) * xd_vtssw/max(xd_vtssw+v_si_b,1.0e-3))-1.0);
805 | isb_tun = isb_tun - as_i*js_t*(exp(v_si_b*ratioT/(Vt*njts_t) * xd_vts/max(xd_vts+v_si_b,1.0e-3))-1.0);
806 | I(s,b) <+ (is_s * (1.0 - exp(arg_s))*f_breakdown_s+v_si_b*xd_gmin + isb_tun)*TYPE*M;
807 | //AC
808 |
809 | //DRAIN - BULK
810 | if (v_di_b>0.0)
811 | begin
812 | csb_d = cj_t * ad_i * exp(-xd_mj*ln(1.0+v_di_b/pb_t));
813 | cssw_d = cjsw_t * pd_i * exp(-xd_mjsw*ln(1.0+v_di_b/pbsw_t));
814 | csswg_d = cjswg_t * Weff * exp(-xd_mjswg*ln(1.0+v_di_b/pbswg_t));
815 | end
816 | else
817 | begin
818 | csb_d = cj_t * ad_i * (1.0 - xd_mj*v_di_b/pb_t);
819 | cssw_d = cjsw_t * pd_i * (1.0 - xd_mjsw*v_di_b/pbsw_t);
820 | csswg_d = cjswg_t * Weff * (1.0 - xd_mjswg*v_di_b/pbswg_t);
821 | end
822 | qjd = (csb_d+cssw_d+csswg_d) * v_di_b;
823 | I(d,b) <+ ddt(qjd)*TYPE*M;
824 | //SOURCE - BULK
825 | if (v_si_b>0.0)
826 | begin
827 | csb_s = cj_t * as_i * exp(-xd_mj*ln(1.0+v_si_b/pb_t));
828 | cssw_s = cjsw_t * ps_i * exp(-xd_mjsw*ln(1.0+v_si_b/pbsw_t));
829 | csswg_s = cjswg_t * Weff * exp(-xd_mjswg*ln(1.0+v_si_b/pbswg_t));
830 | end
831 | else
832 | begin
833 | csb_s = cj_t * as_i * (1.0 - xd_mj*v_si_b/pb_t);
834 | cssw_s = cjsw_t * ps_i * (1.0 - xd_mjsw*v_si_b/pbsw_t);
835 | csswg_s = cjswg_t * Weff * (1.0 - xd_mjswg*v_si_b/pbswg_t);
836 | end
837 | qjs = (csb_s+cssw_s+csswg_s) * v_si_b;
838 | I(s,b) <+ ddt(qjs)*TYPE*M;
839 | //END OF DIODES
840 | end
841 | endmodule
842 |
--------------------------------------------------------------------------------