Professional Documents
Culture Documents
Outline
The
Problem Modeling Languages Diode Example Guidelines Admonishments Compiler Optimizations Conclusion References (and Further Examples)
USIM
BSIM PSP HVEKV MM20
from McAndrew, BMAS 2003
3
Mextram
HiSIM
The Solution
VBIC ACM Modeling Interface HiCUM Eldo ADS Spectre Smash
USIM
BSIM PSP HVEKV MM20
from McAndrew, BMAS 2003
4
Mextram
HiSIM
Modeling Languages
Programming
FORTRAN
languages:
(SPICE2) C (SPICE3) + Fast, direct access to simulator Must compute derivatives No standard interface
Intimate knowledge of simulator required
MATLAB
+ Excellent for data fitting Does not run directly in any analog simulator
5 Coram: Verilog-A Introduction for Compact Modelers (MOS-AK Montreux 2006)
analog behavioral modeling language working group (IEEE 1076.1) Painfully slow to come to fruition Europe prefers VHDL (for digital) Runs in:
AMS Designer (Cadence), DiscoveryAMS (Synopsys), ADVance MS (Mentor), Smash (Dolphin), only AMS simulators!
Verilog-AMS
by Cadence, came to market earlier Verilog-A from Open Verilog International became part of Accellera Verilog-AMS IEEE 1800 authorized to develop SystemVerilog-AMS Verilog-AMS runs in the same AMS simulators as VHDL-AMS + Verilog-A runs in Spectre, HSpice, ADS, Eldo and internal simulators of semiconductor companies + Clear definition of A + Verilog-AMS LRM 2.2 was driven by the requirements for compact modeling
(gmin)
$param_given paramsets
cards
8 Coram: Verilog-A Introduction for Compact Modelers (MOS-AK Montreux 2006)
VHDL-AMS Diode
-- Modified from http://www.syssim.ecs.soton.ac.uk/vhdl-ams/examples/smpr.htm library IEEE; use IEEE.math_real.all; use IEEE.electrical_systems.all; use IEEE.FUNDAMENTAL_CONSTANTS.all; entity diode is generic (Isat: current := 1.0e-14); -- Saturation current [Amps] port (terminal p, n : electrical); end entity diode; architecture ideal of diode is quantity v across i through p to n; constant TempC : real := 27.0; -- Ambient Temperature [Degrees] constant vt : real := PHYS_K*(273.15 + TempC )/PHYS_Q; -- Thermal Voltage begin i == Isat*(limit_exp(v/vt) - 1.0); end architecture ideal;
9 Coram: Verilog-A Introduction for Compact Modelers (MOS-AK Montreux 2006)
VHDL-AMS Diode
-- Modified from http://www.syssim.ecs.soton.ac.uk/vhdl-ams/examples/smpr.htm library IEEE; use IEEE.math_real.all; use IEEE.electrical_systems.all; use IEEE.FUNDAMENTAL_CONSTANTS.all;
is is a keyword! entity diode is generic (Isat: current := 1.0e-14); -- Saturation current [Amps] port (terminal p, n : electrical); end entity diode;
architecture ideal of diode is quantity v across i through p to n; constant TempC : real := 27.0; -- Ambient Temperature [Degrees] constant vt : real := PHYS_K*(273.15 + TempC )/PHYS_Q; -- Thermal Voltage begin i == Isat*(limit_exp(v/vt) - 1.0); end architecture ideal;
10 Coram: Verilog-A Introduction for Compact Modelers (MOS-AK Montreux 2006)
TempC is a constant!
Verilog-A Diode
`include "disciplines.vams" module diode(a,c); inout a,c; electrical a,c; parameter real is = 10p from (0:inf); real id; (*desc = "conductance "*) real gd; analog begin id = is * (limexp(V(a,c) / $vt) 1.0); gd = ddx(id, V(a)); I(a,c) <+ id + V(a,c)*$simparam("gmin", 1e-12); end endmodule
11 Coram: Verilog-A Introduction for Compact Modelers (MOS-AK Montreux 2006)
Verilog-A Diode
`include "disciplines.vams" module diode(a,c); inout a,c; electrical a,c; parameter real is = 10p from (0:inf); real id; (*desc = "conductance "*) real gd; analog begin id = is * (limexp(V(a,c) / $vt) 1.0); gd = ddx(id, V(a)); I(a,c) <+ id + V(a,c)*$simparam("gmin", 1e-12); end thermal voltage uses endmodule simulation temperature
12 Coram: Verilog-A Introduction for Compact Modelers (MOS-AK Montreux 2006)
Verilog-A Diode
`include "disciplines.vams" disciplines define through and across module diode(a,c); inout a,c; electrical a,c; variables parameter real is = 10p from (0:inf); real id; (*desc = "conductance "*) real gd; analog begin id = is * (limexp(V(a,c) / $vt) 1.0); gd = ddx(id, V(a)); I(a,c) <+ id + V(a,c)*$simparam("gmin", 1e-12); end endmodule
13 Coram: Verilog-A Introduction for Compact Modelers (MOS-AK Montreux 2006)
Verilog-A Diode
`include "disciplines.vams" modules module diode(a,c); combine entity inout a,c; electrical a,c; and architecture; parameter real is = 10p from (0:inf); real id; replace Spice (*desc = "conductance "*) real gd; primitives analog begin id = is * (limexp(V(a,c) / $vt) 1.0); gd = ddx(id, V(a)); I(a,c) <+ id + V(a,c)*$simparam("gmin", 1e-12); end endmodule
14 Coram: Verilog-A Introduction for Compact Modelers (MOS-AK Montreux 2006)
Verilog-A Diode
`include "disciplines.vams" parameters have module diode(a,c); ranges (and defaults) inout a,c; electrical a,c; parameter real is = 10p from (0:inf); real id; (*desc = "conductance "*) real gd; analog begin id = is * (limexp(V(a,c) / $vt) 1.0); gd = ddx(id, V(a)); I(a,c) <+ id + V(a,c)*$simparam("gmin", 1e-12); end endmodule
15 Coram: Verilog-A Introduction for Compact Modelers (MOS-AK Montreux 2006)
Verilog-A Diode
`include "disciplines.vams" module diode(a,c); inout a,c; electrical a,c; parameter real is = 10p from (0:inf); real id; (*desc = "conductance "*) real gd; analog begin id = is * (limexp(V(a,c) / $vt) 1.0); gd = ddx(id, V(a)); I(a,c) <+ id + V(a,c)*$simparam("gmin", 1e-12); end built-in function with endmodule improved convergence
16 Coram: Verilog-A Introduction for Compact Modelers (MOS-AK Montreux 2006)
much like C
Intuitive
and easy to read and learn Start with an existing model and modify
Based
Set
17
Best Practices
Models
most
No
watch
Discontinuities
Spice
requires continuous derivatives Consider this code: if (vbs == 0.0) begin qbs = 0.0; capbs = czbs+czbssw+czbsswg; end else if (vbs < 0.0) begin qbs = I(b,s) <+ ddt(qbs);
19 Coram: Verilog-A Introduction for Compact Modelers (MOS-AK Montreux 2006)
Discontinuities
Resulting
C code: Automatic derivative if (vbs == 0.0) { differs from intended value qbs = 0.0; dqbs_dvbs = 0.0; //capbs=czbs+czbssw+czbsswg; } else if (vbs < 0.0) { qbs =
20
Discontinuities
HiSIM2
Verilog-A (beta code) Clipping in C code may affect values and derivatives differently
4 3.5 3
HiSIM Verilog-A (beta code) ac drain current (real part) hisim ir(m1,d)
x1e-3
Compiler Optimizations
Common
subexpressions
internal nodes
if (rs == 0.0) V(b_res) <+ 0.0; else I(b_res) <+ V(b_res) / rs;
Dependency
replace
22
trees
analysis()
Consider
this code:
if (analysis("tran")) begin qd =
No
capacitance in:
small-signal
analysis()
Consider
But
Compiler/Simulator
24
Events
Consider
this code: @(initial_step) begin isdrain = jsat * ad; happens for a dc sweep?
What
dont
want re-computing for bias sweep need re-computing for temperature sweep
Even
Compiler/Simulator
25
uses special block names to identify sections of code PSP Verilog-A: begin : initializeModel NSUB0_i = `CLIP_LOW(NSUB0,1e20); // hurt for other compilers
Eg
Doesnt
26
Software Practices
Use
Include
comments: brief description, reference documentation Physical constants are not dated and could change
model
correct indentation
if ((qb + eta_qi*qi) > 0.0) begin E0_Q_1 = 1.0 + T0*(qb + eta_qi*qi); end else begin E0_Q_1 = 1.0 - T0*(qb + eta_qi*qi); end T0_GAMMA_1 = 1.0 + T0*GAMMA_sqrt_PHI; // !! mb 97/06/02 ekv v2.6 beta = KP_Weff * T0_GAMMA_1 / (Leq * E0_Q_1+1e-60); // !! mb 97/07/18
34
Coding Style
Verilog-A
Characterization
Make
35
Conclusion
Verilog-A
is a powerful and easy-to-use compact modeling language a good compact model still requires care and rigor examples now available
Writing
Many
36
References
Designers
Guide
37
Examples
Verilog-A
http://www.designers-guide.org/VerilogAMS/
VBIC, MOS11, JFET, etc.
model library at
Silvaco
https://src.silvaco.com/ResourceCenter/en/ downloads/verilogA.jsp
BSIM3,
http://pspmodel.asu.edu/ http://hitec.ewi.tudelft.nl/mug/
Mextram HiCUM
http://www.iee.et.tu-dresden.de/iee/ eb/hic_new/hic_intro.html
38