Professional Documents
Culture Documents
Report Book
Technical reports and descriptions
Mike Brinson
Stefan Jahn
Hélène Parruitte
Copyright
c 2006, 2007, 2008 Mike Brinson <mbrin72043@yahoo.co.uk>
Copyright
c 2007 Stefan Jahn <stefan@lkcc.org>
Copyright
c 2006 Hélène Parruitte <parruit@enseirb.fr>
Permission is granted to copy, distribute and/or modify this document under the
terms of the GNU Free Documentation License, Version 1.1 or any later version
published by the Free Software Foundation. A copy of the license is included in
the section entitled ”GNU Free Documentation License”.
Contents
1 Verilog-AMS interface 7
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 ADMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 XML admst scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3.1 Short introduction into the admst language syntax . . . . . 9
1.3.2 Analogue simulator script . . . . . . . . . . . . . . . . . . . 10
1.3.3 Current limitations of ADMS . . . . . . . . . . . . . . . . . 12
1.3.4 Code for the GUI integration . . . . . . . . . . . . . . . . . 15
1.4 Adding Verilog-AMS devices to Qucs . . . . . . . . . . . . . . . . . 16
1.4.1 The Verilog-AMS source file . . . . . . . . . . . . . . . . . . 16
1.4.2 Integrating the model into the analogue simulator . . . . . . 18
1.4.3 Integrating the model into the GUI . . . . . . . . . . . . . . 21
1.5 Implemented devices . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.5.1 HICUM/L2 v2.11 model . . . . . . . . . . . . . . . . . . . . 24
1.5.2 FBH-HBT model version 2.1 . . . . . . . . . . . . . . . . . . 33
1.6 End Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2
3.2 The ideal logarithmic amplifier . . . . . . . . . . . . . . . . . . . . 60
3.3 The practical logarithmic amplifier . . . . . . . . . . . . . . . . . . 61
3.4 Logarithmic amplifier temperature effects . . . . . . . . . . . . . . . 61
3.5 A compact macromodel for a logarithmic amplifier . . . . . . . . . . 62
3.5.1 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.5.2 Verilog-A model code . . . . . . . . . . . . . . . . . . . . . . 63
3.6 Basic logarithmic amplifier operation . . . . . . . . . . . . . . . . . 65
3.7 Functional description of the Verilog-A logarithmic amplifier macro-
model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.7.1 Input stage . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.7.2 Gain stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.7.3 Output stage . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.8 Logarithmic amplifier large signal AC response . . . . . . . . . . . . 69
3.9 Logarithmic amplifier transfer function temperature variation . . . 70
3.10 Logarithmic amplifier applications . . . . . . . . . . . . . . . . . . . 71
3.10.1 A simple signal multiplier . . . . . . . . . . . . . . . . . . . 71
3.10.2 Light absorption measurements using photodiodes and a log
amplifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.11 End note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3
5.9 Curtice hyperbolic tangent model with subthreshold modification:
LEVEL = 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.10 Statz et. al. (Raytheon) model: LEVEL = 3 . . . . . . . . . . . . . 105
5.10.1 MESFET charge equations QLEVELS = 3 and QLEVELD
= 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
5.11 TriQuint Semiconductor TOM 1 model: LEVEL = 4 . . . . . . . . 110
5.12 TriQuint Semiconductor TOM 2 model: LEVEL = 5 . . . . . . . . 114
5.13 Temperature scaling relations . . . . . . . . . . . . . . . . . . . . . 119
5.14 MESFET noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
5.14.1 Main components . . . . . . . . . . . . . . . . . . . . . . . . 119
5.14.2 MESFET equivalent circuit with noise current components . 121
5.14.3 Curtice hyperbolic tangent model: LEVEL = 1 or 2: Noise
equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
5.14.4 Statz et. al. (Raytheon) model: LEVEL = 3: Noise equations122
5.14.5 TriQuint Semiconductor TOM 1 model: LEVEL = 4: Noise
equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
5.14.6 TriQuint Semiconductor TOM 2 model: LEVEL = 5 . . . . 124
5.15 Adding external passive components to the MESFET models . . . . 126
5.16 End note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
4
6.8 Update number one: September 2008 . . . . . . . . . . . . . . . . . 164
6.8.1 Model initialisation . . . . . . . . . . . . . . . . . . . . . . . 164
6.8.2 Charge partitioning . . . . . . . . . . . . . . . . . . . . . . . 165
6.8.3 Modelling EKV v2.6 charge partitioning using Qucs EDD . . 165
6.9 End note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
5
10.2 Test code and schematic . . . . . . . . . . . . . . . . . . . . . . . . 204
10.3 History of simulation results . . . . . . . . . . . . . . . . . . . . . . 207
10.3.1 March 13 2007, Simulation tests by Mike Brinson . . . . . . 207
10.3.2 March 15 2007, Simulation tests by Mike Brinson . . . . . . 208
10.3.3 March 18 2007, Simulation tests by Mike Brinson . . . . . . 215
10.4 March 25 2007, Simulation tests by Mike Brinson . . . . . . . . . . 218
10.5 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
6
1 Verilog-AMS interface
1.1 Introduction
Verilog-AMS is a hardware description language. It can be used to specify the
analogue behaviour of compact device models. Usually these are C or C++ im-
plementations in analogue simulators. The effort to implement modern compact
models in C/C++ is quite high compared to the description in Verilog-AMS.
1.2 ADMS
The software ADMS (see http://mot-adms.sourceforge.net) allows Verilog-
AMS descriptions to be translated into any other programming language. It gen-
erates a structured XML tree representing the compact device model description.
Verilog−AMS admsXml:
source file ADMS internal
data tree
admsXml:
Language transform
using admst
The internal XML tree is used to generate ready-to-compile C or C++ code which
is specific to the simulators API. The code generator is able to produce
• evaluation of device equations (current and charge) including their deriva-
tives,
7
• glue code for the simulator API,
• documentation and
• any other data described by the original Verilog-AMS input file.
From version 0.0.11 Qucs comes with the following Verilog-AMS transformers
• qucsMODULEcore.xml
creating the actual analogue simulator implementation
• qucsMODULEdefs.xml
creating the parameter descriptions for the analogue simulator
• qucsMODULEgui.xml
creating the implementation for the GUI integration
• qucsVersion.xml
basic admst library
• analogfunction.xml
creating analogue function code
In order to create admst scripts for a simulator it is necessary to understand both,
the simulator specific API and how the ADMS data tree items – which are based
on the Verilog-AMS source file describing the model – relate to the API.
The command lines for transforming a Verilog-AMS source file into the appropiate
Qucs C++ source files are
$ admsXml <device.va> -e qucsVersion.xml -e qucsMODULEcore.xml
$ admsXml <device.va> -e qucsVersion.xml -e qucsMODULEgui.xml
$ admsXml <device.va> -e qucsVersion.xml -e qucsMODULEdefs.xml
$ admsXml <device.va> -e analogfunction.xml
The admst language is used to traverse the internal tree. The tree’s root is defined
by the Verilog-AMS module definition.
8
module d e v i c e ( node1 , node2 , . . . )
// module d e f i n i t i o n s and code
endmodule
• Traversing a list: The construct allows to traverse all children of the selected
branch.
<a d m s t : f o r −each s e l e c t=”/ module ”>
...
</ a d m s t : f o r −each>
• Defining and using variables: Values from the data tree can be put into
named and typed variables which are then accessible using the $ operator.
<a d m s t : v a l u e −o f s e l e c t=”name ”>
<a d m s t : v a r i a b l e name=”module ” s e l e c t=”%s ”>
• Opening a file: Printed text (see below) is output into the given file.
<admst:open f i l e =”$ module . cpp ”>
...
</ admst:open>
• Output text: Special characters must be encoded (e.g. " → " < →
< > → > and \n → \\n).
<a d m s t : t e x t format=”This i s a t e x t . ”/>
9
<a d m s t : t e m p l a t e match=” n a m e o f f u n c t i o n ”>
...
</ a d m s t : t e m p l a t e>
• Running a function: Templates are applied to parts of the internal data tree.
<admst:apply−t e m p l a t e s s e l e c t=” d a t e t r e e r o o t f o r f u n c t i o n ”
match=” n a m e o f f u n c t i o n ”/>
• Comments:
<!−− t h i s i s a comment −−>
• DC simulation
module::initDC (void),
module::restartDC (void) and
module::calcDC (void)
• AC simulation
module::initAC (void) and
module::calcAC (nr_double_t)
• S-parameter simulation
module::initSP (void) and
module::calcSP (nr_double_t)
• Transient simulation
module::initTR (void) and
module::calcTR (nr_double_t)
• AC noise simulation
module::initNoiseAC (void) and
module::calcNoiseAC (nr_double_t)
10
• Harmonic simulation
module::initHB (int) and
module::calcHB (int)
These functions go into the module.core.cpp file. An appropriate module.core.h
header file is also created.
In case the Verilog-AMS source file contains analog functions in the module defi-
nition, e.g.
a n a l o g function r e a l name ;
input x ;
real x ;
begin
name = x ∗ x ;
end
endfunction
the analogfunction.xml script produces the appropriate C/C++ and header files
• module.analogfunction.cpp
• module.analogfunction.h.
The ADMS language transformer is aware of how analogue simlators solve a net-
work of linear and non-linear devices. The general Newton-Raphson algorithm for
a DC simulation used in SPICE-like simulators as well as in Qucs can be expressed
as
J (m) · V (m+1) = J (m) · V (m) − f V (m)
11
In the Verilog-AMS desciptions only the current and charge contributions are men-
tioned. The appropriate derivatives are meant to be automatically formed by the
language translator ADMS.
I ( c i , e i ) <+ i t ; // c u r r e n t c o n t r i b u t i o n
I ( s i , c i ) <+ ddt ( Qjs ) ; // c h a r g e c o n t r i b u t i o n
The right-hand side of eq. (1.1) consists of the linear and non-linear currents of
the network as well as the Jacobian matrix multiplied by the voltage vector. Since
devices are usually uncorrelated both parts can be computed directly on a per
device basis.
Example 1
There was a bug in the admst scripts. They failed to place the function calls of
analogue functions correctly. This has been fixed.
module d i o d e ( a , c ) ;
inout a , c ;
electrical a, c;
a n a l o g function r e a l c u r r e n t ;
input i s , v ;
begin
c u r r e n t = i s ∗ ( exp ( v / 26 e −3) − 1 ) ;
end
endfunction
r e a l Vd ;
r e a l Id ;
analog begin
Vd = V( a , c ) ;
Id = c u r r e n t ( 1 e −15 , Vd ) ;
I (a , c ) <+ Id ;
end
endmodule
12
Example 2
It is not allowed to mix current and charge contributions in assignments. Mixing
both emits wrong C/C++ code. It accounts the current to be a charge in this
case.
module d i o d e ( a , c ) ;
inout a , c ;
electrical a, c;
r e a l Vd , Id , I s , Cp ;
analog begin
Is = 1e −15;
Cp = 1e −12;
Vd = V( a , c ) ;
Id = I s ∗ ( exp (Vd / 26 e −3) − 1 ) ;
// not a l l o w e d i n ADMS
I ( a , c ) <+ Id + ddt (Cp∗V( a , c ) ) ;
// a l l o w e d i n ADMS
I ( a , c ) <+ Id ;
I ( a , c ) <+ ddt (Cp∗V( a , c ) ) ;
end
endmodule
Example 3
The following example is rejected by the admst scripts with this error message.
r e a l Id , I s ;
13
a n a l o g begin
I s = 1e −15;
Id = I s ∗ ( exp (V( a , c ) / 26 e −3) − 1 ) ;
// not a l l o w e d i n ADMS
I ( a , c ) <+ I s ∗ ( exp (V( a , c ) / 26 e −3) − 1 ) ;
// a l l o w e d i n ADMS
I ( a , c ) <+ Id ;
end
endmodule
Example 4
Potentials on the left-hand side of contribution assignments are not allowed. This
kind of assignment emits wrong C/C++ code.
module d i o d e ( a , c ) ;
inout a , c ;
electrical a, c;
r e a l Id , I s ;
r e a l Rp ;
analog begin
Rp = 1 e9 ;
Is = 1e −15;
Id = I s ∗ ( exp (V( a , c ) / 26 e −3) − 1 ) ;
I (a , c ) <+ Id ;
// a l l o w e d i n ADMS
I ( a , c ) <+ V( a , c ) / Rp ;
// not a l l o w e d i n ADMS
V( a , c ) <+ I ( a , c ) ∗ Rp ;
end
endmodule
14
1.3.4 Code for the GUI integration
The admst script for the GUI creates files according to its API. Basically it
produces the list of parameters as well their descriptions (if available) in a property
list. Additionally the symbol drawing code is emitted which should be adapted to
the devices requirements.
15
Figure 1.3: schematic with the HICUM transistor symbol
// ADMS s p e c i f i c d e f i n i t i o n s
16
‘ d e f i n e a t t r ( t x t ) (∗ t x t ∗)
module d i o d e ( a , c ) ;
// d e v i c e t e r m i n a l s
inout a , c ;
electrical a, c;
// i n t e r n a l node
electrical ci ;
// model p a r a m e t e r s
parameter r e a l I s = 1E−15 from [ 0 : 1 ]
‘ a t t r ( i n f o=” s a t u r a t i o n c u r r e n t ” ) ;
parameter r e a l Cp = 1E−12 from [ 0 : 1 ]
‘ a t t r ( i n f o=” p a r a l l e l c a p a c i t a n c e ” ) ;
parameter r e a l Rs = 1.0 from ( 0 : i n f )
‘ a t t r ( i n f o=” s e r i e s r e s i s t a n c e ” ) ;
parameter r e a l Temp = 300 from ( 0 : i n f )
‘ a t t r ( i n f o=”t e m p e r a t u r e ” ) ;
r e a l Vd , Id , f o u r k t , twoq , Qp ;
analog begin
Vd = V( a , c i ) ;
Id = I s ∗ ( exp (Vd / 26 e −3) − 1 ) ;
Qp = Cp ∗ Vd ;
I ( a , c i ) <+ Id ;
I ( a , c i ) <+ ddt (Qp ) ;
I ( c i , c ) <+ V( c i , c ) / Rs ;
begin : n o i s e
f o u r k t = 4 . 0 ∗ ‘P K ∗ Temp ;
twoq = 2 . 0 ∗ ‘P Q ;
I ( c i , c ) <+ w h i t e n o i s e ( f o u r k t /Rs , ”thermal ” ) ;
I ( a , c i ) <+ w h i t e n o i s e ( twoq∗ Id , ”s h o t ” ) ;
end // n o i s e
end // a n a l o g
17
endmodule
18
• src/components/component.h
In this file it is necessary to add the line
#include "verilog/diode.core.h"
• src/components/component_id.h
The file contains unique component identifiers. It is necessary to add the
Verilog modules name.
enum circuit_type {
CIR_UNKNOWN = -1,
...
// verilog devices
CIR_diode,
...
};
• src/input.cpp
In order to be able to instantiate the new model the file must be modified as
follows.
// The function creates components specified by the type of component.
circuit * input::createCircuit (char * type) {
if (!strcmp (type, "Pac"))
return new pac ();
...
else if (!strcmp (type, "diode"))
return new diode ();
• src/qucsdefs.h
Finally the properties including their range definitions must be added to this
file. The appropiate file can be obtained using the following command line.
$ admsXml diode.va -e qucsVersion.xml -e qucsMODULEdefs.xml
[info] admsXml-2.2.4 Oct 18 2006 19:50:46
[info] diode.defs.h: file created
[info] elapsed time: 0.0335337
[info] admst iterations: 4294 (4294 freed)
The emitted file diode.defs.h looks like
/* diode verilog device */
{ "diode", 2, PROP_COMPONENT, PROP_NO_SUBSTRATE, PROP_NONLINEAR,
19
{
{ "Is", PROP_REAL, { 1E-15, PROP_NO_STR }, { ’[’, 0, 1, ’]’ } },
{ "Cp", PROP_REAL, { 1E-12, PROP_NO_STR }, { ’[’, 0, 1, ’]’ } },
{ "Rs", PROP_REAL, { 1.0, PROP_NO_STR }, { ’]’, 0, 0, ’.’ } },
{ "Temp", PROP_REAL, { 300, PROP_NO_STR }, { ’]’, 0, 0, ’.’ } },
PROP_NO_PROP },
{ PROP_NO_PROP }
},
representing the parameters defined in the original Verilog-AMS file. This
excerpt must be included in the src/qucsdefs.h file into this structure:
// List of available components.
struct define_t qucs_definition_available[] =
{
...
/* end of list */
{ NULL, 0, 0, 0, 0, { PROP_NO_PROP }, { PROP_NO_PROP } }
};
noinst_HEADERS = ... \
diode.analogfuncction.h diode.core.h
if MAINTAINER_MODE
...
diode.analogfunction.cpp: analogfunction.xml
diode.analogfunction.cpp: diode.va
$(ADMSXML) $< -e analogfunction.xml
diode.core.cpp: qucsVersion.xml qucsMODULEcore.xml
diode.core.cpp: diode.va
$(ADMSXML) $< -e qucsVersion.xml -e qucsMODULEcore.xml
diode.defs.h: qucsVersion.xml qucsMODULEdefs.xml
diode.defs.h: diode.va
$(ADMSXML) $< -e qucsVersion.xml -e qucsMODULEdefs.xml
diode.gui.cpp: qucsVersion.xml qucsMODULEgui.xml
diode.gui.cpp: diode.va
20
$(ADMSXML) $< -e qucsVersion.xml -e qucsMODULEgui.xml
...
else
If everything worked fine then the new Verilog-AMS model is now completely
integrated into the analogue simulator.
Both the created files diode.gui.cpp and diode.gui.h should be copied to the
qucs/qucs/components directory.
Depending on the type of device several changes must be applied to these files.
The constructor will basically contain the properties of the device as they are going
to occur in the component property dialog as depicted in fig. 1.2. Check these if
they are complete or if some can be left.
diode : : diode ()
{
D e s c r i p t i o n = QObject : : t r ( ”d i o d e v e r i l o g d e v i c e ” ) ;
21
QObject : : t r ( ”t e m p e r a t u r e ” ) ) ) ;
...
}
The diode::info function should be adapted to meet the devices requirements.
The BitmapFile should be changed to represent a correct PNG file in the quc-
s/bitmaps directory. Both the Name and the bitmap are going to appear in the
left-hand component tab as shown in fig. 1.3.
Element ∗ d i o d e : : i n f o ( QString& Name , char ∗ &BitmapFile ,
bool getNewOne )
{
Name = QObject : : t r ( ”Diode ” ) ;
BitmapFile = ”d i o d e ” ;
// s u b s t r a t e node
L i n e s . append (new L ine ( 9 , 0 , 30 , 0 ,QPen(QPen : : darkBlue , 2 ) ) ) ;
L i n e s . append (new L ine ( 9 , −7, 9 , 7 ,QPen(QPen : : darkBlue , 3 ) ) ) ;
// t h e r m a l node
L i n e s . append (new L ine ( −30 , 20 , −20 , 2 0 ,QPen(QPen : : darkBlue , 2 ) ) ) ;
L i n e s . append (new L ine ( −20 , 17 , −20 , 2 3 ,QPen(QPen : : darkBlue , 2 ) ) ) ;
22
// arrow
i f ( Props . g e t F i r s t ()−>Value == ”npn ”) {
L i n e s . append (new L ine ( −6, 1 5 , 0 , 1 5 ,QPen(QPen : : darkBlue , 2 ) ) ) ;
L i n e s . append (new L ine ( 0 , 9 , 0 , 1 5 ,QPen(QPen : : darkBlue , 2 ) ) ) ;
} else {
L i n e s . append (new L ine ( −5, 1 0 , −5, 1 6 ,QPen(QPen : : darkBlue , 2 ) ) ) ;
L i n e s . append (new L ine ( −5, 1 0 , 1 , 1 0 ,QPen(QPen : : darkBlue , 2 ) ) ) ;
}
// t e r m i n a l d e f i n i t i o n s
P o r t s . append (new Port ( 0 , − 3 0 ) ) ; // collector
P o r t s . append (new Port ( −30 , 0 ) ) ; // base
P o r t s . append (new Port ( 0 , 3 0 ) ) ; // emitter
P o r t s . append (new Port ( 3 0 , 0 ) ) ; // substrate
P o r t s . append (new Port ( −30 , 2 0 ) ) ; // t h e r m a l node
// r e l a t i v e b o u n d i n g s
x1 = −30; y1 = −30;
x2 = 3 0 ; y2 = 3 0 ;
}
In order to test the component in the GUI it is necessary to modify some more
source code files.
• qucs/qucs.cpp
In this file the new Verilog device will be made available to the component
tab. If a new non-linear device is added then place it here:
pInfoFunc nonlinearComps[] =
{ ... &diode::info, 0};
• qucs/components/component.cpp
The new verilog device must be loadable in the GUI. So in the function
getComponentFromName() add this:
Component* getComponentFromName(QString& Line)
{
...
case ’d’ : if(cstr == "iode") c = new diode();
break;
...
return c;
}
• qucs/components/components.h
In the component header file it is necessary to add:
23
#include "diode.h"
In order to make the build-sytem aware of the new Verilog model the file qucs/-
components/Makefile.am must be modified in the following way.
libcomponents_a_SOURCES = ... \
diode.gui.cpp
noinst_HEADERS = ... \
diode.gui.h
With these steps the component is now fully integrated into the GUI.
Some schematics have been setup to verify that the model emits basically the
correct output values and the source code translations worked properly.
DC simulation
The setup for the forward Gummel plot is depicted in fig. 1.4. The base-emitter
voltage is swept (VBE = 0.2 . . . 1.2) with a constant voltage across the second diode
VBC = 0.
24
P toprie1=sD
aTsSSPytW
raim
w r10=lCm
p e IB=EbdD
n.V2beVU hc1serim
TeC Tt
r2
h=1 0 c
I
lulatiIoenVEcqenu=1atbion
am C
V
E
c
e
=
U
Tm p=27BI./I
Figure 1.4: forward Gummel plot schematic for HICUM/L2 v2.11 model
In fig. 1.5 the logarithmic Gummel plot is shown including the ratio between the
base current and collector current on the secondary axis.
25
0
.Ic.b1e1 e 345890671 510
e B
e
0
t
a
2
3
1e 450.0.40.6V 0
be0.811.2
Figure 1.5: forward Gummel plot for HICUM/L2 v2.11 model
DC simulation
In fig. 1.6 the schematic for the output characteristics of the HICUM model is
shown. The 2-dimensional sweep describes the function
26
iV
lU
Cd
D
=EC
cVc
m
s
1
IB
eU ui
t
a
o
n
c P
s
S
T
P
S a
w
W
i
m
y
p
a
t
or
m
p
1
C
D
=
l
e
n
r
0
3
i
1
s
=t
e
c
e
VP
r
a
w
s
W
S
i
m
T
y
a
P
t
o
Sr
m
p
2
=
l
p
e
n
r
0
.
i
6
s
=t
e
1
b
e
V
8
9r
I=ebTrth10
E
b
Figure 1.6: output characteristics schematic for HICUM/L2 v2.11 model
Figure 1.7 shows the results of the DC simulations for the output characteristics
of the bipolar transistor.
27
Ic.8
1e
e
4
6 3
4
2e00.51V
1c.5e22.53
Figure 1.7: output characteristics plot for HICUM/L2 v2.11 model
AC simulation
Figures 1.8 and 1.9 depict the schematic and diagrams for an AC simulation in a
given bias point. The current gains magnitude and phase are shown as well as the
characteristics of the small signal base and collector current in the complex plane
(polar plot).
28
dD
cC s1im ulatioX
n2A aTSiytC
cPlapi1nre=slo05g6G
s m u tzionIcX
aH 3
V
U 1
= V
U3
=1
io(Inc./bi)pE
qgnu2=adtB
E b
I T
r
ct5
y
h p e
1n
=
0
qhnus1ea=ipohnse(Ic.i/b) 5 2
V
=
U
0
4 f
c
re q u ncy9
: 1 e+08 i0.6 0.8 0.4 .02bIi
ig201e6n1a:e376.15e1ec8fr2qun11ce0y91e01eI0.41e61e71aec8frqun1cey91e01e0
in
a 0 a
g . c
Figure 1.8: AC simulation schematic for HICUM/L2 v2.11 model
0
hesap$1$5
0 a i
c
I.
b 00
.
2.0
.
46
0.8
0e61e71aec8frqun1cey91e01e acfrequncy
Figure 1.9: AC simulation plot for HICUM/L2 v2.11 model
29
cC
dD s1im
S-parameter simulation
ulationX1TSsSN
pytPapi1nrea=surol07gm
i m itrX2EN
eG
o
n a1ti=on0*lg1)0(Fm
qFum i
)
n
1VU
P
Z2u5m
N 0.9=O
In the figures 1.10 and 1.11 a two-port S-parameter simulation schematic (including
hmTcrt2yhpe1=0nZN
noise) as well as the results are shown. The four S-parameters are displayed in two
P2u5m=0O hm2 1
V
=
Polar-Smith combi diagrams. The noise figure as well as the minimal noise figure
U
are displayed in a logarithmic Cartesian diagram.
30
]S
,[40frequnc2
1 y 4 6S
[
2
,
1
] ]
2
[
S, r
feq
unc0
.
y102
. S
0
3
[
.
1
,
2
]
F
N inm
200110101e31e4f1re5qun1ecy61e71e81e91e01e
Figure 1.11: S-parameter simulation plot for HICUM/L2 v2.11 model
Transient simulation
In the schematic in fig. 1.12 a current pulse is fed into the base of the transistor.
Varying the input capacitance changes the response in the collector current as
shown in fig. 1.13.
31
IT21fr==t015m
IR
nTSytaam b b
a s
e 1
T
j
i
0
e
=
c
h
t
rC
J C
V
E
3
=
U
lPop1re=us0i5ine1otnsSSPPytW
n s aaw
rim me
rp0nC
topri1e=sT2=lR
0J51 E
=
I
ci
t
q
a
o
u
1
n
C
V
0
.
In
0
.Ic0.15 e
1
3
I
b
e
.
5
4
t
Figure 1.12: Transient simulation schematic for HICUM/L2 v2.11 model
501e92e93e94tiem 0
95e96e97e98e9
Figure 1.13: Transient simulation plot for HICUM/L2 v2.11 model
32
V
B
E
=
U b
e T 1VP
a
w
s
W
S
i
m
C
E
y
p
T
b
a
r
e
=
P
U
t
o
Sr
m
p
1
C
D
=
l
e
n
V
0
4
.
1
5t
e
b
er
1.5.2 FBH-HBT model version 2.1
i2
s
=
The HBT (Hetero Bipolar Transistor) model developed by Matthias Rudolph at
tBsac/t.iboInionIcb11ee011.2345890671 84261000etaB
ieE=nC
l1qV1uC
the FBH (Ferdinand-Braun-Institut für Hochfrequenztechnik) is available in the
cIcbdD m a
u
Internet at http://www.designers-guide.org/VerilogAMS.
DC simulation
Forward Gummel plot.
e13450.0.60.8Vbe11.21.4
Figure 1.14: forward Gummel plot schematic for HBT model
DC simulation
Output characteristics.
33
IVUC
E c
c0.5eBVbIbTS
= P
s
S
P
tdD a
w
W
i
m
y
aoC p r
1
=
eD
rconi1vH m
lp
C
n et r s
SP yw
W
iamp r
2
=
e m
l p
n e
1t
r
c2pu1rel=aStiournceTSPStatorips=in.62Vgbe
V
0s5=em
4
0Ic.60.23210.511.52V2c.5e33.544.55
Figure 1.15: output characteristics schematic for HBT model
The authors would like to thank Hélène Parruitte for the initial implementation
of the Verilog-AMS interface in Qucs. Also thanks go to the company Xmod
Technologies (see http://www.xmodtech.com) allowing her to work on such an
interface and finally to share the outcome of her internship under the GPL.
34
2 Verilog-A Modular Macromodel
for Operational Amplifiers
2.1 Introduction
Since the release of Qucs version 0.0.11 the Qucs team has spent a lot of time
and effort improving and debugging the Qucs device and circuit modelling facil-
ities. Initially, the primary device and circuit modelling technique available to
users was based on a subcircuit approach that allowed new models to be formed
from the built in components distributed with each release of the package1 . Re-
leases 0.0.11 and 0.0.12 added model construction centred around the nonlinear
equation defined device (EDD) and ADMS compact device models. For these
modelling techniques preliminary documentation and application information has
been posted on the Qucs Web site2 , outlining the fundamental basis of these proce-
dures. Unfortunately, both the EDD and ADMS modelling techniques do require
a level of specialised knowledge which many Qucs users may be unfamiliar with.
These notes have been written in the hope that the information they provide will
help add to the body of information published on Qucs modelling and also be
useful to other Qucs users who would like to try constructing, and experiment-
ing with, new device and circuit models using the ADMS software. Today Qucs
has moved on from simply a GPL circuit simulator with user friendly schematic
capture, and has started to evolve into an advanced circuit and device modelling
tool which offers features that were not commonly available in previous gener-
ations of GPL circuit simulators. This report introduces an ADMS synthesised
compact macromodel for the modular operational amplifier previously described
1
It is also possible to construct models directly in C++ and compile and link them to the main
body of the Qucs code. This is the approach taken by the package developers. However, for
the average Qucs user who is primarily interested in using the package, rather than taking
part in it’s development, this route to model development is not really an option.
2
Mike Brinson, “Qucs Tutorial: Component, compact device and circuit modelling using sym-
bolic equations“, http://qucs.sourceforge.net/docs.html, and Stefan Jahn, Hélène Par-
ruitte, “Qucs Description: Verilog-AMS interface”, http://qucs.sourceforge.net/docs.
html.
35
in the Qucs tutorial on operational amplifiers.3 . This macromodel is characterised
by a similar symbol to the primitive operational amplifier gain block included with
all Qucs releases. However, it provides Qucs with a more realistic general purpose
operational amplifier model that can be used with confidence when designing many
practical circuits which are dependent on amplifier characteristics for correct op-
eration. The process of compiling and linking ADMS generated C++ models with
the Qucs C++ code has been a learning vehicle on my part, allowing some of the
complexities of the ADMS Verilog-A compiler to be decoded and understood. The
ADMS synthesised operational amplifier macromodel also marks a departure from
the previously described Qucs compact device models in that it represents a circuit
function rather than a semiconductor device characteristic. The source code for
the modular macromodel is included in this report and the ADMS generated C++
code can be found in the Qucs release source tarballs archive4 . The procedure used
to synthesize and link the model to Qucs followed the route suggested by Stefan
and Hélène in their report on the Verilog-AMS/Qucs interface.
• Input stage: Offset voltage and current, bias current, differential resistance
and capacitance.
• Gain stages: Two pole differential response and single zero common-mode
response.
2.3 Parameters
3
Mike Brinson, “Qucs Tutorial: Modelling Operational Amplifiers”, http://qucs.
sourceforge.net/docs.html.
4
Available from http://qucs.sourceforge.net/download.html
36
Name Symbol Description Unit Default∗
GBP GBP Gain bandwidth product Hz 1e6
AOLDC AOLDC Open-loop differential gain at DC dB 106.0
FP2 FP2 Second pole frequency Hz 3e6
RO RO Output resistance Ω 75
CD CD Differential input capacitance F 1e-12
RD RD Differential input resistance Ω 2e6
IOFF IOF F Input offset current A 20e-9
IB IB Input bias current A 80e-9
VOFF VOFF Input offset voltage V 7e-4
CMRRDC CM RRDC Common-mode rejection ratio at DC dB 90.0
FCM F CM Common-mode zero corner frequency Hz 200.0
PSRT P SRT Positive slew rate V/s 5e5
NSRT N SRT Negative slew rate V/s 5e5
VLIMP V LIM P Positive output voltage limit V 14
VLIMN V LIM P N Negative output voltage limit V -14
ILMAX ILM AX Maximum output current at DC A 35e-3
CSCALE CSCALE Current limit scale factor 50
37
parameter r e a l RO = 75 from [ 0 . 0 1 : i n f ]
‘ a t t r ( i n f o=”Output r e s i s t a n c e (Ohm) ” ) ;
parameter r e a l CD = 1 e −12 from [ 1 e −20 : i n f ]
‘ a t t r ( i n f o=” D i f f e r e n t i a l i n p u t c a p a c i t a n c e (F) ” ) ;
parameter r e a l RD = 2 e6 from [ 0 . 0 1 : i n f ]
‘ a t t r ( i n f o=” D i f f e r e n t i a l i n p u t r e s i s t a n c e (Ohm) ” ) ;
parameter r e a l IOFF = 20 e−9 from [ 1 e −20 : i n f ]
‘ a t t r ( i n f o=”I n p u t o f f s e t c u r r e n t (A) ” ) ;
parameter r e a l IB = 80 e−9 from [ 1 e −20 : i n f ]
‘ a t t r ( i n f o=”I n p u t b i a s c u r r e n t (A) ” ) ;
parameter r e a l VOFF = 7 e−4 from [ 0 : i n f ]
‘ a t t r ( i n f o=”I n p u t v o l t a g e o f f s e t (A) ” ) ;
parameter r e a l CMRRDC = 9 0 . 0 from [ 1 : i n f ]
‘ a t t r ( i n f o=”Common mode r e j e c t i o n r a t i o a t DC (dB) ” ) ;
parameter r e a l FCM = 200 from [ 0 . 0 1 : i n f ]
‘ a t t r ( i n f o=”Common mode z e r o c o r n e r f r e q u e n c y ( Hz ) ” ) ;
parameter r e a l PSRT = 5 e5 from [ 1 : i n f ]
‘ a t t r ( i n f o=” P o s i t i v e s l e w r a t e (V/ s ) ” ) ;
parameter r e a l NSRT = 5 e5 from [ 1 : i n f ]
‘ a t t r ( i n f o=” N e g a t i v e s l e w r a t e (V/ s ) ” ) ;
parameter r e a l VLIMP = 14 from [ 0 . 0 1 : i n f ]
‘ a t t r ( i n f o=” P o s i t v e out put v o l t a g e l i m i t (V) ” ) ;
parameter r e a l VLIMN = −14 from [− i n f : 0 ]
‘ a t t r ( i n f o=” N e g a t i v e out put v o l t a g e l i m i t (V) ” ) ;
parameter r e a l ILMAX = 35 e−3 from [ 1 e−9 : i n f ]
‘ a t t r ( i n f o=”Maximum DC out put c u r r e n t (A) ” ) ;
parameter r e a l CSCALE = 50 from [ 0 : i n f ]
‘ a t t r ( i n f o=”Cu r r e n t l i m i t s c a l i n g f a c t o r ” ) ;
//
r e a l RP1 , CP1 , RP2 , CP2 ;
real Rdiff , Voffset ;
r e a l CMRR0, CMgain , CCM;
real S l e w r a t e p o s i t i v e , Slewratenegative ;
r e a l MTWOPI;
//
a n a l o g begin
//
// C o n s t a n t s
//
MTWOPI = 6 . 2 8 3 1 8 5 3 0 7 1 7 9 5 8 6 4 7 6 9 3 ;
//
// Design e q u a t i o n s
//
V o f f s e t = VOFF∗ 5 ;
R d i f f = RD/ 2 ;
CMRR0 = pow ( 1 0 , CMRRDC/ 2 0 ) ;
CMgain = 1 e6 /CMRR0;
CCM = 1 . 0 / (MTWOPI∗1 e6 ∗FCM) ;
RP1 = pow ( 1 0 , AOLDC/ 2 0 ) ;
CP1 = 1 / (MTWOPI∗GBP) ;
RP2 = 1 ;
CP2 = 1 / (MTWOPI∗FP2 ) ;
S l e w r a t e p o s i t i v e = PSRT/ (MTWOPI∗GBP) ;
S l e w r a t e n e g a t i v e = NSRT/ (MTWOPI∗GBP) ;
//
// I n p u t v o l t a g e o f f s e t
//
I ( i n p , n7 ) <+ V( i n p , n7 ) ;
I ( i n p , n7 ) <+ V o f f s e t ;
//
I ( i n n , n9 ) <+ V( i n n , n9 ) ;
I ( i n n , n9 ) <+ −V o f f s e t ;
38
//
// I n p u t b i a s c u r r e n t s
//
I ( n7 ) <+ IB ;
I ( n9 ) <+ IB ;
//
// I n p u t c u r r e n t o f f s e t
//
I ( n7 , n9 ) <+ IOFF / 2 ;
//
// I n p u t d i f f e r e n t i a l r e s i s t a n c e and c a p a c i t a n c e
//
I ( n7 , n8 ) <+ V( n7 , n8 ) / R d i f f ;
I ( n9 , n8 ) <+ V( n9 , n8 ) / R d i f f ;
I ( n7 , n9 ) <+ ddt (CD∗V( n7 , n9 ) ) ;
//
// Common mode s t a g e
//
I ( n6 ) <+ −CMgain∗V( n8 ) ;
I ( n6 ) <+ V( n6 ) ;
I ( n6 , n10 ) <+ V( n6 , n10 ) / 1 e6 ;
I ( n6 , n10 ) <+ ddt (CCM∗V( n6 , n10 ) ) ;
I ( n10 ) <+ V( n10 ) ;
//
// D i f f e r e n t i a l mode and common mode s i g n a l adder s t a g e
//
I ( n11 ) <+ −V( n10 ) ;
I ( n11 ) <+ −V( n7 , n9 ) ;
I ( n11 ) <+ V( n11 ) ;
//
// Slew r a t e l i m i t i n g s t a g e
//
i f (V( n11 ) > S l e w r a t e p o s i t i v e )
I ( n12 ) <+ −S l e w r a t e p o s i t i v e ;
e l s e i f (V( n11 ) < −S l e w r a t e n e g a t i v e )
I ( n12 ) <+ S l e w r a t e n e g a t i v e ;
e l s e I ( n12 ) <+ −V( n11 ) ;
39
I ( n4 ) <+ −V( n5 ) ;
I ( n4 ) <+ −CSCALE∗V( n5 ) ∗ (V( n2 , o u t p ) + ILMAX ) ;
I ( n4 ) <+ V( n4 ) ;
end
else
begin
I ( n4 ) <+ −V( n5 ) ;
I ( n4 ) <+ V( n4 ) ;
end
//
// Output r e s i s t a n c e
//
I ( n4 , n2 ) <+ V( n4 , n2 ) / (RO−1);
I ( n2 , o u t p ) <+ V( n2 , o u t p ) ;
//
//
// V o l t a g e l i m i t e r s t a g e
//
i f (V( o u t p ) > VLIMP)
begin
I ( o u t p ) <+ −10.0∗VLIMP ;
I ( o u t p ) <+ 1 0 . 0 ∗V( o u t p ) ;
end
e l s e i f (V( o u t p ) < VLIMN)
begin
I ( o u t p ) <+ −10.0∗VLIMN ;
I ( o u t p ) <+ 1 0 . 0 ∗V( o u t p ) ;
end
end
endmodule
40
with a real device. Once again the results demonstrate one of the most important
rules in circuit simulation, namely that the accuracy of the results from a specific
simulation does largely depend on how well a model represents a physical device
or circuit. Further comments about the Verilog-A code and the accuracy of the
simulation results are given with each set of test results.
P
1
O
F3
7
5
=
. 4
are formed by current generators in parallel with one Ohm resistors. Notice that
V e
the direction of the current generator current flow determines the polarity of the
Vt
o
u
batteries.
R
// I n p u t voltage offset
1
g
//
= R2
I ( in p , n7 ) <+ V( i n p , n7 ) ;
0
1
= i l
i
t
I ( in p , n7 ) <+ V o f f s e t ;
k d c s m u a
on
//
C 1
I ( in n , n9 ) <+ V( i n n , n9 ) ;
D
I ( in n , n9 ) <+ −V o f f s e t ;
)V(tou00..1310Rg1(O s
SPW
yw
ia
mp r
1e
= Dm
lp
C
o t
e
r
1
g
)1e3TSPtaorine=s1k02R
0HM
Figure 2.1: UA741 modular macromodel input voltage offset test circuit and results
41
VV
t
o
u
U1
5
=
2V
1VR=0g1R2O=1P01k dDsCPcw1asrim u l
ai
t
o
n
tou.0..3101R0g1e3TSSPyW m p e t
r
1orpe=Dsl=Cik0n2R1g1
itam
Figure 2.2: UA741 transistor level input voltage offset test circuit and simulation
results
42
lsuatiRo2=n1kRVV=1pnkVO
idDCc1sVU=m PIBF148=.230e794TsSSPPyW V o u t
ataim
w p0lCi.n4V13e15ster
roprin1ee==Dm
5V)(tou50 V)(n33..62ee44
3
.V)(P4.8293e5e43.6e43.7eV4s(3.8)e43.9e4e4V003s...5e4337734.89655e4V003..n.7eV334s22(55367.8)e4V44p3..88.933eee40055eV.o400u4321t.9V8775
4.81e35.43.6e43.7eV4s(3.8)e43.9e4e40.3742150.3256894.83e050.452398
Figure 2.3: UA741 modular macromodel input bias and offset current test circuit
and simulation results
43
dDCc1VUs1=im V p
uslatRio2=1nkRV=1nkOP1V3TSSPyW o ut VU 2
= 1 5 sP wa re m p e t r
1oprine==D0lCi.nV13187s5e'3
itam
0)V(tou'03..2275e4376e437e4378e4379e438e4V)(n33..2826ee3''.4475e'43.76e'43.7e'43.78e'43.79e'43.8e'4
' . ' . V' s (.
)'
. '
. ' s n V s( )
4V)(p''4.8.81719ee3''.557e'43.76e'43.7e'4(3.)78e'43.79e'43.8e'4V000...333777668901555V00...0333222999118670166'''444...888V222eee'''000555V''00.o0..ut13V93271854867
p
Vs
Figure 2.4: UA741 transistor level input bias and offset current test circuit and
simulation results
44
2.7 Open loop differential voltage gain
Differential voltage gain is represented by the Verilog-A code listed in this section.
Differential gain is modelled with three distinct quantities. These are 1. resistor
RP1 which is set equal to the open loop differential gain at DC, 2. the primary
pole in the voltage gain frequency response which is set by capacitor CP1, and 3.
a high frequency pole set by CP2 and resistor RP2. Each pole stage is driven by
a voltage controlled current generator. Note the current generator negative sign.
This is required to maintain the correct signal phase. The derivation, and a more
detailed discussion, of the model open-loop differential voltage gain properties can
be found in pages 13 to 19 of the Qucs operational amplifier tutorial. Simulated
results for the open-loop differential gain response are shown in Figs. 2.5 and 2.6
The AOLDC and CD parameters given in Fig. 2.5 have been adjusted to give the
same response as the Qucs transistor level model. Again due to perfect transistor
matching a value of CD roughly zero is required to produce similar high frequency
responses above the second pole frequency.
//
// F i r s t p o l e
//
I ( n3 ) <+ −V( n12 ) ;
I ( n3 ) <+ V( n3 ) /RP1 ;
I ( n3 ) <+ ddt (CP1∗V( n3 ) ) ;
//
// Second p o l e
//
I ( n5 ) <+ −V( n3 ) ;
I ( n5 ) <+ V( n5 ) /RP2 ;
I ( n5 ) <+ ddt (CP2∗V( n5 ) ) ;
//
45
idaD
lytcC
cTAiC s m
u
1SPopi1rnes=sim
ula
att o
i
onn V
U1
V
=
C1
2
0
= m 1
R M
0 Vo
u
P
1
O
B
G
A
Ct
L=
e
D
C
2
6
0
1g
pt
q
a
u
E
1
=
h
s
e
.i
o
dn
Bra(
V
o
2t
u
d
ev
.
g)
(
n
ur
wa(
pn
gl
e(
V
t
o
u)
v
.
1)V e 5
4 o
g
0
1
.
H
M
9 z 0
1 = F
I
O
B
=
V48
3
.
e9
7
4
(tou10e01.331110101314151617B )d(iG
5a5000
n
e)eee.11101F0requ1nec3hy(H
Freq)dserguenc5y00(H
z 1ez4)1e51e61e7
(P
hsa1150.111010Frequ1en3cy(H
1ze)41e51e61e7
Figure 2.5: UA741 modular macromodel open-loop differential voltage gain test
circuit and simulation results
46
iTA
laSPytcC
i0o.91guM
taopi1rnes=sm
aH o n V
U1
V
=
1
C
=2
0
m O P1 V
out V
U
V
U2
=
3
=V
1
5
V
1
5
1V)(tou1ee01543 gout.v)B z i
t
q
a
o
n
u
E
1
h
p
s
e
=
Bd
2
r
a
(
V(
e
g
u
)nwra 1
R
=
(
p
0
1d(iG n0M
l
ge(
Vo ut
v
.)d
Dc
s
1
Ci
mul
t
ai
o
n
0.3111010Frequ1en3c0y(H n
a 5
50
0
0
1
4
e
)
z
)d(hPsergasJ21001
5
e1
e6
1e7 J 1
. 1 100
1Fr
e
q1
e
n
u3
c1
4
e
(
)
y
z
H1
e6
5
1
e1
7
e
J.111010Frequ1en3cy(H
z1)e41e51e61e7
Figure 2.6: UA741 transistor level open-loop differential voltage gain test circuit
and simulation results
47
2.8 Common mode effects
Operational amplifier common-mode effects are represented by the Verilog-A code
listed in this section. Common-mode effects are simulated using an identical net-
work to that outlined in page 20 the Qucs operational amplifier tutorial. The
simulated results for a unity gain CMMR test circuit are illustrated in Figs. 2.7
and 2.8. The macromodel parameters CMRR and FCM have been set at their
default values to demonstrate the difference when compared to the transistor level
model. Common-mode simulation results observed with the transistor level model
are significantly better than those obtained from measurements on real devices,
mainly because the simulation model is constructed from perfectly matched tran-
sistors. Associated with the differential amplifier stages and the common-mode
section of the macromodel is a signal adder which combines the differential and
common-mode signals. The Verilog code for this adder stage is also repeated with
common-mode code. An adder can be formed by a one Ohm resistor driven by
differential and common-mode currents. The resulting volt drop across the one
Ohm resistor then becomes the sum of the two signal voltages.
//
// Common mode s t a g e
//
I ( n6 ) <+ −CMgain∗V( n8 ) ;
I ( n6 ) <+ V( n6 ) ;
I ( n6 , n10 ) <+ V( n6 , n10 ) / 1 e6 ;
I ( n6 , n10 ) <+ ddt (CCM∗V( n6 , n10 ) ) ;
I ( n10 ) <+ V( n10 ) ;
//
// D i f f e r e n t i a l mode and common mode s i g n a l adder s t a g e
//
I ( n11 ) <+ −V( n10 ) ;
I ( n11 ) <+ −V( n7 , n9 ) ;
I ( n11 ) <+ V( n11 ) ;
//
48
1A
O
G
C=BM P
B
A=F4R8.23De02eC619=0VU40.1=VR=10kR2=10kVoutdDTAaSCcytcCa1ps1resi=im
LVCIFO D C lm
i0o.gu1lHaztioonn
u a t
R3=10kR4=10kCEM
q
a
u
R 1tion
=dB
(1
/
V o
ut
v
. ) Poin s 8 k
)V(tou311eeAA4530.10.1F1requ1n0cy(1H0z)1e31e4RM 8C600.10.1F1requ1n0cy(1H0z)1e31e4
qCEM R2
uRa1tiVo=n1=dB(1/VoRut=1.v0)k=10kOP1VoutVU32=15VdDTAaCcytcC1p1sesi=im l
i
Figure 2.7: UA741 modular macromodel CMRR test circuit and simulation results
UVR3=10kR4=10k10 SPaoirns0o.8gk1Hz m ut
a
o
l
i
t
a
un
o
n
)V(tou31eeEE560.10.1F1requ1n0cy(1H0z)1e31e4R 5C19050.10.1F1requ1n0cy(1H0z)1e31e4
M
Figure 2.8: UA741 transistor level CMRR test circuit and simulation results
49
2.9 Slew rate limiting
Operational amplifier slew rate limiting effects are represented by the Verilog-A
code listed in this section. Slew rate limiting can be modelled in Verilog-A using
the if-else language statement. This allows the maximum signal current at node
n12 to be limited to a value set by variables Slewratepositve or Slewratenegative
which in turn are functions of parameters PSRT and NSRT (see page 25 of the
Qucs operational amplifier tutorial). Again please note the sign of I(n12). The sim-
ulated results for a UA741 slewrate limiting test circuit are illustrated in Figs. 2.9
and 2.10. In general the results are very similar for both models. However, there
is one point worth commenting on; in the case of the transistor level model there
is a marked difference in the level of slewing for negative and positive signals (see
waveform Vout3 in Fig. 2.10). This effect is probably due to the fact that the
UA741 operational amplifier circuitry is very different near the power supply rails,
resulting in significant differences in signal shape at high signal swings. This effect
is not modelled by the modular macromodel.
//
// Slew r a t e l i m i t i n g s t a g e
//
i f (V( n11 ) > S l e w r a t e p o s i t i v e )
I ( n12 ) <+ −S l e w r a t e p o s i t i v e ;
e l s e i f (V( n11 ) < −S l e w r a t e n e g a t i v e )
I ( n12 ) <+ S l e w r a t e n e g a t i v e ;
e l s e I ( n12 ) <+ −V( n11 ) ;
I ( n12 ) <+ V( n12 ) ;
50
dDCc1sim ulatioVninTtsSryRtiaaom
np1reu=s0liia.en3nm 5
otsOP1Vout1V)(in115005e11e4T1im
fSGR=VUC1=.12405kHzR2=10kR=10kVout2)V(1tou11005e11e4T1im .5e(4s)2e142.5e143e14
3 OP2 )
s
(
2
t
u
o 1 0
0 .5e(4s)2e142.5e143e14
R
0
1
=k
SGR=1C.25R5=10kOP3Vout3V)(3tou11100 R 4
= 10k V 1
1 0 5e11e4T1i.
m5e(4s)2e142.5e143e14
R6=10k 5e11e4T1im
Figure 2.9: UA741 modular macromodel slewrate limiting test circuit and simula-
tion results
.5e(4s)2e142.5e143e14
51
dDCc1sim ulatioVninTtsSryR np1reu=s0liia.en3nm
itaaom 5
otsVout1VU2=15V)(Visn125005e21e24T1im
VRfUC1=140VkHzR2=10kR=10kOP3)V(1tou21005e21e24T1im .5e2(4s)2e242.5e43e24
SG=.25R3=10kO VoPut2VU4=15V)V(2tou211000 .5e2(4s)2e242.5e43e24
2SGR C R 4
=
=1.5R5=10kOP3Vout3VU67=15V)V(3tou21100 10k 5
e
21e24T1i.
m5e2(4s)2e242.5e43e24
R6=10k 5e21e24T1im
Figure 2.10: UA741 transistor level slewrate limiting test circuit and simulation
results
.5e2(4s)2e242.5e43e24
52
2.10 Output voltage limiting
Operational amplifier output voltage limiting effects are represented by the Verilog-
A code listed in this section. A Verilog-A if-else statement is used to model voltage
limiting. This language construction also demonstrates the use of the Verilog-A
block construction formed with begin-end code words. Effectively the if-else state-
ment swaps circuit elements as the voltage signal polarity changes. The simu-
lated results for a UA741 voltage limiting test circuit are illustrated in Figs. 2.11
and 2.12. Again the results are very similar for both models. However, in the case
of the macromodel there is no attempt to reduce the differential gain when output
voltage limiting occurs and as a result some waveform distortion takes place. In
practice if, as in the case of pure AC simulation, output voltage limiting is not
required then simply set VLIMP and VLIMN well outside the range of required
operating voltage and voltage limiting is never triggered.
//
// V o l t a g e l i m i t e r s t a g e
//
i f (V( o u t p ) > VLIMP)
begin
I ( o u t p ) <+ −10.0∗VLIMP ;
I ( o u t p ) <+ 1 0 . 0 ∗V( o u t p ) ;
end
e l s e i f (V( o u t p ) < VLIMN)
begin
I ( o u t p ) <+ −10.0∗VLIMN ;
I ( o u t p ) <+ 1 0 . 0 ∗V( o u t p ) ;
end
end
53
dDs1im
cC ulationTtS
sryR lp1re=30iiaenm
itaaomn s
u nsot V1
)
(
0
n
i
1=VR
V
U i
n
V 2=1k R O
V P
1
L
I
M
N
o
V1
4
=
.
3
!
1
t
u5
)
V1
!
0
105
4
1
e
e
!3
0
!
T
i .
m
e1(5s0).20.250.3
(
1=0k 2tou!1005e!41e!3T0i.m
e1(5s0).20.250.3
S
R
=
GC1
5
. =kR 4
R
1 O
VLP2
I
M
=
N
V1
4
.
3
!
2
t
o
u5
)
V
(
22
0
0
t
u
o
3=10k !205e!41e!3T0i.m e1(5s0).20.250.3
Figure 2.11: UA741 modular macromodel output voltage limiting test circuit and
simulation results
54
VU
1=VR V
i
n 2=1k R V
o
P
O1
t
u V
2
=
U
V
3
=V
1
5
V
1
51
)
V
(
0
n
i
1
/
=10kVout2V4V)(2tou/11005e/41e/30.150.2 U 05
e4
/
T3
1
e
/
i
(
m0
)
s1
5
.02
.
SG=C
R .15R 4=1kR P
O =
U
V
=
UV
1
5
V
1
5
)
(
2
t
u
o
V2
0
0 Ti
(
m)
s
cdDi1m
sC ulationtsriam 3
= 10
nusliaenkotTSM
tSaillaospt1xoregI==er20l10ritpn.m
yvIrnebnR 2
0
/ 5
e4
/
T3
1
e
/
i
(
m0
)
s1
5
.02
.
reaxTSR s
o
1
=
5
CM
/
p
V
ut
e
2
0
Ah
d
o
r
a
=
T
=nLU
ot p
e
o
zi
d
l
a
Figure 2.12: UA741 transistor level output voltage limiting test circuit and simu-
lation results
55
2.11 Output current limiting
Operational amplifier output current limiting effects are represented by the Verilog-
A code listed in this section. A Verilog-A if-else statement is used to model current
limiting. The effect is modelled by a feedback mechanism which reduces the mag-
nitude of current I(n4) which is proportional to the difference of the current flowing
in the output path and ILMAX. A scale factor CSCALE is used to adjust maxi-
mum clamped output current. The simulated results for a UA741 current limiting
test circuit are illustrated in Figs. 2.13 and 2.14. Current clamping induces distor-
tion in the output waveform. Both the macromodel and the transistor level model
give roughly the same clamped output currents but the wave shapes, and hence the
distortion, are somewhat different. This is not surprising as the macromodel does
not include a mechanism to control clamping distortion. Setting CSCALE to zero
removes the current limiting process from the operational amplifier macromodel.
//
// Current l i m i t e r s t a g e
//
i f (V( n2 , o u t p ) >= ILMAX)
begin
I ( n4 ) <+ −V( n5 ) ;
I ( n4 ) <+ CSCALE∗V( n5 ) ∗ (V( n2 , o u t p ) − ILMAX ) ;
I ( n4 ) <+ V( n4 ) ;
end
e l s e i f (V( n2 , o u t p ) <= −ILMAX)
begin
I ( n4 ) <+ −V( n5 ) ;
I ( n4 ) <+ −CSCALE∗V( n5 ) ∗ (V( n2 , o u t p ) + ILMAX ) ;
I ( n4 ) <+ V( n4 ) ;
end
else
begin
I ( n4 ) <+ −V( n5 ) ;
I ( n4 ) <+ V( n4 ) ;
end
//
56
idfVUc1=skiHm
zV nR1
=0k VP
1
O
L
M
A
I
S
C
t
o
uX
1
=
L
E5
e03
R
3
=20
lDC1ationR2=10kTtsSInryRtiaaom
u i
n
s
l
u
1
p
=
e
0
r
2
g
de
a
i
n
m
t n
s
ot
oM eth
od=
Tr
ap
eo
zi
d
l
a
1)V(in100 V)(tou11000Oe =
5e4Ti1m e3(s)0.150.25e4Ti1m
e3(s)0.150.2
ifVU1=dCck1HszimV unR
l
a1
=0
i
ok
n P
1
O V out R3
=20 V
U2
3=1
5V
Figure 2.13: UA741 modular macromodel output current limiting test circuit and
simulation results
t
D
1V)(in-100 V)(tou-100 TSO R2
0
1
=
k t
sr
ni
R
1IM
y
ta
n
m
p
e
a
r
o
g
d
es
u
=
0
2
=i
e
l
a
i
n
m
t
on
t
o
s
M h
d
t
e
o
=r
a
p
Ti
d
l
e
o
a
z
5e-4Ti1m e-3(s)0.150.25e-4Ti1m r i
aS
x
l
t
o p
r
0
.1
0
5 -6
e-3(s)0.150.2vbns=1upVA
Figure 2.14: UA741 transistor level output current limiting test circuit and simu-
lation results
57
2.12 End note
These notes summarise a number of techniques for modelling operational amplifier
functions using Verilog-A. Verilog-A is primarily intended for modelling compact
semiconductor devices. However, as this report demonstrates it can be equally em-
ployed for macromodelling of integrated circuits and circuits in general. The Qucs
C++ code for the modular operational amplifier model, generated by ADMS, can
be found in the Qucs release source tarballs at http://qucs.sourceforge.net.
The procedure followed to convert the Verilog-A code into C++ for compilation
and linking with Qucs closely followed that described by Sefan Jahn and Hélène
Parruitte. Although it takes more work to construct models using ADMS the ef-
fort is worthwile because the finished models are very efficient in terms of memory
usage and have significantly reduced run times. One interesting observation which
is worth recording here is the fact that Qucs equation defined device (EDD) models
and ADMS Verilog-A models have a very similar structure, implying that EDD
models can be used as prototypes prior to compilation and linking via the compact
device modelling route using ADMS. Once again a special thanks to Stefan Jahn
for all his help and encouragement over the period that I have been developing the
Verilog-A version of the operational amplifier macromodel, writing this report and
testing the examples it includes.
58
3 Verilog-A Logarithmic Amplifier
Macromodel
3.1 Introduction
The development of simulation component and device models in many ways re-
flects how circuit simulator functionality has improved with increasing personal
computer computational power. Early circuit simulators were often restricted to
the DC, AC and transient analysis domains. Similarly, in the early days of circuit
simulation, the available types of component and device models were extremely
limited, often being confined to the fundamental passive components, simple volt-
age and current sources and the basic semiconductor devices. Adding new models
to a circuit simulator was, in most instances, a complex task. Today this picture is
changing. Modern circuit simulators, like Qucs, are equipped with an ever widening
selection of simulation tools plus increasingly sophisticated modelling tools. The
later allows easy construction of subcircuit models, linear and non-linear macro-
models, equation defined device models, and Verliog-A compact device models.
This report describes how a compact macromodel of a logarithmic amplifier can
be constructed from a model description written in the Verilog-A hardware de-
scription language, compiled to C++ code using the ADMS compiler plus Qucs
XML interface, and linked to the main body of Qucs C++ code1 . The logarithmic
amplifier model demonstrates an approach to Qucs modelling which allows high-
level functional models of integrated circuits to be added to the existing range of
Qucs component and device models.
1
A detailed description of the procedure for the compilation of Verilog-A models with ADMS
and linking of the resulting C++ code to Qucs can be found in the Qucs publication :
“Qucs Description: Verilog-AMS interface”, by Stefan Jahn, Hélène Parruitte, located at
http://qucs.sourceforge.net/docs.html.
59
3.2 The ideal logarithmic amplifier
The operation of an ideal logarithmic amplifier2 is defined by the function given
in equation (3.1).
Ii
Vout (ideal) = Kv · log (3.1)
Ir
The device accepts two input currents (Ii and Ir ) and outputs voltage Vout (ideal)
which is proportional to the base ten logarithm of the current ratio Ii /Ir , where
the constant of proportionality is Kv volts per decade. In equation (1) current Ir
is called the reference current and current Ii represents the amplifier input signal.
The primary purpose of a logarithmic amplifier is not to amplify input signals but
to compress a wide dynamic range input signal to give as output it’s logarithmic
equivalent. In some respects the name logarithmic amplifier is misleading and it
would be better to consider the amplifier as a measurement device rather than an
amplifier. For the ideal logarithmic amplifier when Ii = Ir , the output voltage
Vout (ideal) ⇒ 0. In a practical logarithmic amplifier the current input terminals
are effectively at virtual ground potential which allows the amplifier input signals
to be derived from input voltages divided by scaling resistors of identical value. In
this case Ir = Vr /R and Ii = Vi /R, where Vr and Vi are the input signal voltages
respectively, and R is the scaling resistance. Transforming from current inputs to
voltage inputs gives equation (3.2).
Vi
Vout (ideal) = Kv · log (3.2)
Vr
60
In a real logarithmic amplifier Ir can be as low as 10 nA with the maximum allowed
value of Ii around 10 mA, yielding a dynamic range of six decades. Integrated
logarithmic amplifiers are available with dynamic ranges of five or six decades.
Where T E is called the total error. This can be represented by a function formed
from the combination of errors in gain scale factor, input offset current, input bias
current, output offset voltage and transfer function non-linearity. On adding the
major contributions due to these errors equation (3.4) becomes equation (3.5).
Ii − Ib1
Vout = Kv · (1 ± ∆Kv ) · log ± 2 · Kv · N · m ± Vosout (3.5)
Ir − Ibr
Vi
− Ib1
Vout = Kv · (1 ± ∆Kv ) · log R ± 2 · Kv · N · m ± Vosout (3.6)
Vr
− Ibr
R
Where ∆Kv is the scale error factor in percent, Ib1 is the bias current at input I in
amperes, Ibr is the bias current at the reference input R in amperes, N is the log
conformity error in percent, m is the number of decades over which N is specified,
and Vosout is the output offset voltage. The log conformity error of a logarithmic
amplifier is defined as the peak deviation from the best-fit straight line of Vout
versus the log(Ii /Ir ) curve expressed as a percentage of peak-to-peak full-scale.
The other error parameters have their usual meaning. In general error parameters
may be plus or minus in sign, leading to the ± signs in the previous equations.
61
first approximation parameter temperature dependence is usually limited to the
simple linear functions of temperature given in equation (3.7).
Where T emp is the circuit simulation temperature in Celsius, T nom is the device
parameter measurement temperature in Celsius and ∆Kv tc, Ib1 tc, Ibr tc, N tc and
Vosout tc are first order linear temperature coefficients in percentage per degree
Celsius or units per degree Celsius.
* The default parameters are for a typical integrated circuit logarithmic amplifier.
+ These parameters may be negative.
62
++ Typical bias current doubles for every eight to ten degrees temperature in-
crease.
63
parameter r e a l Dktc = 0 . 0 3 from [ −100 : 1 0 0 ]
‘ a t t r ( i n f o=” s c a l e f a c t o r e r r o r t e m p e r a t u r e c o e f f i c i e n t ” u n i t = ”%/ C e l s i u s ” ) ;
parameter r e a l I b 1 t c = 0 . 5 e −12 from [− i n f : i n f ]
‘ a t t r ( i n f o=” i n p u t I 1 b i a s c u r r e n t t e m p e r a t u r e c o e f f i c i e n t ” u n i t = ”A/ C e l s i u s ” ) ;
parameter r e a l I b r t c = 0 . 5 e −12 from [− i n f : i n f ]
‘ a t t r ( i n f o=” i n p u t r e f e r e n c e b i a s c u r r e n t t e m p e r a t u r e c o e f f i c i e n t ” u n i t = ”A/ C e l s i u s ” ) ;
parameter r e a l Tnom = 2 6 . 8 5 from [ −273 : i n f ]
‘ a t t r ( i n f o=”p a r a m e t e r measurement t e m p e r a t u r e ” u n i t = ” C e l s i u s ” ) ;
//
r e a l R, I x ;
r e a l V1 , V2 ;
r e a l Cc , PI ;
r e a l TempK, TnomK, T d i f f , NTemp, VosoutTemp , DkTemp , Ib1Temp , IbrTemp ;
//
a n a l o g begin
//
// C o n s t a n t s
//
PI = 3 . 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 ;
//
// Model e q u a t i o n s
//
V1=V( P I 1 ) ;
V2=V( P I r )+1e −20;
R=Rinp+1e −6;
Cc=1/(2∗ PI ∗Fc ) ;
//
TempK=$ t e m p e r a t u r e ;
TnomK=Tnom+ 2 7 3 . 1 5 ;
T d i f f=TempK−TnomK ;
NTemp=N+Ntc ∗ T d i f f ;
VosoutTemp=Vosout+V o s o u t t c ∗ T d i f f ;
DkTemp=Dk+Dktc ∗ T d i f f ;
Ib1Temp=I b 1+I b 1 t c ∗ T d i f f ;
IbrTemp=I b r+I b r t c ∗ T d i f f ;
//
i f (V1 >= V2 ) I x = Kv∗(1+DkTemp/ 1 0 0 ) ∗ l o g ( ( ( V1/R)−Ib1Temp ) / ( ( V2/R)−IbrTemp ))+
(Kv∗ 2 ∗ (NTemp/ 1 0 0 ) ∗M)+VosoutTemp ;
else Ix = 0 . 0 ;
//
// C i r c u i t s t a g e s
//
// I n p u t s t a g e
//
I ( P I 1 ) <+ V( P I 1 ) /R;
I ( P I r ) <+ V( P I r ) /R;
//
// Log f u n c t i o n s t a g e
//
I ( n3 ) <+ −I x ;
I ( n3 ) <+ V( n3 ) ;
//
// Frequency compensation
//
I ( n4 ) <+ −V( n3 ) ;
I ( n4 ) <+ V( n4 ) ;
I ( n4 ) <+ ddt ( Cc∗V( n4 ) ) ;
//
// Output s t a g e
I ( P Vout ) <+ −V( n4 ) /Ro ;
I ( P Vout ) <+ V( P Vout ) /Ro ;
end
64
endmodule
The ADMS syntax is a subset of Verilog-A. Allowed language structures are out-
lined in a SYNTAX-SUPPORTED file which can be downloaded from http:
//mot-adms.sourceforge.net.
3.6 Basic logarithmic amplifier operation
The circuit shown in Fig. 3.1 demonstrates the operation of the logarithmic am-
plifier macromodel with the input signals set as voltages. Input scaling resistance
Rinp is 10kΩ, the reference voltage is 100 uV DC (which is equivalent to Ir = 10
nA), and the input signal V s is swept between 1 uV and 10 V DC. For input sig-
nals (V 2) less than V 1 the macromodel restricts the output voltage to zero volts,
preventing signal ratios from being less than one. Figure 3.2 illustrates the loga-
rithmic amplifier operating in current input mode. In Fig. 3.2 the input scaling
resistors are set to 1Ω, causing the amplifier inputs to become effectively virtual
earth points. Both Fig. 3.1 and Fig. 3.2 illustrate the performance of a typical
general purpose logarithmic amplifier over five signal decades, clearly showing the
signal compression properties of the device.
65
V
U2
= s V
U 1
= 0 L
R
V
uA
i1
n
p
I
R4
=
e V
t
o
ui
c
s
d
C
1
Dl
m
a
ui
t
o
n
6V
)(tou4201e061e05Ir1e=04101enV0A a
r
P
s
e
w
W
1
S
i
m
=
p
y
T
e
a
r
P
t
S
ot
m
e
p
C
1
D
l
o
g
V
s
u
0
1r
s3(0.)10.1110 =
Figure 3.1: Qucs schematic for a basic voltage driven logarithmic amplifier and
simulated DC transfer function
L
RA
1
i
n
p
=
I1o
ut
I2
s
=
I I=
1 R V c
s
d
C
1
Di
m
ul
i
t
ao
n
A
0
n
6
4 r
=
IA
0
1
n a
P
s
wr
a
m
e
pt
e
er
)
V
(
t
u
o
2
V W
S
i
m
y
T
a1
C
=
D
l
p
e
o
r
a
m1
g
s
0 P
t
S
o=
0
t
1
p
=I
1
n
.
m
1
e
00
1
19
1
e
08
1
e
0I7
e
0 6
1
e
0
i(
A
)1
e
05
14
1
e
e
03
0
Figure 3.2: Qucs schematic for a basic current driven logarithmic amplifier and
simulated DC transfer function
66
3.7 Functional description of the Verilog-A
logarithmic amplifier macromodel
The macromodel of a general purpose logarithmic amplifier presented in previous
sections simulates the following device characteristics:
• Gain stage : Logarithmic base ten transfer function over N decades with a
single pole frequency response. Errors; gain scale and log conformity.
• Properties with temperature variation : gain scale, log conformity, bias cur-
rents and output offset voltage.
67
Figure 3.3 illustrates a small signal test circuit which allows amplifier transfer
function frequency response to be simulated.
//
// C o n s t a n t s
//
PI = 3 . 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 ;
//
// Model e q u a t i o n s
//
V1=V( P I 1 ) ;
V2=V( P I r )+1e −20;
R=Rinp+1e −6;
Cc=1/(2∗ PI ∗Fc ) ;
//
TempK=$ t e m p e r a t u r e ;
TnomK=Tnom+ 2 7 3 . 1 5 ;
T d i f f=TempK−TnomK ;
NTemp=N+Ntc ∗ T d i f f ;
VosoutTemp=Vosout+V o s o u t t c ∗ T d i f f ;
DkTemp=Dk+Dktc ∗ T d i f f ;
Ib1Temp=I b 1+I b 1 t c ∗ T d i f f ;
IbrTemp=I b r+I b r t c ∗ T d i f f ;
//
i f (V1 >= V2 ) I x = Kv∗(1+DkTemp/ 1 0 0 ) ∗ l o g ( ( ( V1/R)−Ib1Temp ) / ( ( V2/R)−IbrTemp ))+
(Kv∗ 2 ∗ (NTemp/ 1 0 0 ) ∗M)+VosoutTemp ;
else Ix = 0 . 0 ;
..
..
..
//
// Log f u n c t i o n s t a g e
//
I ( n3 ) <+ −I x ;
I ( n3 ) <+ V( n3 ) ;
//
// Frequency compensation
//
I ( n4 ) <+ −V( n3 ) ;
I ( n4 ) <+ V( n4 ) ;
I ( n4 ) <+ ddt ( Cc∗V( n4 ) ) ;
68
V
2fVU
=U 13=1k00H
.uz1Vu1VU V i
n L
R
F
I1=0RA
1
i
n
p
=
c
V
u3e4 d
D
V
t
o
u
a
c
A
T
y c
C
C 1s
si
im
m l
i
t
a
o
u
l
i
t
a
o
u
1Staore=o0H
p gn
n
)(tou00..1110rqu10ncy(H
V z
k
Fez1)e31e4
Figure 3.3: Qucs small signal AC test circuit and simulated transfer function
69
V
2fVU
=U V
3
V
9
1
=
.
H
0
z V
i V
U1
0
=
. VI
R A
1
L
V
t
o
u
4)V
(i2020.50.1T0im c
d
C
Di
s
m
1ul
i
a
o
tn
.
e
)(tou010.50.10im
V 15
( s)0.20.250.3
t
s
T
Sr
a
n
s
i
m
u
R
1
p
e
y
=
t
a
r
oi
e
l
a
in
t
o
nm
0
3s
T.e15(s)0.20.250.3
Figure 3.4: Qucs large signal logarithmic amplifier AC test circuit and simulated
transient response
70
VU2=sVU L
R
T A
1
i
n
p
=
m
e4
e
s
T c
d
C s
1TsSPyW
I1=0uVRVoutD
aSPtaim im u lai
t
o
n
to0Vg1sur
ropr1ee==D
w m
e1lC
p
6V)(tou420Tem p P
s
S
T ya
w
W
i
m
p in
r
2ee= m
p
W
S
l
i 5
e
n 1 tr
1e141e130.V1s(0).1110Soin=115T0s
P a
r
t
Figure 3.5: Qucs logarithmic amplifier transfer function test circuit and simulated
temperature response
71
iUV 1 L
RA
i4=inV2snR
n 1IVU 4A
p2==1emVV
LS
R
C
2
1
1
=
G S
r
=
I
KU0 B V
1
.P
0 Vot
u
VU3
=4V
m V I VU 1= L
Rm2
i
n
p
=
V1
4
e2
V
L S
Gd
D
R
=1 c
C 1i
s
m u l
ation P
s
S
T
P
Sw
W
i
y
a
ta
m
p
r
or
e
1
=
e
=Dm
e
p
C
l
o
g
V
0
1t
r
1
s
6
/
V 1 0
)(i1n10ee//.453611e/51e/41e/s3(0.)10.1110V in
)(i2n0.051e/61e/51e/41ev/s3(0.)10.1110 7
6V V
)(L1543201e/61e/51e/41eV/s3(0.)10.1110V 0 V
)(L20.131e/61e/51e/41eV/s3(0.)10.1110
5V
)(P43201e/61e/51e/41eV/s3(0.)10.1110V 1 0
)(tou1e0/.43161e/51e/41e/s3(0.)10.1110
Figure 3.6: A simple electronic multiplier circuit and test waveforms
V
a maximum value of 10/1e-3 = 1e4, causing the output result to be 4e4 which is
way beyond the output voltage of a practical circuit. By setting k=1 and Ir to
1e-4 the output voltage is scaled so that the maximum output becomes roughly 4
volts.
72
P_V S
R
C
1
=2
iP_Vout11GSR
SIK
r=U
B
1 1G =C
1Q
O hm
1=r*0^(V1/K
ID )
Figure 3.7: A simple antilog amplifier based on a single equation defined device:
Controlled source SRC2 acts as a buffer and source SCR1 converts
EDD current I1 to voltage
73
Lisg=h1t_m
V source1 TC iR
tB
P h
JIN o
0 p d
= o
6 0 1
e
p
stvedpsarr=ikoe1n.03s5i1vm
n IVt
o
u
same numerical value then it also becomes possible to represent light signals paths
R
by nets with specific voltage values. In Fig. 3.8 the light paths are represented by
0
5
t
y
=
. A
1
L
wires connecting the light source, the liquid vessel and the photodiodes. Models
d
ci
s
ml
a
ui
t
o
n
for the light absorbing liquid and the photodiodes are shown in Fig. 3.9.
i
d
q
u
Ln
u
_d
t
e
r
e
s
_
f1 P
C
s
I
N
B h
v
tJdpo
0at
pr= k 1d
=.0i
3o
650 2
e
p
1
n C
D
P
s
w
W
S
y
T1
a
r
e
1
i
=
m
D
p
et
m
e
p
C
1
l
o
gr
)(lttegaoporvu1
V 1 0 r
a
n
s
Tt
r
c
=o T
R e s r i oe n s i
1v0
5
t
y
=
.
m a
P
t
Sr
o
=
i
n
st
r
_
6
1
.
9
5f
c
o
e
filLepm ago00..11e.61e.51e.4Transm
is1oe.n3coeficent0.10.11
Figure 3.8: Light absorption measurements using photodiodes and a logarithmic
amplifier
In Fig. 3.9 the light absorbing liquid is represented by a voltage controlled voltage
source where the source gain models the transmission coefficient: a gain of one
implies 100% transmission and a gain of zero no light transmission at all. The
photodiode model is much more complex. A voltage controlled current source in
parallel with a diode forms the core of the model. The gain of the controlled source
represents the responsivity of the diode. Responsivity is expressed in amperes per
watt or as the photodiode current for a given input light power per unit area. As
the current generated is also expressed as the current per unit area, effectively
74
S
R
C
T
=
G2
rans
P_in1P_PA _1out1R
hTC
iB
tIN
P
JR o d o e
0stvedpsaprr=iko1=n.036s50i1vpm 1 S
R
=
GCe1s
po
nsi
v
nty=0.5P_Vlight1P_C t
y1TC1
s
e
r
=
1B
D i
sIN s daJ0rdkpd
=tjv0=pC
Figure 3.9: Experimental Qucs models for a light absorbing liquid and a
photodiode
the area factor is eliminated. Equation (3.8) relates the photodiode current to the
voltage at the light input terminal:
Responsivity is a function of the light wavelength and is around 0.5 to 0.6 for
wavelengths of 900nm. It is roughly 0.3 for blue wavelengths and drops to 0.2 in
the ultraviolet region of the spectrum. With no illumination falling on a photodiode
the resulting diode current is small, being called the device dark current. It ranges
from tens of pA for ultraviolet detecting photodiodes to several µA for low cost
silicon diodes. Typical values for Rseries are in the range 1m to 20mΩ. The other
parameters are similar to those representing standard semiconductor diodes but
with values specifically chosen to represent the properties of photodiodes.
75
found in the Qucs release archives at http://qucs.sourceforge.net/download.
html. The procedure undertaken to convert the Verilog-A code into C++ for
compilation and linking with Qucs closely followed that described by Stefan Jahn
and Hélène Parruitte. Although it takes more work to construct models using
ADMS the effort is worthwile because the finished models are very efficient in
terms of memory usage and have significantly reduced run times. It is worth
noting that Verilog-A based models can be combined with other forms of Qucs
model, forming a powerful combination that extends Qucs simulation capabilities.
Once again a special thanks to Stefan Jahn for all his help and encouragement
over the period that I have been developing the Verilog-A logarithmic amplifier
macromodel, writing this report and testing the examples it includes.
76
4 Verilog-A Macromodel for
Resistive Potentiometers
4.1 Introduction
The resistive potentiometer is a common component in electronic systems. Un-
fortunately, it is often very poorly modelled by circuit simulators. A common
approach is to simply treat the device as two series resistances with values set
by linear or logarithmic algebraic equations. This is fine as a rough and ready
approach to modelling the basic potentiometer function. However, it fails to ac-
knowledge the fact that potentiometers are much more complex devices that in-
volve not only electrical characteristics but also mechanical rotational features.
Furthermore, potentiometers are subject to a number of errors such as taper con-
formity and linearity. This report presents a more realistic model of a resistive
potentiometer and shows how Qucs can be used to develop practical models of
this fundamental component that give an order of magnitude improvement over
the commonly used two resistor models. Finally, the notes show how a Qucs
subcircuit of the potentiometer can be coded as a compact Verilog-A macromodel.
77
u_2epaq1tnio=dn(C
qR
E .1c1sim 0D k
0
1 i )*
1u+PlaostonR V
1
=
UV
p_otR12=Paeeqqrnnm
=R VM i
d
)V(dM
0i.500.20P.4osito0n.60.81SPtaorine==D s
S
Tw
W
i
y mp e
1 p
ls10C e t r
inP1ositon
Figure 4.1: Basic two resistor model of a linear resistive potentiometer
1
R.G. Keen, The secret life of pots, 1999, http://www.geofex.com/Article_Folders/
potsecrets/potscret.htm
78
20% or 10% types, being defined as the percentage of total potentiometer resis-
tance between the bottom fixed cantact and the wiper contact when the wiper is
1 Inver
s Lo
g
moved to the middle of it’s full range. Inverse logarithmic potentiometers have a
similar characteristic to the logarithmic potentiometer except that potentiometer
)V
(d
taper is reversed. This has the effect of causing large changes in output at small
i0.5000L
M iL
n
wiper angles and the reverse at high angles. Inverse logarithmic potentiometers
have in recent years become unusual items and are no longer widely manufactured.
1A
n
g e2g
le(d og
res)30
Figure 4.2: Resistive potentiometer characteristics: Vin = 1V DC
V out (R2 k RT ) 1
= = (4.1)
V in R1 + (R2 k RT ) R1 R1
1+ +
RT RT
79
TR1
VinBR2RTMVout
Figure 4.3: Basic two resister potentiometer with taper resister RT connect be-
tween the bottom fixed contact (B) and the wiper arm contact (M)
V out 1 a · T aperCoef f
= = (4.2)
V in 1−a 1−a a − a2 + T aperCoef f
1+ +
a T aperCoef f
80
0
.)V
0
.iM
(d 81
6 Ta
p eC
roe f
00..042
5010A50le(d
1g
n 0res)25030350
e2g
TR1RT
Figure 4.4: Potentiometer response curves for different T aperCoef f values: curves
blue to black; T aperCoef f = 0.1, 0.2, 0.75, 1, 2, 3, 4, 5
VinBR2MVout
4.5 Modelling inverse logarithmic potentiometers
By placing the fixed taper resistance in parallel with resistor R1 the potentiometer
response changes to the inverse logarithmic form shown in Fig. 4.2. Consider the
three resister model shown in Fig. 4.5.
Figure 4.5: Basic two resister potentiometer with taper resister RT connect be-
tween the top fixed contact (T) and the wiper arm contact (M)
The transfer function for the schematic illustrated in Fig. 4.5 is given in equation
(4.3).
81
V out R2 R2 R1 · R2 + R2 · RT
= = =
V in (R1 k RT ) + R2 R1 · RT R1 · R2 + R1 · RT + R2 · RT
+ R2
R1 + RT
(4.3)
Writing Rpot = R1 + R2 and setting a = R2 /Rpot and T aperCoef f = RT /Rpot
yields equation (4.4).
.V 0 81
V out a − a2 + a · T aperCoef f
= (4.4)
V in a − a2 + T aperCoef f
)(d 6
Figure 4.6 illustrates the effect of different T aperCoef f values on the inverse
0.042 T
im ap erC
ef
o
potentiometer response curves. Inverse logarithmic potentiometer response is ap-
proximated when the T aperCoef f is in the range 0.2 to 0.25.
5010A
n5l0e(d
1g 0res)25030350
e2g
Figure 4.6: Inverse potentiometer response curves for different T aperCoef f values:
curves blue to black; T aperCoef f = 0.1, 0.2, 0.75, 1, 2, 3, 4, 5
82
the previous sections of this report. The subcircuit schematic represents a practical
resistive potentiometer, with electrical and positional characteristics set by a resis-
tive taper coefficient, a conformity error parameter, a linearity parameter, wiper
arm contact resistance and resistance temperature coefficient. The subcircuit mod-
els both single and multi-turn potentiometers of type linear, logarithmic or inverse
logarithmic and indeed any other laws set by the value of parameter Taper Coeff.
The following list outlines the function and units of the model parameters.
4.6.1 Parameters
* The default parameters are for typical 10k cemet linear potentiometer.
+ Parameter LEVEL selects the potentiometer type: LEVEL=1; linear, LEVEL=2;
logarithmic and LEVEL=3; inverse logarithmic.
++ For a single turn potentiometer 240 <= MaxRotation <= 360 degrees 2 . For
multi-turn potentiometers add 360 degrees per complete shaft rotation.
+++ Potentiometer temperature coefficients are normally quoted in parts per mil-
lion (PPM) per degree Celsius by manufacturers. Typical values are: cemet ±100
PPM/Celsius, wire ±50 PPM/Celsius and conductive plastic ±1000 PPM/Celsius.
Potentiometer functional errors are introduced in the model illustrated in Fig. 4.7
by adding conformity and linearity factors to the basic taper coefficient via equa-
tion (4.5).
2
The value of parameter MaxRotation is normally set by the position of an end stop at the end
of the resistive track.
83
Conf ormity + Linearity · sin (RadAngle)
T pcoef f = T aperCoef f + (4.5)
100
Where RadAngle = Rotation · π/180 is the shaft rotation angle in radians. Abso-
lute conformity error is defined as the maximum deviation of the taper function
characteristic from an ideal theoretical characteristic. Conformity error is normally
specified in percentage and can have plus or minus values. Absolute linearity has a
similar definition. However, it often shows sinusoidal characteristics3 due to shaft
rotation, particularly with multi-turn potentiometers. Contact resistance has been
introduced into the model to take account of any resistance that exists from the
wiper terminal to the contact on the potentiometer resistive track. With sprung
loaded contacts this resistance should be small and can often be neglected. Effects
of temperature on the model performance are included via a simple linear tem-
perature coefficient which controls the change in device resistance as temperature
varies. A potentiometer test circuit and the response of a multi-turn linear poten-
tiometer with zero conformity and linearity errors are given in Fig. 4.8. Multi-turn
potentiometers are modelled by setting the shaft rotation parameter to multiplies
of 360 degrees plus slightly less angle for the final rotation. Figure 4.9 illustrates a
test circuit for comparing the performace of log and inverse log single-turn poten-
tiometers. The response curves show both simulation results and those obtained
by fitting logarithmic curves to the simulated output data. With the Taper Coeff
parameter set to 0.2, remarkably good agreement is observed when the simula-
tion data is compared to the ideal logarithmic performance. The test circuit and
simulation curves illustrated in Fig. 4.10 demonstrate the effects that conformity
and linearity parameters have on a multi-turn potentiometer. Normally both of
these parameters are much less than one percent, making their effects difficult to
observe. In Fig. 4.10 they have both been set at ten percent, greatly exaggerating
their effect on potentiometer performance.
3
See section 3.2: Novotechnik Potentiometer Definitions, http://www.novotechnik.com/
novotechnic_tech_ref.html
84
P_Pbotot1p1R R 4
=
3
= tbo o pt R
R 1
=
2
= T
T B R 5
= C o n t a c _ R e s P _ m id
1
qTR
uR
E _
aTabcdB ito((fLn0nE..g0TVlm
1p_ot==eA (pR
e=0ro11_t3%+2aC
a0=pLR eionTtfta*(a+ppioiC
o?R noT1nre8/_/(0(CMfM opoaarexm i_R
_xfC o!e=o+ftt0aL*.(iTo)oen?anm
yR 1ip1t_eyeT%*%2s20i0otn)_)m
++rR (T**R
a/R t*)ont__gTcTleoem
_1d_ep6poA /fp1p0:1e5:1e5)
)m
P
tM
R
rC B
_TTC
iLLiEoamO p
fom T
a o
e 1 =
__L==criC
VxnneftppaR Cn 0
o
626oaR
tm ke1 2 = 0
..e88yif55=s0n=1.24 T
csSC
sPW
dD iw
l1ar1em m apettironTP
u R B O
_ p Tao 1 t
i = n 0 kA V
g M
l T
ei d VU 1
= V 1
iTSPytam
porine==D C 178gleTC L E mV e pr _L
=_=criC C
2 1
6o e8 f5 = 0
..e8yif5=s0n=116700050A d
i
M
V . 0 5
Figure 4.7: Qucs subcircuit of a resistive potentiometer: schematic, equations and
ls10i6nA aLiom
M
oC nnxeftpaR t26oaR
m
symbol
Figure 4.8: Multi-turn linear potentiometer test circuit and performance curve
ngl1e31.5e3
85
cdD sC i1m B
ulationTC
PO T
1
tLLiEoam
R
_TM
im p
o
=
lVnxefppR
a n V
0 kAM P got
e1
T)
V
0
.1
8 Pot2
tim
aTsSSPPyW
rtaw m e r Co e
r
_
L
=
r
=
_
t
n
a
c i
CC
m
2 2
6
t6o
oa.
R.ee
88yif
f55=s=
0n=0
.
12
8(
e
g
a
t
l
o
v
m
r
0
a
.
e
p
i
W6
4
2
1oprinee==D
ps20lC
1i8nA1gleP B
RO
tTTC
_M
lm
rC T
2
p
o
=
iLLiEoam
a
fonnxeftppaR
e 1
n
C
._==criC
_
V
0
o kA
eM P=got
e
0
2
T
2V
1
=
U0
V0
5
T P
E Fqo
Pu
nt a1
1At i 0
n
o g
=l
e
1E(
kd
*1
l5
g
o0
r
ge
102
0
)
s
(
Max+M2
5
i
n0
EA gl)
i
/
e
n
M)
V
L 2m 3
t266oaR M 0
..e88yif55=s0n=18 TkkE=1Fqa=Pux0.26t.i26o8n=k1*log10(A
ngle+M
in)/M
in)
Figure 4.9: Single-turn log and inverse log potentiometer test circuit and perfor-
mance curves: (1) simulated data solid curves, (2) fitted data dotted
curves
86
P
tM
R
_TTCO
iLLiE B T
p ao1 = n 0 kAV M
n gPlo
et1
T i
c
s
m
d
C
1
Dl
a
ui
t
on
rC aoomV e p _
L
=
tnneftpaR
xm C
._=criC
im2
6o
26oRa e
.eV8 y
8f5M f5= =n
00
1 .2
170 a
r
P
s
e
w
W
1
S
i
m
=
D
T
p
e
y
P
a
r
t
St
m
e
p
C
1
l
i
n
A
0r
l
g
e
B s =P ot2
T o
=
i
n
s2
1
73
P
R
_M
iL
rC O
tTTC
E
aLioom Vp
xmTao
e2
p _
RL
= =
fnetpa_=criC
n C1
n2
60
o
t26oaR
m k
eA
8
..e8yV f5n
if5=M g
=
n 0
0l
e.
12
7 00
.
)
V
(
e
g
a
0
t1
8
6
s =1
P ot3
T .
l
o
v
m
r
a
0
.
e
p
i
W
0
.4
2
P
tTTC
R
_M
iLLiE
rC OB
ao
xomp
V
m T
ao
e3
p _L
== C1
n
6m 20
o
.26oR
tnneftpa_=criC a k
eA f n g
= l
0e2
. V
1
=
U
8.e8y1if55=sn=01170V02
00
46
08
0
A
l
n
g
e1
(
d
g
r3
1
e
)
s2
3
e
.1
e
.
43
6
1
e
.3
R
Figure 4.10: Multi-turn log potentiometer test circuit and response curves, illus-
trating conformity and linearity errors: both conformity and linearity
parameters are set at ten percent to clearly indicate their effects; blue
curve Pot1, red curve Pot2 and black curve Pot3
87
4.7 A Verilog-A resistive potentiometer model
One of the advantages of using Qucs subcircuits, and indeed EDD models, is that
they allow fast interactive prototyping of new models. Once a new model is tested
and functioning satisfactorily it can often be easily translated into Verilog-A code
for compiling into C++ code, using the ADMS compiler, and finally compiled and
linked with the main Qucs software. When prototyping new models it is advisable
to use, whenever possible, circuit elements/structures that can be easily transposed
to Verilog-A statements. The Verilog-A code listed in the next section is based
directly on the Qucs subcircuit model of the potentiometer. In general there is a
one-to-one correspondence between the different sections of the subcircuit model
and the Verilog-A code. However, for completeness the Verilog-A code also includes
white noise statements to account for resistor noise4 . Overall the subcircuit model
and the Verilog-A code give the same performance except that the Verilog-A code
appears to simulate much faster. This is not surprising considering it comprises
compiled and linked machine code rather than being a netlist which is interpreted
during circuit simulation.
4
The resistors comprising the potentiometer subcircuit have thermal noise built-in as a standard
component feature.
88
//
‘define a t t r ( txt ) (∗ txt ∗)
//
parameter r e a l R pot = 1 e4 from [ 1 e−6 : i n f ]
‘ a t t r ( i n f o=”nominal d e v i c e r e s i s t a n c e ” u n i t = ”Ohm” ) ;
parameter r e a l R o t a t i o n = 120 from [ 0 : i n f ]
‘ a t t r ( i n f o=” s h a f t / w i p e r arm r o t a t i o n ” u n i t = ” d e g r e e s ” ) ;
parameter r e a l T a p e r C o e f f = 0 from [ 0 : i n f ]
‘ a t t r ( i n f o=” r e s i s t i v e law t a p e r c o e f f i c i e n t ” ) ;
parameter integer LEVEL = 1 from [ 1 : 3 ]
‘ a t t r ( i n f o=” d e v i c e t y p e s e l e c t o r ” ) ;
parameter r e a l Max Rotation = 2 4 0 . 0 from [ 0 : i n f ]
‘ a t t r ( i n f o=”maximum s h a f t / w i p e r r o t a t i o n ” u n i t = ” d e g r e e s ” ) ;
parameter r e a l Conformity = 0 . 2 from [− i n f : i n f ]
‘ a t t r ( i n f o=” c o n f o r m i t y e r r o r ” u n i t = ”%” ) ;
parameter r e a l L i n e a r i t y = 0 . 2 from [− i n f : i n f ]
‘ a t t r ( i n f o=” l i n e a r i t y e r r o r ” u n i t = ”%” ) ;
parameter r e a l C o n t a c t R e s = 1 from [ 1 e−6 : i n f ]
‘ a t t r ( i n f o=”w i p e r arm c o n t a c t r e s i s t a n c e ” u n i t = ”Ohm” ) ;
parameter r e a l Temp Coeff = 100 from [ 0 : i n f ]
‘ a t t r ( i n f o=” r e s i s t a n c e t e m p e r a t u r e c o e f f i c i e n t ” u n i t = ”PPM/ C e l s i u s ” ) ;
parameter r e a l Tnom = 2 6 . 8 5 from [ −273 : i n f ]
‘ a t t r ( i n f o=”p a r a m e t e r measurement t e m p e r a t u r e ” u n i t = ” C e l s i u s ” ) ;
//
r e a l Rad Angle , R pot Temp , Rtop , Rbot , T p c o e f f , Rconta ct ;
r e a l RTB, RTT, e r r o r t e r m ;
real four kt ;
//
a n a l o g begin
//
// Model e q u a t i o n s
//
Rconta ct=C o n t a c t R e s+1e −6;
Rad Angle=R o t a t i o n ∗ ‘M PI / 1 8 0 ;
R pot Temp=(R pot+1e −6)∗(1+ Temp Coeff ∗ ( $ t e m p e r a t u r e −Tnom) / 1 e6 ) ;
T p c o e f f=T a p e r C o e f f +( Conformity+L i n e a r i t y ∗ s i n ( Rad Angle ) ) / 1 0 0 ;
e r r o r t e r m =(1+( Conformity+L i n e a r i t y ∗ s i n ( Rad Angle ) ) / 1 0 0 ) ;
//
case (LEVEL)
2 : begin
RTB=R pot Temp ∗ T p c o e f f ;
RTT=1e15 ;
Rtop =(1.000001 −( R o t a t i o n / ( Max Rotation+1e − 2 0 ) ) )∗ R pot Temp ;
Rbot =(0.000001+( R o t a t i o n / ( Max Rotation+1e − 2 0 ) ) )∗ R pot Temp ;
end
3 : begin
RTB=1e15 ;
RTT=R pot Temp ∗ T p c o e f f ;
Rtop =(1.000001 −( R o t a t i o n / ( Max Rotation+1e − 2 0 ) ) )∗ R pot Temp ;
Rbot =(0.000001+( R o t a t i o n / ( Max Rotation+1e − 2 0 ) ) )∗ R pot Temp ;
end
default : begin
RTB=1e15 ;
RTT=1e15 ;
Rtop =(1.000001 −( R o t a t i o n / ( Max Rotation+1e − 2 0 ) ) )∗ R pot Temp ∗ e r r o r t e r m ;
Rbot =(0.000001+( R o t a t i o n / ( Max Rotation+1e − 2 0 ) ) )∗ R pot Temp ∗ e r r o r t e r m ;
end
endcase
//
i f ( T a p e r C o e f f == 0 . 0 )
89
begin
RTB=1e15 ;
RTT=1e15 ;
Rtop =(1.000001 −( R o t a t i o n / ( Max Rotation+1e − 2 0 ) ) )∗ R pot Temp ∗ e r r o r t e r m ;
Rbot =(0.000001+( R o t a t i o n / ( Max Rotation+1e − 2 0 ) ) )∗ R pot Temp ∗ e r r o r t e r m ;
end
//
// Macromodel
//
I (T, n1 ) <+ V(T, n1 ) / Rtop ;
I (T, n1 ) <+ V(T, n1 ) /RTT;
I (B, n1 ) <+ V(B, n1 ) / Rbot ;
I (B, n1 ) <+ V(B, n1 ) /RTB;
I (M, n1 ) <+ V(M, n1 ) / Rc ontact ;
//
// Noise c o n t r i b u t i o n s
//
f o u r k t =4.0∗ ‘P K ∗ $ t e m p e r a t u r e ;
I (T, n1 ) <+ w h i t e n o i s e ( f o u r k t /Rtop , ”t h e r m a l ” ) ;
I (T, n1 ) <+ w h i t e n o i s e ( f o u r k t /RTT, ”t h e r m a l ” ) ;
I (B, n1 ) <+ w h i t e n o i s e ( f o u r k t /Rbot , ”t h e r m a l ” ) ;
I (B, n1 ) <+ w h i t e n o i s e ( f o u r k t /RTB, ”t h e r m a l ” ) ;
I (M, n1 ) <+ w h i t e n o i s e ( f o u r k t / Rcontact , ”t h e r m a l ” ) ;
//
end
endmodule
The ADMS syntax is a subset of Verilog-A. Allowed language structures are out-
lined in a SYNTAX-SUPPORTED file which can be downloaded from http:
//mot-adms.sourceforge.net. Recent news concerning the ADMS Verilog-A
compiler can also be found on the ADMS Website Wiki.
4.9 End note
Resistive potentiometers are fundamental components in electronic system design.
They deserve due attention when forming part of a circuit simulation package.
This report introduces a number of basic properties of potentiometric devices and
outlines how they can be accurately and efficiently simulated by Qucs. While writ-
ing this report I have tried to demonstrate how practical resistive potentiometer
models can be constructed from a set of basic concepts. Qucs subcircuits and com-
ponent defining equations form the fundamental tools for modelling a potentiome-
ter. Both encourage interactive model development and the subsequent conversion
of their properties into Verilog-A code. My thanks to Stefan Jahn for all his help
and encouragement during the period I have been working on the potentiometer
model and writing this report.
90
5 Verilog-A compact device models
for GaAs MESFETs
5.1 Introduction
A previous Qucs Report1 described a MESFET model based on an equation defined
device (EDD) representation of the level 1 Curtice model. This model evolved as
a test example during the initial Qucs EDD development phase. Today the EDD
model is popular amongst Qucs users as either a powerful non-linear component in
it’s own right or as the basis of a component prototyping system for constructing
compact Verilog-A device models, translated with ADMS to C++ code, compiled
to object code and finally linked to the main body of the Qucs program code.
Over the last year the Qucs development team has invested a significant amount
of time improving both EDD prototyping and Verilog-A compact device/circuit
model development, making the development process more transparent to anyone
interested in trying their hand at model construction. One branch of the current
Qucs modelling activities is concentrating on adding new models which fill in some
of the gaps in the Qucs released model lists. One such model in this category is
the GaAs MESFET. This report outlines the background and mathematical basis
for a number of MESFET models. These have been coded in Verilog-A and tested
using recent Qucs CVS code. They will be included in the next full release of Qucs.
91
have contributed improvements to the basic model, including for example Statz
et. al. (Raytheon)3 and TriQuint Semiconductor Inc.4 . These models form the
basis of the Qucs MESFET model described in this report.
92
Name Symbol Description Unit Default
Eg Eg bandgap voltage V 1.11
M M grading coefficient 0.5
Cgs Cgs zero-bias gate-source capacitance F 0.2p
Cgd Cgd zero-bias gate-drain capacitance F 1p
Cds Cds zero-bias drain-source capacitance F 1p
Betatc Betatc Beta temperature coefficient %/C 0
Alphatc Alphatc Alpha temperature coefficient %/C 0
Gammatc Gammatc Gamma temperature coefficient %/C 0
Ng Ng subthreshold slope gate parameter 2.65
Nd Nd subthreshold drain pull parameter −0.19
ILEVELS ILEV ELS gate-source current equation selector 3
ILEVELD ILEV ELD drain-source current equation selector 3
QLEVELS QLEV ELS gate-source charge equation selector 2
QLEVELD QLEV ELS gate-source charge equation selector 2
QLEVELDS QLEV ELDS drain-source charge equation selector 2
Vtotc V totc Vto temperature coefficient V/C 0
Rg Rg gate series resistance Ω 5.1
Rd Rd drain series resistance Ω 1.3
Rs Rs source series resistance Ω 1.3
Rgtc Rgtc gate series resistance tempera- 1/C 0
ture coefficient
Rdtc Rdtc drain series resistance temper- 1/C 0
ature coefficient
Rstc Rstc source series resistance tem- 1/C 0
perature coefficient
Ibv Ibv gate reverse breakdown current A 1m
Rf Rf forward bias slope resistance Ω 10
R1 R1 breakdown slope resistance Ω 10
Af Af Flicker noise exponent 1.0
Kf Kf flicker noise coefficient 0.0
Gdsnoi Gdnsnoi shot noise coefficient 1.0
◦
Tnom T nom device parameter measure- C 26.85
ment temperature
◦
Temp T emp device circuit temperature C 26.85
93
LEVEL MESFET model type
1 Quadratic Curtice - basic form
2 Quadratic Curtice - basic plus subthreshold properties
3 Statz et. al. (Raytheon) - same as SPICE 3f5
4 TriQuint - TOM 1 model
5 TriQuint - TOM 2 model
charge equation models the common default models are the ones listed in Table 5.5.
94
Model LEVEL ILEVELS ILEVELD QLEVELS QLEVELD QLEVELDS
Curtice L1 1 0 to 4 0 to 4 0 to 2 0 to 2 0 to 2
Curtice (Adv.) 2 0 to 4 0 to 4 0 to 2 0 to 2 0 to 2
Statz-Raytheon 3 4 4 3 3 2
TOM 1 4 4 4 3 3 2
TOM 2 5 4 4 3 3 2
95
• ILEVELS = 3: if (V (b1) > V bi)
V (b1)
Igs = Is T 2 · limexp − 1.0 + GM IN · V (b1) (5.5)
N ·V t T2
else Igs2 = 0
if (V (b1) == −Bv)
Igs3 = −Ibv (5.8)
else Igs3 = 0
if (V (b1) < −Bv)
−(Bv + V (b1)) Bv
Igs4 = −Area · Is T 2 · limexp − 1.0 +
V t T2 V t T2
(5.9)
else Igs4 = 0
Igs = Igs1 + Igs2 + Igs3 + Igs4 (5.10)
96
D 1
2
C g
Idd 6b D
2ri
a
nnR3b 1
=8d t
a
e
G D
r
o
S
di
a
un
M
r
cE
eSF T1
b7 =
n=1bD4Q
ateR3=gCQ
G g 5 I1
=
b 3d
s
12gsnIbR1b4=innR4b2=9Q3
C
d
=
Qn
x
s
b
W
h
(
I
b
(n
=
b
e
)
1
<
2
3
4
)
5
<e
r
a
g
+
I
A
+n
h
s
d
t
r
e;
(
Q
am
*
Vgb
s)
;r
5s
e
/ i
n
;
I
b6d b
d R
sSource 897Vb7/R(89)ds
Figure 5.1: Qucs MESFET symbol and large signal equivalent circuit
Qgs = 0 (5.11)
97
Where,
V bi T 2 n 1−M
o
F1 = · 1 − (1 − F c) , (5.16)
1−M
F 2 = (1 − F c)1+M , (5.17)
and
F 3 = 1 − F c · (1 + M ) . (5.18)
Qds = 0 (5.19)
98
V
U1
g
s
= d
Is
M
L
B
A
CE
t
e
l
gS
V
o
p
m
sa
hF
b
= T
1
=
L
8
.
3
e
2
d
e5
0
1 d
D c
C V
U1 2
=
s id
ms
ul
t
a io n
)A(dIs0.010246Vds(V)810Rd=51.3TsSSPPyW rorp1e=Ds10l=CipnVedtsrTsSSPPyW
atawim t5ipnV112gsr
rtawior2pe=am
m
eSs0l=W
Figure 5.2: Curtice LEVEL 1 DC test circuit and Ids-Vds characteristics
99
tTsSSPPyW V
1
=
Ug s tId
s
M
L
B
A
CtE
e
l
gV
o
p
msS
a
h b
=F
L
3
d =
8
.
e
2T 1
05
1 V
2
d
s
=
U
wtaiaorrp1e=m m ein6V2dsrTsSSPPyW
pSs1l=W pDs0l=C3in4V1e1gsrR0d.=D51Cc.3e1simulation
wtaiaorr2pe=m m
A)(dIs0.0132.52Vg1s.5(V)10.50A)(dIs1e58967032.52Vg1s.5(V)10.50 1 e 3
4
Figure 5.3: Curtice LEVEL 1 DC test circuit and Ids-Vgs characteristics
100
Id
s
E
M
SF
E
T1 2
V
5
=
V
U1
=g
s
VVI
g L
V
t
o
=
e
a
B
l
h
pE
=
L
8
1
'
.
3
e
'
2
=
.3
2
5 U
a
r
a
P t
m
ee
ra
Pra
m
et
e
r A
a
m
L
C
d
g
s
C
db
d
a
=
0
2
e
=
.
1
1
e
'
=0
0
5
.
2
1
'
2
e
w
s
W
1
S
i
m
=Dp
C
1 w
s
W
S
ie
2
mp
W
1
=
S I
E
L
V
g
=
R
dE
L
S
D
5
1
.
3
13
=
p
e
y
T
a
r
a
P
t
t
S
o
pm
=l
i
n
g
=
V
0
6
.
1sy
T
a
P
t
Sp
e
r
a
o
pl
i
n
m
e
=
T
0
1
t
'
=m
p s
=
R
e
m
T
c.
p
e
=
T
i
mm
p
l
t
a
ui
o
n
01
.i
n
Pt
s2
1
= Pi
n6
t
s
= d
D
C
1s
)
A1
e
'
1
e
'3
4
5
(
g
I1
e
'6
7
8
1
e
'
1
1
e9
0
'0
.6
0.6
50
.70
.7
5
V0
8
.
(
g
s
V 0
8
.
)50
9
.0
9
.51
Figure 5.4: Curtice LEVEL 1 DC test circuit and Ig-Vgs characteristics
101
dD iw
li1am
csSPC
sW P
N
Z
tr1em
m1
u 5m u0 =
O
a1
h
mX
11
V
0
=
U
E
M
S
ip1etronA
L
V
t
oF
< E
1
T
=
L
8
.X
2 V
U2
=Sd
ps
a rmt
eP
N
Z
r2
2
m
u
=
O
h
0
5
m
e
a
B
l
h
p
m
L
C
g
s
=
d
E
I
L
Vb 13
e
2
5
d
0
=
1
<
.
e
3
=
L
S2 Ti
s
P
y
t
S
Pm
1
p
a
r
o
i
neu
=l
0
si
g
k
H
G
3
5o
n
z
1
TSPytaoprine==Ss25lPi0n6VdsQE
L
5
g
=
R
d
sV .D
L
S
1
32
=
][S1,1.frequncy][S2,1.frequncy
]S
2[1,frequnc0y.20.40.6]S 2[1, frequnc5y1015
Figure 5.5: Curtice LEVEL 1 S parameter test circuit and characteristics
102
5.9 Curtice hyperbolic tangent model with
subthreshold modification: LEVEL = 2
Ids = Beta T 2 · V f 2 · {1 + Lambda · V (b3)} · tanh(Alpha · V (b3)) (5.23)
Where
1
Vf = · ln {1 + exp (Ah · (V (b1) − V to T 2))} (5.24)
Ah
and
1
Ah = (5.25)
2 · N sc · V t T 2
When V (b2) > V to T 2, V f =⇒ V (b2) − V to T 2. Otherwise, V f approaches zero
asymptotically. This modification to the basic Curtice model provides an improved
match to channel gradual pinch-off and MESFET subthreshold conduction.
103
Id
s
E
F
M
SE
T
1 V2
d
=s
V
U1
g
sV
=
V E
L
V
L
1
t
o
=
$
3
e
a
B
l
h
p2
=
8
.
3
e
$
2
2
5
=
. U
V
a
Pr
a
m
et
e
rPar
a
m
et
e
r A
b
d
a
m
L
1
s
c
=
N
C
d
0
g
1
s
=0
a
=
2
e
$
.
2
1
e
$0
5
.
2
1
w
s
W
S
i
me
p
1
W
=
S2w
s
W
S
ime
p
2
D
C
1
= C
d
5
g
=
.
R
d
3
1
s
=1dc
si
m
ul
i
t
ao
n
T
p
y
a
r
P
t
S
ol
i
e
n
a
m
=
V
1
t
p
=d
sT
y
a
P
t
Sp
r
ol
i
e
n
a
m
=
V
3
t
$
0
p
=g
s .
R DC
1
in
P6P
t
s
= in
4
t
s
=100
1
.
0
)
A
(0
1
. )
A
(3
1
e
$
4
1
5
e
$
6
s
d
I0 I1 s
d1
7
e
$
8
9
1
e
$
0
1
3
$2
$.52
$
$
g
V1
5
.
(
)
s1
$$
V V0
5
.0 e
$
$32
5
$
.2
$1
$
g
s5
.
(
)
V1
$0
5
$
.0
Figure 5.6: Curtice LEVEL 2 DC test circuit and Ids-Vgs characteristics illustrat-
ing subthreshold conduction modification
104
5.10 Statz et. al. (Raytheon) model: LEVEL = 3
if (V (b1) − V to T 2) > 0
3
if (0 < V (b3)) and (V (b3) < )
Alpha
begin
3
Alpha · V (b3)
1− 1−
3
H1 = (5.26)
1 + B · (V (b1) − V to T 2)
Ids = Beta T 2 · {1 + Lambda · V (b3)} · (V (b1) − V to T 2)2 · H1 (5.27)
end
3
if (V (b3) > )
Alpha
Beta T 2 · {1 + Lambda · V (b3)} · (V (b1) − V to T 2)2
Ids = (5.28)
1 + B · (V (b1) − V to T 2)
else Ids = 0.
n p o
V ef f 1 = 0.5 · V (b4) + V (b6) + (V (b6) − V (b4))2 + V delta12 (5.30)
n p o
V new = 0.5 · V ef f 1 + V to T 2 + (V ef f 1 − V to T 2)2 + V delta22 (5.31)
105
Id
s
E
F
M
SE
T
1 V2
d
=s
1
V
g
sV
=
U
V E
L
V
L
1
t
o
=
+
e
a
B
l
h
p3
=
8
.
3
3
e
+
2
2
5
=
. U
V
A
b
d
a
m
L
9
1
e
=
+
B
m
a
x
=
V
C
d
g0
a
=
0
5
.
2
e
+0
5
.
2
1c
d
C
Di
s
m
1l
i
t
a
uon
0
)
A
(
s
d0
1
. 1
s
=
C
d
5
g
=
.
R
d
12
1
e
+
1
3a
P
s
wr
a
m
e
pt
e
er
P
sa
wr
a
m
e
e
pt
e
r
I0 R s
=
.TW
S
i
m
p
y
a
r
P1
C
=
D
l
i
e
a
m
=1
n
d
s
VS
T
y
PW
i
m
p
a
r2
W
1
=
S
l
i
e
n
a
m
=
Vg
s
0 2
4
V6
d
(
)
s80
1
V P t
S
o0
t
1
p
=
i
t
n
s0
1
1
=PSt
o5
t
+
0
p
=
in
2
1
t
s
=
Figure 5.7: Statz et. al. LEVEL 3 DC test circuit and Ids-Vds characteristics
6
D. Divehar, Comments on GaAs FET device and circuit simulation in SPICE,IEEE Transac-
tions on Electronic Devices, Vol. ED-34, pp 2564-2565, Dec. 1987
106
Id
s
E
F
M
SE
T
1 V2
d
s
=
1
V
=
Ug
sV
V E
L
V
L
1
t
o
=
$
3
e
a
B
l
h
p3
=
8
.
3
e
$
2
2
5
=
. UV
a
r
a
Pt
m
ee
rPa
r
a
mt
e
erA
b
d
a
m
L
9
1
e
=
$
B
m
a
x
=
V
C
d
g0
a
=
0
5
.
2
e
$0
5
.
2
1
e
w
s
W
1
S
i
m
=
Sp
W
2 w
s
W
S
ie
p
2
D
C
m
=1 1
s
=
C
d
5
g
=
.
R
d
3
12
1
e
$
1
T
p
e
y
a
r
a
m
P
t
t
S
o
p
=l
i
n
d
=
V
1sT
y
a
P
t
Sl
i
p
e
r
a
m
=
3
t
$
0
o
p
=n
g
s
V s
=
.
R c
d
D
Ci
m
s
1l
i
t
a
uo
n
i
t
n
s
P6
=P i
t
n
s4
1
=1 0
0
1
.
0
)
A
(0
1
. )
A
(3
e
$
4
1
5
e
$
6
s
d
I0 I1 s
d1
7
e
$
8
9
1
e
$
0
1
3
$2
$ 2
.5
$1
$
g
s
V5
.
(
)1
$0
5
$
.
V V0 e
$
$32
5
$
.2
$1
5
$
.
(
g
s
V1
$
)0
5
$
.0
Figure 5.8: Statz et. al. LEVEL 3 DC test circuit and Ids-Vgs characteristics
107
Id
s
E
M
SF
E
T1V2
5
=
V
U1
=g
s
V IgV L
V
t
o
=
e
a
B
l
h
pE
3
=
L
8
1
'
.
3
e
'
2
=
.3
2
5 U
a
r
a
P t
m
ee
r a
r
Pa
m
et
e
r A
a
m
L
1
=
B
m
a
V
C
d
gb
d
a
=
9
e
'
0
x
=
.
2
e0
0
5
.
5
2
1
'
e
w
s
W
1
S
i
m
=Dp
C
1 e
w
s
W
2
S
i
mp
W
1
=
S s
C
d
I
E
L
V1
1
e
=
'
E
L
S
D2
3
= il
i
t
p
e
y
T
a
r
a
P
t
t
S
o
pm
=l
i
n
g
=
V
0
6
.
1s p
e
y
T
a
r
a
P
t
S
o
pl
i
n
m
e
=
T
0
1
t
'
=m
p g
=
R
d
s
=
R5
1
.
3
1
. c
d
s
D
C
1m
uao
n
01
.i
n
Pt
s2
1
= i
n
P6
t
s
= e
m
Tp
e
=
Tm
p
)
A1
e
'
1
e
'3
4
5
(
g
I1
e
'6
7
8
1
e
'
1
1
e9
0
'0
.6
0.6
50
.70
.7
5
V0
8
.
(
g
s
V 0
8
.
)50
9
.0
9
.51
Figure 5.9: Statz et. al. LEVEL 3 DC test circuit and Ig-Vgs characteristics
108
dD iw
li1am
csSPC
sW P
N
Z
tr1em
m1
u 5m u0 =
O
a1
h
mX
11
V
0
=
U
M
ip1etronALt E
oV S F
< E
L
.T
=
8 1
3 X
2
2
V
=
U
Sd
s
parmt
e2
P
m
u
N
0
5
Z
r2
=
O
h
m
V
CB
Le
d l
g
d pm
e
s a
h=b
t a
1d
1e
2
2 0
=
e
<5
.32s
T
S
Pi
m
1
P
p
e
y
t
a
r
o
i
n u
=
sl
g
k
G
0
3
5i
o
n
H
z
1
TSPytaoprine==Ss25lPi0n6VdsQ LgdsLE=EV5V.31LLSD
IR =S3=2
][S1,1.26frequncy][S2,1.3frequncy
]S[21,frequnc0y.50.10.15]S 2[1, frequn2cy468
Figure 5.10: Statz et. al. LEVEL 3 S parameter test circuit and characteristics
109
5.11 TriQuint Semiconductor TOM 1 model:
LEVEL = 4
if (V (b1) − V to T 2) > 0
3
if (0 < V (b3)) and (V (b3) < )
Alpha
begin
( 3 )
n
Qp
o Alpha · V (b3)
Ids1 = Beta T 2 · (V (b1) − V to T 2) · 1− 1−
3
(5.36)
Ids1 · {1 + Lambda · V (b3)}
Ids = (5.37)
1 + Delta · V (b3) · Ids1
end
3
if (V (b3) > )
Alpha
110
Id
s
E
F
M
SE
T
1 2
V
d
=sc
s
di
m
ul
i
t
ao
n
1
V
=
Ug
sV
V E
L
V
L
1
t
o
=
+
e
a
B
l
h
p4
=
8
.
3
3
e
+
2
2
=
.5 U
V C
1
D
A
b
d
a
m
L
1
e
=
+
B
2
p
.
Q
l
t
e
a
=0
a
=
9
0
10
5
.P
sa
r
a
e
wt
m
e
pe
rP
sa
r
a
e
wt
m
e
pe
r
)
A
(0
0
1
. D
m
x
V
d
l
t
e
a
V
a
m
m.
0
5
0
1
=
2
0
a3
.
2
0
1
5S
TW
1
i
m
=
D
p
e
yC
1
l
i
n S
T
yW
2
i
m
=
S
p
eW
1
l
i
n
Is
d0 G
C
d
0
g
=
1
s
C
d
=
E
Q
L
V
=
2
e
+
.
2
1
e
+
E
L
S
.
2
1
3
=P
S
Pa
r
a
m
t
t
o
p
=
i
t
n
sd
=
V
0
1
0
1
=s
1P
S
Pa
r
a
m
t
t
o
p
=
i
t
n
sg
=
V
5
+
0
2
1
=s
0 24
d
V6
(
)
s
VR8 0
15
g
=
.
R
d
1
s
=
.D
1
3
d
D
Ci
c
m
s
1l
a
ui
t
o
n I
d
s
E
MF
SE
T
1 V2
d
=s
E4 UV
Figure 5.11: TOM1 LEVEL 4 DC test circuit and Ids-Vds characteristics
V
U1
g
sV
=
V L
t
e
B
l
AV
L
1
o
=
$
3
a
h
p
==
8
.
3
e
$
2
2
5
.
a
P
wr
a
m
e
e
pt
e
rP
war
a
m
e
e
pta
L
=
B
p
e
r
Q
D
eb
d
m
9
1
e
$
2
0
.
l
t
a
=0
a
=
.
1
.0
5
s
W
S
i
m
T
p
y1
W
=
S
l
i
e
n2s
W
S
i
T
ym
p2
D
C
1
=
l
i
e
n m
V
d
V
a
Gx
l
t
e
a
m
m0
5
0
3
1
=
.
2
2
0
a
=
.0
1
5
a
r
P
t
S
oa
m
=
V
1
t
p
=
ind
s
6P
t
s a
P
t
Sr
oa
m
=
V
3
t
$
0
p
=
in
4
t
sg
s
1C
g
C
d
Q
Ld
0
=
1
s
=
E
E
V2
1
e
$
.
2
1
e
$
=
L
S2
3
P= = g
R
d
s5
1
=
.
3
1
=
.D
0
0
.
1
e1
3
)
A
(0
0
1
.
s R)
A
(
s1
e$
4
5
$
6
d
I0 d1
e
I1
1
e
17
$
8
9
$
0
3
$2
$.52
$
$
g
V1
5
.
(
)
s
V1
$$0
5
.0 e
$3
$2
5
$
.$2
$
g
V1
5
.
(
)
s
V1
$0
5
$
.0
Figure 5.12: TOM1 LEVEL 4 DC test circuit and Ids-Vgs characteristics
111
Id
sV 2 E
M
S
E
L
V
t
o
=
V
e
a
BF
E
T
4
=
L
8
1
'
.
3
e
'1
3
V
U1
=g
s
V I
g 5
=
U l
h
p
A
a
m
L
1
e
=
B
2
p
Q2
=
.
b
d
a
=
9
'
0
.2
5
0
0
5
.
a
r
a t
m
ee
rara
m
et
e
r il
i
t D
l
t
e
a
m
V
d
l
e
V1
=
.
0
x
1
t
a
=
25
0
3
.
2
P
e
w
s
W
1
S
i
mDp
C
1 P
w
s
W
S
ie
2
mp
W
1 d
Dc
s
C
1m
uao
n a
m
G
C
d
g
=
s
C
d
=m
a
=
0
2
e
.
1
1
e
'0
0
1
5
.
2
1
'
2
=
p
e
y
T
a
r
a
P
t
t
Sm
=l
i
n
g
=
V
0
6
.
1sy
T
a
P
t
Sp
e
r
a=
S
l
i
n
m
e
=
T
0
1
t
'm
p I
E
L
V
E
Q
LE
L
S
D
E
V
L
S3
=
2
=
D
3
01o
p
i
n
Pt
s2
1
= Po
p
i
n=
6
t
s
= 5
g
=
R
d
1
s
=
R
e
m1
.
3
.
p
em
p
1
e
'.
3 T=
T
)
A
(1
e
'4
5
6
Ig
1
e
'
1
e
'7
8
9
1
1
e0
'0
.6
0.6
50
.70
.7
50
8
.
(
g
s 0
8
.
)50
9
.09
5
.1
VV
Figure 5.13: TOM1 LEVEL 4 DC test circuit and Ig-Vgs characteristics
112
dD iw
li1am
csSPC
sW P
N
Z 1
u
tr1em
m 5m 0 =
O1hm X
ip1etron TS
u a 1
1
V
0
=
U X
2
2
V
=
U d
s
p
a
rm
eZ
tP
N2
u
rm
5=
02
OhM
m
A
Q
VL
B
L
Dt
e
e l E
o
pV
m=S
a
h
taF
=
b
x.L
3
dE
1.T
=
8
e
2 1
4
0
=
55
= s
y
S
Pi
P
tl
m
u
1
p
e
=
a
r
o
i
n
si
o
g
k
H
z
G
0
3
5
1n G
N
C
N d a
s
g
d m
c
d
= l
=
2
0 1
06 2
a
.5 0
=
e
=
2.3
215
TSPytaoprine=Ss25lPi0n6Vds Q LgdsLE=EV5V.31LLSD
IR =S3=2
][S1, frequncy ]S [2, frequncy
][S21, 0.50.10.15]S 1
,
2
[ 0
5
. 0 .1 0.15
frequncy frequncy
Figure 5.14: TOM1 LEVEL 4 S parameter test circuit and characteristics
113
5.12 TriQuint Semiconductor TOM 2 model:
LEVEL = 5
if (V (b1) − V to T 2) > 0
begin
N st = N g + N d · V (b3) (5.40)
if (N st < 1.0)N st = 1.0
V st = N st · V t T 2 (5.41)
V (b1) − V to T 2 + Gamma T 2 · V (b3)
V g = Qp · V st · ln exp +1 (5.42)
Qp · V st
Al = Alpha T 2 · V (b3) (5.43)
Al
Fd = √ (5.44)
1 + Al · Al
Ids1 = Beta T 2 · V g Qp · F d (5.45)
1 + Lambda · V (b3)
Ids = Ids1 · (5.46)
1 + Delta · V (b3) · Ids1
end
else Ids = 0
114
Id
s
E
F
M
SE
T
1 2
V
d
=sc
s
di
m
ul
i
t
ao
n
1
V
g
sV
=
U
V E
L
V
L
1
t
o
=
+
e
a
B
l
h
p5
=
8
.
3
3
e
+
2
2
5
=
. U
V C
1
D
0
0
2 V
. A
b
d
a
m
L
9
1
e
=
+
B
2
p
.
Q
l
t
e
a
=0
a
=
0
10
5
.P
sa
r
a
e
wt
m
e
pe
rP
sa
r
a
e
wt
m
e
pe
r
)
A
(0
0
1
. D
m
x
d
l
t
e
a
V
a
m
m.
0
5
0
1
=
.
2
0
a3
2
0
1
5S
TW
1
i
m
=
D
p
e
yC
1
l
i
n S
T
yW
2
i
m
=
S
p
eW
1
l
i
n
Is
d0 G
C
d
0
g
=
1
s
C
d
=
2
g
.
N
d
1
=
2
e
+
.
2
1
e
+
6
5
9
1
.
2
1P
S
Pa
r
a
m
t
t
o
p
=
i
t
n
sd
=
V
0
1
0
1
=s
1P
S
Pa
r
a
m
t
t
o
p
=
i
t
n
sg
=
V
5
+
0
2
1
=s
0 2
4
V6
d
(
s
V8
)Q0
1=
+
E
L
V
5
g
=
.
Re
+
E
=
L
S
D
13
d
1
s
=
.
R3
Figure 5.15: TOM2 LEVEL 5 DC test circuit and Ids-Vds characteristics
115
ci
ml
t
a
ui
o
n I
d
s E
F
M
S
E
L
V
t
o
=
+
V
e
a
BE
T
1
5
=
L
8
1
.
3
3
e
+
d
s
C
1
D 1
V
=
Ug
s
V 2
V
=
Ud
s
Vl
h
p
A
b
a
m
L
1
e
=
B
2
p2
2
=
.
d
0
a
=
9
+
0
.5
0
5
.
Q
l
t
e
a
D
m
x
V
d
l
t
e1
=
.
0
5
0
1
a
=
23
.
2
a
r
a
P
e
w
s
W
1t
m
e
pe
r a
r
a
P
e
w
s
W
2t
m
e
pe
r V
a
m
m
G
C
d
g
=
s
C
d
=0
a
=
0
2
e
.
1
1
e
+0
1
5
.
2
1
+
2
S
i
m
=
S
T
p
e
y
a
r
a
m
P
t
tW
2
l
i
n
d
=
V
1s S
i
m
=
D
T
p
e
y
a
r
a
m
P
t
tC
1
l
i
n
g
=
V
3
+s 1
g
N
d
0
=
+
E
Q
L
V9
1
.
E
L
S3
=
00
2 S
o
p
=
i
t
n
s
P6
= S
o
p
=
i
t
n
s
P0
4
1
= 5
g
=
R
d
1
s
=
RD
1
.
3
.
)
A. 0
1
1
)
A0
1
.
3
e
+
4
5
e
+
0
(
s
d0
1
.
I0 I1 (
s
1
d
16
7
e
+
8
9
e
+
3
+2
+ 2
.5
+1
+
g
s
V5
.
(
)1
+0
5
+
.
V V0e0
1
+
3
++2
5
.2
+1
5
+
.
(
)
g
s
V1
+0
5
+
.0
Figure 5.16: TOM2 LEVEL 5 DC test circuit and Ids-Vgs characteristics
116
Id
sV 2 E
M
S
E
L
V
t
o
=
V
e
a
BF
E
T
5
=
L
8
1
'
.
3
e
'1
3
V
U1
=g
s
V I
g 5
=
U l
h
p
A
a
m
L
1
e
=
B
2
p
Q2
=
.
b
d
a
=
9
'
1
.2
5
0
0
5
.
a
r
a t
m
ee
rara
m
et
e
r il
i
t D
l
t
e
a
m
V
d
l
e
V0
1
=
.
x
1
t
a
=
25
0
3
.
2
P
e
w
s
W
1
S
i
mDp
C
1 P
w
s
W
S
ie
2
mp
W
1 d
Dc
s
C
1m
uao
n a
m
G
C
d
g
=
s
C
d
=m
a
=
0
2
e
.
1
1
e
'0
0
1
5
.
2
1
'
2
=
p
e
y
T
a
r
a
P
t
t
Sm
=l
i
n
g
=
V
0
6
.
1sy
T
a
P
t
Sp
e
r
a=
S
l
i
n
m
e
=
T
0
1
t
'm
p 2
g
N
d
=
'
I
E
L
V6
5
.
0
9
1
E
L
S
D3
=
01o
p
i
n
Pt
s2
1
= Po
p
i
n=
6
t
s
= E
Q
L
5
g
=
R
d
1E
V
L
S
1
.
32
=
D
3
1
e
'.
3
4 s
=
R
e
m
T.
p
e
=
Tm
p
)
A
(1
e
'
Ig
1
e
'5
6
7
1
e
'
18
9
0
1
e
'0
.6
0.6
50
.70
.7
5
V0
8
.
(
g
s
V 0
8
.
)50
9
.09
5
.1
Figure 5.17: TOM2 LEVEL 5 DC test circuit and Ig-Vgs characteristics
117
cdD P
N
Z
iW
lw
ssSPCir1em
ti1am 1
mu 5 m u0 =O1
ahmoX
n 1
1
V
0
=
U X
2
2
V
=
U
S dp s
a r mZ
t
e2
P
m
u
N
0
5
r2
=
O
h
mM
L
t
e
B
l
A
L
Q
e
D
V E
o
pV
mS
a
h
=
taF
<
b
x.L
3
dE
.1
T
5
=
8
e
2
=
10 5
si m1 u l i
o
n
tTSPytaopre==S25lPip0nV1edsr TSPytPaopirne=s03kg5G
H
z
1 d
G
a
s
N
C
g
N
d m
c
d
= l
=
2
0 1
062
a
.=
e
50
3
.
2
<
215
ins6 R I
L
Q E V LS
D3
=
Lds=E5V.31LS=2
g
][S1, frequncy ]S [2, frequncy
][S21, 0.50.10.15]S 1
,
2
[ 0
5
. 0 .1 01
.5
frequncy frequncy
Figure 5.18: TOM2 LEVEL 5 S parameter test circuit and characteristics
118
5.13 Temperature scaling relations
T1=Tnom+273.15;
T2=Temp+273.15;
Tr=T2/T1;
con1=pow(Tr, 1.5);
Rg_T2=Rg*(1+Rgtc*(T2-T1));
Rd_T2=Rd*(1+Rdtc*(T2-T1));
Rs_T2=Rs*(1+Rstc*(T2-T1));
Beta_T2=Area*Beta*pow(1.01, Betatc*(T2-T1));
Vt_T2=$vt;
Eg_T1=Eg-7.02e-4*T1*T1/(1108+T1);
Eg_T2=Eg-7.02e-4*T2*T2/(1108+T2);
Vbi_T2=(Tr*Vbi)-(2*Vt_T2*ln(con1)) - ( Tr*Eg_T1-Eg_T2);
Is_T2=Area*Is*pow( Tr, (Xti/N))*limexp(-(‘P_Q*Eg_T1)*(1-Tr)/(‘P_K*T2));
Cgs_T2=Area*Cgs*(1+M*(400e-6*(T2-T1)-(Vbi_T2-Vbi)/Vbi));
Cgd_T2=Area*Cgd*(1+M*(400e-6*(T2-T1)-(Vbi_T2-Vbi)/Vbi));
Vto_T2=Vto+Vtotc*(T2-T1);
Gamma_T2=Gamma*(1+Gammatc*(T2-T1));
Alpha_T2=Alpha*( pow( 1.01, Alphatc*(T2-T1)));
• Gate noise: Mainly channel noise induced in the gate (via the channel to gate
capacitance) The resulting noise is amplified by the MESFET. The capacitive
coupling causes the gate noise to have a power spectral density proportional
to frequency.
A typical plot of GaAs MESFET Ids noise current is shown in Fig. 5.19, where
119
l[oIgdsncale]FlickernoiseChanelnoiseG
atenoise
1kHz10M Hz1GHz10G HzFrequncy
Figure 5.19: Typical GaAS MESFET Ids noise characteristic
To a first approximation:
s
1 + α + α2
7 8·K ·T
• Channel-thermal-noise-current = · gm · · Gdsnoi
3 1+α
∂Ids
Where gm = ,
∂V gs
V ds 3
and α = 1 − , when V ds < – Linear region of operation
V gs − V to Alpha
3
Or α = 0, when V ds >= – Saturation region of operation
Alpha
s
Kf · IdsAf
• flicker-noise-current =
f
r r
4·K ·T 4·K ·T
• Resister thermal noise equations IRgn = , IRdn = ,
r Rg Rd
4·K ·T
and IRsn =
Rs
120
IG 5 D 1
iateR=3=bR7gg_nn1b4CQg
I d b
6 D
2ri
a
nnR3b 1
=
8 2
I
d
i
2C=g=sn1gdRb4=5innI4b=13dQd
n
=
R
_ t
a
Ge SD r
oda u i n
M
r c Ee F
T
S 1
1 3
I
i
sd
s
n
=
_3
C
d
=
Qn
s
b
W
I( x
b h 4 1
2
3=e) n
b
< r
+ a I
QD2IbSRbo2=9ursceiI4=Rs_nfII(doRbsug589676r)kn<t+=flA g c s
d n
th ;
( Q m
e
b
u
)
s r s
;589*)hT/Ri2(tfedsiln6c;nkoirs6ep(Aw
g
r=Vd4iIc(.b0kbe9873e*7a)r*P̀/<VR6n+d(obKw
Valuesfortherm al6pwrandflicker6pwraeSivenitex. h
t
r
m
1
,
.
*l
a
w
p
"
i
0
6
f
o
u"
t
r
,
k
c
/
g
R
d
6h
e
r
m
)
T
2
,l
"
)
a
+
h
t
e
r
ml
"
)
a
Figure 5.20: Typical GaAS MESFET equivalent circuit illustrating noise current
components
fourkt=4.0*‘P_K*T2;
gm=2*Beta_T2*(V(b1)-Vto_T2)*(1+Lambda*V(b3))*tanh(Alpha_T2*V(b3));
if ( V(b3) < 3/Alpha ) begin An=1-V(b3)/(V(b1)-Vto_T2);
thermal_pwr= (8*‘P_K*T2*gm/3)*((1+An+An*An)/(1+An))*Gdsnoi;
end
else
thermal_pwr=(8*‘P_K*T2*gm/3)*Gdsnoi;
I(b3)<+white_noise(thermal_pwr,"thermal"); flicker_pwr = Kf*pow(Ids,Af);
I(b3)<+flicker_noise(flicker_pwr,1.0,"flicker");
end
I(b7) <+ white_noise(Area*fourkt/Rg_T2, "thermal");
7
Yannis Tsividis, Operation and modeling of the MOS transistor, McGraw-HIll 1987, p340
121
I(b8) <+ white_noise(Area*fourkt/Rd_T2, "thermal");
Id
sV
I(b9) <+ white_noise(Area*fourkt/Rs_T2, "thermal");
2
=
Ud
s
V
2. Typical noise simulation results
1
V
0
=
UI
g M
L
tE
S
F
E
V
L
1E
T
1
=
8
3
V
1
=
UV
ci
s
m
ul
t
ai
o
nV
B
A
a
Lo
=
e
a
l
h
p
b
d
m.
3
3
e
2
2
5
=
.
0
a
=0
5
.a
P
s
wr
a
m
e
pt
e
er
a
ci
s
md
C
D
l
a
u1
i
t
o
n D
K
Gl
t
e
a
=
f
1
e
=
d
s
n
o0
1
.
2
i
1
= S
W
i
m
T
y
a1
C
=
A
l
i
p
e
r
a
m1
n
d
s
C
A
T
y
S
t1
l
p
e
o
=
1
t
a
rg
H
z P
S
t
o
P=
1
t
=
6
p
i
t
n
s
=V
3
P
o
No
p
=
i
t
n
s
=
s
e
yk
H
0
G
2
0
e
sz
)
f8
1
e
(
t
r
q
s
M
A9
1
e
(
n
I
s
d0
1
1
e
I1
1
e
e31
4
e 1
5
eF6
1
e
r
qe
n
u1
7
e
H
c
yz8
1
e 1
e90
1
1
e
Figure 5.21: Typical LEVEL 1 (or 2) GaAS MESFET Ids noise characteristic
122
if ( V(b3) < 3/Alpha )begin
H1=(1-(1-(Alpha*V(b3))/3))/(1+B*(V(b1)-Vto_T2));
gm=2*Beta_T2*(V(b1)-Vto_T2)*(1+Lambda*V(b3))*H1+(Beta_T2*
(1+Lambda*V(b3))*pow((V(b1)-Vto_T2),2))*B*H1/(1+B*(V(b1)-Vto_T2));
An=1-V(b3)/(V(b1)-Vto_T2);
thermal_pwr= (8*‘P_K*T2*gm/3)*((1+An+An*An)/(1+An))*Gdsnoi;
end
else begin
gm=2*Beta_T2*(V(b1)-Vto_T2)*(1+Lambda*V(b3))/(1+B*(V(b1)-Vto_T2))+
(Beta_T2*(1+Lambda*V(b3))*pow((V(b1)-Vto_T2),2))
*B/pow( (1+B*(V(b1)-Vto_T2)),2);
thermal_pwr=(8*‘P_K*T2*gm/3)*Gdsnoi;
end
I(b3) <+ white_noise(thermal_pwr, "thermal");
flicker_pwr = Kf*pow(Ids,Af);
I(b3) <+ flicker_noise(flicker_pwr,1.0, "flicker");
I(b7) <+ white_noise(Area*fourkt/Rg_T2, "thermal");
I(b8) <+ white_noise(Area*fourkt/Rd_T2, "thermal");
I(b9) <+ white_noise(Area*fourkt/Rs_T2, "thermal");
123
Id
sV 2
=d
sa
P
s
wr
a
m
e
pt
e
er
1
V
0
=
UI
g M
LE
S
F
E
V
LE
=T
1
3 U
V S
W
i
m
T
y1
C
=
A
l
i
p
e1
n
3
V
1
=
U
Vc
si
m
ul
i
t
ao
nt
V
B
A
a1
o
=
3
e
a
l
h
p
b
d
m.
e
=
a8
3
2
2
5
.
0
0
=
.a
c
C
5
A
Ti
s
m
1
ll
a
ui
t
o
na
P
S
t
o
Pr
a
m
=
1
t
=
6
p
i
t
n
s
=d
s
V
3
d
DC
1G L
D
Kl
t
e
a
=
f
1
e
=
d
s
n
o01
.
2
i=
1y
S
t
a
Pp
e
o
=
1
t
r
o
p
=
i
t
n
s
=g
H
z
k
H
0
G
2
0z
19 o
Ns
e
ye
s
)
f
(
te
r
q
s
M
A
(1
e
n
I
Is
d 0
1
1
e1
e3
1
e415
e1
F6
e
r
qe
n
c
uy1
7
e
H
z 8
1
e 9
1
e10
1
e
Figure 5.22: Typical LEVEL 3 GaAS MESFET Ids noise characteristic
end
I(b3) <+ white_noise(thermal_pwr, "thermal");
flicker_pwr = Kf*pow(Ids,Af);
I(b3) <+ flicker_noise(flicker_pwr,1.0, "flicker");
I(b7) <+ white_noise(Area*fourkt/Rg_T2, "thermal");
I(b8) <+ white_noise(Area*fourkt/Rd_T2, "thermal");
I(b9) <+ white_noise(Area*fourkt/Rs_T2, "thermal");
124
I
d
s
E
S
MF
E
T
1 2
V
=d
sr
P
a
a
s
e
wt
m
e
pe
r
1
V
=
U0
c
aI
g
i
s
ml
u
ai
t
o
n L
V
t
o
=
V
e
a
B
l
pE
4
=
L
8
1
.
3
3
e
h
2
2
=5 U
V S
W
1
i
m
=
A
T
p
e
yC
1
l
i
n
3
V
=
UC
1
A
T
V
y
S
t1
l
p
e
o
=
1
t
a
rg
H
z
k A
a
m
L
l
t
e
D
f
=
K
d
s.
b
d
0
a
=
0
1
a
=
.
2
1
e
i
1
n
o0
5
.
ci
s
ml
i
t
uo
na
r
a
m
P
S
t
t
o
p
=
i
t
n
s
Pd
=
V
1
6
3
=s
8
1
eP
o
No
p
=
i
t
n
s
=
s
e
yH
0
G
2
0
e
sz G=d
C
1
D a
)
f
(
t
r
q
s
M
A
(9
1
e
n
I
s
d0
1
1
e
I1
1
e
e31
4
e 1
5
eF6
1
e
r
q
e
n
u1
7
e
H
c
y
z 8
1
e19
e1
1
e0
Figure 5.23: Typical LEVEL 4 GaAS MESFET Ids noise characteristic
125
I(b3) <+ white_noise(thermal_pwr, "thermal");
flicker_pwr = Kf*pow(Ids,Af);
I(b3) <+ flicker_noise(flicker_pwr,1.0, "flicker");
I(b7) <+ white_noise(Area*fourkt/Rg_T2, "thermal");
I
d
s
I(b8) <+ white_noise(Area*fourkt/Rd_T2, "thermal");
rt
m
ee
r
I(b9) <+ white_noise(Area*fourkt/Rs_T2, "thermal");
1 E
M
SF
E
1
T
E
5
= 2
V
=
U
Vd
sP
a
a
s
e
wp
2. Typical noise simulation results
V
=
U
30
c
aI
g
i
s
ml
u
ai
t
o
n L
V
t
o
=
V
e
a
B
l
p
A
a
mL
8
1
8
.
3
3
e
8
h
2
2
=
.
b
d
0
a5
0
5 W
1
S
i
m
=
A
p
e
y
T
a
r
a
m
PC
1
l
i
n
d
=
Vs
V
=
UC
1
A
V
y
T
t
S1
l
p
e
o
=
1
t
a
r
o
p
=g
H
z
k
G
H
0z L
l
t
e
D
f
=
K
G
d
s=
0
1
a
=
.
2
1
e
8
i
1
n
o
=.
c
di
s
ml
i
t
u
ao
nt
t
S
o
p
=
i
t
n
s
P1
6
3
=
8
1
e
8P
o
Ni
t
n
s
=
s
e
y2
0
e
s C
1
D
)
f
(
tr
q
s
M9
1
e
8
A
(n
Is
d 0
I1
1
e
8
1
1
e
8
e31
4
e 1
5
eF6
1
e
r
q
e
n
u1
7
e
H
c
y
z 8
1
e19
e1
1
e0
Figure 5.24: Typical LEVEL 5 GaAS MESFET Ids noise characteristic
126
1dDCc1sPZNiaur5m
P
=sw0m
lTSyW O h m 1
XV
1
0
U M L E g
= S 1 0
F n T H s
L
=d
L
=
H
0
1
n
VsVah=bt=dL1.e82SD3e025.33TSsSytPiaom
tSlPipnedionrAVCIBLLtegdlEopm
aair1e=m 2
X
i5GH1ozentr
pi1rnpeau=srl03kgm V
2
0
1
=
U2
P
u
N
5
Zm
=
O
h
0
m
S]1,Ptops10=LQRgds=5.31=2]2,
[Sfrequncy [Sfrequncy
][S21,frequn0c.2y40.68][S21, frequnc2y46
Figure 5.25: S parameter simulated characteristics for test circuit shown in Fig. 5.5
that has external inductance added
127
5.16 End note
MESFETs are important high frequency devices which have been missing from
the range of active component models supplied with Qucs. While developing the
models described in this report I have attempted to make them as flexible as
possible so as to allow users the opportunity to select which model, or indeed
the make-up of the components of a model, they would like to try for a specific
simulation. The work described in this report is very much work in progress,
mainly because there are a number of other published MESFET models that have
not been included. My intention has simply been to provide a number of practical
models which were not previously available to Qucs users. Also knowing that
many Qucs users have an interest in high frequency circuit design and simulation,
the work would be of direct relevance to making Qucs more “universal“. The
procedures employed for model development are another example of the work being
undertaken by the Qucs team in response to Qucs being adopted by the wider
modelling community as part of the Verilog-A compact device standardization
project. Overall the simulation results from the models described here show a
high degree of consistency from DC to the high frequency S parameter domain.
The noise results are particularly interesting as they are based on mix of available
theories and extensions introduced especially for Qucs. Some readers will probably
have spotted one area where there appears to be differences in the simulation
results from the different models; look at the S[1,2] and S[2,1] characterstics for
each model. Here there are noticeable difference which are possibly due to the
lack of symmetry in some of the model charge equations? MESFET modelling
is a complex subject, suggesting that there are likely to be errors /bugs in the
models. If you find an error/bug please inform the Qucs development team so
that we can correct problems as they are found. In the future, particularly if the
response to this group of models is positive, I will attempt to add more MESFET
models to Qucs. Once again a special thanks to Stefan Jahn for all his help and
encouragement over the period that I have been developing the Qucs MESFET
models and writing the report which outlines their physical and mathematical
fundamentals.
128
6 Verilog-A implementation of the
EKV v2.6 long and short channel
MOSFET models
6.1 Introduction
This report presents the background to the Qucs implementation of the EKV 2.6
long and short channel MOSFET models. During 2007 the Qucs development
team employed the EKV v2.6 MOSFET model as a test case while developing the
Qucs non-linear equation defined devices (EDD)1 . More recently complete imple-
mentations of the long and short channel EKV v2.6 models have been developed
using the Qucs Verilog-A compact device modelling route. This work forms part
of the Verilog-A compact device modelling standardisation initiative2 . The EKV
v2.6 MOSFET model is a physics based model which has been placed in the public
domain by its developers. It is ideal for analogue circuit simulation of submicron
CMOS circuits. Since the models introduction and development between 1997 and
1999 it has been widely used in industry and by academic circuit design groups.
Today the EKV v2.6 model is available with most of the major commercial simu-
lators and a growing number of GPL simulators. The Verilog-A code for the Qucs
ADMS3 compiled version of the EKV v2.6 model is given in an appendix to this
report.
129
• Basic geometrical and process related features dependent on oxide thickness,
junction depth, effective channel length and width
• Modelling of mobility effects due to vertical and lateral fields, velocity satu-
ration
The Qucs implementation of the short channel EKV v2.6 model includes nearly
all the features listed above4 . A simpler long channel version of the model is also
available for those simulations that do not require short channel effects. Both
nMOS and pMOS devices have been implemented. No attempt is made in this
report to describe the physics of the EKV v2.6 model. Readers who are interested
in learning more about the background to the model, its physics and function
should consult the following references:
• Matthias Bucher et. al., The EPFL-EKV MOSFET Model Equations for
Simulation, Electronics Laboratories, Swiss Federal Institute of Technology
(EPFL), Lausanne, Switzerland, Model Version 2.6, Revision II, July 1998.
• Wladyslaw Grabiński et. al. Advanced compact modelling of the deep sub-
micron technologies, Journal of Telecommunications and Information Tech-
nology, 3-4/2000, pp. 31-42.
• Matthias Bucher et. al., A MOS transistor model for mixed analog-digital
circuit design and simulation, pp. 49-96, Design of systems on a chip -
Devices and Components, KLUWER Academic Publishers, 2004.
4
This first release of the Qucs implementation of the EKV v2.6 MOSFET model does not
include the first-order non-quasistatic model for transconductances.
130
• Trond Ytterdal et. al., Chapter 7: The EKV model, pp. 209-220, Device
Modeling for Analog and RF CMOS Circuit Design, John Wiley & Sons,
Ltd, 2003.
• Dan Fitzpatrick and Ira Miller, Analog Behavioral Modeling with the Verilog-
A Language, Kluwer Academic Publishers, 1998.
• Coram G. J., How to (and how not to) write a compact model in Verilog-A,
2004, IEEE International Behavioural modeling and Simulation Conference
(BMAS2004), pp. 97-106.
The equivalent circuit of the Qucs EKV long channel n type MOSFET model is
shown in Fig. 6.1. In this model the inner section, enclosed with the red dotted
box, represents the fundamental intrinsic EKV v2.6 elements. The remaining
components model extrinsic elements which represent the physical components
connecting the intrinsic MOSFET model to its external signal pins. In the Qucs
implementation of the EKV v2.6 long channel MOSFET model the drain to source
5
See http://legwww.epfl.ch/ekv/verilog-a/ for the Verilog-A code.
6
No dynamic, noise or temperature effects.
131
Intrinsic model
Gate
Bulk
Source-int Drain-int
Figure 6.1: Equivalent circuit for the Qucs EKV v2.6 long channel nMOS model
DC current Ids is represented by the equations listed in a later section of the report,
capacitors Cgdi, Cgsi, Cdbi and Csbi are intrinsic components derived from the
charge-based EKV equations, capacitors Cgdo, Cgso and Cgbo represent external
overlap elements, the two diodes model the drain to channel and source to channel
junctions (including diode capacitance) and resistors RDeff and RSeff model series
connection resistors in the drain and source signal paths respectively.
132
Name Symbol Description Unit Default nMOS Default pMOS
Vj Vj junction potential V 1.0 1.0
Cj0 Cj0 zero bias depletion capacitance F 1e − 12 1e − 12
M M grading coefficient 0.5 0.5
Area Area relative area 1.0 1.0
Fc Fc forward-bias depletion capcitance coefficient 0.5 0.5
Tt Tt transit time s 0.1e − 9 0.1e − 9
Xti Xti saturation current temperature exponent 3.0 3.0
Kf KF flicker noise coefficient 1e − 27 1e − 28
Af Af flicker noise exponent 1.0 1.0
Tnom T nom parameter measurement temperature ◦C 26.85 26.85
Temp T emp device temperature ◦C 26.85 26.85
Where VGprime is the effective gate voltage, Vp is the pinch-off voltage, n is the
slope factor, β is a transconductance parameter, Ispecific is the specific current, If
is the forward current, Ir is the reverse current, Vt is the thermal voltage at the
device temperature, and Ids is the drain to source current. EKV v2.6 equation
numbers are given in “< >” brackets at the left-hand side of each equation. Typical
plots of Ids against Vds for both the nMOS and pMOS long channel devices are
given in Figure 6.2.
133
EKV26nMOS1 dc simulation Parameter
LEVEL=2 sweep
L=10e-6 DC1
W=10e-6 SW2
Vto=0.6 Sim=DC1
V2
Gamma=0.71 Idsn Type=lin
U=Vdsn
Phi=0.97 V1 Param=Vdsn
Kp=50e-6 U=Vgsn Start=0
Theta=50e-3 Stop=3
Idsp Points=61
V3
V4 U=Vdsp
EKV26pMOS1
U=Vgsp
LEVEL=2 Parameter
L=10e-6 Equation
W=25e-6
sweep
Eqn1
Vto=-0.55 SW1
Ids_pMOS_3D=PlotVs(Idsp.I, Vgsp, Vdsp)
Gamma=0.69 Sim=SW2
Ids_pMOS=PlotVs(Idsp.I, Vgsp, Vdsp)
Phi=0.87 Type=lin
Ids_nMOS=PlotVs(Idsn.I, Vgsn, Vdsn)
Kp=20e-6 Param=Vgsn
Vdsp=-Vdsn
Theta=50e-3 Start=0
Vgsp=-Vgsn
Ids_nMOS_3D=PlotVs(Idsn.I, Vgsn, Vdsn) Stop=3
Points=17
1e-4
Ids_nMOS (A)
5e-5
0 0
0 0.5 1 1.5 2 2.5 3
Ids_pMOS (A)
Vds (V)
-5e-5
-1e-4
-3 -2.5 -2 -1.5 -1 -0.5 0
Vds (V) 1e-4
Idsn (I)
5e-5
Vg
sn
0 0
(V)
2 2.5 3
0.5 1 1.5
0
0
Vdsn (V)
Idsp (A)
-5e-5
0
Vg
sp
0-1e-4
(V)
-1.5 -1 -0.5
-3 -2.5 -2
Vdsp (V)
Figure 6.2: Ids versus Vds plots for the Qucs EKV v2.6 long channel nMOS and
pMOS models
134
6.4 Testing model performance
Implementing advanced component models like the EKV v2.6 MOSFET model is
a complex process, involving the translation of a set of equations into the Verilog-
A hardware design language, conversion of the Verilog-A code into C++ code
via the ADMS compiler, and finally compiling and linking the model code with
the main body of Qucs code. At all stages in the process accuracy becomes an
important issue. This section of the Qucs EKV v2.6 report introduces a number of
test simulations which were used during the model development cycle to check the
performance of the Qucs EKV v2.6 implementation. The tests also demonstrate
how a circuit simulator can be used to extract model parameters. The values of
which help to confirm correct model operation.
√
r
Ispecif ic
Ids = · (V p − V s) (6.2)
2 · V t2
Hence √ r
∂( Ids) Ispecif ic
=− = −slope (6.3)
∂V s 2 · V t2
Or
Ispecif ic = 2 · slope2 · V t2 (6.4)
Figure 6.3 shows a typical test circuit configuration for measuring and simulating
Ids with varying Vs. Qucs post-simulation functions in equation block Eqn1 are
used to calculate the value for Ispecific. The value of Ispecific for the nMOS
transistor with the parameters given in Fig. 6.3 is 3.95e-8 A. Figure 6.4 illustrates
a test circuit for measuring Vp with the transistor in saturation. In this circuit
Is=Ispecific and the threshold voltage corresponds to Vg when Vp = 0V. Notice
also that n = ∂V g/∂V p. In Fig. 6.4 Qucs post-simulation processing functions are
also used to generate data for Vp, VGprime and n. The value of the threshold
voltage for the device shown in Fig. 6.4 is 0.6V. At this voltage n = 1.37. The
two test configurations illustrated in Figs. 6.3 and 6.4 go some way to confirming
135
that the Qucs implementation of the EKV v2.6 long channel model is functioning
correctly.
Gamma
nq = 1 + √ (6.5)
2 · V p + P hi + 1e − 6
r
1
Xf = + If (6.6)
4
r
1
Xr = + Ir (6.7)
4
4 3 · Xr3 + 6 · Xr2 · Xf + 4 · Xr · Xf 2 + 2 · Xf 3 1
qD = −nq · · − (6.8)
15 (Xf + Xr)2 2
4 3 · Xf 3 + 6 · Xf 2 · Xr + 4 · Xf · Xr2 + 2 · Xr3 1
qS = −nq · · − (6.9)
15 (Xf + Xr)2 2
4 3 · Xf 3 + Xr · Xf + Xr2
qI = qS + qD = −nq · · −1 (6.10)
3 Xf + Xr
p 1 nq − 1
qB = −Gamma · V p + P hi + 1e − 6 · − · qI ∀(V Gprime > 0)
Vt nq
(6.11)
1
qB = −V Gprime · ∀(V Gprime <= 0) (6.12)
Vt
qG = −qI − qB (6.13)
136
EKV26nMOS1
L=10e-6
W=10e-6 dc simulation V2
Cox=3.45e-3 Ids
DC1 U=3 V
Vto=0.6
Gamma=0.71
Parameter
V3
Phi=0.97 sweep
U=2 V V1
Kp=50e-6
U=Vs SW1
Theta=50e-3
Sim=DC1
1e-4 Type=lin
1e-5 Param=Vs
1e-6
1e-7 Start=0
1e-8
Ids (A)
Stop=2
1e-9
1e-10 Points=21
1e-11
1e-12 Equation
1e-13
1e-14 Eqn1
0 0.5 1 1.5 2
Vs (V) root_Id=sqrt(Ids.I)
Ispecific=(slope^2)*2*vt(300)*vt(300)
slope=-max(abs(diff_root_Id))
sqrt(Ids) (A^0.5)
0.005
diff_root_Id=diff(root_Id, Vs)
0 0.00588 -0.00544
0
0.1 0.00534 -0.00544
0.2 0.00479 -0.00544
-0.002
0.3 0.00425 -0.00544
Figure 6.3: Ispecific extraction test circuit and post simulation data processing
results
137
EKV26nMOS1
LEVEL=1
L=10e-6 V1 Parameter
W=10e-6 U=Vg sweep
Vs
Cox=3.45e-3
Vto=0.6 I1 SW1
Gamma=0.71 I=3.95e-8 Sim=DC1
Phi=0.97 dc simulation Type=lin
Kp=50e-6 Param=Vg
DC1
Start=0
Equation Stop=1
Eqn1 Points=101
VGprime=Vg-Vto+Phi+Gamma*sqrt(Phi)
Gamma=0.71
Vto=0.6
Phi=0.97
Vp=VGprime-Phi-Gamma*(sqrt( VGprime+(Gamma/2)*(Gamma/2) ) -Gamma/2)
n=diff(Vg, Vs.V)
0.5 0.5
2
VGprime (V)
Vs = VP (V)
Vp (V)
0 0 1.5
1
-0.5 -0.5
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
Vg (V) Vg (V)
Vg n Vs.V Vp VGprime
0.57 1.37297 -0.0187 -0.022 1.64
4
0.58 1.37151 -0.0114 -0.0147 1.65
0.59 1.37006 -0.00408 -0.00735 1.66
n
Figure 6.4: Vp extraction test circuit and post simulation data processing results
138
Q(I, B, D, S, G) = COX · V t · q(I, B, D, S, G) (6.15)
The first release of the Qucs EKV v2.6 MOSFET model assumes that the gate and
bulk charge is partitioned between the drain and source in equal ratio7 . Fifty per-
cent charge portioning yields the following Ids current contributions:
Where p n MOS = 1 for nMOS devices or -1 for pMOS devices. Charge associated
with the extrinsic overlap capacitors, Cgs0, Cgd0 and Cgb0, is represented in the
Qucs EKV v2.6 implementation by the following equations:
j · ω · Cg
y11 = (6.23)
1 + ω 2 · (Rgn · Cg)2
7
For an example of this type of charge partitioning see F. Pregaldiny et. al., An analytic
quantum model for the surface potential of deep-submicron MOSFETS, 10th International
Conference, MIXDES 2003, Lodz, Poland, 26-28 June 2003.
8
A more detailed anlysis of the EKV v2.6 y-parameters can be found in F. Krummenacher et.
al., HF MOSET MODEL parameter extraction, European Project No. 25710, Deliverable
D2.3, July 28, 2000.
139
Or
y11 ∼
= ω 2 · Rg · Cg 2 + j · ω · Cg, when ω · Rg · Cg << 1. (6.24)
Hence, Cg = imag(y11 /ω) and Rgn = real(y11 /(ω 2 · Cg 2 )), where ω = 2 · π · f ,
and f is the frequency of y-parameter measurement, Rg is a series extrinsic gate
resistance and Cg ∼
= Cgs+Cgd+Cgb. With equal partitioning of the intrinsic gate
charge Cgb approximates to zero and Cg ∼ = Cgs + Cgd. The data illustrated in
Figures 6.5 and 6.6 shows two features which are worth commenting on; firstly the
values of Cg are very much in line with simple hand calculations (for example in
the case of the nMOS device Cg(max) = W · L · Cox = 10e−6∗10e−6∗3.45e−3 =
3.45e − 13F) and secondly both sets of simulation data indicate the correct values
for the nMOS and pMOS threshold voltages (for example -0.55 V for the pMOS
device and 0.6 V for the nMOS device), reinforcing confidence in the EKV v2.6
model implementation.
y11 ∼
= ω 2 · RDef f · Cd2 + j · ω · Cd, when ω · RDef f · Cd << 1. (6.25)
Hence, Cd = imag(y11 /ω) and Rdef f = real(y11 /(ω 2 · Cd2 )), where ω = 2 · π · f ,
f is the frequency of y-parameter measurement, and Cd is the diode capacitance.
The data shown in Fig. 6.7 indicate good agreement with the expected values for
Cd and RDeff ; which are expected to be Cd = 300fF at Vds=0V, and Rdeff =
46Ω.
140
dc simulation
EKV26nMOS1
DC1 V2
Ids_n LEVEL=1
U=Vds L=10e-6
P1
Rgn W=10e-6
Num=1 X1 V1 R=1 Cox=3.45e-3
Z=50 Ohm U=Vgs
Vto=0.6
Gamma=0.71
Phi=0.97
Parameter Parameter S parameter
Kp=50e-6
sweep sweep simulation Theta=50e-3
Cgso=1.5e-10
SW1 SW2 Equation SP1
Cgdo=1.5e-10
Sim=SW2 Sim=SP1 Eqn1 Type=const
Cgbo=4.0e-10
Type=lin Type=lin y=stoy(S) Values=[1 MHz]
Cj0=300e-15
Param=Vds Param=Vgs L=10e-6
Start=0 Start=-2 W=10e-6
Stop=3 Stop=2 Cox=3.45e-3
Points=31 Points=201 Cg=imag(y[1,1])/Omega
Cgpl=PlotVs( Cg/(Cox*W*L), Vds, Vgs)
4e-13 Rg=PlotVs( (real(y[1,1])/(Omega*Omega*Cg*Cg)), Vds, Vgs)
Cg_2D=PlotVs(Cg, Vgs)
3e-13 Omega=2*pi*frequency
Cg (F)
2e-13
1e-13
-2 -1 0 1 2
Vgs (V)
1
Cg/ (W*L*Cox)
2
2
Rgn (Ohm)
Vds
0.5
1
(V)
Vds
0 2
(V)
20 0 0 1
0 -1
-2 -2
Vgs (V) Vgs (V)
Figure 6.5: y11 test circuit and values of Cg for the long channel EKV v2.6 nMOS
model
141
dc simulation
EKV26pMOS1
DC1 V2 L=10e-6
Ids_n
U=Vds W=20e-6
P1
Rgn Cox=3.45e-3
Num=1 X1 V1 R=1 Vto=-0.55
Z=50 Ohm U=Vgs Gamma=0.69
Phi=0.87
Kp=20e-6
Parameter Parameter S parameter Theta=50e-3
sweep sweep simulation Cgso=1.5e-10
Cgdo=1.5e-10
SW1 SW2 Equation SP1
Cgbo=4.0e-10
Sim=SW2 Sim=SP1 Eqn1 Type=const
Cj0=300e-15
Type=lin Type=lin y=stoy(S) Values=[1 MHz]
Param=Vds Param=Vgs L=10e-6
Start=0 Start=2 W=10e-6
Stop=-3 Stop=-2 Cox=3.45e-3
Points=31 Points=201 Cg=imag(y[1,1])/Omega
Cgpl=PlotVs( Cg/(Cox*W*L), Vds, Vgs)
8e-13 Rg=PlotVs( (real(y[1,1])/(Omega*Omega*Cg*Cg)), Vds, Vgs)
Cg_2D=PlotVs(Cg, Vgs)
6e-13 Omega=2*pi*frequency
Cg (F)
4e-13
2e-13
-2 -1 0 1 2
Vgs (V)
2
Cg/ (W*L*Cox)
2
Rgn (Ohm)
Vds
1
0 1
-2
(V)
Vds
2
(V)
20 0 1
0 -1
-2 -2
Vgs (V) Vgs (V)
Figure 6.6: y11 test circuit and values of Cg for the long channel EKV v2.6 pMOS
model
142
EKV26nMOS1
LEVEL=1 Ids
L=10e-6
W=10e-6 P1
Cox=3.45e-3 V1
dc simulation X1 V2 Num=1
Vto=0.6 U=0 U=Vds Z=50 Ohm
DC1
Gamma=0.71
Phi=0.97 S parameter
Kp=50e-6
simulation Parameter Parameter
Theta=50e-3
SP1 sweep sweep
Equation
Type=const
Eqn2 SW1 SW2
Values=[1 MHz]
y=stoy(S) Sim=SW2 Sim=SP1
Cd=PlotVs(imag(y[1,1])/Omega, Vgs, Vds) Type=lin Type=lin
Cd_2D=PlotVs(imag(y[1,1])/Omega, Vds) Param=Vgs Param=Vds
RDeff=real(y[1,1])/(Omega^2*Cd^2) Start=0 Start=0
PL_RDeff=PlotVs(real(y[1,1])/(Omega^2*Cd^2),Vgs,Vds) Stop=3 Stop=3
Omega=2*pi*frequency Points=31 Points=61
0.15 1.72e-14
0.2 1.72e-14
2e-13
1.5e-13
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3
Vds (V)
50
3e-13
48
Rdeff (Ohm)
Cd (F)
46
44 2e-13
42
3
Vg
340 0
Vg
0 2
s
2 1
s
(V
1
(V
0
)
0 )
Vds (V
)
)
Vds (V
Figure 6.7: Test circuit for extracting EKV v2.6 extrinsic diode capacitance
143
SP SD = Sthermal + Sf licker (6.26)
Where
• Thermal noise
Sthermal = 4 · k · T · β · | qI | (6.27)
• Flicker noise
2
KF · gmg
Sf licker = , (6.28)
N p · W ef f · N s · Lef f · Cox · f Af
s s !
∂Ids 4 · If 4 · Ir
gmg = = β ·V t· +1− +1 (6.29)
∂V gs Ispecif ic Ispecif ic
144
dc simulation Ids V2
U=3V
EKV26nMOS7 DC1
L=1.0e-6
W=W
ac simulation
Kf=1.0e-27 V1
Af=1.0 U=0.6
AC1
Type=log
EKV26nMOS8 Ids1
Start=100Hz
L=1.0e-6 Stop=100 MHz
W=W Points=131
V3
Kf=1.0e-27 Noise=yes
U=1
Af=1.0
Parameter
EKV26nMOS9 sweep
Ids2
L=1.0e-6
SW1
W=W V4 Sim=AC1
Kf=1.0e-27 U=2 V Type=log
Af=1.0
Param=W
Start=1e-6
EKV26nMOS10 Ids3
Stop=100e-6
L=1.0e-6
Points=11
W=W
Kf=0.0
Af=1.0
1e-8
1e-9
Idsn (A/sqrt(Hz))
1e-10
1e-11
1e-12
100 1e3 1e4 1e5 1e6 1e7 1e8
Frequency (Hz)
Figure 6.8: Test circuit for simulating EKV v2.6 noise: Ids.in blue curve, Ids1.in
red curve, Ids2.in black curve and Ids3.in green curve
145
6.5 The Qucs short channel EKV v2.6 model
The Qucs implementation of the short short channel EKV v2.6 MOSFET model
contains all the features implemented in the long channel version of the model plus
a number of characteristics specific to short channel operation. However, the short
channel version of the model does not use parameter Theta. Parameter LEVEL set
to 2 selects the short channel model. Both pMOS and nMOS versions of the model
are available for both long and short channel implementations. The entire short
channel EKV v2.6 MOSFET model is described by roughly 94 equations. Readers
who are interested in the mathematics of the model should consult “The EPFL-
EKV MOSFET Model Equations for Simulation” publication cited in previous
text. Appendix A lists the complete Verilog-A code for the first release of the
Qucs EKV v2.6 MOSFET models. Additional Verilog-A code has been added to
the model equation code to (1) allow interchange of the drain and source terminals,
and (2) select nMOS or pMOS devices.
146
Name Symbol Description Unit Default nMOS Default pMOS
Bv Bv reverse breakdown voltage V 100 100
Ibv Ibv current at Bv A 1e − 3 1e − 3
Vj Vj junction potential V 1.0 1.0
Cj0 Cj0 zero bias depletion capacitance F 1e − 12 1e − 12
M M grading coefficient 0.5 0.5
Area Area relative area 1.0 1.0
Fc Fc forward-bias depletion capcitance coefficient 0.5 0.5
Tt Tt transit time s 0.1e − 9 0.1e − 9
Xti Xti saturation current temperature exponent 3.0 3.0
Kf KF flicker noise coefficient 1e − 27 1e − 28
Af Af flicker noise exponent 1.0 1.0
Avto Avto area related threshold mismatch parameter 0 0
Akp Akp area related gain mismatch parameter 0 0
Agamma Agamma area related body effect mismatch parameter 0 0
Iba Iba first impact ionization coefficient 1/m 2e8 0.0
Ibb Ibb second impact ionization coefficient V /m 3.5e8 3.5e8
Ibn Ibn saturation voltage factor for impact ionization 1.0 1.0
Tnom T nom parameter measurement temperature ◦C 26.85 26.85
Temp T emp device temperature ◦C 26.85 26.85
147
EKV26nMOS1 Ids_NO_Charge_Sharing EKV26nMOS2
LEVEL=2 LEVEL=2
L=0.5e-6 L=0.5e-6
W=10e-6 W=10e-6
V2
Cox=3.45e-3 Cox=3.45e-3
U=Vds
Xj=0.15e-6 Xj=0.15e-6
Dw=-0.02e-6 V1 Dw=-0.02e-6
Dl=-0.05e-6 U=0.7 Dl=-0.05e-6
Vto=0.6 Ids_charge_Sharing Vto=0.6
Gamma=0.71 Gamma=0.71
Phi=0.97 Phi=0.97
Kp=150e-6 Kp=150e-6
EO=88.0e6 EO=88.0e6
Parameter Parameter Ucrit=4.5e6
Ucrit=4.5e6
Lambda=0.23 sweep sweep Lambda=0.23
Weta=0.0 Weta=0.05
SW1 SW2
Leta=0.0 Leta=0.28
Sim=SW2 Sim=DC1
Q0=280e-6 dc simulation Type=lin Type=lin
Q0=280e-6
Lk=0.5e-6 Lk=0.5e-6
DC1 Param=Vgs Param=Vds
Start=0 Start=0
Stop=3 Stop=3.3
Points=7 Points=101
8e-6
6e-6
Ids (A)
4e-6
2e-6
0
0 0.5 1 1.5 2 2.5 3
Vds (v)
Figure 6.9: Test circuit for simulating EKV v2.6 charge sharing effects in short
channel devices: Ids blue curve; NO charge sharing (Weta = 0.0, Leta
= 0.0), Ids red curve; charge sharing (Weta = 0.05, Leta = 0.28)
148
6.6 End note
This report outlines some of the background to the Qucs implementation of the
EKV v2.6 MOSFET model. A series of test results demonstrate a range of results
that have been achieved with this new Qucs compact device model. Although the
test results give data similar to what is expected in all cases it must be stressed
that this is the first release of this MOSFET model and as such it will probably
contain bugs. A great deal of work has gone into providing this new Qucs model.
However, all the effort has been worthwhile because for the first time Qucs now
has a submicron MOSFET model. Please use the model and report bugs to the
Qucs development team. Much work still remains to be done in the development
of MOSFET models for Qucs. In future releases both bug fixes and new models
are likely to feature strongly. Once again I would like to thank Stefan Jahn and
Wladyslaw Grabiński (of MOS-AK) for their encouragement and support during
the period I have been working on developing the Qucs implementation of the
EKV v2.6 model and writing this report.
//
module EKV26nMOS ( Drain , Gate , Source , Bulk ) ;
inout Drain , Gate , Source , Bulk ;
e l e c t r i c a l Drain , Gate , Source , Bulk ;
// I n t e r n a l nodes
e l e c t r i c a l Drain int , Source int ;
149
‘define a t t r ( txt ) (∗ txt ∗)
// D e v i c e dimension p a r a m e t e r s
parameter r e a l LEVEL = 1 from [ 1 : 2 ]
‘ a t t r ( i n f o=” l o n g = 1 , s h o r t = 2 ” ) ;
parameter r e a l L = 0 . 5 e−6 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” l e n g t h p a r a m e t e r ” u n i t = ”m” ) ;
parameter r e a l W = 10 e−6 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=”Width p a r a m e t e r ” u n i t = ”m” ) ;
parameter r e a l Np = 1 . 0 from [ 1 . 0 : i n f ]
‘ a t t r ( i n f o=” p a r a l l e l m u l t i p l e d e v i c e number ” ) ;
parameter r e a l Ns = 1 . 0 from [ 1 . 0 : i n f ]
‘ a t t r ( i n f o=” s e r i e s m u l t i p l e d e v i c e number ” ) ;
// P r o c e s s p a r a m e t e r s
parameter r e a l Cox = 3 . 4 5 e−3 from [ 0 : i n f ]
‘ a t t r ( i n f o=” g a t e o x i d e c a p a c i t a n c e p e r u n i t a r e a ” u n i t = ”F/m∗∗2 ” ) ;
parameter r e a l Xj = 0 . 1 5 e−6 from [ 0 . 0 1 e−6 : 1 . 0 e −6]
‘ a t t r ( i n f o=” m e t a l l u r g i c a l j u n c t i o n depth ” u n i t = ”m” ) ;
parameter r e a l Dw = −0.02 e−6 from [− i n f : 0 . 0 ]
‘ a t t r ( i n f o=” c h a n n e l width c o r r e c t i o n ” u n i t = ”m” ) ;
parameter r e a l Dl = −0.05 e−6 from [− i n f : 0 . 0 ]
‘ a t t r ( i n f o=” c h a n n e l l e n g t h c o r r e c t i o n ” u n i t = ”m” ) ;
// B a s i c i n t r i n s i c model p a r a m e t e r s
parameter r e a l Vto = 0 . 6 from [ 1 e−6 : 2 . 0 ]
‘ a t t r ( i n f o=” l o n g c h a n n e l t h r e s h o l d v o l t a g e ” u n i t=”V” ) ;
parameter r e a l Gamma = 0 . 7 1 from [ 0 . 0 : 2 . 0 ]
‘ a t t r ( i n f o=”body e f f e c t p a r a m e t e r ” u n i t=”V∗ ∗ ( 1 / 2 ) ” ) ;
parameter r e a l Phi = 0 . 9 7 from [ 0 . 3 : 2 . 0 ]
‘ a t t r ( i n f o=”b u l k Fermi p o t e n t i a l ” u n i t=”V” ) ;
parameter r e a l Kp = 150 e−6 from [ 1 0 e−6 : i n f ]
‘ a t t r ( i n f o=” t r a n s c o n d u c t a n c e p a r a m e t e r ” u n i t = ”A/V∗∗2 ” ) ;
parameter r e a l Theta = 50 e−3 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” m o b i l i t y r e d u c t i o n c o e f f i c i e n t ” u n i t = ”1/V” ) ;
parameter r e a l EO = 8 8 . 0 e6 from [ 1 . 0 e6 : i n f ]
‘ a t t r ( i n f o=” m o b i l i t y c o e f f i c i e n t ” u n i t=”V/m” ) ;
parameter r e a l U c r i t = 4 . 5 e6 from [ 2 . 0 e6 : 2 5 . 0 e6 ]
‘ a t t r ( i n f o=” l o n g i t u d i n a l c r i t i c a l f i e l d ” u n i t=”V/m” ) ;
// Channel l e n g t h and c h a r g e s h a r i n g p a r a m e t e r s
parameter r e a l Lambda = 0 . 2 3 from [ 0 . 1 : i n f ]
‘ a t t r ( i n f o=” d e p l e t i o n l e n g t h c o e f f i c i e n t ” ) ;
parameter r e a l Weta = 0 . 0 5 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=”narrow−c h a n n e l e f f e c t c o e f f i c i e n t ” ) ;
parameter r e a l Leta = 0 . 2 8 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” l o n g i t u d i n a l c r i t i c a l f i e l d ” ) ;
// R e v e r s e s h o r t c h a n n e l e f f e c t p a r a m e t e r s
parameter r e a l Q0 = 280 e−6 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” r e v e r s e s h o r t c h a n n e l c h a r g e d e n s i t y ” u n i t=”A∗ s /m∗∗2 ” ) ;
parameter r e a l Lk = 0 . 5 e−6 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” c h a r a c t e r i s t i c l e n g t h ” u n i t=”m” ) ;
// I n t r i n s i c model t e m p e r a t u r e p a r a m e t e r s
parameter r e a l Tcv = 1 . 5 e−3
‘ a t t r ( i n f o=” t h r e s h o l d v o l t a g e t e m p e r a t u r e c o e f f i c i e n t ” u n i t=”V/K” ) ;
parameter r e a l Bex = −1.5
‘ a t t r ( i n f o=” m o b i l i t y t e m p e r a t u r e c o e f f i c i e n t ” ) ;
parameter r e a l Ucex = 1 . 7
‘ a t t r ( i n f o=” L o n g i t u d i n a l c r i t i c a l f i e l d t e m p e r a t u r e exponent ” ) ;
parameter r e a l I b b t = 0 . 0
‘ a t t r ( i n f o=”Ibb t e m p e r a t u r e c o e f f i c i e n t ” u n i t=”1/K” ) ;
// S e r i e s r e s i s t a n c e c a l c u l a t i o n p a r a m e t e r s
parameter r e a l H d i f = 0 . 9 e−6 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” h e a v i l y doped d i f f u s i o n l e n g t h ” u n i t = ”m” ) ;
parameter r e a l Rsh = 5 1 0 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” d r a i n / s o u r c e d i f f u s i o n s h e e t r e s i s t a n c e ” u n i t=”Ohm/ s q u a r e ” ) ;
150
parameter r e a l Rsc = 0 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” s o u r c e c o n t a c t r e s i s t a n c e ” u n i t=”Ohm” ) ;
parameter r e a l Rdc = 0 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” d r a i n c o n t a c t r e s i s t a n c e ” u n i t=”Ohm” ) ;
// Gate o v e r l a p c a p a c i t a n c e s
parameter r e a l Cgso = 1 . 5 e −10 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” g a t e t o s o u r c e o v e r l a p c a p a c i t a n c e ” u n i t = ”F/m” ) ;
parameter r e a l Cgdo = 1 . 5 e −10 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” g a t e t o d r a i n o v e r l a p c a p a c i t a n c e ” u n i t= ”F/m” ) ;
parameter r e a l Cgbo = 4 . 0 e −10 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” g a t e t o b u l k o v e r l a p c a p a c i t a n c e ” u n i t= ”F/m” ) ;
// Impact i o n i z a t i o n r e l a t e d p a r a m e t e r s
parameter r e a l I b a = 2 e8 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” f i r s t impact i o n i z a t i o n c o e f f i c i e n t ” u n i t = ”1/m” ) ;
parameter r e a l Ibb = 3 . 5 e8 from [ 1 . 0 e8 : i n f ]
‘ a t t r ( i n f o=”s e c o n d impact i o n i z a t i o n c o e f f i c i e n t ” u n i t=”V/m” ) ;
parameter r e a l Ibn = 1 . 0 from [ 0 . 1 : i n f ]
‘ a t t r ( i n f o=” s a t u r a t i o n v o l t a g e f a c t o r f o r impact i o n i z a t i o n ” ) ;
// F l i c k e r n o i s e p a r a m e t e r s
parameter r e a l Kf = 1 . 0 e −27 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” f l i c k e r n o i s e c o e f f i c i e n t ” ) ;
parameter r e a l Af = 1 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” f l i c k e r n o i s e exponent ” ) ;
// Matching p a r a m e t e r s
parameter r e a l Avto = 0 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” a r e a r e l a t e d t h e s h o l d v o l t a g e mismatch p a r a m e t e r ” u n i t = ”V∗m” ) ;
parameter r e a l Akp = 0 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” a r e a r e l a t e d g a i n mismatch p a r a m e t e r ” u n i t=”m” ) ;
parameter r e a l Agamma = 0 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” a r e a r e l a t e d body e f f e c t mismatch p a r a m e t e r ” u n i t=” s q r t (V) ∗m” ) ;
// Diode p a r a m e t e r s
parameter r e a l N=1.0 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” e m i s s i o n c o e f f i c i e n t ” ) ;
parameter r e a l I s =1e −14 from [ 1 e −20: i n f ]
‘ a t t r ( i n f o=” s a t u r a t i o n c u r r e n t ” u n i t=”A” ) ;
parameter r e a l Bv=100 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” r e v e r s e breakdown v o l t a g e ” u n i t=”V” ) ;
parameter r e a l Ibv=1e−3 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” c u r r e n t a t r e v e r s e breakdown v o l t a g e ” u n i t=”A” ) ;
parameter r e a l Vj =1.0 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” j u n c t i o n p o t e n t i a l ” u n i t=”V” ) ;
parameter r e a l Cj0=300e −15 from [ 0 : i n f ]
‘ a t t r ( i n f o=” z e r o −b i a s j u n c t i o n c a p a c i t a n c e ” u n i t=”F” ) ;
parameter r e a l M=0.5 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” g r a d i n g c o e f f i c i e n t ” ) ;
parameter r e a l Area =1.0 from [ 1 e −3: i n f ]
‘ a t t r ( i n f o=” d i o d e r e l a t i v e a r e a ” ) ;
parameter r e a l Fc =0.5 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=”forward −b i a s d e p l e t i o n c a p c i t a n c e c o e f f i c i e n t ” ) ;
parameter r e a l Tt =0.1 e−9 from [ 1 e −20: i n f ]
‘ a t t r ( i n f o=” t r a n s i t time ” u n i t=”s ” ) ;
parameter r e a l X t i =3.0 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” s a t u r a t i o n c u r r e n t t e m p e r a t u r e exponent ” ) ;
// Temperature p a r a m e t e r s
parameter r e a l Tnom = 2 6 . 8 5
‘ a t t r ( i n f o=”p a r a m e t e r measurement t e m p e r a t u r e ” u n i t = ” C e l s i u s ” ) ;
// L o c a l v a r i a b l e s
r e a l e p s i l o n s i , e p s i l o n o x , Tnomk , T2 , T r a t i o , Vto T , U c r i t T , Egnom , Eg , Phi T ;
r e a l Weff , L e f f , RDeff , RSeff , con1 , con2 , Vtoa , Kpa , Kpa T , Gammaa, C e p s i l o n , x i ;
r e a l nnn , deltaV RSCE , Vg , Vs , Vd , Vgs , Vgd , Vds , Vdso2 , VG, VS , VD;
r e a l VGprime , VP0 , VSprime , VDprime , Gamma0, Gammaprime , Vp ;
r e a l n , X1 , i f f , X2 , i r , Vc , Vdss , Vdssprime , deltaV , Vip ;
151
r e a l Lc , DeltaL , Lprime , Lmin , Leq , X3 , i r p r i m e , Beta0 , e t a ;
r e a l Qb0 , Beta0prime , nq , Xf , Xr , qD , qS , qI , qB , Beta , I s p e c i f i c , I d s , Vib , Idb , Ibb T ;
r e a l A, B, Vt T2 , Eg T1 , Eg T2 , Vj T2 , Cj0 T2 , F1 , F2 , F3 , I s T 2 ;
r e a l Id1 , Id2 , Id3 , Id4 , I s 1 , I s 2 , I s 3 , I s 4 , V1 , V2 , Ib d , I b s , Qd , Qs , Qd1 , Qd2 , Qs1 , Qs2 ;
r e a l qb , qg , qgso , qgdo , qgbo , f o u r k t , Sthermal , gm, S f l i c k e r , StoDswap , p n MOS ;
//
a n a l o g begin
// E q u a t i o n i n i t i a l i z a t i o n
p n MOS = 1 . 0 ; // nMOS
A=7.02 e −4;
B= 1 1 0 8 . 0 ;
e p s i l o n s i = 1 . 0 3 5 9 e −10; // Eqn 4
e p s i l o n o x = 3 . 4 5 3 1 4 3 e −11; // Eqn 5
Tnomk = Tnom+ 2 7 3 . 1 5 ; // Eqn 6
T2=$ t e m p e r a t u r e ;
T r a t i o = T2/Tnomk ;
Vto T = Vto−Tcv ∗ ( T2−Tnomk ) ;
Egnom = 1 . 1 6 − 0 . 0 0 0 7 0 2 ∗Tnomk∗Tnomk/ (Tnomk+ 1 1 0 8 ) ;
Eg = 1 . 1 6 − 0 . 0 0 0 7 0 2 ∗T2∗T2 / ( T2+ 1 1 0 8 ) ;
Phi T = Phi ∗ T r a t i o − 3 . 0 ∗ $ v t ∗ l n ( T r a t i o )−Egnom∗ T r a t i o+Eg ;
Ibb T = Ibb ∗(1. 0+ I b b t ∗ ( T2 −Tnomk ) ) ;
Weff = W + Dw; // Eqn 25
L e f f = L + Dl ; // Eqn 26
RDeff = ( ( H d i f ∗Rsh ) / Weff ) /Np + Rdc ;
R S e f f = ( ( H d i f ∗Rsh ) / Weff ) /Np + Rsc ;
con1 = s q r t (Np∗ Weff ∗Ns∗ L e f f ) ;
Vt T2=‘P K ∗T2/ ‘P Q ;
Eg T1=Eg−A∗Tnomk∗Tnomk/ (B+Tnomk ) ;
Eg T2=Eg−A∗T2∗T2 / (B+T2 ) ;
Vj T2=(T2/Tnomk) ∗ Vj −(2∗Vt T2 ) ∗ l n ( pow ( ( T2/Tnomk ) , 1 . 5 ) ) − ( ( T2/Tnomk) ∗ Eg T1−Eg T2 ) ;
Cj0 T2=Cj0 ∗(1+M∗ ( 4 0 0 e −6∗(T2−Tnomk) −( Vj T2−Vj ) / Vj ) ) ;
F1=(Vj/(1−M))∗(1 −pow((1 −Fc ) ,(1 −M) ) ) ;
F2=pow((1 −Fc ) , (1+M) ) ;
F3=1−Fc∗(1+M) ;
I s T 2=I s ∗pow ( ( T2/Tnomk ) , ( X t i /N) ) ∗ l i m e x p (( −Eg T1/Vt T2 )∗(1 −T2/Tnomk ) ) ;
con2 = ( Cox∗Ns∗Np∗ Weff ∗ L e f f ) ;
f o u r k t = 4 . 0 ∗ ‘P K ∗T2 ;
//
i f (LEVEL == 2 )
begin
U c r i t T = U c r i t ∗pow ( T r a t i o , Ucex ) ;
Vtoa = Vto+Avto / con1 ; // Eqn 27
Kpa = Kp∗(1. 0+Akp/ con1 ) ; // Eqn 28
Kpa T = Kpa∗pow ( T r a t i o , Bex ) ; // Eqn 18
Gammaa = Gamma+Agamma/ con1 ; // Eqn 29
C e p s i l o n = 4 . 0 ∗ pow ( 2 2 e −3 , 2 ) ; // Eqn 30
x i = 0 . 0 2 8 ∗ ( 1 0 . 0 ∗ ( L e f f /Lk ) − 1 . 0 ) ; // Eqn 31
nnn = 1 . 0 + 0 . 5 ∗ ( x i+ s q r t ( pow ( x i , 2 ) + C e p s i l o n ) ) ;
deltaV RSCE = ( 2 . 0 ∗ Q0/Cox ) ∗ ( 1 . 0 / pow ( nnn , 2 ) ) ; // Eqn 32
end
//
// Model branch and node v o l t a g e s
//
152
VD=Vd ; // Eqn 24
end
else
begin
StoDswap = − 1 . 0 ;
VD=Vs ;
VS=Vd ;
end
i f (LEVEL == 2 )
VGprime=VG−Vto T−deltaV RSCE+Phi T+Gamma∗ s q r t ( Phi T ) ; // Eqn 33 nMOS e q u a t i o n
else
VGprime=Vg−Vto T+Phi T+Gamma∗ s q r t ( Phi T ) ;
//
i f (LEVEL == 2 )
begin
i f ( VGprime > 0 )
VP0=VGprime−Phi T−Gammaa∗ ( s q r t ( VGprime+(Gammaa/ 2 . 0 ) ∗ (Gammaa / 2 . 0 ) )
−(Gammaa / 2 . 0 ) ) ; // Eqn 34
else
VP0 = −Phi T ;
VSprime =0. 5∗(VS+Phi T+s q r t ( pow ( (VS+Phi T ) , 2 ) + pow ( ( 4 . 0 ∗ $ v t ) , 2 ) ) ) ; // Eqn 35
VDprime =0.5∗(VD+Phi T+s q r t ( pow ( (VD+Phi T ) , 2 ) + pow ( ( 4 . 0 ∗ $ v t ) , 2 ) ) ) ; // Eqn 35
Gamma0=Gammaa−( e p s i l o n s i /Cox ) ∗ ( ( Leta / L e f f ) ∗ ( s q r t ( VSprime)+ s q r t ( VDprime ) )
−(3.0∗Weta/ Weff ) ∗ s q r t (VP0+Phi T ) ) ; // Eqn 36
Gammaprime = 0 . 5 ∗ (Gamma0+s q r t ( pow (Gamma0, 2 ) +0.1∗ $ v t ) ) ; // Eqn 37
i f ( VGprime > 0 . 0 )
Vp = VGprime−Phi T−Gammaprime ∗ ( s q r t ( VGprime+(Gammaprime / 2 . 0 ) ∗
( Gammaprime / 2 . 0 ) ) − ( Gammaprime / 2 . 0 ) ) ; // Eqn 38
else
Vp = −Phi T ;
n = 1 . 0 +Gammaa/ ( 2 . 0 ∗ s q r t (Vp+Phi T +4.0∗ $ v t ) ) ; // Eqn 39
end
else
begin
i f ( VGprime > 0 )
Vp=VGprime−Phi T−Gamma∗ ( s q r t ( VGprime+(Gamma/ 2 . 0 ) ∗ (Gamma/ 2 . 0 ) )
−(Gamma / 2 . 0 ) ) ; // Eqn 34
else
Vp = −Phi T ;
n = 1 . 0 +Gamma/ ( 2 . 0 ∗ s q r t (Vp+Phi T +4.0∗ $ v t ) ) ; // Eqn 39
end
//
X1 = (Vp−VS) / $ v t ;
i f f = l n (1.0+ l i m e x p (X1 / 2 . 0 ) ) ∗ l n (1.0+ l i m e x p (X1 / 2 . 0 ) ) ; // Eqn 44
X2 = (Vp−VD) / $ v t ;
i r = l n (1.0+ l i m e x p (X2 / 2 . 0 ) ) ∗ l n (1.0+ l i m e x p (X2 / 2 . 0 ) ) ; // Eqn 57
//
i f (LEVEL == 2 )
begin
Vc = U c r i t T ∗Ns∗ L e f f ; // Eqn 45
Vdss = Vc ∗ ( s q r t ( 0 . 2 5 + ( ( $ v t / ( Vc ) ) ∗ s q r t ( i f f ) ) ) − 0 . 5 ) ; // Eqn 4 6 ;
Vdssprime = Vc ∗ ( s q r t ( 0 . 2 5 + ( $ v t /Vc ) ∗ ( s q r t ( i f f ) −0.75∗ l n ( i f f ) ) ) − 0 . 5 )
+$ v t ∗ ( l n ( Vc / ( 2 . 0 ∗ $ v t ) ) − 0 . 6 ) ; // Eqn 47
i f ( Lambda ∗ ( s q r t ( i f f ) > ( Vdss / $ v t ) ) )
d e l t a V = 4 . 0 ∗ $ v t ∗ s q r t ( Lambda ∗ ( s q r t ( i f f ) −(Vdss / $ v t ) )
+ (1.0/64.0) ); // Eqn 48
else
deltaV = 1 . 0 / 6 4 . 0 ;
Vdso2 = (VD−VS ) / 2 . 0 ; // Eqn 49
Vip = s q r t ( pow ( Vdss , 2 ) + pow ( deltaV , 2 ) ) − s q r t ( pow ( ( Vdso2 − Vdss ) , 2 )
+ pow ( deltaV , 2 ) ) ; // Eqn 50
153
Lc = s q r t ( ( e p s i l o n s i /Cox ) ∗ Xj ) ; // Eqn 51
DeltaL = Lambda∗Lc∗ l n ( 1 . 0 + ( ( Vdso2−Vip ) / ( Lc∗ U c r i t T ) ) ) ; // Eqn 52
Lprime = Ns∗ L e f f − DeltaL + ( ( Vdso2+Vip ) / U c r i t T ) ; // Eqn 53
Lmin = Ns∗ L e f f / 1 0 . 0 ; // Eqn 54
Leq = 0 . 5 ∗ ( Lprime + s q r t ( pow ( Lprime , 2 ) + pow ( Lmin , 2 ) ) ) ; // Eqn 55
X3 = (Vp−Vdso2−VS−s q r t ( pow ( Vdssprime , 2 ) + pow ( deltaV , 2 ) )
+ s q r t ( pow ( ( Vdso2−Vdssprime ) , 2 ) + pow ( deltaV , 2 ) ) ) / $ v t ;
i r p r i m e = l n (1.0+ l i m e x p (X3 / 2 . 0 ) ) ∗ l n (1.0+ l i m e x p (X3 / 2 . 0 ) ) ; // Eqn 56
Beta0 = Kpa T ∗ (Np∗ Weff / Leq ) ; // Eqn 58
eta = 0 . 5 ; // Eqn 59 − nMOS
Qb0 = Gammaa∗ s q r t ( Phi T ) ; // Eqn 6 0 ;
Beta0prime = Beta0 ∗ ( 1 . 0 +(Cox / (EO∗ e p s i l o n s i ) ) ∗ Qb0 ) ; // Eqn 61
nq = 1 . 0 +Gammaa/ ( 2 . 0 ∗ s q r t (Vp+Phi T+1e − 6 ) ) ; // Eqn 69
end
else
nq = 1 . 0 +Gamma/ ( 2 . 0 ∗ s q r t (Vp+Phi T+1e − 6 ) ) ; // Eqn 69
//
Xf = s q r t ( 0.25+ i f f ) ; // Eqn 70
Xr = s q r t (0. 25+ i r ) ; // Eqn 71
qD = −nq ∗ ( ( 4 . 0 / 1 5 . 0 ) ∗ ( ( 3 . 0 ∗ pow ( Xr , 3 ) + 6 . 0 ∗ pow ( Xr , 2 ) ∗ Xf + 4 . 0 ∗ Xr∗pow ( Xf , 2 )
+ 2 . 0 ∗ pow ( Xf , 3 ) ) / ( pow ( ( Xf+Xr ) , 2 ) ) ) − 0 . 5 ) ; // Eqn 72
qS = −nq ∗ ( ( 4 . 0 / 1 5 . 0 ) ∗ ( ( 3 . 0 ∗ pow ( Xf , 3 ) + 6 . 0 ∗ pow ( Xf , 2 ) ∗ Xr + 4 . 0 ∗ Xf ∗pow ( Xr , 2 )
+ 2 . 0 ∗ pow ( Xr , 3 ) ) / ( pow ( ( Xf+Xr ) , 2 ) ) ) − 0 . 5 ) ; // Eqn 73
q I = −nq ∗ ( ( 4 . 0 / 3 . 0 ) ∗ ( ( pow ( Xf , 2 ) + ( Xf ∗Xr)+pow ( Xr , 2 ) ) / ( Xf+Xr ) ) − 1 . 0 ) ; // Eqn 74
i f (LEVEL == 2 )
i f ( VGprime > 0 )
qB = (−Gammaa∗ s q r t (Vp+Phi T+1e − 6 ) ) ∗ ( 1 . 0 / $ v t ) − ( ( nq −1.0) / nq ) ∗ q I ; // Eqn 75
else
qB = −VGprime/ $ v t ;
else
i f ( VGprime > 0 )
qB = (−Gamma∗ s q r t (Vp+Phi T+1e − 6 ) ) ∗ ( 1 . 0 / $ v t ) − ( ( nq −1.0 )/ nq ) ∗ q I ; // Eqn 75
else
qB = −VGprime/ $ v t ;
//
i f (LEVEL == 2 )
Beta = Beta0prime / ( 1 . 0 + ( Cox/ (EO∗ e p s i l o n s i ) ) ∗ $ v t ∗ abs (qB+e t a ∗ q I ) ) ; // Eqn 62
else
Beta = Kp∗ ( Weff / L e f f )/(1+ Theta ∗Vp ) ;
//
I s p e c i f i c = 2 . 0 ∗ n∗ Beta ∗pow ( $vt , 2 ) ; // Eqn 65
//
i f (LEVEL == 2 )
begin
I d s = I s p e c i f i c ∗ ( i f f −i r p r i m e ) ; // Eqn 66
Vib = VD−VS−Ibn ∗ 2 . 0 ∗ Vdss ; // Eqn 67
i f ( Vib > 0 . 0 )
Idb = I d s ∗ ( I b a / Ibb T ) ∗ Vib ∗ exp ( (−Ibb T ∗Lc ) / Vib ) ; // Eqn 68
else
Idb = 0 . 0 ;
end
else
I d s = I s p e c i f i c ∗ ( i f f −i r ) ; // Eqn 66
//
S t h e r m a l = f o u r k t ∗ Beta ∗ abs ( q I ) ;
gm = Beta ∗ $ v t ∗ ( s q r t ( ( 4 . 0 ∗ i f f / I s p e c i f i c ) +1.0) − s q r t ( ( 4 . 0 ∗ i r / I s p e c i f i c ) + 1 . 0 ) ) ;
S f l i c k e r = ( Kf∗gm∗gm) / ( Np∗ Weff ∗Ns∗ L e f f ∗Cox ) ;
//
qb = con2 ∗ $ v t ∗qB ;
qg = con2 ∗ $ v t ∗(− qI−qB ) ;
q g s o = Cgso ∗ Weff ∗Np∗ (VG−VS ) ;
qgdo = Cgdo∗ Weff ∗Np∗ (VG−VD) ;
154
qgbo = Cgbo∗ L e f f ∗Np∗VG;
// Drain and s o u r c e d i o d e s
i f ( StoDswap > 0 . 0 )
begin
V1=p n MOS∗V( Bulk , D r a i n i n t ) ;
V2=p n MOS∗V( Bulk , S o u r c e i n t ) ;
end
else
begin
V2=p n MOS∗V( Bulk , D r a i n i n t ) ;
V1=p n MOS∗V( Bulk , S o u r c e i n t ) ;
end
I d 1= (V1>−5.0∗N∗ $ v t ) ? Area ∗ I s T 2 ∗ ( l i m e x p ( V1/ (N∗Vt T2 ) ) − 1 . 0 ) : 0 ;
Qd1=(V1<Fc∗ Vj ) ? Tt∗ I d 1+Area ∗ ( Cj0 T2 ∗ Vj T2 /(1−M))∗(1 −pow((1 −V1/ Vj T2 ) ,(1 −M) ) ) : 0 ;
I d 2 =(V1<=−5.0∗N∗ $ v t ) ? −Area ∗ I s T 2 : 0 ;
Qd2=(V1>=Fc∗ Vj ) ? Tt∗ I d 1+Area ∗ Cj0 T2 ∗ ( F1+(1/F2 ) ∗ ( F3 ∗ (V1−Fc∗ Vj T2 )+(M/ ( 2 . 0 ∗ Vj T2 ) )
∗ (V1∗V1−Fc∗Fc∗ Vj T2 ∗ Vj T2 ) ) ) : 0 ;
I d 3 =(V1 == −Bv) ? −Ibv : 0 ;
I d 4 =(V1<−Bv) ?−Area ∗ I s T 2 ∗ ( l i m e x p ( −(Bv+V1) / Vt T2)−1.0+Bv/Vt T2 ) : 0 ;
I b d = I d 1+I d 2+I d 3+I d 4 ;
Qd = Qd1+Qd2 ;
//
I s 1= (V2>−5.0∗N∗ $ v t ) ? Area ∗ I s T 2 ∗ ( l i m e x p ( V2/ (N∗Vt T2 ) ) − 1 . 0 ) : 0 ;
Qs1=(V2<Fc∗ Vj ) ? Tt∗ I s 1+Area ∗ ( Cj0 T2 ∗ Vj T2 /(1−M))∗(1 −pow((1 −V2/ Vj T2 ) ,(1 −M) ) ) : 0 ;
I s 2 =(V2<=−5.0∗N∗ $ v t ) ? −Area ∗ I s T 2 : 0 ;
Qs2=(V2>=Fc∗ Vj ) ? Tt∗ I s 1+Area ∗ Cj0 T2 ∗ ( F1+(1/F2 ) ∗ ( F3 ∗ (V2−Fc∗ Vj T2 )+(M/ ( 2 . 0 ∗ Vj T2 ) )
∗ (V2∗V2−Fc∗Fc∗ Vj T2 ∗ Vj T2 ) ) ) : 0 ;
I s 3 =(V2 == −Bv) ? −Ibv : 0 ;
I s 4 =(V2<−Bv) ?−Area ∗ I s T 2 ∗ ( l i m e x p ( −(Bv+V2) / Vt T2)−1.0+Bv/Vt T2 ) : 0 ;
I b s = I s 1+I s 2+I s 3+I s 4 ;
Qs = Qs1+Qs2 ;
// Current and n o i s e c o n t r i b u t i o n s
i f ( StoDswap > 0 . 0 )
begin
i f ( RDeff > 0 . 0 )
I ( Drain , D r a i n i n t ) <+ V( Drain , D r a i n i n t ) / RDeff ;
else
I ( Drain , D r a i n i n t ) <+ V( Drain , D r a i n i n t ) / 1 e −7;
i f ( RSeff > 0 . 0 )
I ( Source , S o u r c e i n t ) <+ V( Source , S o u r c e i n t ) / R S e f f ;
else
I ( Source , S o u r c e i n t ) <+ V( Source , S o u r c e i n t ) / 1 e −7;
I ( D r a i n i n t , S o u r c e i n t ) <+ p n MOS∗ I d s ;
i f (LEVEL == 2 )
I ( D r a i n i n t , Bulk ) <+ p n MOS∗ Idb ;
I ( Gate , D r a i n i n t ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qg ) ;
I ( Gate , S o u r c e i n t ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qg ) ;
I ( D r a i n i n t , Bulk ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qb ) ;
I ( S o u r c e i n t , Bulk ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qb ) ;
I ( Gate , S o u r c e i n t ) <+ p n MOS∗ ddt ( q g s o ) ;
I ( Gate , D r a i n i n t ) <+ p n MOS∗ ddt ( qgdo ) ;
I ( Gate , Bulk ) <+ p n MOS∗ ddt ( qgbo ) ;
I ( Bulk , D r a i n i n t ) <+ p n MOS∗ I b d ;
I ( Bulk , D r a i n i n t ) <+ p n MOS∗ ddt (Qd ) ;
I ( Bulk , S o u r c e i n t ) <+ p n MOS∗ I b s ;
I ( Bulk , S o u r c e i n t ) <+ p n MOS∗ ddt ( Qs ) ;
I ( D r a i n i n t , S o u r c e i n t ) <+ w h i t e n o i s e ( Sthermal , ”t h e r m a l ” ) ;
I ( D r a i n i n t , S o u r c e i n t ) <+ f l i c k e r n o i s e ( S f l i c k e r , Af , ” f l i c k e r ” ) ;
I ( Drain , D r a i n i n t ) <+ w h i t e n o i s e ( f o u r k t / RDeff , ”t h e r m a l ” ) ;
I ( Source , S o u r c e i n t ) <+ w h i t e n o i s e ( f o u r k t / RSeff , ”t h e r m a l ” ) ;
end
else
155
begin
i f ( RSeff > 0 . 0 )
I ( Drain , D r a i n i n t ) <+ V( Drain , D r a i n i n t ) / R S e f f ;
else
I ( Drain , D r a i n i n t ) <+ V( Drain , D r a i n i n t ) / 1 e −7;
i f ( RDeff > 0 . 0 )
I ( Source , S o u r c e i n t ) <+ V( Source , S o u r c e i n t ) / RDeff ;
else
I ( Source , S o u r c e i n t ) <+ V( Source , S o u r c e i n t ) / 1 e −7;
I ( S o u r c e i n t , D r a i n i n t ) <+ p n MOS∗ I d s ;
i f (LEVEL == 2 )
I ( S o u r c e i n t , Bulk ) <+ p n MOS∗ Idb ;
I ( Gate , S o u r c e i n t ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qg ) ;
I ( Gate , D r a i n i n t ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qg ) ;
I ( S o u r c e i n t , Bulk ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qb ) ;
I ( D r a i n i n t , Bulk ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qb ) ;
I ( Gate , D r a i n i n t ) <+ p n MOS∗ ddt ( q g s o ) ;
I ( Gate , S o u r c e i n t ) <+ p n MOS∗ ddt ( qgdo ) ;
I ( Gate , Bulk ) <+ p n MOS∗ ddt ( qgbo ) ;
I ( Bulk , S o u r c e i n t ) <+ p n MOS∗ I b d ;
I ( Bulk , S o u r c e i n t ) <+ p n MOS∗ ddt (Qd ) ;
I ( Bulk , D r a i n i n t ) <+ p n MOS∗ I b s ;
I ( Bulk , D r a i n i n t ) <+ p n MOS∗ ddt ( Qs ) ;
I ( S o u r c e i n t , D r a i n i n t ) <+ w h i t e n o i s e ( Sthermal , ”t h e r m a l ” ) ;
I ( S o u r c e i n t , D r a i n i n t ) <+ f l i c k e r n o i s e ( S f l i c k e r , Af , ” f l i c k e r ” ) ;
I ( S o u r c e i n t , S o u r c e ) <+ w h i t e n o i s e ( f o u r k t / RDeff , ”t h e r m a l ” ) ;
I ( D r a i n i n t , Drain ) <+ w h i t e n o i s e ( f o u r k t / RSeff , ”t h e r m a l ” ) ;
end
end
endmodule
//
module EKV26pMOS ( Drain , Gate , Source , Bulk ) ;
inout Drain , Gate , Source , Bulk ;
e l e c t r i c a l Drain , Gate , Source , Bulk ;
// I n t e r n a l nodes
e l e c t r i c a l Drain int , Source int ;
‘define a t t r ( txt ) (∗ txt ∗)
156
// D e v i c e dimension p a r a m e t e r s
parameter r e a l LEVEL = 1 from [ 1 : 2 ]
‘ a t t r ( i n f o=” l o n g = 1 , s h o r t = 2 ” ) ;
parameter r e a l L = 0 . 5 e−6 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” l e n g t h p a r a m e t e r ” u n i t = ”m” ) ;
parameter r e a l W = 10 e−6 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=”Width p a r a m e t e r ” u n i t = ”m” ) ;
parameter r e a l Np = 1 . 0 from [ 1 . 0 : i n f ]
‘ a t t r ( i n f o=” p a r a l l e l m u l t i p l e d e v i c e number ” ) ;
parameter r e a l Ns = 1 . 0 from [ 1 . 0 : i n f ]
‘ a t t r ( i n f o=” s e r i e s m u l t i p l e d e v i c e number ” ) ;
// P r o c e s s p a r a m e t e r s
parameter r e a l Cox = 3 . 4 5 e−3 from [ 0 : i n f ]
‘ a t t r ( i n f o=” g a t e o x i d e c a p a c i t a n c e p e r u n i t a r e a ” u n i t = ”F/m∗∗2 ” ) ;
parameter r e a l Xj = 0 . 1 5 e−6 from [ 0 . 0 1 e−6 : 1 . 0 e −6]
‘ a t t r ( i n f o=” m e t a l l u r g i c a l j u n c t i o n depth ” u n i t = ”m” ) ;
parameter r e a l Dw = −0.03 e−6 from [− i n f : 0 . 0 ]
‘ a t t r ( i n f o=” c h a n n e l width c o r r e c t i o n ” u n i t = ”m” ) ;
parameter r e a l Dl = −0.05 e−6 from [− i n f : 0 . 0 ]
‘ a t t r ( i n f o=” c h a n n e l l e n g t h c o r r e c t i o n ” u n i t = ”m” ) ;
// B a s i c i n t r i n s i c model p a r a m e t e r s
parameter r e a l Vto = −0.55 from [− i n f : −1e −6]
‘ a t t r ( i n f o=” l o n g c h a n n e l t h r e s h o l d v o l t a g e ” u n i t=”V” ) ;
parameter r e a l Gamma = 0 . 6 9 from [ 0 . 0 : 2 . 0 ]
‘ a t t r ( i n f o=”body e f f e c t p a r a m e t e r ” u n i t=”V∗ ∗ ( 1 / 2 ) ” ) ;
parameter r e a l Phi = 0 . 8 7 from [ 0 . 3 : 2 . 0 ]
‘ a t t r ( i n f o=”b u l k Fermi p o t e n t i a l ” u n i t=”V” ) ;
parameter r e a l Kp = 35 e−6 from [ 1 0 e−6 : i n f ]
‘ a t t r ( i n f o=” t r a n s c o n d u c t a n c e p a r a m e t e r ” u n i t = ”A/V∗∗2 ” ) ;
parameter r e a l Theta = 50 e−3 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” m o b i l i t y r e d u c t i o n c o e f f i c i e n t ” u n i t = ”1/V” ) ;
parameter r e a l EO = 5 1 . 0 e6 from [ 1 . 0 e6 : i n f ]
‘ a t t r ( i n f o=” m o b i l i t y c o e f f i c i e n t ” u n i t=”V/m” ) ;
parameter r e a l U c r i t = 1 8 . 0 e6 from [ 2 . 0 e6 : 2 5 . 0 e6 ]
‘ a t t r ( i n f o=” l o n g i t u d i n a l c r i t i c a l f i e l d ” u n i t=”V/m” ) ;
// Channel l e n g t h and c h a r g e s h a r i n g p a r a m e t e r s
parameter r e a l Lambda = 1 . 1 from [ 0 . 1 : i n f ]
‘ a t t r ( i n f o=” d e p l e t i o n l e n g t h c o e f f i c i e n t ” ) ;
parameter r e a l Weta = 0 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=”narrow−c h a n n e l e f f e c t c o e f f i c i e n t ” ) ;
parameter r e a l Leta = 0 . 4 5 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” l o n g i t u d i n a l c r i t i c a l f i e l d ” ) ;
// R e v e r s e s h o r t c h a n n e l e f f e c t p a r a m e t e r s
parameter r e a l Q0 = 200 e−6 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” r e v e r s e s h o r t c h a n n e l c h a r g e d e n s i t y ” u n i t=”A∗ s /m∗∗2 ” ) ;
parameter r e a l Lk = 0 . 6 e−6 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” c h a r a c t e r i s t i c l e n g t h ” u n i t=”m” ) ;
// I n t r i n s i c model t e m p e r a t u r e p a r a m e t e r s
parameter r e a l Tcv = −1.4 e−3
‘ a t t r ( i n f o=” t h r e s h o l d v o l t a g e t e m p e r a t u r e c o e f f i c i e n t ” u n i t=”V/K” ) ;
parameter r e a l Bex = −1.4
‘ a t t r ( i n f o=” m o b i l i t y t e m p e r a t u r e c o e f f i c i e n t ” ) ;
parameter r e a l Ucex = 2 . 0
‘ a t t r ( i n f o=” L o n g i t u d i n a l c r i t i c a l f i e l d t e m p e r a t u r e exponent ” ) ;
parameter r e a l I b b t = 0 . 0
‘ a t t r ( i n f o=”Ibb t e m p e r a t u r e c o e f f i c i e n t ” u n i t = ”1/K” ) ;
// S e r i e s r e s i s t a n c e c a l c u l a t i o n p a r a m e t e r s
parameter r e a l H d i f = 0 . 9 e−6 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” h e a v i l y doped d i f f u s i o n l e n g t h ” u n i t = ”m” ) ;
parameter r e a l Rsh = 9 9 0 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” d r a i n / s o u r c e d i f f u s i o n s h e e t r e s i s t a n c e ” u n i t=”Ohm/ s q u a r e ” ) ;
parameter r e a l Rsc = 0 . 0 from [ 0 . 0 : i n f ]
157
‘ a t t r ( i n f o=” s o u r c e c o n t a c t r e s i s t a n c e ” u n i t=”Ohm” ) ;
parameter r e a l Rdc = 0 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” d r a i n c o n t a c t r e s i s t a n c e ” u n i t=”Ohm” ) ;
// Gate o v e r l a p c a p a c i t a n c e s
parameter r e a l Cgso = 1 . 5 e −10 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” g a t e t o s o u r c e o v e r l a p c a p a c i t a n c e ” u n i t = ”F/m” ) ;
parameter r e a l Cgdo = 1 . 5 e −10 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” g a t e t o d r a i n o v e r l a p c a p a c i t a n c e ” u n i t= ”F/m” ) ;
parameter r e a l Cgbo = 4 . 0 e −10 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” g a t e t o b u l k o v e r l a p c a p a c i t a n c e ” u n i t= ”F/m” ) ;
// Impact i o n i z a t i o n r e l a t e d p a r a m e t e r s
parameter r e a l I b a = 0 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” f i r s t impact i o n i z a t i o n c o e f f i c i e n t ” u n i t = ”1/m” ) ;
parameter r e a l Ibb = 3 . 0 e8 from [ 1 . 0 e8 : i n f ]
‘ a t t r ( i n f o=”s e c o n d impact i o n i z a t i o n c o e f f i c i e n t ” u n i t=”V/m” ) ;
parameter r e a l Ibn = 1 . 0 from [ 0 . 1 : i n f ]
‘ a t t r ( i n f o=” s a t u r a t i o n v o l t a g e f a c t o r f o r impact i o n i z a t i o n ” ) ;
// F l i c k e r n o i s e p a r a m e t e r s
parameter r e a l Kf = 1 . 0 e −28 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” f l i c k e r n o i s e c o e f f i c i e n t ” ) ;
parameter r e a l Af = 1 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” f l i c k e r n o i s e exponent ” ) ;
// Matching p a r a m e t e r s
parameter r e a l Avto = 0 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” a r e a r e l a t e d t h e s h o l d v o l t a g e mismatch p a r a m e t e r ” u n i t = ”V∗m” ) ;
parameter r e a l Akp = 0 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” a r e a r e l a t e d g a i n mismatch p a r a m e t e r ” u n i t=”m” ) ;
parameter r e a l Agamma = 0 . 0 from [ 0 . 0 : i n f ]
‘ a t t r ( i n f o=” a r e a r e l a t e d body e f f e c t mismatch p a r a m e t e r ” u n i t=” s q r t (V) ∗m” ) ;
// Diode p a r a m e t e r s
parameter r e a l N=1.0 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” e m i s s i o n c o e f f i c i e n t ” ) ;
parameter r e a l I s =1e −14 from [ 1 e −20: i n f ]
‘ a t t r ( i n f o=” s a t u r a t i o n c u r r e n t ” u n i t=”A” ) ;
parameter r e a l Bv=100 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” r e v e r s e breakdown v o l t a g e ” u n i t=”V” ) ;
parameter r e a l Ibv=1e−3 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” c u r r e n t a t r e v e r s e breakdown v o l t a g e ” u n i t=”A” ) ;
parameter r e a l Vj =1.0 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” j u n c t i o n p o t e n t i a l ” u n i t=”V” ) ;
parameter r e a l Cj0=300e −15 from [ 0 : i n f ]
‘ a t t r ( i n f o=” z e r o −b i a s j u n c t i o n c a p a c i t a n c e ” u n i t=”F” ) ;
parameter r e a l M=0.5 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” g r a d i n g c o e f f i c i e n t ” ) ;
parameter r e a l Area =1.0 from [ 1 e −3: i n f ]
‘ a t t r ( i n f o=” d i o d e r e l a t i v e a r e a ” ) ;
parameter r e a l Fc =0.5 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=”forward −b i a s d e p l e t i o n c a p c i t a n c e c o e f f i c i e n t ” ) ;
parameter r e a l Tt =0.1 e−9 from [ 1 e −20: i n f ]
‘ a t t r ( i n f o=” t r a n s i t time ” u n i t=”s ” ) ;
parameter r e a l X t i =3.0 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” s a t u r a t i o n c u r r e n t t e m p e r a t u r e exponent ” ) ;
// Temperature p a r a m e t e r s
parameter r e a l Tnom = 2 6 . 8 5
‘ a t t r ( i n f o=”p a r a m e t e r measurement t e m p e r a t u r e ” u n i t = ” C e l s i u s ” ) ;
// L o c a l v a r i a b l e s
r e a l e p s i l o n s i , e p s i l o n o x , Tnomk , T2 , T r a t i o , Vto T , U c r i t T , Egnom , Eg , Phi T ;
r e a l Weff , L e f f , RDeff , RSeff , con1 , con2 , Vtoa , Kpa , Kpa T , Gammaa, C e p s i l o n , x i ;
r e a l nnn , deltaV RSCE , Vg , Vs , Vd , Vgs , Vgd , Vds , Vdso2 , VG, VS , VD;
r e a l VGprime , VP0 , VSprime , VDprime , Gamma0, Gammaprime , Vp ;
r e a l n , X1 , i f f , X2 , i r , Vc , Vdss , Vdssprime , deltaV , Vip ;
r e a l Lc , DeltaL , Lprime , Lmin , Leq , X3 , i r p r i m e , Beta0 , e t a ;
158
r e a l Qb0 , Beta0prime , nq , Xf , Xr , qD , qS , qI , qB , Beta , I s p e c i f i c , I d s , Vib , Idb , Ibb T ;
r e a l A, B, Vt T2 , Eg T1 , Eg T2 , Vj T2 , Cj0 T2 , F1 , F2 , F3 , I s T 2 ;
r e a l Id1 , Id2 , Id3 , Id4 , I s 1 , I s 2 , I s 3 , I s 4 , V1 , V2 , Ib d , I b s , Qd , Qs , Qd1 , Qd2 , Qs1 , Qs2 ;
r e a l qb , qg , qgso , qgdo , qgbo , f o u r k t , Sthermal , gm, S f l i c k e r , StoDswap , p n MOS ;
//
a n a l o g begin
// E q u a t i o n i n i t i a l i z a t i o n
p n MOS = − 1 . 0 ; // pMOS
A=7.02 e −4;
B= 1 1 0 8 . 0 ;
e p s i l o n s i = 1 . 0 3 5 9 e −10; // Eqn 4
e p s i l o n o x = 3 . 4 5 3 1 4 3 e −11; // Eqn 5
Tnomk = Tnom+ 2 7 3 . 1 5 ; // Eqn 6
T2=$ t e m p e r a t u r e ;
T r a t i o = T2/Tnomk ;
Vto T = −Vto+Tcv ∗ ( T2−Tnomk ) ; // S i g n s o f Vto and Tcv changed f o r pMOS
Egnom = 1 . 1 6 − 0 . 0 0 0 7 0 2 ∗Tnomk∗Tnomk/ (Tnomk+ 1 1 0 8 ) ;
Eg = 1 . 1 6 − 0 . 0 0 0 7 0 2 ∗T2∗T2 / ( T2+ 1 1 0 8 ) ;
Phi T = Phi ∗ T r a t i o − 3 . 0 ∗ $ v t ∗ l n ( T r a t i o )−Egnom∗ T r a t i o+Eg ;
Ibb T = Ibb ∗(1. 0+ I b b t ∗ ( T2 −Tnomk ) ) ;
Weff = W + Dw; // Eqn 25
L e f f = L + Dl ; // Eqn 26
RDeff = ( ( H d i f ∗Rsh ) / Weff ) /Np + Rdc ;
R S e f f = ( ( H d i f ∗Rsh ) / Weff ) /Np + Rsc ;
con1 = s q r t (Np∗ Weff ∗Ns∗ L e f f ) ;
Vt T2=‘P K ∗T2/ ‘P Q ;
Eg T1=Eg−A∗Tnomk∗Tnomk/ (B+Tnomk ) ;
Eg T2=Eg−A∗T2∗T2 / (B+T2 ) ;
Vj T2=(T2/Tnomk) ∗ Vj −(2∗Vt T2 ) ∗ l n ( pow ( ( T2/Tnomk ) , 1 . 5 ) ) − ( ( T2/Tnomk) ∗ Eg T1−Eg T2 ) ;
Cj0 T2=Cj0 ∗(1+M∗ ( 4 0 0 e −6∗(T2−Tnomk) −( Vj T2−Vj ) / Vj ) ) ;
F1=(Vj/(1−M))∗(1 −pow((1 −Fc ) ,(1 −M) ) ) ;
F2=pow((1 −Fc ) , (1+M) ) ;
F3=1−Fc∗(1+M) ;
I s T 2=I s ∗pow ( ( T2/Tnomk ) , ( X t i /N) ) ∗ l i m e x p (( −Eg T1/Vt T2 )∗(1 −T2/Tnomk ) ) ;
con2 = ( Cox∗Ns∗Np∗ Weff ∗ L e f f ) ;
f o u r k t = 4 . 0 ∗ ‘P K ∗T2 ;
//
i f (LEVEL == 2 )
begin
U c r i t T = U c r i t ∗pow ( T r a t i o , Ucex ) ;
Vtoa = Vto+Avto / con1 ; // Eqn 27
Kpa = Kp∗(1. 0+Akp/ con1 ) ; // Eqn 28
Kpa T = Kpa∗pow ( T r a t i o , Bex ) ; // Eqn 18
Gammaa = Gamma+Agamma/ con1 ; // Eqn 29
C e p s i l o n = 4 . 0 ∗ pow ( 2 2 e −3 , 2 ) ; // Eqn 30
x i = 0 . 0 2 8 ∗ ( 1 0 . 0 ∗ ( L e f f /Lk ) − 1 . 0 ) ; // Eqn 31
nnn = 1 . 0 + 0 . 5 ∗ ( x i+ s q r t ( pow ( x i , 2 ) + C e p s i l o n ) ) ;
deltaV RSCE = ( 2 . 0 ∗ Q0/Cox ) ∗ ( 1 . 0 / pow ( nnn , 2 ) ) ; // Eqn 32
end
//
// Model branch and node v o l t a g e s
//
159
end
else
begin
StoDswap = − 1 . 0 ;
VD=Vs ;
VS=Vd ;
end
i f (LEVEL == 2 )
VGprime=VG−Vto T−deltaV RSCE+Phi T+Gamma∗ s q r t ( Phi T ) ; // Eqn 33 nMOS e q u a t i o n
else
VGprime=Vg−Vto T+Phi T+Gamma∗ s q r t ( Phi T ) ;
i f (LEVEL == 2 )
begin
i f ( VGprime > 0 )
VP0=VGprime−Phi T−Gammaa∗ ( s q r t ( VGprime+(Gammaa/ 2 . 0 ) ∗ (Gammaa/ 2 . 0 ) ) − (Gammaa / 2 . 0 ) ) ;
// Eqn 34
else
VP0 = −Phi T ;
VSprime =0. 5∗(VS+Phi T+s q r t ( pow ( (VS+Phi T ) , 2 ) + pow ( ( 4 . 0 ∗ $ v t ) , 2 ) ) ) ; // Eqn 35
VDprime =0.5∗(VD+Phi T+s q r t ( pow ( (VD+Phi T ) , 2 ) + pow ( ( 4 . 0 ∗ $ v t ) , 2 ) ) ) ; // Eqn 35
Gamma0=Gammaa−( e p s i l o n s i /Cox ) ∗ ( ( Leta / L e f f ) ∗ ( s q r t ( VSprime)+ s q r t ( VDprime ) )
−(3.0∗Weta/ Weff ) ∗ s q r t (VP0+Phi T ) ) ; // Eqn 36
Gammaprime = 0 . 5 ∗ (Gamma0+s q r t ( pow (Gamma0, 2 ) +0.1∗ $ v t ) ) ; // Eqn 37
i f ( VGprime > 0 . 0 )
Vp = VGprime−Phi T−Gammaprime ∗ ( s q r t ( VGprime+(Gammaprime / 2 . 0 ) ∗ ( Gammaprime / 2 . 0 ) )
− ( Gammaprime / 2 . 0 ) ) ; // Eqn 38
else
Vp = −Phi T ;
n = 1 . 0 +Gammaa/ ( 2 . 0 ∗ s q r t (Vp+Phi T +4.0∗ $ v t ) ) ; // Eqn 39
end
else
begin
i f ( VGprime > 0 )
Vp=VGprime−Phi T−Gamma∗ ( s q r t ( VGprime+(Gamma/ 2 . 0 ) ∗ (Gamma/ 2 . 0 ) ) − (Gamma / 2 . 0 ) ) ;
// Eqn 34
else
Vp = −Phi T ;
n = 1 . 0 +Gamma/ ( 2 . 0 ∗ s q r t (Vp+Phi T +4.0∗ $ v t ) ) ; // Eqn 39
end
//
X1 = (Vp−VS) / $ v t ;
i f f = l n (1.0+ l i m e x p (X1 / 2 . 0 ) ) ∗ l n (1.0+ l i m e x p (X1 / 2 . 0 ) ) ; // Eqn 44
X2 = (Vp−VD) / $ v t ;
i r = l n (1.0+ l i m e x p (X2 / 2 . 0 ) ) ∗ l n (1.0+ l i m e x p (X2 / 2 . 0 ) ) ; // Eqn 57
//
i f (LEVEL == 2 )
begin
Vc = U c r i t T ∗Ns∗ L e f f ; // Eqn 45
Vdss = Vc ∗ ( s q r t ( 0 . 2 5 + ( ( $ v t / ( Vc ) ) ∗ s q r t ( i f f ) ) ) − 0 . 5 ) ; // Eqn 4 6 ;
Vdssprime = Vc ∗ ( s q r t ( 0 . 2 5 + ( $ v t /Vc ) ∗ ( s q r t ( i f f ) −0.75∗ l n ( i f f ) ) ) − 0 . 5 )
+$ v t ∗ ( l n ( Vc / ( 2 . 0 ∗ $ v t ) ) − 0 . 6 ) ; // Eqn 47
i f ( Lambda ∗ ( s q r t ( i f f ) > ( Vdss / $ v t ) ) )
d e l t a V = 4 . 0 ∗ $ v t ∗ s q r t ( Lambda ∗ ( s q r t ( i f f ) −(Vdss / $ v t ) ) + ( 1 . 0 / 6 4 . 0 ) ) ; // Eqn 48
else deltaV = 1 . 0 / 6 4 . 0 ;
Vdso2 = (VD−VS ) / 2 . 0 ; // Eqn 49
Vip = s q r t ( pow ( Vdss , 2 ) + pow ( deltaV , 2 ) ) − s q r t ( pow ( ( Vdso2 − Vdss ) , 2 )
+ pow ( deltaV , 2 ) ) ; // Eqn 50
Lc = s q r t ( ( e p s i l o n s i /Cox ) ∗ Xj ) ; // Eqn 51
DeltaL = Lambda∗Lc∗ l n ( 1 . 0 + ( ( Vdso2−Vip ) / ( Lc∗ U c r i t T ) ) ) ; // Eqn 52
Lprime = Ns∗ L e f f − DeltaL + ( ( Vdso2+Vip ) / U c r i t T ) ; // Eqn 53
Lmin = Ns∗ L e f f / 1 0 . 0 ; // Eqn 54
160
Leq = 0 . 5 ∗ ( Lprime + s q r t ( pow ( Lprime , 2 ) + pow ( Lmin , 2 ) ) ) ; // Eqn 55
X3 = (Vp−Vdso2−VS−s q r t ( pow ( Vdssprime , 2 ) + pow ( deltaV , 2 ) )
+ s q r t ( pow ( ( Vdso2−Vdssprime ) , 2 ) + pow ( deltaV , 2 ) ) ) / $ v t ;
i r p r i m e = l n (1.0+ l i m e x p (X3 / 2 . 0 ) ) ∗ l n (1.0+ l i m e x p (X3 / 2 . 0 ) ) ; // Eqn 56
Beta0 = Kpa T ∗ (Np∗ Weff / Leq ) ; // Eqn 58
e t a = 0 . 3 3 3 3 3 3 3 ; // Eqn 59 − pMOS
Qb0 = Gammaa∗ s q r t ( Phi T ) ; // Eqn 6 0 ;
Beta0prime = Beta0 ∗ ( 1 . 0 +(Cox / (EO∗ e p s i l o n s i ) ) ∗ Qb0 ) ; // Eqn 61
nq = 1 . 0 +Gammaa/ ( 2 . 0 ∗ s q r t (Vp+Phi T+1e − 6 ) ) ; // Eqn 69
end
else
nq = 1 . 0 +Gamma/ ( 2 . 0 ∗ s q r t (Vp+Phi T+1e − 6 ) ) ; // Eqn 69
//
Xf = s q r t ( 0.25+ i f f ) ; // Eqn 70
Xr = s q r t (0. 25+ i r ) ; // Eqn 71
qD = −nq ∗ ( ( 4 . 0 / 1 5 . 0 ) ∗ ( ( 3 . 0 ∗ pow ( Xr , 3 ) + 6 . 0 ∗ pow ( Xr , 2 ) ∗ Xf + 4 . 0 ∗ Xr∗pow ( Xf , 2 )
+ 2 . 0 ∗ pow ( Xf , 3 ) ) / ( pow ( ( Xf+Xr ) , 2 ) ) ) − 0 . 5 ) ; // Eqn 72
qS = −nq ∗ ( ( 4 . 0 / 1 5 . 0 ) ∗ ( ( 3 . 0 ∗ pow ( Xf , 3 ) + 6 . 0 ∗ pow ( Xf , 2 ) ∗ Xr + 4 . 0 ∗ Xf ∗pow ( Xr , 2 )
+ 2 . 0 ∗ pow ( Xr , 3 ) ) / ( pow ( ( Xf+Xr ) , 2 ) ) ) − 0 . 5 ) ; // Eqn 73
q I = −nq ∗ ( ( 4 . 0 / 3 . 0 ) ∗ ( ( pow ( Xf , 2 ) + ( Xf ∗Xr)+pow ( Xr , 2 ) ) / ( Xf+Xr ) ) − 1 . 0 ) ; // Eqn 74
i f (LEVEL == 2 )
i f ( VGprime > 0 )
qB = (−Gammaa∗ s q r t (Vp+Phi T+1e − 6 ) ) ∗ ( 1 . 0 / $ v t ) − ( ( nq −1.0) / nq ) ∗ q I ; // Eqn 75
else
qB = −VGprime/ $ v t ;
else
i f ( VGprime > 0 )
qB = (−Gamma∗ s q r t (Vp+Phi T+1e − 6 ) ) ∗ ( 1 . 0 / $ v t ) − ( ( nq −1.0 )/ nq ) ∗ q I ; // Eqn 75
else
qB = −VGprime/ $ v t ;
//
i f (LEVEL == 2 )
Beta = Beta0prime / ( 1 . 0 + ( Cox/ (EO∗ e p s i l o n s i ) ) ∗ $ v t ∗ abs (qB+e t a ∗ q I ) ) ; // Eqn 62
else
Beta = Kp∗ ( Weff / L e f f )/(1+ Theta ∗Vp ) ;
//
I s p e c i f i c = 2 . 0 ∗ n∗ Beta ∗pow ( $vt , 2 ) ; // Eqn 65
//
i f (LEVEL == 2 )
begin
I d s = I s p e c i f i c ∗ ( i f f −i r p r i m e ) ; // Eqn 66
Vib = VD−VS−Ibn ∗ 2 . 0 ∗ Vdss ; // Eqn 67
i f ( Vib > 0 . 0 )
Idb = I d s ∗ ( I b a / Ibb T ) ∗ Vib ∗ exp ( (−Ibb T ∗Lc ) / Vib ) ; // Eqn 68
else
Idb = 0 . 0 ;
end
else
I d s = I s p e c i f i c ∗ ( i f f −i r ) ; // Eqn 66
//
S t h e r m a l = f o u r k t ∗ Beta ∗ abs ( q I ) ;
gm = Beta ∗ $ v t ∗ ( s q r t ( ( 4 . 0 ∗ i f f / I s p e c i f i c ) +1.0) − s q r t ( ( 4 . 0 ∗ i r / I s p e c i f i c ) + 1 . 0 ) ) ;
S f l i c k e r = ( Kf∗gm∗gm) / ( Np∗ Weff ∗Ns∗ L e f f ∗Cox ) ;
//
qb = con2 ∗ $ v t ∗qB ;
qg = con2 ∗ $ v t ∗(− qI−qB ) ;
q g s o = Cgso ∗ Weff ∗Np∗ (VG−VS ) ;
qgdo = Cgdo∗ Weff ∗Np∗ (VG−VD) ;
qgbo = Cgbo∗ L e f f ∗Np∗VG;
// Drain and s o u r c e d i o d e s
i f ( StoDswap > 0 . 0 )
begin
161
V1=p n MOS∗V( Bulk , D r a i n i n t ) ;
V2=p n MOS∗V( Bulk , S o u r c e i n t ) ;
end
else
begin
V2=p n MOS∗V( Bulk , D r a i n i n t ) ;
V1=p n MOS∗V( Bulk , S o u r c e i n t ) ;
end
I d 1= (V1>−5.0∗N∗ $ v t ) ? Area ∗ I s T 2 ∗ ( l i m e x p ( V1/ (N∗Vt T2 ) ) − 1 . 0 ) : 0 ;
Qd1=(V1<Fc∗ Vj ) ? Tt∗ I d 1+Area ∗ ( Cj0 T2 ∗ Vj T2 /(1−M))∗(1 −pow((1 −V1/ Vj T2 ) ,(1 −M) ) ) : 0 ;
I d 2 =(V1<=−5.0∗N∗ $ v t ) ? −Area ∗ I s T 2 : 0 ;
Qd2=(V1>=Fc∗ Vj ) ? Tt∗ I d 1+Area ∗ Cj0 T2 ∗ ( F1+(1/F2 ) ∗ ( F3 ∗ (V1−Fc∗ Vj T2 )+(M/ ( 2 . 0 ∗ Vj T2 ) )
∗ (V1∗V1−Fc∗Fc∗ Vj T2 ∗ Vj T2 ) ) ) : 0 ;
I d 3 =(V1 == −Bv) ? −Ibv : 0 ;
I d 4 =(V1<−Bv) ?−Area ∗ I s T 2 ∗ ( l i m e x p ( −(Bv+V1) / Vt T2)−1.0+Bv/Vt T2 ) : 0 ;
I b d = I d 1+I d 2+I d 3+I d 4 ;
Qd = Qd1+Qd2 ;
//
I s 1= (V2>−5.0∗N∗ $ v t ) ? Area ∗ I s T 2 ∗ ( l i m e x p ( V2/ (N∗Vt T2 ) ) − 1 . 0 ) : 0 ;
Qs1=(V2<Fc∗ Vj ) ? Tt∗ I s 1+Area ∗ ( Cj0 T2 ∗ Vj T2 /(1−M))∗(1 −pow((1 −V2/ Vj T2 ) ,(1 −M) ) ) : 0 ;
I s 2 =(V2<=−5.0∗N∗ $ v t ) ? −Area ∗ I s T 2 : 0 ;
Qs2=(V2>=Fc∗ Vj ) ? Tt∗ I s 1+Area ∗ Cj0 T2 ∗ ( F1+(1/F2 ) ∗ ( F3 ∗ (V2−Fc∗ Vj T2 )+(M/ ( 2 . 0 ∗ Vj T2 ) )
∗ (V2∗V2−Fc∗Fc∗ Vj T2 ∗ Vj T2 ) ) ) : 0 ;
I s 3 =(V2 == −Bv) ? −Ibv : 0 ;
I s 4 =(V2<−Bv) ?−Area ∗ I s T 2 ∗ ( l i m e x p ( −(Bv+V2) / Vt T2)−1.0+Bv/Vt T2 ) : 0 ;
I b s = I s 1+I s 2+I s 3+I s 4 ;
Qs = Qs1+Qs2 ;
// Current c o n t r i b u t i o n s
i f ( StoDswap > 0 . 0 )
begin
i f ( RDeff > 0 . 0 )
I ( Drain , D r a i n i n t ) <+ V( Drain , D r a i n i n t ) / RDeff ;
else
I ( Drain , D r a i n i n t ) <+ V( Drain , D r a i n i n t ) / 1 e −7;
i f ( RSeff > 0 . 0 )
I ( Source , S o u r c e i n t ) <+ V( Source , S o u r c e i n t ) / R S e f f ;
else
I ( Source , S o u r c e i n t ) <+ V( Source , S o u r c e i n t ) / 1 e −7;
I ( D r a i n i n t , S o u r c e i n t ) <+ p n MOS∗ I d s ;
i f (LEVEL == 2 )
I ( D r a i n i n t , Bulk ) <+ p n MOS∗ Idb ;
I ( Gate , D r a i n i n t ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qg ) ;
I ( Gate , S o u r c e i n t ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qg ) ;
I ( D r a i n i n t , Bulk ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qb ) ;
I ( S o u r c e i n t , Bulk ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qb ) ;
I ( Gate , S o u r c e i n t ) <+ p n MOS∗ ddt ( q g s o ) ;
I ( Gate , D r a i n i n t ) <+ p n MOS∗ ddt ( qgdo ) ;
I ( Gate , Bulk ) <+ p n MOS∗ ddt ( qgbo ) ;
I ( Bulk , D r a i n i n t ) <+ p n MOS∗ I b d ;
I ( Bulk , D r a i n i n t ) <+ p n MOS∗ ddt (Qd ) ;
I ( Bulk , S o u r c e i n t ) <+ p n MOS∗ I b s ;
I ( Bulk , S o u r c e i n t ) <+ p n MOS∗ ddt ( Qs ) ;
I ( D r a i n i n t , S o u r c e i n t ) <+ w h i t e n o i s e ( Sthermal , ”t h e r m a l ” ) ;
I ( D r a i n i n t , S o u r c e i n t ) <+ f l i c k e r n o i s e ( S f l i c k e r , Af , ” f l i c k e r ” ) ;
I ( Drain , D r a i n i n t ) <+ w h i t e n o i s e ( f o u r k t / RDeff , ”t h e r m a l ” ) ;
I ( Source , S o u r c e i n t ) <+ w h i t e n o i s e ( f o u r k t / RSeff , ”t h e r m a l ” ) ;
end
else
begin
i f ( RSeff > 0 . 0 )
I ( Drain , D r a i n i n t ) <+ V( Drain , D r a i n i n t ) / R S e f f ;
else
162
I ( Drain , D r a i n i n t ) <+ V( Drain , D r a i n i n t ) / 1 e −7;
i f ( RDeff > 0 . 0 )
I ( Source , S o u r c e i n t ) <+ V( Source , S o u r c e i n t ) / RDeff ;
else
I ( Source , S o u r c e i n t ) <+ V( Source , S o u r c e i n t ) / 1 e −7;
I ( S o u r c e i n t , D r a i n i n t ) <+ p n MOS∗ I d s ;
i f (LEVEL == 2 )
I ( S o u r c e i n t , Bulk ) <+ p n MOS∗ Idb ;
I ( Gate , S o u r c e i n t ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qg ) ;
I ( Gate , D r a i n i n t ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qg ) ;
I ( S o u r c e i n t , Bulk ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qb ) ;
I ( D r a i n i n t , Bulk ) <+ p n MOS ∗ 0 . 5 ∗ ddt ( qb ) ;
I ( Gate , D r a i n i n t ) <+ p n MOS∗ ddt ( q g s o ) ;
I ( Gate , S o u r c e i n t ) <+ p n MOS∗ ddt ( qgdo ) ;
I ( Gate , Bulk ) <+ p n MOS∗ ddt ( qgbo ) ;
I ( Bulk , S o u r c e i n t ) <+ p n MOS∗ I b d ;
I ( Bulk , S o u r c e i n t ) <+ p n MOS∗ ddt (Qd ) ;
I ( Bulk , D r a i n i n t ) <+ p n MOS∗ I b s ;
I ( Bulk , D r a i n i n t ) <+ p n MOS∗ ddt ( Qs ) ;
I ( S o u r c e i n t , D r a i n i n t ) <+ w h i t e n o i s e ( Sthermal , ”t h e r m a l ” ) ;
I ( S o u r c e i n t , D r a i n i n t ) <+ f l i c k e r n o i s e ( S f l i c k e r , Af , ” f l i c k e r ” ) ;
I ( S o u r c e i n t , S o u r c e ) <+ w h i t e n o i s e ( f o u r k t / RDeff , ”t h e r m a l ” ) ;
I ( D r a i n i n t , Drain ) <+ w h i t e n o i s e ( f o u r k t / RSeff , ”t h e r m a l ” ) ;
end
end
endmodule
163
6.8 Update number one: September 2008
The first version of the Qucs EPFL-EKV v2.6 model provided Qucs users with
reasonably complete long and short channel models for nMOS and pMOS devices.
In no respect were these models optimized for minimum simulation run time or
were they flexible enough to allow users to select the style of charge partitioning
employed by the EKV model. Recent work on the Qucs implementation of the
EKV v2.6 MOSFET model and the Qucs ADMS/XML interface has resulted in a
significant reduction in simulation run time overhead, particularly in transient and
small signal analysis. The addition of a SPICE BSIM style partition parameter
Xpart to the Qucs version of the EKV v2.6 model now allows users to set the
style of charge partitioning employed by the EKV model. These notes explain the
function of the first EKV v2.6 update and introduce a series of test simulations
that demonstrate the effects these changes have on the operation of the Qucs port
of the EKV V2.6 model.
164
6.8.2 Charge partitioning
The MOSFT is a four terminal device with a dynamic performance that requires
accurate calculation of the charge at each terminal. Previous notes indicated that
the intrinsic channel charge equals the sum of the drain and source charges. How-
ever, the exact proportion of intrinsic channel charge that belongs to the drain or
to the source is often not known. The assignment of the proportion of the chan-
nel charge to the drain and source charges is called charge partitioning. The first
release of the Qucs EKV v2.6 model used the 50/50 partitioning scheme where
50% of the channel charge is arbitrarily assigned to both drain and source. It’s
interesting to note that this partitioning scheme has no physical basis but depends
entirely on convenience. A second partitioning scheme, called the 40/60 partition-
ing, does however, have a strong physical basis9 . Yet a third charge partitioning
is often employed for digital circuit simulation; this is known as the 0/100 par-
tition. The second release of the Qucs EPFL-EKV v2.6 model includes an extra
parameter called Xpart which allows users to set the partitioning scheme for dy-
namic simulation calculations. Xpart default is set at 0.4 which corresponds to the
40/60 partitioning scheme. Figure 6.10 illustrates a test circuit for determining
the S-Parameters of an nMOS device connected as a capacitance. Both the device
capacitance and associated series resistance can be extracted from S[1,1]. Qucs
equation block Eqn1 gives the equations for extracting these properties. Other
equations in Eqn1 show how the extracted capacitance can be represented as a
ratio of the basic parallel capacitance given by
165
dc simulation S parameter Parameter
DC1
simulation sweep
SP1 SW1
Type=const Sim=SP1
number C_parallel_plate
Values=[1MHz] Type=lin
1 6.9e-14
Param=Vgs
Start=-2
Stop=2
Points=81
EKV26nMOS1
P1
R1 L=1e-6
Num=1 X1 R=1 W=20e-6
Z=50 Ohm V1
Dw=-0.02e-6
U=Vgs
Is Dl=-0.05e-6
Cgso=1.5e-10
Equation Cgdo=1.5e-10
Eqn1 Cgbo=4.0e-10
PL_Cap=PlotVs(Cap, Vgs) Xpart=0.4
y=stoy(S)
Omega=2*pi*frequency Vgs frequency Rin
Cap=imag(y[1,1])/Omega -0.15 1e6 5.18
Rin=real(y[1,1])/(imag(y[1,1])*imag(y[1,1])) -0.1 1e6 5.25
L=1e-6
-0.05 1e6 5.31
W=20e-6
0 1e6 5.37
Cox=3.45e-3
0.05 1e6 5.43
C_parallel_plate=W*L*Cox
0.1 1e6 5.49
PL_Cap_ratio=PlotVs(Cap/C_parallel_plate, Vgs)
8e-14
Versus.0001: 0
6e-14 PL_Cap: 2.76e-14
Cap (F)
Versus.0001: 1.5
Versus.0001: -1.5
PL_Cap: 7.18e-14
4e-14 PL_Cap: 7.19e-14
2e-14
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Vgs (V)
1
Versus.0002: 0
Cap_ratio
Figure 6.10: Test circuit for simulating EKV v2.6 charge partitioning effects: Xpart
= 0.4 or QD/QS = 40/60
166
the Verilog-A model includes both overlap capacitance and drain and gate source
resistances. Hence the slight difference in the capacitance ratio and the recorded
values of Rin above one Ohm for the Verilog-A model.
167
VGP VP Beta Equation
n Eqn2
SRC4 SRC5 SRC7
P1=KP*W/L
G=1 Ohm G=1 Ohm G=1 Ohm
P2=PHI+4*vt(T2)
SRC18 P3=GAMMA/2
gate
G=1 Ohm P4=P3*P3
P5=2*vt(T2)*vt(T2)
1
gate D1 D4 P6=4/3
I1=V1-VTO+PHI+GAMMA*sqrt(PHI) I1=P1/(1.0+THETA*V1) P7=GAMMA/vt(T2)
bulk bulk SRC1 D3
P8=-COX*W*L*vt(T2)
G=1 I1=1.0+GAMMA/(2*sqrt(V1+P2))
D2 Spart=1-Xpart
I1=(V1 > 0) ? V1-PHI-GAMMA*(sqrt(V1+P4)-P3) : -PHI
drain drain
SRC2 D6
G=1 I1=(V3-V2)/vt(T2)
source VP
VP I2=0
I3=0
source X1
3
1
X2
SRC3
D5
G=1
I1=(V3-V2)/vt(T2) SRC19 SRC20
Beta Is I2=0 X1
G=1 Ohm If G=1 Ohm
I3=0
SRC10 SRC12
G=1 Ohm Equation
n G=1 Ohm
D7 Eqn1 D8
I1=P5*V2*V1 T2=Temp+273.15 I1=ln(1.0+limexp(0.5*V1))^2
I2=0
1
Ir
2
Is If drain
Ir X2
VP nq
SRC15
4
I1=1+GAMMA/(2*sqrt(V1+PHI+1e-6)) I3=0
1
I4=0 If Xf
nq qI
SRC23
SRC21
G=1 Ohm
G=1 Ohm
Xf Xr
Ir Xr
qI
qG
SRC24
SRC25
3
I2=abs(sqrt(0.25+V2))
SRC22 SRC26
VP nq G=1 G=P8
VGP
D12
I1=(V4 >0 ) ? -P7*sqrt(V3+PHI+1e-6)-V1*(V2-1)/(V2+1e-9) : -V4/vt(T2)
4
EKV_long1
L=10e-6
drain gate D14 W=10e-6
qG qB source Q1=Xpart*V6 VTO=0.5
gate
Q2=Spart*V6 GAMMA=0.7
Q3=Xpart*V5 PHI=0.5
Q4=Spart*V5 KP=20e-6
6
Figure 6.11: Qucs EDD model for a EKV v2.6 long channel nMOS device with
charge partitioning
168
dc simulation S parameter Parameter
DC1
simulation sweep
SP1 SW1
Type=const Sim=SP1
number C_parallel_plate Values=[1MHz] Type=lin
Param=Vgs
1 6.9e-14
Start=-2 EKV_long1
Stop=2 L=1e-6
Points=81 W=20e-6
P1 VTO=0.6
R1
Num=1 X1 GAMMA=0.71
R=1
Z=50 Ohm V1 PHI=0.97
U=Vgs KP=150e-6
Is THETA=50e-3
Temp=26.85
Equation
COX=3.45e-3
Eqn1 Xpart=0.4
PL_Cap=PlotVs(Cap, Vgs)
y=stoy(S)
Omega=2*pi*frequency Vgs frequency Rin
Cap=imag(y[1,1])/Omega -0.15 1e6 1
Rin=real(y[1,1])/(imag(y[1,1])*imag(y[1,1])) -0.1 1e6 1
L=1e-6
-0.05 1e6 1
W=20e-6
0 1e6 1
Cox=3.45e-3
0.05 1e6 1
C_parallel_plate=W*L*Cox
0.1 1e6 1
PL_Cap_ratio=PlotVs(Cap/C_parallel_plate, Vgs)
6e-14 Versus.0001: 0
PL_Cap: 2.24e-14
Cap (F)
Versus.0001: 1.5
4e-14 Versus.0001: -1.5
PL_Cap: 6.9e-14
PL_Cap: 6.9e-14
2e-14
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Vgs (V)
0.8 Versus.0002: 0
Cap_ratio
PL_Cap_ratio: 0.325
0.6 Versus.0002: 1.5
Versus.0002: -1.5 PL_Cap_ratio: 0.999
0.4 PL_Cap_ratio: 1
0.2
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Vgs (V)
Figure 6.12: Test circuit for simulating EKV v2.6 EDD model charge partitioning
effects: Xpart = 0.4 or QD/QS = 40/60
169
6.9 End note
The first update of the Qucs EKV v2.6 model provides users with a more opti-
mised model, with improved simulation performance and a more complete charge
partitioning scheme. Even with these changes the model is still not complete. The
nMOS and pMOS Verilog-A code needs to be unified and a number of optional
parameters need to be added to the Qucs implementation of the EKV v2.6 model.
The next update of the model is scheduled for the near future, following correction
of bug reports sent in by Qucs users. Once again my thanks to Stefan Jahn for all
his help and support during the first EKV v2.6 update development phase.
170
7 Compact Verilog-A pn junction
photodiode model
7.1 Introduction
Optoelectronic devices are not included in Qucs version 0.0.14 or earlier releases
of the software. With the growing importance of these devices, and indeed the
fact that they are present in an increasing number of electronic systems, this is a
significant omission. This report presents the structure and physical details of a
Qucs implementation of a pn junction photodiode model. The photodiode model
is the first in a planned series of Verilog-a compact device models for optoelectronic
components. The report also introduces the concept of a light bus and shows how
light paths can be added to Qucs simulation schematics. A number of example
schematics are also included in the report to demonstrate the performance of the
new Verilog-A pn junction photodiode model. The background to the work out-
lined in this report was first published in the International Journal of Numerical
Modelling: Electronic Networks, Devices and Fields in September 20081 .
• Diode DC I-V characteristics in the forward and reverse bias regions including
avalanche breakdown in reverse bias.
171
• Diode package series resistance.
172
PD1
Anode
N=1.35
Light (a) Rseries=1e-3
Cathode Is=0.34e-12
Bv=60
Ibv=1e-3
Anode
Vj=0.7
R=Rseries_area Cj0=60e-12
M=0.5
G=Responsivity Area=1.0
Tnom=26.85
R=Rsh
Ilight (b) Fc=0.5
Tt=10e-9
Xti=3.0
Light
Cathode Eg=1.16
Responsivity=0.5
Anode Rsh=5e8
QEpercent=80
Lambda=900
LEVEL=1
i=IRseries_arean (c) Kf=1e-12
R=Rseries_area
Af=1.0
G=Responsivity
Ffe=1.0
i=Ilightn I=Id C=Cd i=Idsn i=Idfn R=Rsh i=IRshn Temp=26.85
Ilight
Light
Cathode
Figure 7.1: Qucs pn junction photodiode model: (a) schematic capture symbol,
(b) basic model circuit, (c) full equivalent circuit, including noise
∗ Parameter LEVEL is used to select how the photodiode Responsivity is determined: with LEVEL = 1 the
model uses the listed value of parameter Responsivity or calculates it’s value if QEpercent is not equal to zero;
with LEVEL = 2 Responsivity is always calculated using QEpercent.
∀ (V d >= F c · V j)
Where
Vj h
1−M
i
F1 = · 1 − (1 − F c)
1−M
F 2 = [1 − F c]1+M
F 3 = 1 − F c · (1 + M )
and GMIN = 1e-12S.
174
K ·T1 K ·T2
Vt = , V t(T 2) = and K and q have their usual mean-
q q
ing.
• Diode photocurrent
QE · q · λ QEpercent · λ
Where Responsivity = =
h·c 1.2398e55
• photodiode noise
4·K ·T Kf · IdAf
Where IRshn2 = , Idsn2 = 2 · q · Id, Idf n2 = ,
Rsh f F fe
Ilight2 = 2 · q · Ilight, and ∆f is the noise frequency bandwidth in Hz.
175
‘ a t t r ( i n f o=” c u r r e n t a t r e v e r s e breakdown v o l t a g e ” u n i t=”A” ) ;
parameter r e a l Vj =0.7 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” j u n c t i o n p o t e n t i a l ” u n i t=”V” ) ;
parameter r e a l Cj0=60e −12 from [ 0 : i n f ]
‘ a t t r ( i n f o=” z e r o −b i a s j u n c t i o n c a p a c i t a n c e ” u n i t=”F” ) ;
parameter r e a l M=0.5 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” g r a d i n g c o e f f i c i e n t ” ) ;
parameter r e a l Area =1.0 from [ 1 . 0 : i n f ]
‘ a t t r ( i n f o=” d i o d e r e l a t i v e a r e a ” ) ;
parameter r e a l Tnom=26.85 from [ − 2 7 3 : i n f ]
‘ a t t r ( i n f o=”p a r a m e t e r measurement t e m p e r a t u r e ” u n i t=” C e l s i u s ” ) ;
parameter r e a l Fc =0.5 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=”forward −b i a s d e p l e t i o n c a p c i t a n c e c o e f f i c i e n t ” ) ;
parameter r e a l Tt=10e−9 from [ 1 e −20: i n f ]
‘ a t t r ( i n f o=” t r a n s i t time ” u n i t=”s ” ) ;
parameter r e a l X t i =3.0 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” s a t u r a t i o n c u r r e n t t e m p e r a t u r e exponent ” ) ;
parameter r e a l Eg= 1 . 1 6 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” e n e r g y gap ” u n i t=”eV ” ) ;
parameter r e a l R e s p o n s i v i t y =0.5 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=” r e s p o n s i v i t y ” u n i t=”A/W” ) ;
parameter r e a l Rsh=5e8 from [ 1 e −6: i n f ]
‘ a t t r ( i n f o=”shunt r e s i s t a n c e ” u n i t=”Ohm” ) ;
parameter r e a l QEpercent=80 from [ 0 : 1 0 0 ]
‘ a t t r ( i n f o=”quantum e f f i c i e n c y ” u n i t=”%” ) ;
parameter r e a l Lambda=900 from [ 1 0 0 : 2 0 0 0 ]
‘ a t t r ( i n f o=” l i g h t w a v e l e n g t h ” u n i t=”nm” ) ;
parameter integer LEVEL=1 from [ 1 : 2 ]
‘ a t t r ( i n f o=” r e s p o n s i v i t y c a l c u l a t o r s e l e c t o r ” ) ;
parameter r e a l Kf=1e −12 from [ 0 : i n f ]
‘ a t t r ( i n f o=” f l i c k e r n o i s e c o e f f i c i e n t ” ) ;
parameter r e a l Af =1.0 from [ 0 : i n f ]
‘ a t t r ( i n f o=” f l i c k e r n o i s e exponent ” ) ;
parameter r e a l F f e =1.0 from [ 0 : i n f ]
‘ a t t r ( i n f o=” f l i c k e r n o i s e f r e q u e n c y exponent ” ) ;
//
r e a l A, B, T1 , T2 , F1 , F2 , F3 , R s e r i e s A r e a , Eg T1 , Eg T2 ,
r e a l Vt T2 , Vj T2 , Cj0 T2 , Is T2 , GMIN;
r e a l I1 , I2 , I3 , I4 , I5 , Id , V1 , Q1 , Q2 , f o u r k t , TwoQ, Res1 ,
r e a l Res2 , Res , Vt , I f l i c k e r ;
r e a l con1 , con2 , con3 , con4 , con5 , con6 ;
// Model b r a n c h e s
branch ( Anode , n1 ) b6 ;
branch ( n1 , Cathode ) b1 ;
//
a n a l o g begin
// Model e q u a t i o n s
@( i n i t i a l s t e p )
begin
R s e r i e s A r e a =( R s e r i e s +1e −10)/ Area ;
A=7.02 e −4;
B= 1 1 0 8 . 0 ;
T1=Tnom+ 2 7 3 . 1 5 ;
T2=$ t e m p e r a t u r e ;
Vt=‘P K ∗ 3 0 0 . 0 / ‘P Q ;
Vt T2=‘P K ∗T2/ ‘P Q ;
F1=(Vj/(1−M))∗(1 −pow((1 −Fc ) ,(1 −M) ) ) ;
F2=pow((1 −Fc ) , (1+M) ) ;
F3=1−Fc∗(1+M) ;
Eg T1=Eg−A∗T1∗T1 / (B+T1 ) ;
Eg T2=Eg−A∗T2∗T2 / (B+T2 ) ;
Vj T2=(T2/T1 ) ∗ Vj−2∗ $ v t ∗ l n ( pow ( ( T2/T1 ) , 1 . 5 ) ) − ( ( T2/T1 ) ∗ Eg T1−Eg T2 ) ;
176
GMIN=1e −12;
Cj0 T2=Cj0 ∗(1+M∗ ( 4 0 0 e −6∗(T2−T1) −( Vj T2−Vj ) / Vj ) ) ;
I s T 2=I s ∗pow ( ( T2/T1 ) , ( X t i /N) ) ∗ l i m e x p ( −(Eg T1 ) / $ v t ∗(1−T2/T1 ) ) ;
Res1=(QEpercent != 0 ) ? QEpercent ∗Lambda / 1 . 2 3 9 8 e5 : R e s p o n s i v i t y ;
Res2=QEpercent ∗Lambda / 1 . 2 9 3 8 e5 ;
Res=(LEVEL==1) ? Res1 : Res2 ;
con1 =−5.0∗N∗Vt ;
con2=Area ∗ I s T 2 ;
con3=Area ∗ Cj0 T2 ;
con4=Fc∗ Vj ;
con5=Fc∗ Vj T2 ;
con6=Bv/ Vt T2 ;
end ;
// Current c o n t r i b u t i o n s
V1=V( b1 ) ;
I 1 =(V1 > con1 ) ? con2 ∗ ( l i m e x p (V1/ (N∗Vt T2 )) −1.0)+GMIN∗V1 : 0 ;
I 2 =(V1 <= con1 ) ? −con2+GMIN∗V1 : 0 ;
I 3 =(V1 == −Bv)?− Ibv : 0 ;
I 4 =(V1<−Bv)?− con2 ∗ ( l i m e x p ( −(Bv+V1) / Vt T2)−1.0+ con6 ) : 0 ;
Q1=(V1<con4 ) ? Tt∗ I 1 + con3 ∗ ( Vj T2 /(1−M))∗(1 −pow((1 −V1/ Vj T2 ) ,(1 −M) ) ) : 0 ;
Q2=(V1>=con4 ) ? Tt∗ I 1 + con3 ∗ ( F1+(1/F2 ) ∗ ( F3 ∗ (V1−con5)+
(M/ ( 2 . 0 ∗ Vj T2 ) ) ∗ ( V1∗V1−con5 ∗ con5 ) ) ) : 0 ;
I 5=V( L i g h t ) ∗ Res ;
I d=I 1+I 2+I 3+I 4 ;
I ( b1 ) <+ −I 5 ;
I ( b1 ) <+ V( b1 ) / Rsh ;
I ( b6)<+V( b6 ) / R s e r i e s A r e a ;
I ( b1)<+I d ;
I ( b1)<+ddt (Q1+Q2 ) ;
I ( L i g h t)<+V( L i g h t ) / 1 e10 ;
// Noise c o n t r i b u t i o n s
f o u r k t =4.0∗ ‘P K ∗ $ t e m p e r a t u r e ;
TwoQ=2.0∗ ‘P Q ;
I f l i c k e r =pow ( Id , Af ) ;
I ( b6)<+ w h i t e n o i s e ( f o u r k t / R s e r i e s A r e a , ”t h e r m a l ” ) ;
I ( b1)<+ w h i t e n o i s e ( f o u r k t /Rsh , ”t h e r m a l ” ) ;
I ( b1)<+ w h i t e n o i s e (TwoQ∗ Id , ” s h o t ” ) ;
I ( b1)<+ f l i c k e r n o i s e ( Kf∗ I f l i c k e r , Ffe , ” f l i c k e r ” ) ;
I ( b1)<+ w h i t e n o i s e (TwoQ∗ I5 , ” s h o t ” ) ;
//
end
endmodule
177
7.4 Example photodiode circuits
PD1
QEpercent=0
V1
Light_Const1 Ipd
U=Vpd
Light_Power=PLS
0.02
Ipd (A)
-0.02
-5 -4 -3 -2 -1 0 1
Vpd (V)
P_light1
V2
Light_Const2 U=Light_Power
Light_Power=1m
Figure 7.2: Basic photodiode test circuit for simulating device output current as a
function of light input level and applied DC bias
178
PD1
P1
Light_Const1 X1 V1 Num=1
Light_Power=PLS U=Vpd Z=50 Ohm
Cpd (F)
1e4
1e3 1e-9
100
10 1e-10
1
0.1
0.03 1e-11
-4 -2 0 -4 -2 0
Vpd (V) Vpd (V)
Figure 7.3: Photodiode test circuit for extracting device capacitance and resistance
as a function of applied DC bias
179
VL2 PD2 Vout
I
LA1
PD1
Light_pulse Kv=1.0
R
Power_Const=1u Dk=0.3
Power_PL=0.1u M=5
transient
Power_PH=200m Light1 Vosout=3e-3
Stime=1m simulation
Light_Power=1u Ro=10
Ftime=4m
TR1
TR=10u
Type=lin
TF=10u dc simulation
Start=0
DC1 Stop=10ms
Points=2000
IntegrationMethod=Gear
Order=6
6
0.2
light_pulse (W)
Vout (V)
0.1
2
0 0
0 1e-3 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01
Time (s)
Light_source21
V1
Power_Const=1m P_Light1
U=Power_Const
Power_PL=0
Power_PH=1m SRC2
Stime=0.1m G=1
Ftime=1m V2
TR=1u U1=Power_PL
TF=1u U2=Power_PH
T1=Stime SRC1
T2=Ftime G=1
Tr=TR
Tf=TF
Figure 7.4: Pulsed light power comparator circuit using two photodiodes and a
logarithmic amplifier
180
PD1
V1
Light_source Ipd N=1.35
U=Vbias
Light_Power=Light Equation Rseries=1e-3
Is=0.34e-12
Eqn1
Bv=60
Ipd_noise=PlotVs(Ipd.in, Light, Vbias)
Ibv=1e-3
Vj=0.7
Parameter Parameter ac simulation Cj0=60e-12
M=0.5
sweep sweep AC1 Area=1.0
SW1 SW2 Type=const Tnom=26.85
Sim=SW2 Sim=AC1 Values=[10k] Fc=0.5
Type=lin Type=lin Tt=10e-9
Param=Light Param=Vbias Xti=3.0
Start=1m Start=-0.5 dc simulation Eg=1.16
Stop=10m Stop=0.8 Responsivity=0.5
Points=10 Points=100 DC1 Rsh=5e8
QEpercent=0
0.005 Lambda=900
LEVEL=1
Kf=1e-12
Ipd (A)
Af=1.0
0 Ffe=1.0
Temp=26.85
1e-10
1e-11
-0.4 -0.2 0 0.2 0.4 0.6 0.8
Vbias (V)
Figure 7.5: Photodiode noise test circuit and simulated noise characteristics
181
7.5 End Note
Optoelectronic devices are an important group of electronic components and as
such deserve more attention than has been given to them in the past by the Qucs
development team. This situation should improve over the coming year. The pn
junction photodiode model is the first in a planned series of optoelectronic mod-
els, including models for transimpedance amplifiers, optical actuators and optical
media. Given time it should be possible to significantly improve Qucs optoelec-
tronic capabilities. The photodiode model reported here is an interesting model
in that it is one of the first Verilog-A models to fully utilize the recent changes to
the ADMS/Qucs interface which allow proper initialisation of model parameters.
A new procedure for combining Verilog-A generated models also introduces for
the first time the initial stages towards a fully modularized approach to linking
complex models with the main body of the Qucs code. Once again my thanks to
Stefan Jahn for all his encouragement and help during the period I worked on the
photodiode model.
182
8 SPICE to Qucs conversion: Test
File 1
8.1 Introduction
8.1.1 Title
DC and independent voltage pulse generator test.
Notes:
2. Character / denotes OR
183
3. V2 is the pulsed value; default: must be specified
∗ SPICE t o Qucs s y n t a x t e s t f i l e 1 .
∗ DC and i n d e p e n d e n t v o l t a g e p u l s e s o u r c e s , p l u s r e s i s t o r s .
∗
. s u b c k t S2Q t e s t 1 p01 p02 p03 p04 p05 p06 p07 p08 p09 p10 p11
v1 p01 0 1v
r 1 p01 0 10 k
∗
v2 p02 0 dc 1v
r 2 p02 0 10 k
∗
v3 p03 0 p u l s e ( 0 5 )
r 3 p03 0 10 k
∗
v4 p04 0 p u l s e ( 0 5 20n )
r 4 p04 0 10 k
∗
v5 p05 0 p u l s e ( 0 5 20n 10n )
r 5 p05 0 10 k
∗
v6 p06 0 p u l s e ( 0 5 20n 10n 10n )
r 6 p06 0 10 k
∗
v7 p07 0 p u l s e ( 0 5 20n 10n 10n 50n )
r 7 p07 0 10 k
∗
v8 p08 0 p u l s e ( 0 5 20n 10n 10n 50n 100n )
r 8 p08 0 10 k
184
vp1
1 vp2
vp3
dc simulation transient
2 simulation
3 vp4 DC1
4 vp5 TR1
Type=lin
5 vp6
S2Q_test1 Start=0
vp7 Stop=100ns
6 IntegrationMethod=Trapezoidal
7 vp8
8 vp9
9 vp10
10 vp11
11
SUB1
∗
v9 p09 0 p u l s e ( 0 5 20n 1n 1n 20n 40n )
r 9 p09 0 10 k
∗
v10 p10 0 p u l s e ( 0 5 20n 0 . 1n 0 . 1n 5n 50n )
r 1 0 p10 0 10 k
∗
v11 p11 0 dc 5v p u l s e ( 0 5 20n 0 . 5n 0 . 5n 10n 20n )
r 1 1 p11 0 10 k
. ends
. end
185
6. Test 6 : Vp6.Vt; Pass.
186
# Qucs 0 . 0 . 11 / media / hda2 / s p i c e t o q u c s p r j /s2Q ( t e s t 1 ) . s c h
4
vp1.Vt
vp2.Vt
vp7.Vt
1 1
2
0
0 0
0 2e-8 4e-8 6e-8 8e-8 1e-7 0 2e-8 4e-8 6e-8 8e-8 1e-7 0 2e-8 4e-8 6e-8 8e-8 1e-7
time time time
6
4 4
4
vp3.Vt
vp3.Vt
vp8.Vt
2 2
2
0 0 0
0 2e-8 4e-8 6e-8 8e-8 1e-7 0 1e-9 2e-9 3e-9 4e-9 5e-9 0 2e-8 4e-8 6e-8 8e-8 1e-7
time time time
6
4
4
4
vp4.Vt
vp4.Vt
vp9.Vt
2
2
2
0
0 0
0 2e-8 4e-8 6e-8 8e-8 1e-7
time 1.5e-8 2e-8 2.5e-8 0 2e-8 4e-8 6e-8 8e-8 1e-7
time time
6 6
6
4 4
4
vp10.Vt
vp5.Vt
vp5.Vt
2 2
2
0 0
0
1.5e-8 2e-8 2.5e-8 3e-8 3.5e-8 4e-8 0 2e-8 4e-8 6e-8 8e-8 1e-7
0 2e-8 4e-8 6e-8 8e-8 1e-7 time time
time
6 6 6
4 4 4
vp11.Vt
vp6.Vt
vp6.Vt
2 2 2
0 0 0
0 2e-8 4e-8 6e-8 8e-8 1e-7 1.5e-8 2e-8 2.5e-8 3e-8 3.5e-8 4e-8 4.5e-8 5e-8 0 2e-8 4e-8 6e-8 8e-8 1e-7
time time time
188
∗ SPICE t o Qucs s y n t a x t e s t f i l e 1 .
∗ DC and i n d e p e n d e n t v o l t a g e p u l s e s o u r c e s , p l u s r e s i s t o r s .
∗
. s u b c k t S2Q t e s t 1 p01 p02 p03 p04 p05 p06 p07 p08 p09 p10 p11
v1 p01 0 1v
r 1 p01 0 10 k
∗
v2 p02 0 dc 1v
r 2 p02 0 10 k
∗
v3 p03 0 p u l s e ( 0 5 )
r 3 p03 0 10 k
∗
v4 p04 0 p u l s e ( 0 5 20n )
r 4 p04 0 10 k
∗
v5 p05 0 p u l s e ( 0 5 20n 10n )
r 5 p05 0 10 k
∗
v6 p06 0 p u l s e ( 0 5 20n 10n 10n )
r 6 p06 0 10 k
∗
v7 p07 0 p u l s e ( 0 5 20n 10n 10n 50n )
r 7 p07 0 10 k
∗
v8 p08 0 p u l s e ( 0 5 20n 10n 10n 50n 100n )
r 8 p08 0 10 k
∗
v9 p09 0 p u l s e ( 0 5 10n 1n 1n 20n 40n )
r 9 p09 0 10 k
∗
v10 p10 0 p u l s e ( 0 5 20n 0 . 1n 0 . 1n 5n 50n )
r 1 0 p10 0 10 k
∗
v11 p11 0 dc 5v p u l s e (−3 5 20n 0 . 5n 0 . 5n 10n 40n )
r 1 1 p11 0 10 k
. ends
. end
189
9. Test 9 : Vp9.Vt; Pass.
190
2 2 6
4
vp1.Vt
vp2.Vt
vp7.Vt
1 1
2
0
0 0
0 2e-8 4e-8 6e-8 8e-8 1e-7 0 2e-8 4e-8 6e-8 8e-8 1e-7 0 2e-8 4e-8 6e-8 8e-8 1e-7
time time time
6
4 4
4
vp3.Vt
vp3.Vt
vp8.Vt
2 2
2
0 0 0
0 2e-8 4e-8 6e-8 8e-8 1e-7 0 1e-9 2e-9 3e-9 4e-9 5e-9 0 2e-8 4e-8 6e-8 8e-8 1e-7
time time time
6
4
4
4
vp4.Vt
vp4.Vt
vp9.Vt
2
2
2
0
0 0
0 2e-8 4e-8 6e-8 8e-8 1e-7
time 1.5e-8 2e-8 2.5e-8 0 2e-8 4e-8 6e-8 8e-8 1e-7
time time
6 6
6
4 4
4
vp10.Vt
vp5.Vt
vp5.Vt
2 2
2
0 0
0
1.5e-8 2e-8 2.5e-8 3e-8 3.5e-8 4e-8 0 2e-8 4e-8 6e-8 8e-8 1e-7
0 2e-8 4e-8 6e-8 8e-8 1e-7 time time
time
6 6
10
4 4
vp11.Vt
vp6.Vt
vp6.Vt
5
2 2
0 0
0
0 2e-8 4e-8 6e-8 8e-8 1e-7 1.5e-8 2e-8 2.5e-8 3e-8 3.5e-8 4e-8 4.5e-8 5e-8 0 2e-8 4e-8 6e-8 8e-8 1e-7
time time time
191
# Qucs 0 . 0 . 11 / media / hda2 / s p i c e t o q u c s p r j /s2Q ( t e s t 1 ) . s c h
Figure 8.6: Qucs netlist for modified test1 SPICE netlist [Edited to fit on page
width]
192
8.4 References
1. A. Vladimirescu, Kaihe Zhang, A.R. Newton, D.O Pederson A. Sangiovanni-
Vincentelli, SPICE 2G User’s Guide (10 Aug 1981), Department of Electrical
Engineering and Computer Sciences, University of California, Berkeley, Ca.,
94720.
3. Andrei Vladimirescu, THE SPICE book,1994, John Wiley and Sons. Inc.,
ISBN 0-471-609-26-9.
193
9 SPICE to Qucs conversion: Test
File 2
9.1 Introduction
9.1.1 Title
DC and independent voltage sin generator test.
Notes:
2. Character / denotes OR
Notes:
194
3. VA is the signal amplitude; default: must be specified
4. FREQ is the signal frequency; default: value = 1/TSTOP
5. TD is initial delay before sinusoidal signal starts; default: value = 0 seconds
6. KD is the damping coefficient; default: value = 0. The damping factor has
dimension 1/time.
∗ SPICE t o Qucs s y n t a x t e s t f i l e 2
∗ DC and i n d e p e n d e n t v o l t a g e s i n s o u r c e s , p l u s r e s i s t o r s .
∗
. s u b c k t S2Q t e s t 2 p01 p02 p03 p04 p05 p06 p07 p08 p09 p10 p11
v1 p01 0 1v
r 1 p01 0 10 k
∗
v2 p02 0 dc 1v
r 2 p02 0 10 k
∗
∗ v3 p03 0 s i n ( 0 5 )
r 3 p03 0 10 k
∗
v4 p04 0 s i n ( 0 5 1k )
r 4 p04 0 10 k
∗
v5 p05 0 s i n ( 0 5 1k 0 . 5m)
r 5 p05 0 10 k
∗
v6 p06 0 s i n ( 0 5 1k 0 . 5m 1 0 0 )
r 6 p06 0 10 k
∗
v7 p07 0 s i n ( 0 5 1k 0 . 5m 1 0 0 0 )
r 7 p07 0 10 k
∗
v8 p08 0 dc 5v s i n ( 0 5 1k 0 . 5m 1 0 0 0 )
r 8 p08 0 10 k
∗
v9 p09 0 s i n (−5 5 1k 0 . 5m 1 0 0 0 )
r 9 p09 0 10 k
195
2 2 1
vp1.Vt
vp2.Vt
vp3.Vt
1 1 0
0 0 -1
0 1e-3 0.002 0.003 0.004 0.005 0 1e-3 0.002 0.003 0.004 0.005 0 1e-3 0.002 0.003 0.004 0.005
time time time
5 5
5
vp4.Vt
vp5.Vt
vp6.Vt
0
0 0
-5
-5 -5
0 1e-3 0.002 0.003 0.004 0.005
time 0 1e-3 0.002 0.003 0.004 0.005 0 1e-3 0.002 0.003 0.004 0.005
time time
0
vp7.Vt
5 -5
vp8.Vt
vp9.Vt
-5
0 1e-3 0.002 0.003 0.004 0.005 0 -10
time 0 1e-3 0.002 0.003 0.004 0.005 0 1e-3 0.002 0.003 0.004 0.005
time time
5 -10
vp10.Vt
vp11.Vt
0 -15
0 1e-3 0.002 0.003 0.004 0.005 0 1e-3 0.002 0.003 0.004 0.005
time time
∗
v10 p10 0 s i n ( 5 5 1k 0 . 5m 1 0 0 0 )
r 1 0 p10 0 10 k
∗
v11 p11 0 dc −10 s i n ( 5 5 1k 0 . 5m 1 0 0 0 )
r 1 1 p11 0 10 k
. ends
. end
196
3. Test 3 : Vp3.Vt; Fail ERROR: line 17: checker error, no such variable ‘nan’
used in a ‘Vac:V3’ property NOTE error occurs when v3 uncommented.
11. Test 11 : Vp11.Vt; Fail TD should be 0.5m seconds, plus DC level wrong.
197
# Qucs 0 . 0 . 11 / media / hda2 /S2Q t e s t 2 p r j /S2Q ( t e s t 2 ) . s c h
Figure 9.2: March 11: Qucs netlist showing V3 error [Edited to fit on page width]
198
vp1
1 vp2 dc simulation
2 vp3
DC1
3 vp4
4 vp5
SUB1
1. The SPICE SIN generator assumes that the frequency of the generated si-
nusoidal signal equals 1/TSTOP if not explicitly given. Hence, in such cases
a .TRAN statement must be present in the simulated SPICE netlist; if a
.TRAN statement is not included a default frequency of f = 1GHz is used.
Also, when setting the transient simulation parameters using a Qucs tran-
sient analysis icon turn off SPICE simulation in the Edit SPICE Properties
dialog box, otherwise two transient simulations are undertaken by Qucs.
199
2 2
5
vp1.Vt
vp2.Vt
vp3.Vt
1 1 0
-5
0 0
0 1e-3 0.002 0.003 0.004 0.005 0 1e-3 0.002 0.003 0.004 0.005 0 1e-3 0.002 0.003 0.004 0.005
time time time
5
5 5
vp4.Vt
vp5.Vt
vp6.Vt
0
0 0
-5
-5 -5
0 1e-3 0.002 0.003 0.004 0.005
time 0 1e-3 0.002 0.003 0.004 0.005 0 1e-3 0.002 0.003 0.004 0.005
time time
5
10 0
0
vp7.Vt
5 -5
vp8.Vt
vp9.Vt
-5
0 -10
5 -5
vp10.Vt
vp11.Vt
0 -10
0 1e-3 0.002 0.003 0.004 0.005 0 1e-3 0.002 0.003 0.004 0.005
time time
200
# Qucs 0 . 0 . 11 / media / hda2 /S2Q t e s t 2 p r j /S2Q ( t e s t 2 ) . s c h
Figure 9.5: March 12: Qucs netlist showing V3 error [Edited to fit on page width]
201
9.4 References
1. A. Vladimirescu, Kaihe Zhang, A.R. Newton, D.O Pederson A. Sangiovanni-
Vincentelli, SPICE 2G User’s Guide (10 Aug 1981), Department of Electrical
Engineering and Computer Sciences, University of California, Berkeley, Ca.,
94720.
3. Andrei Vladimirescu, THE SPICE book,1994, John Wiley and Sons. Inc.,
ISBN 0-471-609-26-9.
202
10 SPICE to Qucs conversion: Test
File 3
10.1 Introduction
10.1.1 Title
SPICE 2g6 and 3f5 resistors.
Notes:
1. Characters [ and ] enclose optional items
5. Equations:
2. Semiconductor resistors:
RX N+ N- [value] [mname] [L=length] [W=width] [TEMP=T]
1
See section 6.1, SPICE 2g6 user’s guide.
2
See sections 3.1.1 and 3.1.2, SPICE 3f6 user’s guide.
203
Notes:
∗ SPICE t o Qucs s y n t a x t e s t f i l e
∗ SPICE 2 g6 r e s i s t o r s .
∗
. s u b c k t S2Q t e s t 3 a p01 p02 p03
v1 1 0 DC 1v
204
r 1 1 p01 10 k
r 2 p01 0 10 k
∗
v2 2 0 dc 1v
r 3 2 p02 10 k t c=0 . 01
r 4 p02 0 10 k
∗
v3 3 0 Dc 1v
r 5 3 p03 10 k t c=0 . 01 0 . 015
r 6 p03 0 10 k
. ends
. end
205
vp1
1 vp2
vp3
dc simulation
S2Q_test3_a 2
3 DC1
SUB1
number vp1.V vp2.V vp3.V
1 0.5 0 0
Figure 10.1: March 13: SPICE to Qucs conversion: Test3 schematic plus output
table for SPICE 2g6 test1: linear resistors
∗ SPICE t o Qucs s y n t a x t e s t f i l e
∗ SPICE 3 f 5 r e s i s t o r s .
∗
. s u b c k t S2Q t e s t 3 a p01 p02 p03
v1 1 0 DC 1v
r 1 1 p01 10 k
r 2 p01 0 10 k
∗
v2 2 0 dc 1v
r 3 2 p02 RMOD1 L=10u W=1u
r 4 p02 0 10 k
. model RMOD1 R(RSH=50 DEFW=2 e−6 NARROW=1 e −7)
∗
. ends
. end
206
10.3 History of simulation results
10.3.1 March 13 2007, Simulation tests by Mike Brinson
A: SPICE 2g6 tests:
Test 1 [v2, r3, v3, and r5 commented]: Linear resistors: Vp1: PASS correct
output voltage.
Test 2 [v3, and r5 commented]: SPICE 2g6 resistor with first order temperature
coefficient: FAIL - inncorrect Qucs netlist.
Qucs netlist line 14: checker error, extraneous property ‘TC’ is invalid in ‘R:R3’
Qucs netlist:
# Qucs 0 . 0 . 11 / media / hda2 /S2Q t e s t 3 p r j /S2Q( t e s t 3 a ) . s c h
. Def : S2Q t e s t 3 a n e t 0 n e t 1 n e t 2
Sub : X1 n e t 0 n e t 1 n e t 2 gnd Type=”S2Q t e s t 3 a c i r ”
. Def : End
Test 3 [v2, r2, and r3 commented]: FAIL - netlist not passed correctly.
Qucs error message: line 14: syntax error, unexpected Floats, expecting Eol.
Qucs netlist:
# Qucs 0 . 0 . 11 / media / hda2 /S2Q t e s t 3 p r j /S2Q( t e s t 3 a ) . s c h
207
. Def : S2Q t e s t 3 a n e t 0 n e t 1 n e t 2
Sub : X1 n e t 0 n e t 1 n e t 2 gnd Type=”S2Q t e s t 3 a c i r ”
. Def : End
• * scan_spice.l: Lexer modifications for the Spice 2g6 resistor syntax were
necessary. Stefan Jahn
• * parse_spice.y: Allow Spice 2g6 syntax for resistors, also fixed netlist
grammar for Spice 3f5 models. Stefan Jahn
NOTES:
• The Vp02 and Vp03 test results are only correct for TEMP=TNOM.
208
• SPICE 2g6 simulates circuit performance at temperature set by the value
of TNOM; 27 ◦ C by default.
Qucs netlist:
# Qucs 0 . 0 . 11 / media / hda2 /S2Q t e s t 3 p r j /S2Q( t e s t 3 a ) . s c h
. Def : S2Q t e s t 3 a n e t 0 n e t 1 n e t 2
Sub : X1 n e t 0 n e t 1 n e t 2 gnd Type=”S2Q t e s t 3 a c i r ”
. Def : End
209
vp1
1 vp2
vp3
dc simulation
S2Q_test3_a 2
3 DC1
SUB1
number vp1.V vp2.V vp3.V
1 0.5 0.5 0.5
Figure 10.2: March 15: SPICE to Qucs conversion: SPICE 2g6 resistor schematic
plus output table
210
SPICE code: File S2Q_test3_b.cir
Qucs netlist:
# Qucs 0 . 0 . 11 / media / hda2 /S2Q t e s t 3 p r j /S2Q( t e s t 3 b ) . s c h
. Def : S2Q t e s t 3 b n e t 0 n e t 1
Sub : X1 n e t 0 n e t 1 gnd Type=”S2Q t e s t 3 b c i r ”
. Def : End
211
∗
v3 3 0 dc 1v
r 5 3 p03 10 k RMOD1 TEMP=30
r 6 p03 0 10 k
∗
v4 4 0 dc 1v
r 7 4 p04 10 k RMOD1 TEMP=40
r 8 p04 0 10 k
∗
v5 5 0 dc 1v
r 9 5 p05 10 k RMOD1 TEMP=50
r 1 0 p05 0 10 k
∗
v6 6 0 dc 1v
r 1 1 6 p06 10 k RMOD1 TEMP=60
r 1 2 p06 0 10 k
∗
v7 7 0 dc 1v
r 1 3 7 p07 10 k RMOD1 TEMP=70
r 1 4 p07 0 10 k
∗
v8 8 0 dc 1v
r 1 5 8 p08 10 k RMOD1 TEMP=80
r 1 6 p08 0 10 k
∗
v9 9 0 dc 1v
r 1 7 9 p09 10 k RMOD1 TEMP=90
r 1 8 p09 0 10 k
∗
v10 10 0 dc 1v
r 1 9 10 p10 10 k RMOD1 TEMP=100
r 2 0 p10 0 10 k
. ends
. end
212
• Vp06.V: PASS; correct dc output.
• In SPICE 3f5 TEMP values attached to resistors override the global value
of TEMP.
• SPICE 3f5 differs from SPICE 2g6 in that it does not allow the control
statement .TEMP.
213
vp01
1 vp02
2 vp03
3 vp04
4 vp05
dc simulation vp06
S2Q_test3_c 5
DC1 6 vp07
7 vp08
8 vp09
SUB1
9 vp10
10
number vp01.V vp02.V vp03.V vp04.V vp05.V vp06.V vp07.V vp08.V vp09.V vp10.V
1 0.5 0.5 0.459 0.212 0.0974 0.0531 0.0329 0.0223 0.016 0.012
Figure 10.3: March 15: SPICE to Qucs conversion: Test3 schematic plus output
for SPICE 3f5 test c
Qucs netlist:
# Qucs 0 . 0 . 11 / media / hda2 /S2Q t e s t 3 p r j /s2Q ( t e s t 3 c ) . s c h
214
R: R10 netP05 r e f R=”10 k ”
Vdc : V6 n e t 6 r e f U=”1V”
R: R11 n e t 6 netP06 R=”10 k ” Temp=”60 ” Tc1=”0 . 01 ” Tc2=”0 . 015 ”
R: R12 netP06 r e f R=”10 k ”
Vdc : V7 n e t 7 r e f U=”1V”
R: R13 n e t 7 netP07 R=”10 k ” Temp=”70 ” Tc1=”0 . 01 ” Tc2=”0 . 015 ”
R: R14 netP07 r e f R=”10 k ”
Vdc : V8 n e t 8 r e f U=”1V”
R: R15 n e t 8 netP08 R=”10 k ” Temp=”80 ” Tc1=”0 . 01 ” Tc2=”0 . 015 ”
R: R16 netP08 r e f R=”10 k ”
Vdc : V9 n e t 9 r e f U=”1V”
R: R17 n e t 9 netP09 R=”10 k ” Temp=”90 ” Tc1=”0 . 01 ” Tc2=”0 . 015 ”
R: R18 netP09 r e f R=”10 k ”
Vdc : V10 n e t 1 0 r e f U=”1V”
R: R19 n e t 1 0 netP10 R=”10 k ” Temp=”100 ” Tc1=”0 . 01 ” Tc2=”0 . 015 ”
R: R20 netP10 r e f R=”10 k ”
. Def : End
Sub : X1 r e f netP01 netP02 netP03 netP04 netP05 netP06 netP07
netP08 netP09 netP10 Type=”S2Q TEST3 A”
. Def : End
Sub : SUB1 vp01 vp02 vp03 vp04 vp05 vp06 vp07 vp08 vp09 vp10 Type=”S2Q t e s t 3 c ”
.DC:DC1 Temp=”26 . 8 ” r e l t o l=”0 . 001 ” a b s t o l=”1 pA” v n t o l=”1 uV” saveOPs=”no ”
MaxIter=”150 ” s a v e A l l=”no ” c o n v H e l p e r=”none ” S o l v e r=”CroutLU ”
215
r 4 p02 0 10 k
. model RMOD1 R(TC1=0 . 01 TC2=0 . 0 1 5 )
∗
v3 3 0 dc 1v
r 5 3 p03 10 k RMOD1
r 6 p03 0 10 k
. model RMOD1 R(TC1=0 . 01 TC2=0 . 015 TNOM=1 0 0 )
∗
v4 4 0 dc 1v
r 7 4 p04 10 k RMOD1
r 8 p04 0 10 k
. model RMOD1 R(TC1=0 . 01 TC2=0 . 0 1 5 )
∗
. ends
.OPTION TNOM=40
. end
• In SPICE 3f5 TEMP values attached to resistors override the global value
of circuit temperature
216
vp01
1 vp02
2 vp03
dc simulation S2Q_test3_f
3 vp04
DC1 4
SUB1
Figure 10.4: March 18: SPICE to Qucs conversion: Test3 schematic plus output
for SPICE 3f5 test f
Qucs netlist:
# Qucs 0 . 0 . 11 / media / hda2 /S2Q t e s t 3 p r j /S2Q( t e s t 3 f ) . s c h
. Def : S2Q t e s t 3 f n e t 0 n e t 1 n e t 2 n e t 3
Sub : X1 n e t 0 n e t 1 n e t 2 n e t 3 gnd Type=”S2Q t e s t 3 f c i r ”
. Def : End
217
.DC:DC1 Temp=”26 . 8 ” r e l t o l=”0 . 001 ” a b s t o l=”1 pA” v n t o l=”1 uV”
saveOPs=”no ” MaxIter=”150 ” s a v e A l l=”no ” c o n v H e l p e r=”none ” S o l v e r=”CroutLU ”
218
vp01
1 vp02
2 vp03
dc simulation S2Q_test3_f
3 vp04
DC1 4
SUB1
Figure 10.5: March 25: SPICE to Qucs conversion: Test3 schematic plus output
for SPICE 3f5 test f
. ends
.OPTION TNOM=40
. end
219
Qucs netlist:
# Qucs 0 . 0 . 12 / media / hda2 /S2Q t e s t 3 p r j /S2Q( t e s t 3 f ) . s c h
. Def : S2Q t e s t 3 f n e t 0 n e t 1 n e t 2 n e t 3
Sub : X1 n e t 0 n e t 1 n e t 2 n e t 3 gnd Type=”S2Q t e s t 3 f c i r ”
. Def : End
NOTES:
220
• In SPICE 3f5 TEMP values attached to resistors override the global value
of circuit temperature
10.5 References
1. A. Vladimirescu, Kaihe Zhang, A.R. Newton, D.O Pederson A. Sangiovanni-
Vincentelli, SPICE 2G User’s Guide (10 Aug 1981), Department of Electrical
Engineering and Computer Sciences, University of California, Berkeley, Ca.,
94720.
3. Andrei Vladimirescu, THE SPICE book,1994, John Wiley and Sons. Inc.,
ISBN 0-471-609-26-9.
221
11 SPICE to Qucs conversion: Test
File 4
11.1 Introduction
11.1.1 Title
SPICE 2g6 and 3f5 capacitors.
Notes:
1. Characters [ and ] enclose optional items
5. Equations:
222
1. Linear capacitors: CX N+ N- value [ IC = INCOND ]
2. Semiconductor capacitors:
CX N+ N- [value] [mname] [L=length] [W=width] [IC=VAL]
Notes:
9. Equations:
CAP =
CJ · (L − N ARROW ) · (W − N ARROW ) + 2 · CJSW · (L + W − 2 · N ARROW )
∗ SPICE t o Qucs s y n t a x t e s t f i l e
∗ SPICE 2 g6 and 3 f 5 l i n e a r c a p a c i t o r s .
∗ DC and AC t e s t s .
∗
. s u b c k t S2Q t e s t 4 a p01 p02 p03 p04 p05 p06
v1 1 0 AC 1v
r 1 1 p01 10 k
223
c1 p01 0 1u
v2 2 0 ac 1v
r 3 2 p02 10 k
c2 p02 0 1u i c =10 v
v3dc 3 0 dc 1v
v3ac 4 3 ac 1v
r 4 4 p03 10 k
c3 p03 0 1u
v4dc 5 0 dc 1v
v4ac 6 5 ac 1v
r 5 6 p04 10 k
c4 p04 0 1u i c = 10 v
v3 7 0 dc 1v ac 1v
r 6 7 p05 10 k
c5 p05 0 1u
v4 8 0 dc 1v ac 1v
r 7 8 p06 10 k
c6 p06 0 1u i c = 10 v
. ends
. end
∗ SPICE t o Qucs s y n t a x t e s t f i l e
∗ SPICE 2 g6 and 3 f 5 l i n e a r c a p a c i t o r s .
∗ Pulse t e s t s .
∗
. s u b c k t S2Q t e s t 4 b p01 p02 p03 p04 p05
v1 1 0 p u l s e ( 0 1 50ms 1 us 1 us 100ms 200ms)
r 1 1 p01 10 k
c1 p01 0 1u i c=0v
v2 2 0 p u l s e ( 0 1 50ms 1 us 1 us 100ms 200ms)
r 3 2 p02 10 k
c2 p02 0 1u i c = −1v
v3dc 3 0 1v
v3ac 4 3 p u l s e ( 0 1 50ms 1 us 1 us 100ms 200ms)
r 4 4 p03 10 k
c4 p03 0 1u i c=0v
v4dc 5 0 dc 1v
v4ac 6 5 p u l s e ( 0 1 50ms 1 us 1 us 100ms 200ms)
r 5 6 p04 10 k
c5 p04 0 1u i c = −1v
v5 7 0 dc 1v p u l s e ( 0 1 50ms 1 us 1 us 100ms 200ms)
r 6 7 p05 10 k
c6 p05 0 1u i c = −1v
. ends
. end
224
X1
File=S2Q_test4_a.cir
dc simulation vp01 P01 P02 vp02
DC1
AC1
Type=log Ref
Start=1 Hz
Stop=100kHz
Points=100
number vp01.V vp02.V vp03.V vp04.V vp05.V vp06.V
1 1 1 2 2 1 1
Figure 11.1: March 22: SPICE to Qucs conversion: Test4 schematic plus dc output
table for SPICE 2g6 and 3f5 linear capacitors test
225
11.3 History of simulation results
11.3.1 March 22 2007, Simulation tests by Mike Brinson
A: SPICE 2g6 and 3f5 linear capacitor dc tests:
NOTE: It would appear that the value of a branch AC voltage source is being
added to DC sources in the same branch during the DC simulation. This is
incorrect. Qucs correctly computes the DC conditions from a schematic, see
Fig. 11.2. ERROR in SPICE to Qucs conversion process.
226
dc simulation
DC1 vp01
C1
ac simulation R1 C=1 uF
R=10k
AC1
Type=log
Start=1 Hz V2
Stop=10 MHz U=1 V Equation
Points=200
Eqn1
vp01_dB=dB(vp01.v)
number vp01.V V1
1 1 U=1 V
1 0
vp01_dB
vp01.v
-50
0.5
-100
0
1 10 100 1e3 1e4 1e5 1e6 1e7 1 10 100 1e3 1e4 1e5 1e6 1e7
acfrequency acfrequency
Figure 11.2: March 22: Qucs RC simulation with series AC and DC sources
227
Qucs netlist:
# Qucs 0 . 0 . 11 / media / hda2 /S2Q t e s t 4 p r j /S2Q( t e s t 4 a ) . s c h
228
229
1
1
vp02.v
vp01.v
0.5
0.5
0
0
1 10 100 1e3 1e4 1e5
1 10 100 1e3 1e4 1e5 acfrequency
acfrequency
1 1
vp03.v
vp04.v
0.5 0.5
0 0
1 1
vp05.v
vp06.v
0.5 0.5
0 0
Qucs netlist:
# Qucs 0 . 0 . 11 / media / hda2 /S2Q t e s t 4 p r j /S2Q( t e s t 4 b ) . s c h
230
X1
File=S2Q_test4_b.cir
vp01 P01 P02 vp02
dc simulation
DC1 vp03 P03 P04 vp04
spice
vp05 P05
transient
simulation Ref
TR1
Type=lin
Start=0 number vp01.V vp02.V vp03.V vp04.V vp05.V
Stop=400ms
initialDC=yes 1 0.667 0.667 1.67 1.67 1.67
Figure 11.4: March 22: SPICE to Qucs conversion: Test4 schematic plus dc output
table for SPICE 2g6 and 3f5 linear capacitors pulse test
231
C: C6 netP05 r e f C=”1u ” V=”−1V”
. Def : End
Sub : X1 r e f netP01 netP02 netP03 netP04 netP05 Type=”S2Q TEST4 B”
. Def : End
232
1
1
vp01.Vt
vp02.Vt
0.5
0
0
-1
0 0.1 0.2 0.3 0.4
time 0 0.1 0.2 0.3 0.4
time
2 2
vp03.Vt
vp04.Vt
1
0
2
vp05.Vt
Figure 11.5: March 22: Pulse test waveforms for SPICE 2g6 and 3f5 linear
capacitors
233
D: Combined DC, AC and transient source test.
SPICE code: File S2Q_test4_c.cir
∗ SPICE t o Qucs s y n t a x t e s t f i l e
∗ SPICE 2 g6 and 3 f 5 c a p a c i t o r s .
∗ P u l s e t e s t with dc and ac s o u r c e
∗ in s e r i e s with p u l s e v o l t a g e s o u r c e .
∗
. s u b c k t S2Q t e s t 4 c p06
∗
v6 8 0 dc 1v ac 1v p u l s e ( 0 1 50ms 1 us 1 us 100ms 200ms)
r 7 8 p06 10 k
c7 p06 0 1u i c = −1v
. ends
. end
234
X1
dc simulation vp06 File=S2Q_test4_c.cir transient
P06 simulation
DC1 spice
Ref TR1
Type=lin
Start=0
ac simulation Stop=300 ms
IntegrationMethod=Gear
AC1 Order=6
Type=log number vp06.V reltol=0.01
Start=1 Hz 1 1.67 abstol=100 pA
Stop=10 kHz vntol=100 uV
Points=400
1
vp06.v
0.5
Figure 11.6: March 22: Test circuit for combined dc, ac and pulse source test
Qucs netlist:
# Qucs 0 . 0 . 11 / media / hda2 /S2Q t e s t 4 p r j /S2Q( t e s t 4 c ) . s c h
235
E: SPICE 2g6 non-linear capacitor tests.
NO results - Qucs 0.0.11 does not allow non-linear capacitors of the SPICE 2g6
form. Nonlinear capacitors will be added to both Qucs and QUCSCONV
sometime in the future when the nonlinear independent voltage and current
sources are implemented, see the todo list..
v2 2 0 dc 1v ac 1v
r 3 2 p02 10 k
c2 p02 0 1u i c = 10 v
∗
v3dc 3 0 dc 1v
v3ac 4 3 ac 1v
r 4 4 p03 10 k
c3 p03 0 1u i c = −10v
∗
v4dc 5 0 dc 1v
v4ac 6 5 ac 1v
r 5 6 p04 10 k
c4 p04 0 cmod1 L=10u W=1u
. model cmod1 C(CJ=50u CJSW=20p NARROW=0 . 1u )
∗
v3 7 0 dc 1v ac 1v
r 6 7 p05 10 k
c5 p05 0 cmod1 L=10u W=1u
∗
v4 8 0 dc 1v ac 1v
r 7 8 p06 10 k
c6 p06 0 cmod2 L=10u
. model cmod2 C(DEFW=1u CJ=50u CJSW=20p NARROW=0 . 1u )
. ends
. end
236
. Def : S2Q t e s t 4 e c i r netP01 netP02 netP03 netP04 netP05 netP06 r e f
. Def : S2Q TEST4 E r e f netP01 netP02 netP03 netP04 netP05 netP06
Vac : V4 n e t 8 c n e t 5 U=”1V”
Vac : V3 n e t 7 c n e t 4 U=”1V”
Vac :V4AC n e t 6 c n e t 3 U=”1V”
Vac :V3AC n e t 4 c n e t 2 U=”1V”
Vac : V2 n e t 2 c n e t 1 U=”1V”
Vac : V1 n e t 1 c n e t 0 U=”1V”
Vdc : V1 c n e t 0 r e f U=”1V”
R: R1 n e t 1 netP01 R=”10 k ”
C: C1 netP01 r e f C=”1u ”
Vdc : V2 c n e t 1 r e f U=”1V”
R: R3 n e t 2 netP02 R=”10 k ”
C: C2 netP02 r e f C=”1u ” V=”10V”
Vdc :V3DC n e t 3 r e f U=”1V”
Vdc :V3AC c n e t 2 n e t 3 U=”1 ”
R: R4 n e t 4 netP03 R=”10 k ”
C: C3 netP03 r e f C=”1u ” V=”−10V”
Vdc :V4DC n e t 5 r e f U=”1V”
Vdc :V4AC c n e t 3 n e t 5 U=”1 ”
R: R5 n e t 6 netP04 R=”10 k ”
C: C4 netP04 r e f L=”10u ” W=”1u ” C=”1 e −12 ”
Vdc : V3 c n e t 4 r e f U=”1V”
R: R6 n e t 7 netP05 R=”10 k ”
C: C5 netP05 r e f L=”10u ” W=”1u ” C=”1 e −12 ”
Vdc : V4 c n e t 5 r e f U=”1V”
R: R7 n e t 8 netP06 R=”10 k ”
C: C6 netP06 r e f L=”10u ” C=”1 e −12 ”
. Def : End
Sub : X1 r e f netP01 netP02 netP03 netP04 netP05 netP06 Type=”S2Q TEST4 E”
. Def : End
RESULTS:
line 25: checker error, extraneous property ‘L’ is invalid in ‘C:C4’
line 25: checker error, extraneous property ‘W’ is invalid in ‘C:C4’
line 28: checker error, extraneous property ‘L’ is invalid in ‘C:C5’
line 28: checker error, extraneous property ‘W’ is invalid in ‘C:C5’
line 31: checker error, extraneous property ‘L’ is invalid in ‘C:C6’
Errors in SPICE semiconductor capacitor to Qucs netlist format conversion.
237
• * check_spice.cpp: Handling capacitor models correctly. Also fixed
wrong DC value of sources when neither the DC directive nor an immediate
value was given. Stefan Jahn.
A: SPICE 2g6 and 3f5 linear capacitor dc tests:
• Vp01.V: PASS; dc output = 0V.
• Vp02.V: PASS; dc output = 0V.
• Vp03.V: PASS; dc output = 1V.
• Vp04.V: PASS; dc output = 1V.
• Vp05.V: PASS; dc output = 1V.
• Vp06.V: PASS; dc output = 1V.
C: SPICE code: File S2Q_test4_b.cir
Further notes on test results:
• SPICE independent voltage sources with DC, AC and transient elements
appear to be handled differently by SPICE and Qucs. In a SPICE DC
operating point simulation, time domain sources have their DC values set
to their value at simulation time equal to zero seconds. However, for time
domain pulse source Qucs finds the DC level by integrating it’s waveform
over one signal cycle. This results in a DC value of 0.6667V, yielding the
DC offset recorded in the original test. In Qucs a generator is added to the
Qucs netlist for each of the elements specified in the original SPICE voltage
source entry. Hence, it is possible to have upto three voltage sources in
series. Figure 11.7 illustrates that the DC offset occurs from a pulse
generator placed in series with a DC source on a schematic.
• The same comment concerning SPICE and Qucs differences introduced
above applies to the AC component of a SPICE independent voltage source
component. In this case there is not a DC offset but because the frequency
of the source is NOT included in the SPICE code, Qucs assumes it’s default
value to be 1GHz. Hence, in the time domain an AC generator is included
in the independent voltage source branch with a frequency of 1GHz. This
in turn causes the transient analysis routines to require a very small time
step for satisfactory accuracy and hence the simulation takes a long time
and appears to hang. SPICE on the other hand considers the AC source to
be only applicable to small signal AC analysis and does NOT include it in
time domain simulation. Yet another example of the difference between
SPICE and Qucs.
238
vp06
V3 R1
U=1 V R=10k
TH=0.100002 C1
TL=0.04998 C=1u
Tr=1 us V=-1
Tf=1 us
Td=50 ms
V2 number vp06.V
U=1 V dc simulation
1 1.67
DC1
• RECOMMENDATIONS:
1. Mix DC, AC and time domain source elements in SPICE independent
voltage sources with care when converting code to be simulated with
Qucs.
2. When simulating SPICE netlists in the time domain ensure capacitors
have their initial condition voltages set to known values. This ensures
that the correct DC conditions form the starting point for a transient
circuit simulation.
11.4 References
1. A. Vladimirescu, Kaihe Zhang, A.R. Newton, D.O Pederson A. Sangiovanni-
Vincentelli, SPICE 2G User’s Guide (10 Aug 1981), Department of Electrical
Engineering and Computer Sciences, University of California, Berkeley, Ca.,
94720.
239
3. Andrei Vladimirescu, THE SPICE book,1994, John Wiley and Sons. Inc.,
ISBN 0-471-609-26-9.
240
12 SPICE to Qucs conversion: Test
File 5
12.1 Introduction
12.1.1 Title
SPICE 2g6 and 3f5 inductors.
Notes:
241
8. The “dot” convention is used to denote coupling direction by placing a “dot”
on the first node of each inductor.
9. Equations:
and L1, L2, L3 .......... are the coefficients of a polynomial describing the
element value. Also n <= 20.
Notes: 1 to 8 above.
∗ SPICE t o Qucs s y n t a x f i l e
∗ SPICE 2 g6 and 3 f 5 i n d u c t a n c e
∗ DC and AC t e s t s
. s u b c k t S2Q t e s t 5 a po1 , po2 , po3
v1 1 0 dc 1v
l 1 1 po1 1mH
r 1 po1 0 1k
∗
v2 2 0 ac 1v
l 2 2 po2 1mH
r 2 po2 0 1k
∗
v3 3 0 dc 1v ac 1v
l 3 3 po3 1mH
r 3 po3 0 1k
∗
. ends
. end
2
See sections 3.1.7 and 3.1.8, SPICE 3f6 user’s guide.
242
SPICE code: File S2Q_test5_b.cir
∗ SPICE t o Qucs s y n t a x f i l e
∗ SPICE 2 g6 and 3 f 5 i n d u c t a n c e
∗ DC and t r a n s i e n t tests
. s u b c k t S2Q t e s t 5 a po1 , po2 , po3 , po4 , po5 , po6 , po7
v1 1 0 dc 1v
l 1 1 po1 1mH i c=0mA
r 1 po1 0 1k
∗
v2 2 0 dc 0v
l 2 2 po2 1mH i c=−10mA
r 2 po2 0 1k
∗
v3 3 0 dc 1v
l 3 3 po3 1mH IC=0mA
r 3 po3 0 1k
∗
v4 4 0 dc 0v p u l s e ( 0 1 0 . 1u 0 . 1u 0 . 1u 10u 20u )
l 4 4 po4 1mH i c=0mA
r 4 po4 0 1k
∗
v5 5 0 dc 1v p u l s e ( 0 1 0 . 1u 0 . 1u 0 . 1u 10u 20u )
l 5 5 po5 1mH i c=0mA
r 5 po5 0 1k
∗
v6 6 0 dc 1v p u l s e ( 0 1 0 . 1u 0 . 1u 0 . 1u 10u 20u )
l 6 6 po6 1mH i c= −1mA
r 6 po6 0 1k
∗
v7 7 0 dc 0v p u l s e ( 0 1 0 . 1u 0 . 1u 0 . 1u 10u 20u )
l 7 7 po7 1mH i c=1mA
r 7 po7 0 1k
∗
. ends
. end
∗ SPICE t o Qucs s y n t a x f i l e
∗ SPICE 2 g6 and 3 f 5 mutual i n d u c t a n c e
∗ AC t e s t s
. s u b c k t s2q t e s t 5 c po1 po2
v1 1 0 ac 240
r 1 1 2 1Ohm
l 1 2 0 100mH
l 2 3 0 100mH
243
k23 l 1 l 2 0 . 999
r 2 3 po1 1Ohm
r l po1 0 150
∗
r 1 1 1 21 1Ohm
l 1 1 21 0 100mH
l 2 1 0 31 100mH
k231 l 1 1 l 2 1 0 . 999
r 2 1 31 po2 1Ohm
r l 1 po2 0 150
. ends
. end
244
12.3 History of simulation results
12.3.1 April 17 2007, Simulation tests by Mike Brinson
Summary:
• File s2q 5 b: All DC and transient results correct. NOTE: Outputs po4.V,
po5.V, po6.V and po7.V have a value of 0.513 added to the DC source
values. This corresponds to the DC value of the pulse sources. Changing,
for example, time parameter TD changes this value.
• Inductive coupled networks with more than three coupling coefficients have
not been tested.
245
X1
File=s2q_test5_a.cir
P01 P02
PO1 PO2
spice
P03 dc simulation
PO3
DC1
Ref
ac simulation
AC1
Type=log
Start=1 Hz
Stop=100 kHz
Points=100
Figure 12.1: April 17: Inductor DC and AC test schematic for file s2q 5 a.cir
1
1
P02.v
P01.v
0
0.9
-1
1 10 100 1e3 1e4 1e5 0 2e4 4e4 6e4 8e4 1e5
acfrequency acfrequency
1
P03.v
Figure 12.2: April 17: Inductor DC and AC tests results for file s2q 5 a.cir
246
# Qucs 0 . 0 . 12 / media / hda2 /S2Q t e s t 5 p r j / t e s t s2q 5 a . s c h
X1
File=s2q_test5_b.cir
dc simulation po1
PO1 PO2
po2
DC1
P1 P2
po3 p04
PO3 PO4
P3 P4
spice
transient po5 po6
simulation PO5 PO6
TR1 P5 P6
Type=lin po7
Start=0 PO7
Stop=21u
IntegrationMethod=Gear P7 Ref
Order=6
reltol=0.01
abstol=100 pA
vntol=100 uV
Figure 12.4: April 17: Inductor DC and transient test schematic for file s2q 5 b.cir
247
number po1.V po2.V po3.V p04.V po5.V po6.V po7.V
1 1 0 1 0.513 1.51 1.51 0.513
1 0 1
po1.Vt
po2.Vt
po3.Vt
0.5 -5 0.5
0 -10 0
0 5e-6 1e-5 1.5e-5 2e-5 0 5e-6 1e-5 1.5e-5 2e-5 0 5e-6 1e-5 1.5e-5 2e-5
time time time
1 2 2
p04.Vt
po5.Vt
po6.Vt
0.5 1
0
0 0
0 5e-6 1e-5 1.5e-5 2e-5 0 5e-6 1e-5 1.5e-5 2e-5 0 5e-6 1e-5 1.5e-5 2e-5
time time time
1
po7.Vt
0.5
0
0 5e-6 1e-5 1.5e-5 2e-5
time
Figure 12.5: April 17: Inductor DC and transient tests results for file s2q 5 b.cir
248
# Qucs 0 . 0 . 12 / media / hda2 /S2Q t e s t 5 p r j / t e s t s2q 5 b . s c h
249
X1
dc simulation po1 File=s2q_test5_c.cir
po2
PO1 PO2
DC1 spice
Ref
ac simulation
Equation
AC1
Type=log Eqn1
Start=1 Hz vpo1=abs(po1.v)
Stop=10 MHz phase_vpo1=phase(po1.v)
Points=100 phase_vpo2=rad2deg(unwrap(angle(po2.v)))
vpo2=abs(po2.v)
real_vpo1=real(po1.v)
real_vpo2=real(po2.v)
imag_vpo1=imag(po1.v)
imag_vpo2=imag(po2.v)
Figure 12.7: April 17: Mutual inductance AC test schematic for file s2q 5 c.cir
number po1.V
1 0
100
200 200
imag_vpo1
real_vpo1
vpo1
0
100
100
-100
0
0
1 10 100 1e3 1e4 1e5 1e6 1e7 1 10 100 1e3 1e4 1e5 1e6 1e7
1 10 100 1e3 1e4 1e5 1e6 1e7 acfrequency acfrequency
acfrequency
0
100
200
imag_vpo2
real_vpo2
-100
vpo2
0
100
-200
-100
0
1 10 100 1e3 1e4 1e5 1e6 1e7 1 10 100 1e3 1e4 1e5 1e6 1e7 1 10 100 1e3 1e4 1e5 1e6 1e7
acfrequency acfrequency acfrequency
100 -100
acfrequency po1.v vpo1 vpo2
26 236 / 3.47° 236 236
30.5 236 / 2.95° 236 236
phase_vpo1
phase_vpo2
Figure 12.8: April 17: Mutual inductance tests results for file s2q 5 c.cir
250
# Qucs 0 . 0 . 12 / media / hda2 /S2Q t e s t 5 p r j / t e s t s2q 5 c . s c h
251
dc simulation X1
File=s2q_test5_d.cir
vpo1
DC1 PO1
spice
Ref
transient
simulation
TR1
Type=lin
Start=0
Stop=100 ms
IntegrationMethod=Trapezoidal
Figure 12.10: April 17: Mutual inductance transient test schematic for file
s2q 5 d.cir
number vpo1.V
1 0
200
time vpo1.Vt
0.0341 -235
vpo1.Vt
0.0342 -237
0.0343 -238 0
0.0344 -239
0.0345 -240
0.0346 -241
0.0347 -241 -200
0.0348 -242
0.0349 -242 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
0.035 -242 time
0.0351 -241
0.0352 -240
Figure 12.11: April 17: Mutual inductance transient tests results for file s2q 5 d.cir
252
# Qucs 0 . 0 . 12 / media / hda2 /S2Q t e s t 5 p r j / t e s t s2q d . s c h
253
X1
dc simulation po1
File=s2q_test5_e.cir
po2
PO1 PO2
DC1 spice
Ref
transient
simulation
TR1
Type=lin
Start=0
Stop=100 ms
Figure 12.13: April 17: Mutual inductance transient test schematic for file
s2q 5 e.cir
200 200
po1.Vt
po2.Vt
0 0
-200 -200
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
time time
Figure 12.14: April 17: Mutual inductance transient tests results for file s2q 5 e.cir
254
# Qucs 0 . 0 . 12 / media / hda2 /S2Q t e s t 5 p r j / t e s t s2q 5 e . s c h
255
13 A Curtice level 1 MESFET
model
13.1 Introduction
The Metal and Semiconductor FET (MESFET) is a Schottky-barrier gate FET
made from gallium arsenide. It is popular for high frequency applications because
of it’s high electron mobility. The device was developed by Walter R. Curtice1
in 1980 at the RCA Laboratory in Princeton, New Jersey. USA. The MESFET
model presented below is based on a Qucs equation defined device (EDD) which
functions as a Curtice level 1 MESFET model with interelectrode capacitances.
Basic temperature effects are also included.
256
Name Symbol Description Unit Default
capacitance
CGD CGD interelectrode gate-drain bias-independent F 300f
capacitance
CDS CDS interelectrode drain-source bias-independent F 300f
capacitance
◦
Tnom TN OM device parameter measurement temperature C 27
◦
Temp T device temperature C 27
Alpha α coefficient of Vds in tanh function for 1/V 0.8
quadratic model
Beta β transconductance parameter A/V2 3m
Lambda λ channel length modulation parameter for 1/V 40m
quadratic model
VTO VT O quadratic model gate threshold voltage V −6
257
Gate1 Equation
Num=2
Lg1 Eqn2
L=LG Vt=kB/q*TK
GMIN=1e-12
TK=Temp+273.15
TnK=Tnom+273.15
D1 Rg1
I1=0 R=RG
Q1=CGD*V1
Drain1 Rd1
Num=3 R=RD Equation
1
Eqn1
Ld1 TR=TK/TnK
L=LD IsT=IS*exp(XTI/N*ln(TR) - EG/N/Vt*(1-TR))
D2
I1=V1<-VBR+50*Vt ? -IsT*(1+exp(-(VBR+V1)/Vt)) + GMIN*V1 : 0
Q1=0
I2=V1>=-VBR+50*Vt && V1<-5*Vt ? -IsT+GMIN*V1 : V1>=-5*Vt ? IsT*(exp(V1/(N*Vt))-1) + GMIN*V1 : 0
4
Q2=0
I3=V1-VT0>0 ? Beta*(V1-VT0)^2*(1+Lambda*V3)*tanh(Alpha*V3) : 0
Q3=CDS*V3 + TAU*I3
Rin1 I4=0
R=RIN Q4=CGS*V4
Curtice1
Source1 Ls1 Rs1 RG=1m
Num=1 L=LS R=RS RD=1m
RS=1m
VBR=10e10
LG=0
LD=0
LS=0
IS=10f
N=1
XTI=0
EG=1.11
Beta=3m
Lambda=40m
VT0=-6
Temp=27
Alpha=0.8
CDS=300f
TAU=10p
RIN=1m
CGS=300f
CGD=300f
Tnom=27
258
13.3 The MESFET equations
• DC characteristics
1. for (VGS < −VBR + 50 · VT )
VBR + VGS
IGS = −IS (T ) · 1 + exp − + GM IN · VGS (13.1)
VT
Where
XT I
IS (T ) = IS · exp · ln(T R) − (EG /N/VT ) · (1 − T R) (13.5)
N
TK
Tr = and T K = T + 273.15, T nK = TN OM + 273.15 (13.6)
T nK
• MESFET charge equations
1.
QGS = CGS · VGS (13.7)
2.
QGD = CGD · VGD (13.8)
3.
QDS = CDS · VDS + τ · IDS (13.9)
259
13.4 Test circuits and simulation results
Curtice1
RG=1m V1
RD=1m U=Vds
RS=1m
VBR=10
LG=0
V2 LD=0
U=Vgs LS=0
IS=10f
N=1
XTI=0
EG=1.11
Beta=3m
Lambda=40m Parameter Parameter
VT0=-6 sweep sweep
dc simulation Temp=27
Alpha=0.8
CDS=300f SW1 SW2
DC1 TAU=10p Sim=DC1 Sim=SW1
RIN=1m Type=lin Type=lin
Equation CGS=300f Param=Vds Param=Vgs
CGD=300f Start=-10 Start=-5
Eqn1 Tnom=27 Stop=10 Stop=0
Id=-V1.I Points=41 Points=6
0.15
0.1
0.05
Id
-0.05
-0.1
-10 -8 -6 -4 -2 0 2 4 6 8 10
Vds
260
Curtice1
RG=1m V1
RD=1m U=Vds
RS=1m
VBR=10
LG=0
V2 LD=0
U=Vgs LS=0
IS=10f
N=1
XTI=0
EG=1.11
Beta=3m
Lambda=40m Parameter Parameter
VT0=-6 sweep sweep
dc simulation Temp=27
Alpha=0.8
CDS=300f SW1 SW2
DC1 TAU=10p Sim=DC1 Sim=SW1
RIN=1m Type=lin Type=lin
Equation CGS=300f Param=Vgs Param=Vds
CGD=300f Start=-8 Start=1
Eqn1 Tnom=27 Stop=0 Stop=11
Id=-V1.I Points=21 Points=6
0.15
0.1
Id
0.05
-8 -7 -6 -5 -4 -3 -2 -1 0
Vgs
261
Curtice1
RG=1m V1
RD=1m U=5
RS=1m
VBR=0
LG=0
V2 LD=0
U=Vgs LS=0
IS=10f
N=1
XTI=3
EG=1.11
Beta=3m
Lambda=40m Parameter Parameter
VT0=-6 sweep sweep
dc simulation Temp=Temp
Alpha=0.8
CDS=300f SW1 SW2
DC1 TAU=10p Sim=DC1 Sim=SW1
RIN=1m Type=lin Type=lin
Equation CGS=300f Param=Vgs Param=Temp
CGD=300f Start=0.6 Start=-100
Eqn1 Tnom=27 Stop=1.0 Stop=+100
Id=-V1.I Points=21 Points=6
Ig=-V2.I
100
10
0.1
0.01
1e-3
1e-4
Ig
1e-5
1e-6
1e-7
1e-8
1e-9
1e-10
1e-11
0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
Vgs
262
Curtice1
RG=1m
RD=1m X2
RS=1m V1 P2
VBR=0 U=Vds Num=2
LG=1p Z=50 Ohm
LD=5p
X1
LS=5p
P1 V2 IS=10f
Num=1 U=0 N=1
Z=50 Ohm XTI=3
EG=1.11
Beta=3m
Lambda=40m Parameter S parameter
VT0=-6 sweep simulation
Temp=27
Alpha=0.8
dc simulation CDS=300f SW1 SP1
TAU=10p Sim=SP1 Type=lin
RIN=1m Type=lin Start=1kHz
DC1 CGS=300f Param=Vds Stop=10GHz
CGD=300f Start=5 Points=40
Equation Tnom=27 Stop=20
Eqn1 Points=3
Id=-V1.I
Ig=-V2.I
S[1,1]
S[2,2]
frequency frequency
S[1,2]
S[2,1]
frequency frequency
263