Escolar Documentos
Profissional Documentos
Cultura Documentos
SILVACO International
4701 Patrick Henry Drive, Building #2
Santa Clara, CA 95054
ii SILVACO International
Notice
We welcome your evaluation of this manual. Your comments and suggestions help us to improve our
publications. If you have any responses to the questions below, please let us know. Please write us with
your observations, complaints, bug reports, suggestions, or comments.
• Is this manual technically accurate?
• Are the concepts and wording easy to understand?
• Is the size of this manual convenient for you?
• Do you consider this manual to be readable?
Please add any additional relevant comments.
Send your comments to:
SILVACO International
Attn: Technical Publications
4701 Patrick Henry Drive, Building #2
Santa Clara, CA 95054
FAX: (408) 496-6080
E-MAIL: support@silvaco.com
You can also browse our web page at www.silvaco.com
iv SILVACO International
Preface
This manual describes SILVACO VERILOG®-A language, the analog subset of the Verilog-AMS version 2.0
language (IEEE 1364). VERILOG-A belongs to the "Analog Hardware Description Language" (AHDL)
class of computer languages. AHDLs are intended to help design analog systems in high level
behavioral forms for continuous systems.
The SMARTSPICE VERILOG-A INTERFACE provides the capability to include in a netlist one or several
modules described in VERILOG-A.
Requirements
The VERILOG-A INTERFACE is supported on the following UNIX platforms: Sun Solaris 2.7 and 2.8, Red
Hat linux 7.3 and HP 11.0. VERILOG-A is also supported on Windows NT 4.0, Windows 2000 or XP. On
the UNIX platforms, a C compiler (the gcc compiler, 2.8.1 or 2.95.3, or the SUN C compiler, SC4 or
SC6) could be be used in the VERILOG-A simulation flow for a speedup purpose. The intention of this
manual is not to explain in detail all the features of the VERILOG-A language. For further information,
the reader should consult the LANGUAGE REFERENCE MANUAL OF VERILOG-A, version 2.0 provided by
Accellera (formerly OVI).
Typographic and Syntax Conventions
Typographical conventions are used to emphasize or distinguish certain kinds of text in this manual.
The formal syntax used in this document uses the definition operator, := , to define and describe the
elements of the VERILOG-A language.
• Lowercase words represent syntactic categories. For example:
module_declaration
• Some names begin with a part that indicates how the name is used. For example:
node_identifier
represents an identifier that is used to declare or reference a node.
• Boldface words represent elements of the syntax that must be used exactly as presented. Such
items include keywords, operators, and punctuation marks. For example:
endmodule
• Vertical bars indicate alternatives. One can choose to use any one of the items separated by the
bars. For example:
attribute ::=
abstol
| access
| ddt_nature
| idt_nature
| units
| huge //Vendor compactibility specific
| blowup //Vendor compactibility specific
| identifier
• Square brackets enclose optional items. For example,
input declaration ::=
input [ range ] list_of_port_identifiers ;
• Braces enclose an item that can be repeated zero or more times. For example,
list_of_ports ::=
( port { , port } )
• Code examples are displayed in Courier font.
/* This is an example of Courier font.*/
SILVACO International v
• Within the text, the variables are in Courier italic.
This is Courier italic font.
• Within the text, the keywords, filenames, names of natures, and names of disciplines are set in
Courier font, like this:
keyword, file_name, name_of_nature, name_of_discipline.
• If a statement is too long to fit on one line, the remainder of the statement is indented on the next
line, like this:
egfet = 1.16-(7.02e-4*$temperature*$temperature)
/($temperature+1108);
vi SILVACO International
Table of Contents
Chapter 1:
Modeling Analog System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.1: Modeling with the Verilog-A Language Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.2: Representing a System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.2.1: Nets and nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.3: Verilog-A Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
1.4: Conservative Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
1.4.1: Kirchhoff’s Laws . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
1.4.2: Reference Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.4.3: Reference Directions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.5: Signal-Flow Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.6: Mixed Conservative and Signal-Flow Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Chapter 2:
Makeup of Modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
2.1: Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
2.2: Declaring Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
2.3: Declaring the Module Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
2.3.1: Module Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
2.3.2: Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
2.3.3: Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
2.4: Structural Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
2.4.1: Module Instantiations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
2.5: Behavioral Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
2.5.1: Defining Analog Behavior with Control Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
2.5.2: Using Integration and Differentiation with Analog Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
2.6: Using Internal Nodes in Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
2.6.1: Using Internal Nodes in Behavioral Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
2.6.2: Using Internal Nodes in Higher Order Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
Chapter 3:
Lexical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
3.1: Lexical Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
3.2: White Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
3.3: Comments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.4: Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.5: Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.5.1: Integer Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.5.2: Real Constants. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
3.6: Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5
3.6.1: Special Characters in Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5
3.7: Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
3.7.1: Ordinary Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
3.7.2: Escaped Identifiers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
Chapter 4:
Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.1: Integer Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.2: Real Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.2.1: Converting Real Numbers to Integer Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4.3: Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
4.3.1: A Parameter Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
4.3.2: Permissible Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
4.3.3: Parameter Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
4.3.4: Genvars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
4.4: Natures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
4.4.1: Base Nature. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
4.4.2: Derived Nature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
4.5: Disciplines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
4.5.1: Binding Natures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
4.5.2: Compatibility of Disciplines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11
4.5.3: Multi-Disciplinary Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
4.5.4: Empty Disciplines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
4.5.5: Discipline of Wires and Undeclared Nets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
4.5.6: Overriding Nature Attributes From Discipline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
4.5.7: Deriving Natures From Disciplines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
4.5.8: Ground Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
4.6: Net Disciplines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
4.7: Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
4.8: Implicit Branches. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17
Chapter 5:
Statements for the Analog Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
5.1: Analog Procedural Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
5.1.1: Block Statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
5.1.2: Procedural Assignment Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
5.2: Sequential Block Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
5.3: Conditional Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
5.3.1: Analog Conditional Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
5.4: Case Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
5.4.1: Analog Case Statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
5.4.2: Constant Expression in Case Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
5.5: Looping Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
5.5.1: Repeat and While Statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
5.5.2: For Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
5.6: Analog Signals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
5.7: Signal Access Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
5.8: Probes and Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
5.8.1: Probes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
5.8.2: Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
5.8.3: The four controlled sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
Chapter6:
Expressions and Operators for Analog Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
6.1: Overview of Expressions and Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
6.2: Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
6.2.1: Operators With Real Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
6.2.2: Real to Integer Conversion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
6.2.3: Arithmetic Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
6.2.4: Binary Operator Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
6.2.5: Expression Evaluation Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
6.2.6: Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
6.2.7: Relation Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
6.2.8: Case Equality Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
6.2.9: Logical Quality Operators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
6.2.10: Logical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
6.2.11: Bit-Wise Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
6.2.12: Shift Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
6.2.13: Ternary Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
6.2.14: Event OR Operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
6.2.15: Concatenations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
6.3: Analog Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11
6.3.1: Restrictions To Analog Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11
6.3.2: Vector or Array Arguments To Analog Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11
6.3.3: Analog Operators and Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12
6.3.4: Time Derivative Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12
6.3.5: Time Integral Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12
6.3.6: Circular Integrator Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13
6.3.7: Absolute Delay Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
6.3.8: Transition Filter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15
6.3.9: Slew Filter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20
6.3.10: last_crossing function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22
6.3.11: Laplace Transform Filters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22
6.3.12: Z-Transform Filters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-25
6.3.13: Limited Exponential . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27
Chapter7:
Built-In Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1
7.1: Standard Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1
7.2: Trigonometric and Hyperbolic Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Chapter 8:
Analog Events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
8.1: Detecting and Using Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
8.1.1: Event Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
8.1.2: Event OR Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
8.1.3: Event Triggered Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
8.1.4: Global Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
8.1.5: Monitored Events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
Chapter 9:
Simulator Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1
9.1: Analysis Dependent Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1
9.1.1: Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1
9.1.2: AC stimulus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
9.1.3: Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
9.2: Discontinuity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
9.3: Bounding the Time Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7
9.4: Querying the Simulation Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
9.4.1: Obtaining Current Simulation Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
9.4.2: Obtaining the Current Ambient Temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
9.4.3: Obtaining the Thermal Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9
9.5: Generating Random Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9
9.6: Generating Random Numbers in Specified Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11
9.6.1: Uniform Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11
9.6.2: Normal (Gaussian) Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
9.6.3: Exponential Distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
9.6.4: Poisson Distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-13
9.6.5: Chi-Square Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14
9.6.6: Student’s T Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14
9.6.7: Erlang Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-15
9.7: Silvaco System Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-16
9.7.1: $sit_get_prev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-16
9.7.2: $sit_get_ddv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-16
9.8: Displaying Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-17
9.9: Specifying Power Consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-20
9.10: Working with Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-20
9.10.1: Opening a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-20
9.10.2: Special $fopen Formatting Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-21
9.10.3: Writing to a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-22
9.10.4: Closing a File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-24
9.11: User-Defined Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-24
9.11.1: Declaring an Analog User-Defined Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-24
9.11.2: Returning a Value from a User-Defined Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-25
9.11.3: Calling a User-Defined Analog Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-26
Chapter 10:
Instantiating Modules and Primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1
10.1: Instantiating Verilog-A Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1
10.1.1: Creating and Naming Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1
10.1.2: Mapping Instance Ports to Module Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
10.2: Connecting the Ports of Module Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3
10.2.1: Port Connection Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4
10.2.2: Multilevel Hierarchal Designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5
10.3: Overriding Parameter Values in Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7
10.3.1: Overriding Parameter Values from the Instantiation Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7
10.4: Instantiating Analog Primitives. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9
10.4.1: B device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9
10.4.2: C device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9
10.4.3: D device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-10
10.4.4: E,F,G,H devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-10
10.4.5: I, V devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-13
10.4.6: J device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-15
10.4.7: K, L devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-15
10.4.8: M device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16
10.4.9: O device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16
10.4.10: Q device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16
10.4.11: R device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17
10.4.12: S device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17
10.4.13: T device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17
10.4.14: U device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17
10.4.15: W device. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-18
10.4.16: SPICE Model Card Primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-18
10.4.17: SPICE Subcircuit Primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-18
10.4.18: Instantiating Analog Primitives that Use Array Valued Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 10-19
10.4.19: Instantiating Modules that Use Unsupported Parameter Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-19
Chapter 11:
Grammer Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-1
Chapter 12:
Standard Definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-1
12.1: “discipline.h” content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-1
12.1.1: "Constants.h" file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-7
Chapter 13:
The SmartSpice Verilog-A Simulation Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-1
13.1: Choosing the SILVACO C-INTERPRETER or a third-party C compiler . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
13.2: The SmartSpice Verilog-A interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
13.2.1: New Verilog-A Language Features Supported . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
13.2.2: Attributes HUGE, BLOWUP, MAXDELTA (Cadence Compatibility) . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3
13.2.3: The power function: $pwr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3
13.2.4: The mathematical functions: hypot(x,y) and atan2(x,y) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-4
13.2.5: Analysis Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-4
13.2.6: Usage of the .PRINT and .PLOT Smartspice commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-4
13.2.7: Usage of the command .MODIF. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-5
Chapter 14:
Device Modeling in Verilog-A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-1
14.1: Device Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-1
14.2: MOSFET Model Tutorial for Verilog-A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-2
14.2.1: MOSFET Model Parameter Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-2
14.3: Temperature Compensation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-7
14.3.1: Temperature Model Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-7
14.3.2: DC Current Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-11
14.3.3: Capacitance Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-14
14.4: MOSFET Model LEVEL=3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-15
14.4.1: Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-15
14.4.2: MOS_LEVEL 3 Verilog-A Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-16
14.4.3: EKV MOSFET Model - using Silvaco Verilog-A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-16
14.5: EKV MOSFET Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-17
14.5.1: Geometry Device Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-17
14.5.2: Effective Channel Length and Width Calculations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-17
14.5.3: Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-17
14.5.4: Handling of LEVEL 2/3 Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-21
14.5.5: Temperature Compensation Equations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-21
14.5.6: DC Current Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-22
14.5.7: Charge Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-26
14.5.8: Noise Model Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-28
14.6: Berkeley BSIM3v3 MOSFET Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-29
14.6.1: Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-29
14.6.2: Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-29
14.6.3: Effective Channel Length and Width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-39
14.6.4: Temperature Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-39
14.6.5: I-V Model Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-40
14.6.6: Capacitance Model Equations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-44
14.6.7: NQS Model Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-54
14.7: Berkeley MOSFET Model BSIM4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-55
14.7.1: Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-55
14.7.2: Instance Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-55
14.7.3: Effective Channel Length and Width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-66
14.7.4: Gate Dielectric Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-67
14.7.5: Temperature Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-67
14.7.6: I-V Model Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-69
14.7.7: Capacitance Model Equations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-77
14.7.8: Asymmetric MOS Junction Diode Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-79
Chapter 15:
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-1
15.1: Digital circuits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-1
15.1.1: Inverter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-1
15.1.2: Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-3
15.1.3: Nand. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-4
15.1.4: NOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-7
15.1.5: EXOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-10
15.1.6: DFF (D-type Flip Flop) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-12
15.1.7: 4bit Shift Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-15
15.1.8: 4bit Down Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-16
15.2: Analog Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-17
15.2.1: LPF. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-17
15.2.2: HPF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-20
15.2.3: BPF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-21
15.3: Analog Circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-23
15.3.1: OPAMP (Operational Amplifier) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-23
15.3.2: Sample hold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-26
15.3.3: ADC (Pipelined ADC and user defined resolution). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-28
15.3.4: ADC to DAC Example: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-33
KPL KVL
KFL KCL
Figure 1-2: Kirchhoff’s Flow Law (KFL) and Potential Law (KPL)
2.1: Overview
This chapter introduces the concept of modules. A VERILOG-A module can be divided into 3 parts:
• The first part is an interface declaration that includes port signal declarations (the connection
points of the module) and parameter declarations (characterization of the behavior of the
component).
• The second part is the structural description that defines the connection with sub-components.
Every module can instantiate other modules, referred to as child modules. This instantiation
mechanism allows an hierarchical organization of a system through its parametric specifications
and connections.
• The third part is a behavioral description that defines relations or equations between the input
signals of the module and the output signals.
Verilog-A Module
// port declarations
inout in,out;
electrical in, out; interface declaration
// parameter declarations
parameter real R = 1;
// structural description
<module instantiation structural description
statements>
// behavioral description
analog begin
<analog behavioral statements>
behavioral description
end
The following example defines a temperature compensated resistor to illustrate the form of a module.
The entire module is enclosed between the keywords module and endmodule.
Interface declarations:
module resistor(p, n);
inout p, n; | port signal declarations
electrical p, n; |
Behavioral description:
real rtc;
analog begin
@(initial_step) begin
rtc = r*(1+tc*$temperature);
end
I(p, n) <+ V(p, n)/rtc;
end
endmodule
module_keyword ::=
module
| macromodule
module_items ::=
{ module_item }
| analog_block
module_item ::=
module_item_declaration
| module_instantiation
module_item_declaration ::=
parameter_declaration
| input_declaration
| output_declaration
| inout_declaration
| ground_declaration
| integer_declaration
| net_discipline_declaration
| real_declaration
2.3.2: Ports
To declare the ports used in a module, use port declarations. To specify the type and direction of a port,
use the related declarations described in this section.
list_of_ports ::=
port { , port }
port ::=
port_expression
port_expression ::=
port_identifier
| port_identifier [ constant_expression ]
| port_identifier [ constant_range ]
constant_range ::=
msb_constant_expression : lsb_constant_expression
Example
module and(in1, in2, out); // define three ports
Port Type
To declare the type of a port, use a net discipline declaration in the body of the module. If the user does
not declare the type of a port, they can only use the port in a structural description. In other words, a
user can pass the port to module instances, but cannot access the port in a behavioral description.
Ports declared as vectors must use identical ranges for the port type and port direction declarations.
Examples
electrical out, in1, in2; // types of ports
Port Direction
The user must declare the port direction for every port in the list of port sections of the module
declaration. To declare the direction of a port, use one of the following three syntaxes.
input_declaration ::=
input [ range ] list_of_port_identifiers ;
output_declaration ::=
output [ range ] list_of_port_identifiers ;
inout_declaration ::=
inout [ range ] list_of_port_identifiers ;
range ::=
[ constant_expression : constant_expression ]
input: Declares that the signals on the port cannot be set. Input signals can be used in expressions.
output: Declares that the signals on the port can be set. Output signals cannot be used in expressions.
inout: Declares that the port is bidirectional. The signals on the port can be both set and used in
expressions. inout is the default port direction.
analog
V(a, b) <+ I(a, b)*R;
endmodule
Signal-flow signals:
module signal_flow(out, in);
voltage out, in;
output out; out port used for source
input in; in port used for probe
analog
V(out) <+ gain*V(in);
endmodule
2.3.3: Parameters
With parameter declarations, the user specifies parameters that can be changed when a module is
used as an instance in a design. Using parameters allows each instance to be customized.
For each parameter the user must specify a default value, and can also specify an optional type and an
optional valid range.
Syntax
Examples
parameter real R0 = 1.0;
parameter real P0 = 1.0 from (0:inf);
parameter integer ip0 = 2 exclude 0;
parameter real t0 = 1.0 from (0:10];
parameter t2 = 5.0;
parameter real t3 = 4;
In all cases, the lower bound range must be numerically smaller than the upper bound range. For more
information of the parameter declarations, please see "Chapter 4:" "Data Types".
The following example illustrates how to declare parameters and variables in a module.
analog begin
vd = V(p, n);
id = area*is*(exp(vd/(z*$vt)) - 1);
qd = t_t*id + area*vd
Behavioral description *cjo/pow((1 - vd/phi), m);
I(p, n) <+ id + ddt(qd);
end
endmodule
Module diode has a parameter area that defaults to 4. If area is not specified for an instance, it
receives a value of 4. Similarly, the other parameters: is, n, cjo, m, phi, and t_t, have specified
default values too.
Module diode also defines three local variables: vd, id, and qd.
where param_assigns (or parameter name in child module) and port_assigns can be either by
positional(ordered) or name associated, and they cannot be mixed within a module
instantiation.
Example
//module interface declarations for 4 bit A/D
...
endmodule
...
endmodule
...
endmodule
...
endmodule
module sub_a2d(bit0, bit1, bit2, bit3, bit4, bit5, bit6, bit7, in, clock);
output bit0, bit1, bit2, bit3, bit4, bit5, bit6, bit7;
input in, clock;
electrical bit0, bit1, bit2, bit3, bit4, bit5, bit6, bit7;
electrical in, clock;
//internal signals
electrical a_out, rem_out, gain_out;
endmodule
Since vrange = 1.0 is parameter #1 and tdel = 10ns is parameter #2, respectively,
one can rewrite structure instantiation with the new assigned parameter as:
a2d #(5.0)
lsb_a2d(bit0, bit1, bit2, bit3, gain_out, clock),
msb_a2d(bit4, bit5, bit6, bit7, in, clock);
or can rewrite if all four parameters need to be assigned by their positional orders:
a2d #(5.0, 10n, 15n, 15n)
lsb_a2d(bit0, bit1, bit2, bit3, gain_out, clock),
msb_a2d(bit4, bit5, bit6, bit7, in, clock);
where port orders of child modules lsb_a2d and msb_a2d are corresponding to ports in the parent
module a2d:
a2d (d0, d1, d2, d3, in, clk);
lsb_a2d (bit0, bit1, bit2, bit3, gain_out, clock),
msb_a2d (bit4, bit5, bit6, bit7, in, clock);
Name Association
In addition to ordered or positional association, name association can also be applied.
Example
a2d #(5.0, 10n)
lsb_a2d(bit0, bit1, bit2, bit3, gain_out, clock),
msb_a2d(bit4, bit5, bit6, bit7, in, clock);
statement ::=
null_statement
| block statement
| branch_contribution
| Indirect_branch_assignment
| procedural_assignment
| conditional_statement
| loop_statement
| case_statement
| generate_statement
| event_controlled_statement
| discontinuity_function
| bound_step_function
| last_crossing_function
| system_task_enable
analog statement can only appear within the analog block. The syntax for a block is the following:
block_statement ::=
begin [ : block_identifier
{ block_item_declaration } ]
{ statement }
end
In the analog block, it is possible code contribution statements with the contribution operator (<+) that
define relationships among analog signals in the module.
Example
output_signal <+ f(input_signal);
where output_signal is a branch of potential and flow sources of V(n1,n2) and I(n1,n2),
respectively. It is possible to define f(input_signal) expression to be any combination of linear,
nonlinear, algebraic, or differential expressions involving module signals, constants, and parameters.
The modules that are written can contain at most a single analog block. When an analog block is used,
the user must place it after the interface declarations and local declarations.
The following module, which produces the sum and product of its inputs, illustrates the form of the
analog block. Here the block contains two contribution statements.
Example
module summult(in1, in2, outsum, outmult);
input in1, in2;
output outsum, outmult;
voltage in1, in2, outsum, outmult;
analog begin
V(outsum) <+ V(in1) + V(in2);
V(outmult) <+ V(in1) * V(in2);
end
endmodule
endmodule
endmodule
∫
1
iL = ---- V ( p, n ) dt
L
0
endmodule
In module inductor, the voltage across the external ports of the component is defined as equal to the
L times the derivative of the current flowing between the ports, and its current is equal to the integral
of voltage divided by L.
To define a higher order derivative, the user must use an internal node or signal. For example, module
deriv_2 defines internal node n1, and sets V(n1) equal to the derivative of V(in). Then the
module sets V(out) equal to the derivative of V(n1), in effect taking the second order derivative of
V(in).
endmodule
Note: If scale is not specified, the output of the module would be in magnitude of 1e6 due to a fast varying “noise” component
of differentiating an unknown input signal.
For time domain integration, use the idt or idtmod functions, as illustrated in module
integrator.
endmodule
Module integrator sets the output voltage to the integral of the input voltage. The second term in
the idt function is the initial condition. Without initial condition, idt must be used in a
system description with feedback that forces its argument to zero; it is possible that convergence will
not likely be achieved.
Module rlc uses an internal node Tmp and the ports in, ref, and out, to directly define the
behavioral characteristics of the RLC circuit. Notice how Tmp does not appear in the list of ports for
the module.
electrical Tmp;
analog begin
V(in, Tmp) <+ R*I(in, Tmp);
V(Tmp, out) <+ L*ddt(I(Tmp, out));
I(out, ref) <+ C*ddt(V(out, ref));
end
endmodule
The following code shows a structural description of an RLC circuit with the new parameter
assignments. There are three module instantiations inside the module rlc. The module resistor is
instantiated with an instance named R1, the module inductor with an instance name L1, and the
module capacitor with an instance name C1.
// Verilog-A module:
‘include “discipline.h”
endmodule // rlc
in out ref
module rlc
Tmp
res.va:
‘include “discipline.h”
//Resistor
analog begin
V(p, n) <+ R*I(p, n);
end
endmodule
ind.va:
‘include “discipline.h”
//Inductor
analog begin
V(p, n) <+ L*ddt(I(p, n));
end
endmodule
cap.va:
‘include “discipline.h”
//Capacitor
analog begin
I(p, n) <+ C*ddt(V(p, n);
end
endmodule
.verilog “ind.va”
.verilog “cap.va”
.verilog “res.va”
*voltage sources
vin in 0 sin (0 5 10e06 0 0)
*Analysis
.tran 1n 800n
*output data
.print V(in) V(out)
.end
Note: The parameter values in the model card will override the previous parameters.
1 Vout
H ( s ) = -----------------------------------------
- = --------------
2
LCs + RCs + 1 Vin
If one set:
dVout
V ( TMP ) = ------------------
dt
one can write:
dV ( TMP )
Vout = Vin – RC ⋅ V ( TMP ) – L ⋅ C ---------------------------
dt
endmodule
3.3: Comments
Verilog-A has two forms to introduce comments. A one_line comment starts with the two characters //
and end with a new line. Block comments start with /* and end with */. Block comments cannot be
nested. The one_line comment token // does not have any special meaning in a block comment.
short_comment ::=
// {any_ASCII_characters_except_end_of_line} \n
// This is a one_line comment
long_comment ::=
/* {any_ASCII_character} */
3.4: Operators
Operators are single, double, or triple character sequences used in expressions. Unary operators are
to the left of an operand, while Binary operators are between the operands. A conditional
operator has two operator characters which separate the operands.
3.5: Numbers
VERILOG-A supports two basic literal data types for arithmetic operations: integer constants and
real constants. The syntax for constants is:
integer_constant ::=
[ sign ] unsign_num
sign ::=
+ | -
unsign_num ::=
decimal_digit { _ | decimal_digit }
decimal_digit ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
The simulator ignores the underscore character (_), so one can use it anywhere in a decimal number,
except as the first character. Using the underscore character can make long numbers more legible.
Examples of integer constants include:
277195000
277_195_000 //Same as the previous number
-634 //A negative number
0005
real_constant ::=
[ sign ] unsign_num .unsign_num
| [ sign ] unsign_num [.unsign_num] e [ sign ] unsign_num
| [ sign ] unsign_num [.unsign_num] E [ sign ] unsign_num
| [ sign ] unsign_num [.unsign_num ] scale_factor
sign ::=
+ | -
unsign_num ::=
decimal_digit { _ | decimal_digit }
decimal_digit ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
scale_factor ::=
T | G | M | K | k | m | u | n | p | f | a
scale_factor represents one of the scale factors listed below. If you use scale_factor, you must
not have any white space between the number and the letter. Be certain to use the correct case for the
scale_factor:
T (tera) = 1012
G (giga) = 109
M (mega) = 106
K,k (kilo) = 103
m (milli) = 10-3
u (micro) = 10-6
n (nano) = 10-9
p (pico) = 10-12
f (femto) = 10-15
a (atto) = 10-18
3.5K // 3500
1e-6 // 0.000001
-8.6e9
-5e-4
0.7u
50p // 50*10e-12
1.5G // 1.5*10e9
413_556.523_642
3.6: Strings
A string is a sequence of characters enclosed by double quotes (“ ”) and contained on a single line.
Strings are treated as a sequence of one_byte ASCII value.
“ a / b” // is a string.
“Welcome to Verilog-A” // is a string.
Table 3-1:
\t Tab character.
\\ \ character.
\” ″ character
3.7: Identifiers
An identifier is used to give an object a unique name so it can be referenced. An identifier can be any
sequence of letters, digits, dollar signs ($), and the underscore character (_). The first character of an
identifier cannot be a digit or a $; it can be a letter or an underscore. Identifiers are case sensitive, and
associated with a data type (see "Chapter 4:" "Data Types"). There are two types of identifiers:
ordinary identifiers, and escaped identifiers.
power_gain_bandwidth
MyValue
MyTime
_my$value2
\base+index
\+clock
\***error-condition***
\(a, b)
\a*(b+c)+d
3.8: Keywords
Keywords are predefined non-escape identifiers which are used to define the language constructs.
Preceding a keyword with an escape character (\) causes it to be interrupted as an escaped identifier.
All keywords are defined in lowercase only. Keywords are reserved identifiers used to delimit the
language constructs.
VERILOG HDL (IEEE 1364) Keywords that are not supported (but are still reserved
identifiers):
Syntax:
system_task_function ::=
$system_task_identifier | (list_of_arguments)|;
|$system_function_identifier | (list_of_arguments)|;
list_of_arguments ::=
argument {, |argument | }
argument ::=
expression
Any valid identifier, including keywords already in use in contexts other than this construct can be
used as a system task or function name.
Examples:
$display(“display a message”);
$realtime();
Examples
‘define threshold 1.0
‘include “constant.h”
‘include “discipline.h”
integer_declaration ::=
integer list_of_identifiers ;
list_of_identifiers ::=
var_name { , var_name}
var_name ::=
variable_identifier
| array_identifier [ range ]
range ::=
upper_limit_const_exp : lower_limit_const_exp
In VERILOG-A, the user can declare an integer number in a range at least as great as: -231
to 231 - 1.
To declare an array, specify the upper and lower indexes of the range. Be sure that each index is a
constant expression that evaluates to an integer value.
real_declaration ::=
real list_of_identifiers ;
list_of_identifiers ::=
var_name { , var_name }
var_name ::=
variable_identifier
| array_identifier [ range ]
range ::=
upper_limit_const_exp : lower_limit_const_exp
In VERILOG-A, the user can declare real numbers in a range at least as great as 10-37 to 10+37. To
declare an array of real numbers, specify the upper and lower indexes of the range. Be sure that each
index is a constant expression that evaluates to an integer value.
Note: Real and integer variables have default initial values of zero.
real_valA = -1.8;
int_valA = real_valA; // int_valA is -2
realvalB = 1.6 ;
int_valB = real_valB; // int_valB is 2
real_valC = -1.6;
int_valC = real_valC; // int_valC is -2
If either operand in an expression is real, VERILOG-A converts the other operand to real before applying
the operator. This conversion process can result in a loss of information.
real real_var;
real_var = 9.0;
real_var = 5/8 * real_var; // real_var is 9.0, not 5.625
In this example, both 5 and 8 are integers, so 1 is the result of the division. VERILOG-A converts 1 to 1.0
before multiplying the converted number by 9.0.
4.3: Parameters
Use the parameter declaration to specify a module’s parameters.
parameter_declaration ::=
parameter [opt_type] list_of_param_assignments ;
opt_type ::=
real
| integer
list_of_param_assignments ::=
declarator_init {, declarator_init }
declarator_init ::=
parameter_identifier = constant_exp { opt_range }
As specified in the syntax, the right-hand side of each declarator_init assignment is required to
be a constant expression. It is possible to include in the constant expression only constant numbers
and previously defined parameters.
Parameters are constants, so the value of a parameter at runtime cannot be changed. However, the
user can customize module instances by changing parameter values during compilation. See Chapter
10, “Instantiating Modules and Primitives,” for more information.
Consider the following code fragment. The parameter superior is defined by a constant expression
that includes the parameter subord.
In this example, changing the value of subord also changes the value of superior because the value of
superior depends on the value of subord.
The second example omits the parameter type, so VERILOG-A derives it from the integer type of the
expression.
In the third example, the expression type is real, which conflicts with the specified parameter type.
The specified type, integer, takes precedence.
In all three cases, rate is declared as an integer parameter with the value 15.
opt_range ::=
from value_range_specifier
| exclude value_range_specifier
| exclude value_constant_expression
value_range_specifier ::=
start_paren expression1 : expression2 end_paren
start_paren ::=
[
| (
end_paren ::=
]
| )
expression1 ::=
constant_expression
| -inf
expression2 ::=
constant_expression
| inf
Ensure that the first expression in each range specifier is smaller than the second expression. Use a
bracket, either "[" for the lower bound or "]" for the upper, to include an end point in the range. Use a
parenthesis, either "(" for the lower bound or ")" for the upper, to exclude an end point from the range.
To indicate the value infinity in a range, use the keyword inf. To indicate negative infinity, use -inf.
For example, the following declaration gives the parameter current_value the default of -20.0. The
range specification allows current_value to acquire values in the range - ∞< cur_val < 0.
gives the parameter positive_value the default of 25. The range specification for positive_value
allows it to acquire values in the range 0 < positive_value <= 50. In addition to defining a range of
permissible values for a parameter, you can use the keyword exclude to define certain values as
illegal.
In this example, both a range of values, 15 < int_value <= 20, and the single value 2 are defined as
illegal for the parameter.
Example
parameter real z_array [0:4] = {1.0, 3.198, 4.56, 2.00, 1.96};
where z_array is a real array with five elements with values 1.0, 3.198, 4.56, 2.00 and 1.96.
4.3.4: Genvars
Genvars are integer valued variables used as loop indexes:
genvar_declaration :: =
genvar list_of_genvar_identifiers :
list_of_genvar_identifiers :: =
genvar_identifier {, genvar_identifier} ;
Example
genvar i;
analog begin
.....
.....
end
The genvar variable i can only be assigned within the loop control. Assignments to the genvar
variable i can consist only of expressions of static values.
4.4: Natures
The nature declaration is used to specify a collection of attributes. The attributes of a nature
characterize the analog quantities that are solved during a simulation. Attributes define the units
(such as meter, volts, and newton), access symbols and tolerances associated with an analog quantity,
and can define other characteristics as well. After defining a nature, it can be used as part of the
definition of disciplines and other natures. Access functions defined in natures are used to access the
potential and flow quantities associated to the nodes.
nature_declaration ::=
nature nature_name
[ nature_descriptions ]
endnature
nature_name ::=
nature_identifier
nature_descriptions ::=
nature_description
| nature_description nature_descriptions
nature_description ::=
attribute = constant_expression ;
attribute ::=
abstol
| access
| ddt_nature
| idt_nature
| units
| identifier
| Silvaco_supported_attribute
Silvaco_supported_attribute ::=
huge
| blowup For Vendor compatibility
| maxdelta
• Include all the required attributes listed in the Attribute Requirements table (see Table 4-2).
• Be declared at the top level.
The user cannot nest nature declarations inside other nature, discipline, or module declarations.
The VERILOG-A language specification allows one to define a nature in two ways. One may define the
nature directly by describing its attributes. A nature defined in this way is a base nature. The other
way one can define a nature is to derive it from another nature or a discipline. In this case, the new
nature is called a derived nature.
nature current
units = "A";
access = I;
idt_nature = charge;
abstol = 1e-12;
huge = 1e6;
endnature
nature voltage
units = "V";
access = V;
abstol = 1u;
endnature
Attribute Description
abstol The abstol attribute provides a tolerance measure (metric) for convergence
of potential or flow calculation. It specifies the maximum negligible for
signals associated with the nature. This attribute is required for all base
natures. It is legal for a derived nature to change abstol, but if left
unspecified it shall inherit the abstol from its parent nature. The constant
expression assigned to it shall evaluate to a real value.
access The access attribute identifies the name for the access function. When the
nature is used to bind a potential, the name is used as an access function for
the potential; when the nature is used to bind the flow, the name is used as
an access function for the flow.
This attribute is required for all base natures. It is illegal for a derived
nature to change the access attribute; the derived nature always inherits the
access attribute of its parent nature. If specified, the constant expression
assigned to it shall be an identifier (by name, not as a string).
Attribute Description
units The units attributed provides a binding between the value of the access
functions and the units for that value. The units field is provided so
simulators can annotate the continuous signals with their units and is also
used in the net capability rule check.
This attribute is required for all base natures. It is illegal for a derived
nature to define or change the units; the derived nature always inherits its
parent nature units. If specified, the constant expression assigned to it shall
be a string.
huge Specifies the maximum change in signal value allowed during a single
iteration. The simulator uses huge to facilitate convergence when signal
values are very large. Default is 45.036e06
Attribute Description
blowup Specifies the maximum allowed value for signals associated with the nature.
If the signal exceeds this value, the simulator reports an error and stops
running. Default is 1.0e09
Example
nature Net_current
units = “A”;
access = I;
abstol = 1u;
endnature
// An alias
nature total_Net_current : Net_current
endnature
4.5: Disciplines
Use the discipline declaration to specify the characteristics of a discipline. You can then use the
discipline to declare nets.
discipline_declaration ::=
discipline discipline_identifier
[ discipline_description { discipline_description } ]
enddiscipline
discipline_description ::=
nature_binding
| domain_binding
nature_binding ::=
potential nature_identifier ;
| flow nature_identifier ;
domain_binding ::=
domain continuous ;
| domain discrete ;
Disciplines are declared at the top level. In other words, one cannot nest a discipline declaration inside
other discipline, nature, or module declarations. Discipline identifiers have global scope, so one can use
discipline identifiers to associate nets with disciplines (declare nets) inside any module. A discipline
shall be defined between the keywords discipline and enddiscipline.
discipline voltage
potential Voltage;//A signal-flow discipline must be bound to potential.
enddiscipline
The next declaration, for the electrical discipline, defines two bindings. Disciplines with two
natures are called a conservative discipline.
discipline electrical
potential Voltage;
flow Current;
enddiscipline
When defining a conservative discipline, the nature bound to potential must be different from the
nature bound to flow.
Example
Nature and discipline definitions for electrical systems.
// current in amperes
nature current
units = “A”;
access = I;
abstol = 1e-12;
endnature
// potential in volts
nature voltage
units = “V”;
access = V;
abstol = 1e-6;
endnature
discipline electrical
potential Voltage;
flow Current;
enddiscipline
nature Voltage
access = V;
units = "V";
abstol = 1u;
endnature
nature Current
access = I;
units = "A";
abstol = 1p;
endnature
discipline emptydis
enddiscipline
discipline electrical
potential Voltage;
flow Current;
enddiscipline
discipline sig_flow_v
potential Voltage;
enddiscipline
nature Force
access = F;
units = "N";
abstol = 1n;
endnature
discipline mechanical
potential Position;
flow force;
enddiscipline
module motor_circuitt;
parameter real freq=400;
ground gnd;
electrical drive;
rotational shaft;
motor m1(drive, gnd, shaft);
vsource #(.freq(freq), .ampl(2.0)) v1(drive, gnd);
endmodule
endmodule
Example
discipline neutral
enddiscipline
discipline interconnect
domain continuous;
enddiscipline
Examples
nature ttl_curr
units = "A";
access = I;
abstol = 1u;
endnature
nature ttl_volt
units = "V";
access = V;
abstol = 100u;
endnature
discipline ttl
potential ttl_volt;
flow ttl_curr;
flow.abstol = 10u;
enddiscipline
Examples
nature ttl_net_curr : ttl.flow
endnature // abstol = 10u as modified in ttl
nature ttl_net_volt : ttl.potential
abstol = 1m; // modified for this nature
max = 12.3; // new attribute for this nature
endnature
Syntax
ground_declaration ::=
ground [ range ] list_of_nets;
Example
module example_ground(in, out);
input in;
output out;
electrical in, out;
electrical gnd;
ground gnd;
parameter real V_source = 5.0;
resistor #(.r(10K)) r1(out,gnd);
analog begin
V(out) <+ V(in,gnd)*2;
end
endmodule
net_discipline_declaration ::=
discipline_idendifier [range] list_of_nets ;
wire [range] list_of_nets ;
range ::=
[ msb_expression : lsb_expression ]
list_of_nets ::=
net_identifier
net_identifier , list_of_nets
msb_expression ::=
constant_expression
lsb_expression ::=
constant_expression
A net declared without a range is called a scalar net. A net declared with a range is called a vector net.
Example
module multiple_inputs(multi_ports);
input [0:5] multi_ports;
electrical [0:5] multi_ports;
analog begin
generate i (0, 5)
v(multi_ports [i]) <+ 0.0;
end
endmodule
4.7: Branches
A branch is a path between two nets. If both nets are conservative, then the branch is
conservative, and it defines a branch potential and a branch flow. If one net is a
signal_flow net, then the branch is a signal_flow branch and defines either a branch
potential or a branch flow, but not both.
Each branch declaration is associated with two nets from which it derives a discipline. These nets are
referred to as the branch terminals. Only one net needs to be specified, in which case the second net
defaults to ground and the discipline for the branch is derived from the specified net. The syntax for
declaring branches is shown:
branch_declaration ::=
branch list_of_branches ;
list_of_branches ::=
terminals list_of_branch_identifiers
terminals ::=
( net_identifier )
| ( net_identifier , net_identifier )
list_of_branch_identifiers ::=
branch_identifier
| branch_identifier , list_of_branch_identifiers
Example
module diode (p, n);
inout p, n;
electrical p, n;
analog begin
vd = V (diode);
id = area* is *(exp (Vd/(z*$Vt)) -1);
qd = t_t * id + area * Vd;
I (diode) <+ id + ddt (qd);
end
endmodule
analog_block ::=
analog analog_statement ;
analog_statement ::=
analog_seq_block
|analog_seq_block
|analog_branch_contribution
|analog_indirect_branch_assignment
|analog_procedural_assignment
|analog_conditional_statement
|analog_for_statement
|analog_case_statement
|analog_event_controlled statement
|system_task_enable
|statement
statement ::=
|seq_block
|procedural_assignment
|conditional_statement
|loop_statement
|case_statement
Sequential Blocks
The syntax for sequential blocks is shown below:
seq_block ::=
begin [ : block_identifier { block_item_declaration }]
{ statement }
end
analog_seq_block ::=
begin [ : block_identifier { block_item_declaration }]
{ analog_statement }
end
block_item_declaration ::=
parameter_declaration
| integer_declaration
| real_declaration
An analog_seq_block is a seq_block which encapsulates one or more analog_statements.
Block Names
Name a sequential block by adding a :block_identifier after the keyword begin. The naming
of a block allows local variables to be declared for that block.
All local variables are static - that is, a unique location exists for all variables, and leaving or entering
blocks does not affect the values stored in them.
The block names give a means of uniquely identifying all variables at any simulation time.
procedural_assignment ::=
lexpr = expression ;
analog_procedural_assignments ::=
lexpr = analog_expression ;
lexpr ::=
integer_identifier
| real_identifier
| array_element
array_element ::=
integer_identifier [ constant_expression ]
| real_identifier [ constant_expression ]
The left-hand operand of the procedural assignment must be a modifiable integer or real variable, or
an element of an integer or real array. The type of the left-hand operand determines the type of the
assignment.
The right-hand operand can be any arbitrary scalar expression constituted from legal operands and
operators.
In the following code fragment, the variable phase is assigned a real value. The value must be real
because phase is defined as a real variable.
real phase;
analog begin
phase = idt( gain*V(in));
One can also use procedural assignment statements to modify array values. For example, if z is
declared as:
z[0] = 15.7;
z[1] = 16.1;
z[2] = 17.1;
z[3] = 13.5;
sum = z[0] + z[1] + z[2] + z[3];
analog_seq_block ::=
begin [ : block_identifier { block_item_declaration } ]
{ analog_statement }
end
block_item_declaration ::=
parameter_declaration
integer_declaration
| real_declaration
integer i;
...
for ( i = 0; i < 15; i = i + 1 ) begin
if ( i%2 ) begin : odd
integer i; // Declares a local variable
i = i + 1;
$display("Odd numbers counted = %d", i );
end else begin : even
integer i; // Declares a local variable
i = i + 1;
$display("Even numbers counted = %d" , i );
end
end
conditional_statement ::=
if ( expression ) true_statement_or_null
[ else false_statement_or_null ]
Since the numeric value of the if expression is tested for being zero (0), shortcuts are possible as
listed below.
if (expression)
if (expression ! = 0)
There can be confusion when an else is omitted from a nested if() sequence because the else part
of an if-else is optional. Always associate the else with the closest previous if(), which lacks
an else.
In the example below, the else goes with the inner if(), as shown by indentation.
if (index > 0)
if (i > j)
result = i;
else // else applies to preceding if
result = j;
If that association is not desired, a begin-end shall be used to force the proper association, as shown
below.
The most general way of writing a multi-way decision is through the nesting of if statements (known
as an if-else-if construct). The expressions are evaluated in order. Whenever any expression is
True, the statement associated with it shall be executed, and this action shall terminate the whole
chain. Each statement is either a single statement or a sequential block of statements.
analog_conditional_statement ::=
if ( genvar_expression ) true_analog_statement_or_null ;
[ else false_analog_statement_or_null ; ]
Syntax
case_statement ::=
case (expression) case_item { case_item } endcase
| casex (expression) case_item { case_item } endcase
| casez (expression) case_item { case_item } endcase
case_item ::=
expression { , expression } : statement_or_null
| default [ : ] statement_or_null
The default statement is optional. Use of multiple default statements in one case statement is illegal.
The case expression and the case_item expression can be computed at runtime, but neither
expression is required to be a constant expression.
The case_item expressions are evaluated and compared in the exact order in which they are given.
During this linear search, if one of the case_item expressions matches the case expression given in
parentheses, then the statement associated with that case_item is executed. If all comparisons fail,
and the default item is given, then the default item statement is executed; otherwise none of the
case_item statements are executed.
analog_case_statement ::=
case (genvar_expression) analog_case_item { analog_case_item } endcase
| casex (genvar_expression) analog_case_item { analog_case_item } endcase
| casez (genvar_expression) analog_case_item { analog_case_item } endcase
analog_case_item ::=
genvar_expression { , genvar_expression } : analog_statement_or_null
| default [ : ] analog_statement_or_null
Example
The following example demonstrates the usage by modeling a 3-bit priority encoder.
case (1)
encode[2] : $display(“Select Line 2”);
encode[1] : $display(“Select Line 1”);
encode[0] : $display(“Select Line 0”);
default $strobe(“Error : One of the bits expected ON”);
endcase
The case expression here is a constant expression (1). The case_items are expressions (array
elements) and are compared against the constant expression for a match.
Syntax
repeat_statement ::=
repeat ( expression ) statement
while_statement ::=
while ( expression ) statement
Syntax
for_statement ::=
for ( procedural_assignment ; expression ;
procedural assignment ) statement
analog_for_statement ::=
for ( genvar_assignment ; genvar_expression ;
genvar_assignment ) analog_statement
analog_for statements are syntactically equivalent to for ( ) statements, except the associated
statement is also an analog statement (which contains analog operations). The analog statement puts
the additional restriction upon the procedural assignment and conditional expressions of the for-loop
to be statically evaluated.
Example
genvar i
analog begin
.....
for (i = 0; i < 8; i = i + 1) begin
V(out[i]) <+ transition(value[i], td, tr, tf);
end
.....
end
associated, and uses the ( ) operator. A port access function also takes its name from the discipline of
the port to which it is associated, but uses the port access ( <> ) operator.
If the signal or port access function is used in an expression, the access function returns the value of
the signal. If the signal access function is being used on the left side of a branch assignment, or
contribution statement, a value to the signal is assigned. A port access function cannot be used on the
left side of the branch assignment or contribution statement.
Table 5-1 shows how access functions can be applied to branches, nets, and ports. In the table: b1
refers to a branch, n1 and n2 refer to nets or ports, and p1 refers to a port. These branches, ports and
nets belong to the electrical discipline, where V is the name of the access function for the voltage
(potential) and I is the name of the access function for the current (flow).
Example Comments
V(n1, n2) Accesses the voltage difference between n1 and n2 (nets or ports).
I(<pl>) Accesses the current flow into the module through port p1.
A branch identifier will be the argument expression list for signal access functions, or a list of one or
two nets (or port) expressions. If two net expressions are given as arguments to a flow access function,
they will not evaluate the same signal. The net identifiers will be scalar, or resolve to a constant net of
a composite net type (array or bus) accessed by a genvar expression.
Example
I(n1, n2) creates an unnamed branch from n1 to n2 (if it does not already exist) and then accesses
the branch flow. I(n1) does the same from n1 to the global reference node (ground). Therefore:
• Accessing the flow from a net (or port) to a net (or port) defines an unnamed branch. Accessing the
potential on a single net (or port) defines an unnamed branch from that net (or port) to the global
reference node (ground).
• It is also possible to access the flow passing through a port into a module. The name of the access
function is derived from the flow nature of the discipline of the port. In this case ( <> ) is used to
delimit the port name rather than ( ).
Example
I(<p1>) is used to access the current flow into the module through the electrical port p1. (See section
5.8.8:“Port Branches” for details.)
5.8.1: Probes
If no value is specified for either the potential or the flow, the branch is a probe. If the flow of the
branch is used in an expression anywhere in the module, the branch is a flow probe, otherwise it will
be a potential probe. Using both potential and the flow of a probe branch is illegal. The models for
probe branches are shown in Figure 5-1.
5.8.2: Sources
A branch (named or unnamed) is a source branch if either the potential or the flow of that branch is
assigned a value by a contribution statement anywhere in the module. If the branch potential is
specified, then it is a potential source, and if the branch flow is specified it is a flow source. A branch
cannot simultaneously be a potential and a flow source, although it can switch between them as a
switch branch.
Both the potential and the flow of a source branch are accessible in expressions anywhere in the
module. The module for potential and flow sources are shown in Figure 5-2.
Lower case f is a mode which measures the flow through the branch, and p is a mode which measures
the potential across the branch.
Example
module control_source(p, n, ps, ns);
electrical p, n, ps, ns;
parameter real A=1.0;
branch(ps, ns) in;
branch(p, n) out;
analog begin
end
endmodule
∫
d 1
v ( t ) = Ri ( t ) + L ------ i ( t ) + ---- i ( τ ) dτ
dt C –∞
A parallel RLC circuit is formulated by summing the currents through its three components:
t
v(t)
∫
d 1
i ( t ) = ---------- + C ------ v ( t ) + ---- v ( τ ) dτ
R dt L –∞
Example
In the following example is a simple diode with a series resistor, and the module is implicit because the
diode current I(a, c) appears on both sides of the contribution operator. The current of the diode branch
is specified, making it a flow source branch. In addition, both the voltage and current of diode branch
in the behavioral description.
Example
Writing the junction diode so that the diode current is monitored, and a message is issued if it exceeds
a given value.
analog begin
I(i_diode) <+ is*(limexp(V(i_diode)/$vt) - 1);
I(junc_cap) <+
ddt(tf*I(i_diode) - 2*cjo*sqrt(phi*(phi*V(junc_cap))));
endmodule
The expression V(<a>) is invalid for ports and nets where V is the potential access function. The port
branch I(<a>) cannot be used on the left side of a contribution operator <+.
Example
An ideal relay (a controlled switch) can be implemented as
module relay(p, n, ps, ns);
electrical p, n, ps, ns;
parameter vth = 0.5;
integer closed;
analog begin
endmodule
Example
if (closed)
V(p, n) <+ 0;
is equivalent to
if (closed)
V(p, n) <+ 0;
else
I(p, n) <+ 0;
Examples
The following is an application of access functions to elements of an analog signal vector.
// N-bit DAC example.
real aout;
genvar i;
analog begin
@(cross(V(clk) - vth, +1)) begin
aout = 0;
for (i = width - 1; i >= 0; i = i - 1) begin
if (V(in(i) > vth) begin
aout = aout + fullscale/pow(2, width - i);
end
end
end
V(out) <+ transition(aout, td, tt);
end
endmodule
real aout;
analog begin
@(cross(V(clk) - 2.5, +1)) begin
aout = 0;
aout = aout + ((V(in[7]) > vth) ? fullscale/2.0 : 0.0);
aout = aout + ((V(in[6]) > vth) ? fullscale/4.0 : 0.0);
aout = aout + ((V(in[5]) > vth) ? fullscale/8.0 : 0.0);
aout = aout + ((V(in[4]) > vth) ? fullscale/16.0 : 0.0);
aout = aout + ((V(in[3]) > vth) ? fullscale/32.0 : 0.0);
aout = aout + ((V(in[2]) > vth) ? fullscale/64.0 : 0.0);
aout = aout + ((V(in[1]) > vth) ? fullscale/128.0 : 0.0);
aout = aout + ((V(in[0]) > vth) ? fullscale/256.0 : 0.0);
end
endmodule
Syntax
access_function_reference ::=
bvalue
| pvalue
bvalue ::=
access_identifier (analog_signal_list)
analog_signal_list ::=
branch_indefier
| array_branch_identifier [ genvar_expression ]
| net_or_port_scalar_expression
| net_or_port_scalar_expression , net_or_port_scalar_expression
net_or_port_scalar_expression ::=
| net_or_port_identifier
| array_net_or_port_identifier [ genvar_expression ]
| vector_net_or_port_identifier [ genvar_expression ]
pvalue ::=
flow_access_identifier ( < port_scalar_expression > )
port_scalar_expression ::=
port_identifier
| array_port_identifier [ genvar_expression ]
| vector_port_identifier [ genvar_expression ]
Example
analog
I(out) <+ gm*V(in);
electrical p, n;
branch(p, n) res;
parameter real R = 50;
analog
V(res) <+ R*I(res);
Example
analog begin
I(a, b) <+ c*ddt(V(a, b)), a.potential.abstol);
I(cap) <+ c*ddt(V(cap)), n1.potential.abstol);
end
Syntax
attribute_reference ::=
net_identifier.pot_or_flow.attribute_identifier
(n1, n2) is an unnamed source branch, V(n1, n2) is the potential on the branch, and I(n1, n2)
is the flow on the branch. The nature of the expression can be linear, non-linear, or dynamic. The left
hand side cannot use a port access function. See the following example models a resistor and a
capacitor.
Example
module resistor(p, n);
electrical p, n;
parameter real r = 0;
analog
V(p, n) <+ r*I(p, n);
endmodule
analog
I(p, n) <+ c*ddt(V(p, n));
endmodule
5.11.2: Relations
Source branch relations are defined by branch contribution statements. The branch is directed from
the first net of the access functions to the second net. If the second net is not specified, the global
reference node (ground) is used as the reference point.
The path of the flow between the two nets in a module is the branch relation. The potential and the
flow out of the net are the two quantities. In electrical circuits, the potential of a net is its voltage, and
the flow out is the current. Each branch also has two quantities, the potential and flow across the
branch.
Example
input in;
output out;
voltage out, in;
parameter real Gain = 1;
analog
V(out) <+ Gain*V(in);
endmodule
5.11.3: Evaluation
For source branch contributions the statement is evaluated as following:
• The simulator evaluates the right hand side.
• The value of the right hand side is added to any previously retained value of the branch for any
later assignments to the branch. If there are no previously retained values, the right hand side is
retained.
• After the simulation, the retained value is assigned to the source branch.
Adding additional contribution statements to model the input admittance and output impedance adds
parasitics to the amplifier.
Example
module amp(out, in);
input in;
output out;
voltage out, in;
parameter real Gain=1, Rin=1, Cin=1, Rout=1, Lout=1;
analog begin
// gain of amplifier
V(out) <+ Gain*V(in);
end
endmodule
Example
module switch(p, n, cp, cn);
electrical p, n, cp, cn;
parameter real thresh = 0.01;
analog begin
// resolve threshold crossings
@(cross(V(cp, cn) - thresh, 0));
I(p, n) <+ 0;
end
endmodule
Syntax
analog_branch_contribution ::=
bvalue <+ analog_expression;
Example
Consider the model for an ideal opamp. The output is driven to the voltage which results in the input
voltage being zero (0). The constitutive equation is:
V(in) == 0;
This statement defines the output of the opamp to be a controlled voltage source by assigning to
V(out) and defines the input to be high impedance by only probing the input voltage. The desired
behavior results because the description is formulated in such a way it reduces to V(in) = 0. This
approach does not result in the right tolerances being applied to the equation if out and in have
different disciplines.
Verilog-A includes a special syntax to use in this situation. The above branch contribution can be
rewritten using an indirect branch assignment:
V(out) : V(in) == 0;
Example
A complete description of an ideal opamp is:
analog
V(out) : V(pos_in, neg_in) == 0;
endmodule
Syntax
analog_indirect_branch_assignments ::=
bvalue : nexpr == analog_expression;
nexpr ::=
bvalue
|pvalue
|ddt (bvalue | pvalue)
|idt (bvalue | pvalue)
Examples
The following differential equation:
dx
------- = f ( x, y, z )
dt
dy
------- = g ( x, y, z )
dt
dz
------ = h ( x, y, z )
dt
can be written as:
or
or
6.2: Operators
The symbols for the VERILOG-A operators are similar to those in the C programing language. Table 6-1
lists these operators:
+ - * / Arithmetic
% Modulus
!= == Logical equality
! Logical negation
|| Logical or
~ Bit-wise negation
| Bit-wise inclusive or
^ Bit-wise exclusive or
^~ ~^ Bit-wise equivalence
?: Conditional
or Event or
+ - * / Arithmetic
% Modulus
!= == Logical equality
! && || Logical
?: Conditional
or Event or
The result of using logical or relational operators on real numbers is an integer value 0 (false) or 1
(true).
Table 6-3 lists those operators which shall not be used to operate on real numbers.
~ & | ^ ^~ ~^ Bit-wise
Examples
// The real numbers 35.6 and 35.5 both become 36 when
// converted to an integer and 35.2 becomes 35.
Examples
a = 3 + 5.0;
// The expression “3 + 5.0” is evaluated by “casting” the
// integer 3 to the real 3.0, and the result of the expression is 8.0.
b = 1 / 2;
// The above is integer division and the result is 0.
c = 8.0 + (1 / 2);
// (1 / 2) is treated as integer division, but the result of the
// expression is 8.0
* / %
+ - (binary)
<< >>
== != === !==
& ~&
^ ^~ ~^
| ~|
&&
||
The operators shown in Table 6-4 have the same precedence. The rows are arranged in order of
decreasing precedence for the operators.
All operators associate from left to right, except for the conditional operator which associates from
right to left. The association refers to the order in which the operators of the same precedence are
evaluated.
Example
When B is added to A and the C is extracted from the result of A + B:
A + B - C
When operators differ in precedence, the operators with higher precedence associate first.
Examples
B is divided by C (division has higher precedence than addition) and then the result is added to A:
A + B / C
Parentheses can be used to change the operator precedence:
(A + B) / C
// not the same as A + B / C
Example
integer A, B, C, result;
result = A & (B | C);
If A is known to be zero (0), the result of the expression can be determined as zero (0) without
evaluating the sub-expression B | C.
-m Unary minus m
! Logical Negator
Binary Operators
Table 6-6 shows the binary arithmetic operators. The binary operators each require two operands.
a + b a plus b
a - b a minus b
a * b a multiply by b
a / b a divide by b
a % b a modulo b
a % b = a - floor1(a/b)*b;
An expression using these relational operators yields the value zero (0) if the specified relation is false,
or the value one (1) if it is true. All the relational operators have the same precedence. Relational
operators have lower precedence than arithmetic operators. The following examples show the
implications of this precedence rule.
Examples
When Fxx - (1 < a) is evaluated, the relational expression is evaluated first, and then either zero
(0) or one (1) is subtracted from Fxx. When Fxx - 1 < a is evaluated, the value of Fxx operand is
reduced by one (1) and then compared with a.
a == b a equal to b
a != b a not equal to b
Both equality operators have the same precedence. These operators compare the value of the operands.
As with the relational operators, the result shall be zero (0) if comparison fails, or else one (1) if it
succeeds.
Examples
The following expression performs a logical and three sub-expressions without needing any
parentheses:
However, parentheses can be used to clearly show the precedence intended, as in the following rewrite
of the above example:
Table 6-10: Bit-Wise binary and operator Table 6-11: Bit-Wise exclusive or operator
& 0 1 ^ 0 1
0 0 0 0 0 1
1 0 1 1 1 0
Table 6-12: Bit-Wise binary or operator Table 6-13: Bit-Wise binary exclusive nor
Table 6-12: operator
| 0 1 ^~ 0 1
~^
0 0 1
0 1 0
1 1 1
1 0 1
0 1
1 0
Example
integer start, result;
analog begin
start = 1;
result = (start << 2);
end
In this example, the register result is assigned the binary value 0100, which 0001 shifted to the left
two positions and zero-filled.
is equivalent to:
Example
analog begin
@(initial_step or cross(V(smpl) -2.5, +1)) begin
6.2.15: Concatenations
A concatenation is used for joining scalar elements into compound elements (buses or arrays) for the
built-in types integer or real, or for elements declared type net_discipline. The concatenation is
expressed using the brace characters ({ }), with commas separating the expressions within.
Examples
module x;
parameter real p1[0:2] = {1.0, 2.0, 3.0};
...
endmodule
module y;
parameter real pole1=0, pole2=0, pole3=0;
x #(.p1({pole1, pole2, pole3}) x1;
...
endmodule
Module x defines a real array parameter p1. Module y instantiates x and overrides the array value of
the parameter p1 of module x via the concatenation of the scalar parameters pole1, pole2, and pole3.
Concatenation can be expressed using a replication multiplier.
Example
{c, {2{a, b}}} // equivalent to : {c, a, b, a, b}
A const_array_expression allows the arrays to be passed within the argument list without
explicit declaration of the array object, as shown:
Syntax
const_array_expression
{const_arrayinit_element { , const_arrayinit_element}}
const_arrayinit_element ::=
constant_expression
| integer_constant_expression {constant_expression}
Operator Comments
ddt(expr) d
Returns ------ x ( t ) , the time derivative of x, where x is expr.
dt
In DC analysis, ddt() returns zero (0). The optional parameter abstol is used as an absolute
tolerance if needed. Whether an absolute tolerance is needed depends on the context where ddt() is
used. The absolute tolerance, abstol or derived nature, applies to the output of the ddt operator
and is the largest signal level that is considered negligible.
Operator Comments
idt(expr) t
Returns ∫ x ( τ )dτ , the time integral of x from 0 to t with the initial
0
condition being computed in the DC analysis. Where x is expr.
idt(expr, ic) t
Returns ∫ x ( τ )dτ + ic , the time integral of x from 0 to t with the ini-
0
tial condition ic. In DC analysis, ic is returned. Where x is expr.
Operator Comments
idt(expr, ic, assert, abstol) Same as above, except absolute tolerance is specified explic-
itly.
idt(expr, ic, assert, nature) Same as above, except nature is specified explicitly.
When specified with initial conditions, idt() returns the value of the initial condition in DC and IC
analyses whenever assert is given and is non-zero. Without initial conditions, idt() multiplies its
arguments by infinity in DC analysis. Hence, without initial conditions, it can only be used in a system
with feedback which forces its argument to zero (0).
The optional parameter abstol or nature is used to derive an absolute tolerance if needed.
Whether an absolute tolerance is needed depends on the context where idt() is used. The asolute
tolerance applies to the input of the idt operator and is the largest signal level that is considered
negligible.
Operator Comments
idtmod(expr) t
Returns ∫ x( τ )dτ , the time integral of x from 0 to t with the initial
0
condition being computed in the DC analysis. Where x is expr.
idtmod(expr, ic) t
Returns ∫ x( τ )dτ + ic , the time integral of x from 0 to t with the ini-
0
tial condition ic. In DC analysis, ic is returned. Where x is expr.
∫ x( τ ) dτ + ic = n × mo dulus + k
0
. Where x is expr.
Operator Comments
idtmod(expr, ic, modu- Same as above, except absolute tolerance is specified explicitly.
lus,offset, abstol)
The initial condition is optional. If the initial condition is not specified, it defaults to zero (0).
Regardless, the initial condition shall force the DC solution to the system.
If idtmod() is used in a system with feedback configuration which forces expr to zero (0), the initial
condition can be omitted without any unexpected behavior during simulation. For example, an
operational amplifier alone needs an initial condition, but the same amplifier with the right external
feedback circuitry does not need a forced DC solution.
The output of the idtmod() function shall remain in the range:
offset <= idtmod < offset + modulus
The modulus shall be an expression which evaluates to a positive value. If the modulus is not
specified, then idtmod() will behave like idt() and not limit the output of the integrator..
The default for offset is zero (0).
The following relationships between idtmod() and idt() shall hold at all times.
Examples
if:
y = idt(expr, ic);
z = idtmod(expr, ic, modulus, offset);
then:
y = n*modulus + z; // n is an integer
where:
offset < z < modulus + offset
In this example, the circular integrator is useful in cases where the integral can get very large, such as
a VCO. In a VCO we are only interested in the output values in the range [0, 2π]:
phase = idtmod(fc + gain*V(in), 0, 1, 0);
V(OUT) <+ sin(2*‘M_PI*phase);
Here, the circular integrator returns a value in the range [0,1].
input is delayed by the amount td. In all cases, td will be a positive number. If the optional
maxdelay is specified, then td can vary; but it shall be an error if it becomes larger than maxdelay.
If maxdelay is not specified, changes to td will be ignored. If maxdelay is specified, changes to td
are ignored and the initial value of maxdelay is used.
In DC and operating point analyses, absdelay() returns the value of its input. In AC and other small
signal analyses, the absdelay operator phase-shifts the input expression to the output of the delay
operator based on the following formula:
– jωtd
Output ( ω ) = Input ( ω ) ⋅ e
td is evaluated as a constant at a particular time for any small signal analysis. In time domain
analyses, absdelay() introduces a transport delay equal to the instantaneous value of td based on the
following formula:
From time 0 to 2s, the output remains at input (0). With a delay of 2s, the output then starts tracking
input(t - 2). At 3s, the transport delay changes from 2s to 4s, switching the outputback to input(0),
since input(max(t-td, 0)) returns 0. The output remains at this level until 4s when it once again starts
tracking the input from t = 0. At 5s the transport delay goes to 1s and the output correspondingly
jumps from its current value to the value defined by input(t - 1).
transition() stretches instantaneous changes in signals over a finite amount of time and can delay
the transitions, as shown in Figure 6-3.
Syntax
The general form is:
transition(expr [ , td [ , rise_time [ , fall_time [ , time_tol ]]]])
The input expression is expected to evaluate over time to a piecewise constant waveform. When
applied, transition() forces all positive transitions of expr to occur over rise_time and all
negative transitions to occur in fall_time (after an initial delay of td). Thus, td models transport
delay and rise_time and fall_time model inertial delay.
transition() returns a real number which describes a piecewise linear function over time. The
transition function causes the simulator to place time-points at both corners of a transition. If time_tol
is not specified, the transition function causes the simulator to assure each transition is adequately
resolved.
td, rise_time, fall_time, and time_tol are optional. If td is not specified, it is taken to be
zero (0.0). If only a positive rise_time value is specified, the simulator uses it for both rise and fall
times. If neither rise nor fall time is specified or is equal to zero (0.0), the rise and fall time defaults
to the value defined by ‘default_transition.
If ‘default_transition is not specified, the default behavior approximates the ideal behavior of a
zero-duration transition. Forcing a zero-duration transition is undesirable because it could cause
convergence problems. Instead, a negligible, but non-zero, transition time is used. The small non-zero
transition time allows the simulator to shrink the timestep small enough so a smooth transition
occurs, and convergence problems are avoided. The simulator does not force a time point at the trailing
corner of a transition to avoid causing the simulator to take very small time steps, which would result
in poor performance.
In DC analysis, transition() passes the value of the expr directly to its output. The transition filter
is designed to smooth out piecewise constant waveforms. When applied to waveforms which vary
smoothly, the simulation results are generally unsatisfactory. In addition, applying the transition
function to a continuously varying waveform can cause the simulator to run slowly. Use transition()
for discrete signals and slew() (see section 6.3.9:“Slew Filter”) for continuous signals.
Use short transitions with caution because they can cause the simulator to slow down to meet
accuracy constraints.
The next code fragment demonstrates how the transition filter might be used.
// comparator model
analog begin
if ( V(in) > 0 ) begin
Vout = 5;
end
else begin
Vout = 0;
end
V(out) <+ transition(Vout);
end
Warning: The transition filter is designed to smooth out piecewise constant waveforms. If one apply the
transition filter to smoothly varying waveforms, the simulator might run slowly, and the results
questionable. For smoothly varying waveforms, consider using the slew filter instead.
If interrupted on a rising transition, the transition filter adjusts the slope so that at the revised end of
the transition the value is that of the new destination.
If the new destination value is below the value at the point If the new destination value is above the value at the
of interruption, the transition filter. point of interruption, the transition filter.
1. Uses the value of the original destination as the 1. Retains the original origin.
value of the new origin.
2. Adjusts the slope of the transition to the rate at 2. Adjusts the slope of the transition to the rate
which the value would decay from the value of the at which the value would increase from the
new origin to the value of the new destination in value of the origin to the value of the new
fall_time seconds. destination in rise_time seconds.
3. Causes the value of the filter output to decay at 3. Causes the value of the filter output to
the new slope, from the value at the point of increase at the new slope, from the value at the
interruption to the value at the new destination. point of interruption to the at the new
destination.
In the following example, a rising transition is interrupted when it is about three fourths complete,
and the value of the new destination is below the value at the point of interruption. The transition
filter computes the slope that would complete a transition from the new origin (not the value at the
point of interruption) in the specified fall_time. The transition filter then uses the computed slope
to transition from the current value to the new destination.
An interruption in a falling transition causes the transition filter to behave in an equivalent manner.
With larger delays, it is possible for a new transition to be specified before a previously specified
transition starts. The transition filter handles this by deleting any transitions that would follow a
newly scheduled transition. A transition filter can have an arbitrary number of transitions
pending. A transition filter is used in this way to implement the transport delay of discretely
valued signals.
The following example implements a D-type flip flop. The transition filter smooths the output
waveforms.
Example
module d_ff(vin_d, vclk, vout_q, vout_qbar);
endmodule
The following example illustrates a use of the transition filter that should be avoided. The
expression is dependent on a continuous signal and, as a consequence, the filter runs slowly.
I(p, n) <+ transition(V(p, n)/out1, tdel, trise, tfall); // Do not do this.
However, the following approach can be used to implement the same behavior in a statement that runs
much faster.
I(p, n) <+ V(p, n)*transition(1/out1, tdel, trise, tfall); // Do this instead.
Examples
Example 1 - QAM modulator
In this example, the transition function is used to control the rate of change of the modulation signal in
a QAM modulator.
module qam16(out, in);
parameter freq=1.0, ampl=1.0, dly=0, ttime=1.0/freq;
input [0:4] in;
output out;
electrical [0:4] in;
electrical out;
real x, y, thresh;
integer row, col;
analog begin
row = 2*(V(in[3]) > thresh) + (V(in[2]) > thresh);
col = 2*(V(in[1]) > thresh) + (V(in[0]) > thresh);
x = transition(row - 1.5, dly, ttime);
y = transition(col - 1.5, dly, ttime);
V(out) <+ ampl*x*cos(2*‘M_PI*freq*$abstime)
+ ampl*y*sin(2*‘M_PI*freq*$abstime);
$bound_step(0.1/freq);
end
endmodule
genvar i;
analog begin
@(cross(V(clk)-2.5, +1)) begin
sample = V(in);
thresh = fullscale/2.0;
for (i = bits - 1; i >= 0; i = i - 1) begin
if (sample > thresh) begin
result[i] = 1.0;
sample = sample - thresh;
end else begin
result[i] = 0.0;
end
sample = 2.0*sample;
end
end
endmodule
If only one rate is specified, its absolute value is used for both rates. If no rates are given, slew passes
the signal through unchanged. If the rate of change of expr is less than the specified maximum slew
rates, slew returns the value of expr..
When applied, slew forces all transitions of expr faster than max_pos_rate to change at the
max_pos_rate rate for positive transitions, and limits negative transitions to the max_neg_rate
rate.
The slew filter is particularly valuable for controlling the rate of change of sinusoidal waveforms. The
transition function distorts such signals, whereas slew preserves the general shape of the
waveform.
The following 4-bit digital-to-analog converter uses the slew function to control the rate of change of
the analog signal at its output.
Example
module dac4(d, out);
input [0:3] d;
inout out;
electrical [0:3] d;
electrical out;
parameter real slewrate = 0.1e6 from (0:inf);
real Ti;
real Vref;
real scale_fact;
analog begin
Ti = 0;
Vref = 1.0;
scale_fact = 2;
generate ii (3,0,-1) begin
Ti = Ti + ((V(d[ii]) > 2.5) ? (1.0/scale_fact) : 0);
scale_fact = scale_fact/2;
end
V(out) <+ slew( Ti*Vref, slewrate );
end
endmodule
The direction flag is interpreted in the same way as in the cross() function. The last_crossing()
function is subject to the same usage restrictions as the cross() function. The last_crossing()
function does not control the timestep to get accurate results; it uses linear interpolation to estimate
the time of the last crossing. However, it can be used with the cross function for improved accuracy.
Example
The following example measures the period of its input signal using the cross() and last_crossing()
functions.
module period(in);
input in;
voltage in;
integer crossings;
real latest, previous;
analog begin
@(initial_step) begin
crossings = 0;
previous = 0;
end
@(final_step) begin
if (crossings < 2)
$strobe("Could not measure period.");
else
$strobe("period = %g, crossings = %d",
latest-previous, crossings);
end
end
endmodule
Before the expression crosses zero (0) for the first time, the last_crossing() function returns a
negative value.
needed). Whether an absolute tolerance is needed depends on the context where the filter is used. The
zeros argument may be represented as a null argument. The null argument is characterized by two
adjacent commas (,,) in the argument list.
laplace_zp
laplace_zp() implements the zero-pole form of the Laplace transform filter. The general form is:
laplace_zp( expr , ζ , ρ [ , ε ] )
where ζ (zeta) is a vector of M pairs of real numbers. Each pair represents a zero, the first number in
the pair is the real part of the zero and the second is the imaginary part. Similarly, ρ (rho) is the vector
of N real pairs, one for each pole. The poles are given in the same manner as the zeros. The transfer
function is:
M–1
∏ 1 – -------------------
-
s
ζ + jζ r
k k
i
H(s ) = k=0
---------------------------------------------
N–1
-
∏ 1 – --------------------
-
s
ρ + jρ r
k
i
k
k=0
r i r i
where ζ and ζ are the real and imaginary parts of the kth zero (0), while ρ and ρ are the real
k k k k
and imaginary parts of the kth pole. If a root (a pole or zero) is real, the imaginary part shall be
specified as zero (0). If a root is complex, its conjugate shall also be present. If a root is zero, then the
term associated with it is implemented as s, rather than (1 - s/r) (where r is the root).
laplace_zd
laplace_zd() implements the zero-denominator form of the Laplace transform filter. The general form
is:
laplace_zd( expr , ζ , d [ , ε ] )
where ζ (zeta) is a vector of M pairs of real numbers. Each pair represents a zero, the first number in
the pair is the real part of the zero and the second is the imaginary part. Similarly, d is the vector of N
real numbers containing the coefficients of the denominator. The transfer function is:
M–1
∏ 1 – -------------------
-
s
ζ + jζ r
k
i
k
H ( s ) = ---------------------------------------------
k=0
N–1
-
∑d s
k
k
k=0
r i
where ζ and ζ are the real and imaginary parts of the kth zero, while dk is the coefficient of the kth
k k
power of s in the denominator. If a zero is real, the imaginary part shall be specified as zero (0). If a
zero is complex, its conjugate shall also be present. If a zero is zero (0), then the term associated with
it is implemented as s, rather than (1 - s/ζ).
laplace_np
laplace_np() implements the numerator-pole form of the Laplace transform filter. The general form
is:
laplace_np( expr , n , ρ [ , ε ] )
where nk is a vector of M real numbers containing the coefficients of the numerator. Similarly, ρ (rho)
is a vector of N pairs of real numbers. Each pair represents a pole, the first number in the pair is the
real part of the pole and the second is the imaginary part. The transfer function is:
M–1
∑n s
k
k
H ( s ) = ---------------------------------------------
N–1
k=0
-
∏ 1 – --------------------
-
s
ρ + jρ r
k
i
k
k=0
r i
where nk is the coefficient of the kth power of s in the numerator, while ρ and ρ are the real and
k k
imaginary parts of the kth pole. If a pole is real, the imaginary part shall be specified as zero (0). If a
pole is complex, its conjugate shall also be present. If a pole is zero (0), then the term associated with it
is implemented as s, rather than (1 - s/ρ).
laplace_nd
laplace_nd() implements the numerator-denominator form of the Laplace transform filter.
The general form is:
laplace_nd( expr , n , d [ , ε ] )
where n is an vector of M real numbers containing the coefficients of the numerator, and d is a vector
of N real numbers containing the coefficients of the denominator. The transfer function is:
M
∑n s
k
k
H ( s ) = k---------------------
N
=0
-
∑d s k
k
k=0
where nk is the coefficient of the kth power of s in the numerator and dk is the coefficient of the kth
power of s in the denominator.
Examples
implements:
1+s
H ( s ) = ----------------------------------------------------
1 + ----------s
- 1 + ----------
s
1 + j 1 – j
and
implements:
s
H ( s ) = -------------
2
-
s –1
This example:
2 k
v out = ------------------2-
2
s –1
zi_zp
zi_zp() implements the zero-pole form of the Z-transform filter. The general form is:
zi_zp( expr , ζ , ρ , T [ , τ [ , t0 ] ] )
where ζ (zeta) is a vector of M pairs of real numbers. Each pair represents a zero, the first number in
the pair is the real part of the zero (0) and the second is the imaginary part. Similarly, ρ (rho) is the
vector of N real pairs, one for each pole. The poles are given in the same manner as the zeros. The
transfer function is:
M–1
∏1–z
–1
( ζ kr + jζ ki )
H ( z ) = -----------------------------------------------------
k=0
N–1
-
∏1 – z
–1
( ρ kr + jρ ki )
k=0
r i r i
where ζ and ζ are the real and imaginary parts of the kth zero, while ρ and ρ are the real and
k k k k
imaginary parts of the kth pole. If a root (a pole or zero) is real, the imaginary part shall be specified as
zero. If a root is complex, its conjugate shall also be present. If a root is zero (0), then the term
associated with it is implemented as z, rather than (1 - z/r) (where r is the root).
zi_zd
zi_zd() implements the zero-denominator form of the Z-transform filter.
The form is:
where ζ (zeta) is a vector of M pairs of real numbers. Each pair represents a zero, the first number in
the pair is the real part of the zero and the second is the imaginary part. Similarly, d is the vector of N
real numbers containing the coefficients of the denominator. The transfer function is:
M–1
∏1–z
–1
( ζ kr + jζ ki )
H ( z ) = -----------------------------------------------------
k=0
N–1
∑d z
–1
k
k=0
r i
where ζ and ζ are the real and imaginary parts of the kth zero, while dk is the coefficient of the
k k
kth power of s in the denominator. If a zero is real, the imaginary part shall be specified as zero (0). If
a zero is complex, its conjugate shall also be present. If a zero is zero (0), then the term associated with
it is implemented as z, rather than (1 - z/ζ).
zi_np
zi_np() implements the numerator-pole form of the Z-transform filter. The general form is:
where n is a vector of M real numbers containing the coefficients of the numerator. Similarly, ρ (rho) is
a vector of N pairs of real numbers. Each pair represents a pole, the first number in the pair is the real
part of the pole and the second is the imaginary part. The transfer function is:
M–1
∑n z
–k
k
H ( z ) = -----------------------------------------------------
N–1
k=0
-
∏1 – z
–1
( ρ kr + jρ ki )
k=0
r i
where nk is the coefficient of the kth power of s in the numerator, while ρ and ρ are the real and
k k
imaginary parts of the kth pole. If a pole is real, the imaginary part shall be specified as zero (0). If a
pole is complex, its conjugate shall also be present. If a pole is zero (0), then the term associated with it
is implemented as z, rather than (1 - z/ρ).
zi_nd
zi_nd() implements the numerator-denominator form of the Z-transform filter. The
general form is:
where n is an vector of M real numbers containing the coefficients of the numerator and d is a vector of
N real numbers containing the coefficients of the denominator. The transfer function is:
M–1
∑n z
–k
k
H ( z ) = ------------------------
k=0
N–1
-
∑d z
–k
k
k=0
where nk is the coefficient of the kth power of s in the numerator and dk is the coefficient of the kth
power of s in the denominator.
convergence. On any iteration where the change in the output of the limexp() function is bound, the
simulator is prevented from terminating the iteration. Thus, the simulator can only converge when the
output of limexp() equals the exponential of the input. The general form is:
limexp ( expr )
The apparent behavior of limexp() is not distinguishable from exp(), except using limexp() to model
semiconductor junctions generally results in dramatically improved convergence. There are different
ways of implementing limiting algorithms for the exponential.
Table 6-18 summarizes the arguments of the analog operators defined in this section.
If a dynamic expression is passed as an argument which expects a constant expression, the value of
the dynamic expression at the start of the analysis defaults to the constant value of the argument. Any
further change in value of that expression is ignored during the iterative analysis.
There are two types of analog events, global events (see Section 8.1.4:“Global Events”) and
monitored events (see Section 8.1.5:“Monitored Events”). Null arguments are not allowed in
analog events.
Syntax
event_control_statement ::=
event_control statement_or_null
event_control ::=
@ event_identifier
| @ ( event_expression )
analog_event_expression ::=
global_event
| event_function
| digital_expression
| event_identifier
| posedge digital_expression
| negedge digital_expression
| event_expression or event_expression
The procedural statement following the event expression is executed whenever the event described by
the expression changes. The analog event detection is non-blocking, meaning the execution of the
procedural statement is skipped unless the analog event has occurred. The event expression consists of
one or more signal names, global events, or monitored events separated by the or operator.
The parenthesis around the event expression are required.
Example
analog begin
@(initial_step or cross(V(smpl)-2.5,+1)) begin
vout = (V(in) > 2.5);
end
V(out) <+ vout;
end
Here, initial_step is a global event and cross() returns a monitored event. The variable vout is set
to zero (0) or one (1) whenever either event occurs.
Syntax
global_event ::=
initial_step [ ( analysis_list ) ]
| final_step [ ( analysis_list ) ]
analysis_list ::=
analysis_name { , analysis_name }
analysis_name ::=
" analysis_identifier "
initial_step and final_step generate global events on the first and the last point in an analysis
respectively. They are useful when performing actions which should only occur at the beginning or the
end of an analysis. Both global events can take an optional argument, consisting of an analysis list for
the active global event.
Example
@(initial_step(“ac”, “dc”)) // active for dc and ac only
@(initial_step(“tran”)) // active for transient only
Table 8-1 describes the return value of initial_step and final_step for standard analysis types.
Each column shows the return-on-event status. One (1) represents Yes and zero (0) represents No. A
VERILOG-A simulator can use any or all of these typical analysis types.
DC TRAN AC NOISE
Analysis
OP OP p1 pN OP p1 pN OP p1 pN
Example
The following example measures the bit-error rate of a signal and prints the result at the end of the
simulation.
analog begin
@(initial_step) begin
bits = 0;
errors = 0;
end
@(final_step)
$strobe("bit error rate = %f%%", 100.0 * errors / bits );
end
endmodule
initial_step and final_step take a list of quoted strings as optional arguments. The strings are
compared to the name of the analysis being run. If any string matches the name of the current
analysis name, the simulator generates an event on the first point and the last point of that particular
analysis, respectively.
If no analysis list is specified, the initial_step global event is active during the solution of the first
point (or initial DC analysis) of every analysis. The final_step global event, without an analysis list, is
only active during the solution of the last point of every analyses.
Syntax
event_function ::=
cross_function
| timer_function
cross function
The cross() function is used for generating a monitored analog event to detect threshold crossings in
analog signals when the expression crosses zero (0) in the specified direction. In addition, cross()
controls the timestep to accurately resolve the crossing. The general form is:
where expr is required, and dir, time_tol, and expr_tol are optional. All arguments are real
expressions, except dir (which is an integer expression). If the tolerances are not defined, then the
tool (e.g., the simulator) sets them. If either or both tolerances are defined, then the direction shall also
be defined.
The direction indicator can only evaluate to +1, -1, or 0. If it is set to 0 or is not specified, the event and
timestep control occur on both positive and negative crossings of the signal. If dir is +1 (or -1), the
event and timestep control only occur on rising edge (falling edge) transitions of the signal. For any
other transitions of the signal, the cross() function does not generate an event.
expr_tol and time_tol are defined as shown in Figure 8-1. They represent the maximum
allowable error between the estimated crossing point and the true crossing point.
If expr_tol is defined, time_tol shall also be defined and both tolerances shall be satisfied at the
crossing.
Example
The following description of a sample-and-hold illustrates how the cross() function can be used.
module sh(in, out, smpl);
output out;
input in, smpl;
electrical in, out, smpl;
real state;
analog begin
@(cross(V(smpl) - 2.5, +1))
state = V(in);
V(out) <+ transition(state, 0, 10n);
end
endmodule
The cross() function maintains its internal state and has the same restrictions as analog operators. In
particular, it shall not be used inside an if(), case(), casex(), or casez() statement unless the
conditional expression is a genvar expression. In addition, cross() is not allowed in the repeat() and
while() iteration statements. It is allowed in the analog_for statements.
timer function
The timer() function is used to generate analog events to detect specific points in time. The general
form is:
where start_time is required; period and time_tol are optional arguments. All arguments are
real expressions.
The timer() function schedules an event which occurs at an absolute time (start_time). The analog
simulator places a time point within timetol of an event. At that time point, the event evaluates to
True.
If time_tol is not specified, the default time point is at, or just beyond, the time of the event. If the
period is specified as greater than zero (0), the timer function schedules subsequent events at
multiples of period.
Example
A pseudo-random bit stream generator is an example how the timer function can be used.
module bitStream (out);
output out;
electrical out;
parameter period = 1.0;
integer x;
analog begin
@(timer(0, period))
x = $random + 0.5;
V(out) <+ transition( x, 0.0, period/100.0 );
end
endmodule
9.1.1: Analysis
The analysis() function takes one or more string arguments and returns one (1) if any argument
matches the current analysis type. Otherwise it returns zero (0). The general form is:
analysis( analysis_list )
There is no fixed set of analysis types. Each simulator can support its own set. However, simulators
shall use the types listed in Table 9-1 to represent analyses which are similar to those provided by
SMARTSPICE.
“nodeset” The phase during an equilibrium point calculation where nodesets are
forced.
Table 9-2 describes the implementation of the analysis function. Each column shows the return value
of the function. A status of one (1) represents True and zero (0) represents False.
DC “dc” 1 0 0 0 0 0 0
Transient “tran” 0 1 1 0 0 0 0
Small-signal “ac” 0 0 0 1 1 0 0
Noise “noise” 0 0 0 0 0 1 1
Using the analysis() function, it is possible to have a module behave differently depending on which
analysis is being run.
Example
To implement nodesets or initial conditions using the analysis function and switch branches, use the
following:
if (analysis("ic"))
V(cap) <+ initial_value;
else
I(cap) <+ ddt(C*V(cap));
9.1.2: AC stimulus
A small-signal analysis computes the steady-state response of a system which has been linearized
about its operating point and is driven by a small sinusoid. The sinusoidal stimulus is provided using
the ac_stim() function. The general form is:
The AC stimulus function returns zero (0) during large-signal analyses (such as DC and transient) as
well as on all small-signal analyses using names which do not match analysis_name. The name of
a small-signal analysis is implementation dependent, although the expected name (of the equivalent of
a SPICE AC analysis) is “ac”, which is the default value of analysis_name. When the name of the
small-signal analysis matches analysis_name, the source becomes active and models a source with
magnitude mag and phase phase. The default magnitude is one (1) and the default phase is zero (0).
phase is given in radians.
9.1.3: Noise
Several functions are provided to support noise modeling during small-signal analyses. To model
large-signal noise during transient analyses, use the $random() system task. The noise functions are
often referred to as noise sources. There are three noise functions, one models white noise processes,
another models 1/f or flicker noise processes, and the last interpolates a vector to model a process
where the spectral density of the noise varies as a piecewise linear function of frequency. The noise
functions are only active in smallsignal noise analyses and return zero (0) otherwise.
white_noise
White noise processes are those whose current value is completely uncorrelated with any previous or
future values. This implies their spectral density does not depend on frequency. They are modeled
using:
white_noise( pwr [ , name ] )
Example
The thermal noise of a resistor could be modelled using:
The optional name argument acts as a label for the noise source used when the simulator outputs the
individual contribution of each noise source to the total output noise. The contributions of noise
sources with the same name from the same instance of a module are combined in the noise
contribution summary.
flicker_noise
The flicker_noise() function models flicker noise. The general form is:
which generates pink noise with a power of pwr at 1Hz which varies in proportion to 1/f exp.
The optional name argument acts as a label for the noise source used when the simulator outputs the
individual contribution of each noise source to the total output noise. The contributions of noise
sources with the same name from the same instance of a module are combined in the noise
contribution summary.
noise_table
The noise_table() function interpolates a vector to model a process where the spectraldensity of the
noise varies as a piecewise linear function of frequency. The general form is:
where vector contains pairs of real numbers: the first number in each pair is the frequency in Hertz
and the second is the power. Noise pairs are specified in the order of ascending frequencies.
noise_table() performs piecewise linear interpolation to compute the power spectral density
generated by the function at each frequency.
The optional name argument acts as a label for the noise source used when the simulator outputs the
individual contribution of each noise source to the total output noise. The contributions of noise
sources with the same name from the same instance of a module are combined in the noise
contribution summary.
Correlated noise
Each noise function generates noise which is uncorrelated with the noise generated by other functions.
Perfectly correlated noise is generated by using the output of one noise function for more
than one noise source. Partially correlated noise is generated by combining the output of
shared and unshared noise functions.
Examples
Example 1 - Two noise voltages are perfectly correlated.
n = white_noise(pwr);
V(a,b) <+ c1*n;
V(c,d) <+ c2*n;
9.2: Discontinuity
The $discontinuity function informs the simulator about a discontinuity in signal behavior.
discontinuity_function ::=
$discontinuity[ (constant_expression) ]
constant_expression, which must be zero or a positive integer, is the degree of the discontinuity.
For example, $discontinuity, which is equivalent to $discontinuity(0), indicates a
discontinuity in the equation, and $discontinuity(1) indicates a discontinuity in the slope of the
equation.
Discontinuities created by switch branches or built-in functions, such as transition and slew, do not
need to be announced.
Using the $discontinuity function does not guarantee that the simulator will be able to handle a
discontinuity successfully.
The following example shows the $discontinuity function while describing the behavior of a source
that generates a triangular wave. As the TriangularWave (see Figure 9-1) shows, the triangular wave
is continuous, but as the Triangular Wave First Derivative (see Figure 9-2) shows, the first derivative
of the wave is discontinuous.
Example
The module triangular_source describes this triangular wave source.
module triangular_source(vout);
output vout;
voltage vout;
parameter real wavelength=10.0, amplitude=1.0;
integer slope;
real i_start;
analog begin
endmodule
The two $discontinuity functions in trisource tell the simulator about the discontinuities in
the derivative. In response, the simulator uses analysis techniques that take the discontinuities into
account.
Example
The module relay, as another example, uses the $discontinuity function while modeling a relay.
endmodule
The $discontinuity function in relay tells the simulator that there is a discontinuity in the
current when the voltage crosses the value 1. For example, passing a triangular wave like that shown
in the Relay Voltage (see Figure 9-3) through module relay produces the discontinuous current
shown in the Relay Current (see Figure 9-4).
bound_step_function ::=
$bound_step( max_step )
max_step ::=
constant_expression
By specifying appropriate time steps, the simulator is forced to track signals as closely as one model
requires. For example, module sinwave forces the simulator to simulate at least 50 time points during
each cycle.
Example
module sinwave(out_signal);
output out_signal;
voltage out_signal;
parameter real freq=2.0, ampl=2.0;
analog begin
V(out_signal) <+ ampl * sin(2.0*’M_PI*freq*$abstime);
$bound_step(0.02 / freq); // Max time step = 1/50 period
end
endmodule
$abstime Function
Use the $abstime function to obtain the current simulation time in seconds.
abstime_function ::=
$abstime
$realtime Function
Use the $realtime function to obtain the current simulation time in seconds.
realtime_function ::=
$realtime[(time_scale)]
time_scale is a value used to scale the returned simulation time. The valid values are the integers
1, 10, and 100, followed by one of the scale factors in the following table.
If time_scale is not specified, the return value is scaled to the ’time_unit of the module that
invokes the function.
For example, to print out the current simulation time in seconds, code:
$strobe("Simulation time = %e", $realtime(1s));
temp is the temperature, in degrees Kelvin, at which the thermal voltage is to be calculated. If temp is
not specified, the thermal voltage is calculated at the temperature returned by the $temperature
function.
seed is a reg, integer, or time variable used to initialize the function. The seed provides a starting
point for the number sequence, and allows one to restart at the same point. If, as SILVACO recommends,
seed is used, you must assign a value to the variable before calling the $random function.
The $random function generates a new number every time step.
Individual $random statements with different seeds generate different sequences, and individual
$random statements with the same seed generate identical sequences.
The following code fragment uses the absolute value function and the modulus operator to generate
integers between 0 and 99.
Example
module rand_gen(outpin);
electrical outpin;
integer rand_seed, rand_num;
analog begin
@(initial_step) begin
rand_seed = 124; // Initialize the seed
end
rand_num = abs($random(rand_seed) % 100);
if (rand_num < 5)
V(outpin) <+ 0.0;
else
V(outpin) <+ 3.0;
end
endmodule
or
module DataStream (out);
output out;
electrical out;
parameter TF = 1p;
parameter seed = 5;
real y;
integer rand_seed, x;
analog
begin
@(initial_step)
rand_seed = seed
@(timer(0, period))
x = abs($random(rand_seed) %100);
if (x >= 49)
y = 1.8;
else
y = 0.0;
V(out) <+ transition(y, 0.0, TR, TF);
end
endmodule
• Uniform
• Normal (Gaussian)
• Exponential
• Poisson
• Chi-square
• Student's T
• Erlang
Example
module uniform_check(outpin);
electrical outpin;
parameter integer start_range = 20;
integer seed, end_range;
real rand_num;
analog begin
@(initial_step) begin
seed = 25; // Initialize the seed
end_range = 80;
end
rand_num = $rdist_uniform(seed, start_range, end_range);
$display("Random number is %g", rand_num );
$display("Current seed is %d", seed);
V(outpin) <+ rand_num;
end
endmodule
Example
module normal_check(outpin);
electrical outpin;
integer seed;
real rand_num;
analog begin
@(initial_step) begin
seed = 25;
end
rand_num = $rdist_normal( seed, 0, 1 );
$display("Random number is %g", rand_num);
V(outpin) <+ rand_num;
end
endmodule
Example
module expo_check(outpin);
electrical outpin;
integer seed, mean;
real rand_num;
analog begin
@(initial_step) begin
seed = 25;
mean = 6;
end
rand_num = $rdist_exponential(seed, mean);
$display("Random number is %g", rand_num );
V(outpin) <+ rand_num;
end
endmodule
Example
module pois_check(outpin);
electrical outpin;
integer seed, mean;
real rand_num;
analog begin
@(initial_step) begin
seed = 25;
mean = 6;
end
rand_num = $rdist_poisson(seed, mean);
$display("Random number is %g", rand_num );
V(outpin) <+ rand_num;
end
endmodule
Example
module chi_check(outpin);
electrical outpin;
integer seed, dof;
real rand_num;
analog begin
@(initial_step) begin
seed = 25;
dof = 6;
end
rand_num = $rdist_chi_square(seed, dof);
$display("Random number is %g", rand_num );
V(outpin) <+ rand_num;
end
endmodule
Example
module student_T_check(outpin);
electrical outpin;
integer seed, dof;
real rand_num;
analog begin
@(initial_step) begin
seed = 25;
dof = 12;
end
rand_num = $rdist_t(seed, dof);
$display("Random number is %g", rand_num );
V(outpin) <+ rand_num;
end
endmodule
Example
module erlang_check(outpin);
electrical outpin;
integer seed, k, mean;
real rand_num;
analog begin
@(initial_step) begin
seed = 25;
k = 15;
mean = 10;
end
rand_num = $rdist_erlang(seed, k, mean);
$display("Random number is %g", rand_num);
V(outpin) <+ rand_num;
end
endmodule
Note: Because these tasks are not compliant with the OVI standard, they will not be recognized by Verilog-A compilers from
other vendors.
9.7.1: $sit_get_prev
Returns the value of a specified variable at a previous simulation point.
$sit_get_prev (variable, [iteration])
If the iteration argument is equal to zero (0), the value returned is the value from the previous
iteration (during the same simulation point). If the iteration argument is equal to one (1), the value
returned is the value from the previous simulation point.
If the iteration argument is omitted, the default value is zero (0).
Example
// We allow +/- 10V change between iterations
if (Vb2c1 - $sit_get_prev(Vb2c1, 1) > 10.0) begin
Vb2c1 = $sit_get_prev(Vb2c1, 1) > 5.0;
V(b2, c1) <+ Vb2c1;
end
// usage with no iteration argument
Vds_prev = $sit_get_prev(Vds);
9.7.2: $sit_get_ddv
Returns the derivative of an expression, with regard to a specific branch.
$sit_get_ddv (variable, branch_quality) ;
For each branch quantity expresions, the VERILOG-A compiler computes derivatives that are used to fill
up the spice conductance matrix. These derivative values can be accessed through the internal task
$sit_get_ddv.
Example
// $sit_get_ddv will return the value 5.0
vds = 5 * V(d,s);
Qds = $sit_get_ddv(vds, V(d,s));
// $sit_get_ddv will return the value sin(V(d,s))
vds = cos(V(d,s));
Qds = $sit_get_ddv(vds, V(d,s));
$strobe
Use the $strobe task to display information on the screen. $strobe and $display use the same
arguments, and are completely interchangeable.
strobe_task ::=
$strobe [ ( { list_of_arguments } ) ]
list_of_arguments ::=
argument
| list_of_arguments , argument
The $strobe task prints a new-line character after the final argument. A $strobe task without any
arguments prints only a new-line character.
Each argument is a quoted string or an expression that returns a value.
Each quoted string is a set of ordinary characters, special characters, or conversion specifications, all
enclosed in one set of quotation marks. Each conversion specification in the string must have a
corresponding argument following the string. One must ensure that the type of each argument is
appropriate for the corresponding conversion specification.
An argument can be specified without a corresponding conversion specification. If you do, an integer
argument is displayed using the %d format, and a real argument is displayed using the %g format.
Special Characters
Use the following sequences to include the specified characters and information in a quoted string.
Conversion Specifications
Conversion specifications have the form
where flag, field_width, and precision can be used only with a real argument.
flag is one of the three choices shown in the table:
Flag Definition
- Left justify the output
endmodule
$display
Use the $display task to display information on the screen.
display_task ::=
$display [ ( { list_of_arguments } ) ]
list_of_arguments ::=
argument
| list_of_arguments , argument
$display and $strobe use the same arguments and are completely interchangeable.
$write
Use the $write task to display information on the screen. This task is identical to the $strobe task,
except that $strobe automatically adds a newline character to the end of its output, whereas
$write does not.
write_task ::=
$write [ ( { list_of_arguments } ) ]
list_of_arguments ::=
argument
| list_of_arguments , argument
The arguments one can use in list_of_arguments are the same as those used for $strobe.
Note: The $pwr task is a nonstandard language extension, implemented for VERLIOG-A vendor compatiability.
pwr_task ::=
$pwr( expr )
expr is an expression that specifies the power contribution. If more than one $pwr task is specified in
a behavioral description, the result of the $pwr task is the sum of the individual contributions (See
section 13.2.3:“The power function: $pwr”).
integer my_Chan_Descrip;
my_Chan_Descrip = $fopen( "my_file" );
%P Process ID # 3781
Any other character after a colon (:) signals the end of modifications. That character is copied with the
previous colon.
The modifiers are typically used with the %C command, although they can be used with any of the
commands. However, when the output of a formatting command does not contain a / and ".", the
modifiers :t and :r return the whole name, and the :e and :h modifiers return ".". As a result, be
aware that using modifiers with formatting commands other than %C might not produce the results
one expect. For example, using the command:
$fopen("%I:h.freq_dat");
opens a file named ..freq_dat.
Use a concatenated sequence of modifiers. For example, if the design file name is res.ckt, and the
statement:
$fopen("%C:r.freq_dat");
is used, then:
• %C is the design filename (res.ckt).
• :r is the root of the design filename (res).
• .freq_dat is the new filename extension.
As a result, the name of the opened file is res.freq_dat. The following table shows the various
filenames generated from a design filename (%C) of /users/maxwell/circuits/opamp.ckt by
using different formatting commands and modifiers.
$fopen("%C:r"); /users/maxwell/circuits/opamp
$fopen("%C:e"); ckt
$fopen("%C:h"); /users/maxwell/circuits
$fopen("%C:t"); opamp.ckt
$fopen("%C::"); /users/maxwell/circuits/opamp.ckt:
$fopen("%C:h:h"); /users/maxwell
$fopen("%C:t:r"); opamp
$fopen("%C:r:t"); opamp
$fopen("/tmp/%C:t:r.raw"); /tmp/opamp.raw
$fopen("%C:e%C:r:t"); ckt.opamp
$fopen("%C:r.%I.dat" ); /users/maxwell/circuits/opamp.opamp3.dat
$fstrobe
Use the $fstrobe function to write information to a file.
fstrobe_function ::=
$fstrobe (multi_channel_descriptor {,list_of_arguments })
list_of_arguments ::=
argument
| list_of_arguments , argument
The multi_channel_descriptor that is specified must have a value that is associated with one
or more currently open files. The arguments that that can be used in list_of_arguments are the
same as those used for $strobe. See "$strobe" for guidance.
For example, the following code fragment illustrates how may write simultaneously to two open files.
integer mcd1;
integer mcd2;
integer mcd;
@(initial_step) begin
mcd1 = $fopen("file1.dat");
mcd2 = $fopen("file2.dat");
end
...
mcd = mcd1 | mcd2; // Bitwise OR combines two channels
$fstrobe(mcd, "This is written to both files");
$fdisplay
Use the $fdisplay function to write information to a file.
fdisplay_function ::=
$fdisplay (multi_channel_descriptor {,list_of_arguments })
list_of_arguments ::=
argument
| list_of_arguments , argument
The multi_channel_descriptor that is specified must have a value that is associated with a
currently open file. The arguments that used in list_of_arguments are the same as those used
for $strobe. See "$strobe" for guidance.
$fwrite
Use the $fwrite function to write information to a file.
fwrite_function ::=
$fwrite (multi_channel_descriptor {,list_of_arguments })
list_of_arguments ::=
argument
| list_of_arguments , argument
The multi_channel_descriptor that is specified must have a value that is associated with a
currently open file. The arguments that one can use in list_of_arguments are the same as those
used for $strobe. See "$strobe" for guidance.
The $fwrite function does not insert automatic carriage returns in the output.
file_close_function ::=
$fclose ( multi_channel_descriptor ) ;
The multi_channel_descriptor that is specified must have a value that is associated with the
currently open file that one want to close.
Syntax
analog_function_declaration ::=
analog function [ type ] function_identifier ;
function_item_declaration {function_item_declaration}
statement
endfunction
type ::=
integer
| real
function_item_declaration ::=
input_declaration
| block_item_declaration
block_item_declaration ::=
integer_declaration
| real_declaration
type is the type of the value returned by the function. The default value is real. statement cannot
include analog operators and cannot define module behavior.
Specifically, statement cannot include:
• ddt operator
• idt operator
• idtmod operator
• Access functions
• Contribution statements
• Event control statements
• Simulator library functions, except that you can include the functions in the next list.
statement can include references to:
• $vt
• $vt(temp)
• $temperature
• $realtime
• $abstime
• analysis
• $strobe
• $display
• $write
• $fopen
• $fstrobe
• $fdisplay
• $fwrite
• $fclose
• All mathematical functions
Example
analog function real chopper;
input sw, in; // The function has two declared inputs.
real sw, in;
//The next line assigns a value to the implicit variable, chopper.
chopper = ((sw > 0) ? in : -in);
endfunction
The chopper function takes two variables, sw and in, and returns a real result. Use the function in
any subsequent function definition or in the module definition.
the analog function. This variable can be read and assigned within the flow; its last assigned value is
passed back on the return call.
Example
The following line illustrates from the previous example, this concept:
chopper = ((sw > 0) ? in: -in);
If the internal variable is not assigned, the function shall return zero (0).
Syntax
analog_function_call ::=
function_identifier ( expression { , expression } )
The module phase_detector illustrates how the chopper function can be called.
module phase_detector(lo, rf, if0);
inout lo, rf, if0;
electrical lo, rf, if0;
parameter real gain = 1;
function real chopper;
input sw, in;
real sw, in;
chopper = ((sw > 0) ? in : -in);
endfunction
analog
V(if0) <+ gain * chopper(V(lo),V(rf)); //Call from within the analog block.
endmodule
module_instantiation ::=
module_identifier [ parameter_value_assignment ] instance_list
instance_list ::=
module_instance { , module_instance} ;
module_instance ::=
name_of_instance ( [ list_of_module_connections ] )
name_of_instance ::=
module_instance_identifier
list_of_module_connections ::=
ordered_port_connection { , ordered_port_connection }
ordered_port_connection ::=
[ net_expression ]
net_expression ::=
net_identifier
| net_identifier [ constant_expression ]
| net_identifier [ constant_range ]
constant_range ::=
constant_expression : constant_expression
endmodule
Two of these gain blocks are connected, with the output of the first becoming the input of the second.
This higher-level component is described by module vquad, which creates two instances, named blk1
and blk2, of module vdoubler. Module vquad also defines external ports corresponding to those
shown in the schematic.
endmodule
endmodule
endmodule
One can tell from the order of port names in these modules that port ina[0] in module child maps
to port conin[1] in instance child1. Similarly, port inb in child maps to port conin[6] in
instance child1. Port out in child maps to port conout in instance child1.
endmodule
endmodule
This time, note how the module instantiation statements in vquad use port names to establish a
connection between output port blk1_blk2 of instance blk1 and input port blk1_blk2 of instance
blk2.
One can establish the same connections by using name pairs, as illustrated in the following two
instantiation statements:
vdoubler blk1(.out(blk1_blk2), .in(din)); //By name
vdoubler blk2(.in(blk1_blk2), .out(dout)); //By name
establish different connections. These statements describe a system where the gain blocks are
connected in parallel, see Figure 10-3.
• It is necesary to ensure that the sizes of connected ports and nets match. In other words, you can
connect a scalar port to a scalar net, and a vector port to a vector net or concatenated net
expression of the same width.
‘include "discipline.h"
‘include "constants.h"
module inverter(in,out);
input in;
output out;
electrical in,out;
endmodule
‘include "discipline.h"
‘include "constants.h"
analog begin
@(initial_step) x = 0;
@(cross(V(clk) - vth, +1)) begin
if (V(j) > vth)
case (V(k) > vth)
1 : x = !x;
0 : x = 1;
endcase
.....
end
endmodule
//Parameters
parameter real trise = 10p from [0:inf);
parameter real tfall = 10p from [0:inf);
//Structural declarations
inverter inverter0(din, dinbar);
jk_ff jk_ff0(din, dinbar, clk, q0, qbar0); Instantiation of Verilog-A
Child modules within
Parent module
jk_ff jk_ff1(q0, qbar0, clk, q1, abar1);
jk_ff jk_ff2(q1, qbar1, clk, q2, abar2);
jk_ff jk_ff3(q2, qbar2, clk, q3, abar3);
analog begin
V(d0) <+ transition(V(q0),trise,tfall);
V(d1) <+ transition(V(q1),trise,tfall);
V(d2) <+ transition(V(q2),trise,tfall);
V(d3) <+ transition(V(q3),trise,tfall);
end
endmodule
named_param_override_list ::=
named_param_override { , named_param_override }
named_param_override ::=
. parameter_identifier ( expression )
By default, instances of modules inherit any parameters specified in their defining module. To change
any of the default parameter values, do so on the module instantiation statement itself, or from other
modules and instances by using the defparam statement. The defparam statement is particularly
useful if to change parameters throughout modules from a single location.
Consider the two instances, weakp and plainp, instantiated within module m.
module m;
voltage clk;
electrical out_a, in_a;
mosp #(2e-6, 1e-6) weakp(out_a, in_a, clk);
mosp plainp(out_b, in_b, clk);
endmodule
The weakp module instantiation statement overrides the first two parameters given in the defining
module, mosp, giving the first parameter the new value 2e-6 and the second parameter the value 1e-6.
The plainp module instantiation statement has no parameter override expression, so the
parameters assume their default values.
Examples
module vdoubler(in, out);
input in;
output out;
electrical in, out;
parameter parm1=0.2, parm2=0.1, parm3=5.0;
analog
V(out) <+ (parm1+parm2+parm3) * V(in);
endmodule
endmodule
The module instantiation statement for instance blk1 overrides parameter parm3 by name to specify
that the value for parm3 should be changed to 4.0. The other two parameters retain the default values
0.2 and 0.1. The module instantiation statement for blk2 uses an ordered list by name to override the
first two parameters, parm1, and parm2. Parameter parm3 retains the default value 5.0.
endmodule
The following table shows the device available with their name, port names and parameter names.
10.4.1: B device
Example
with L and W parameters.
Spice Syntax
B8 net18 net011 net033 Depl_TOM2 L=800e-9 W=20e-6
Verilog-A Syntax
Depl_TOM2 #(.L(800e-9), .W(20e-6)) B8(net18,net011,net033);
Note: the Verilog-A module name for a B device must have a corresponding spice model card.
In the SMARTSPICE netlist, the model card for the previous example could be:
.MODEL Depl_TOM2 NMF ( LEVEL = 5 VERSION = 2
+ BETA = 1.814862E-4 VTO = -0.3504765 ALPHA = 2.5848448
+ GAMMA = 0.0225387 DELTA = 0 LAMBDA = 0 )
10.4.2: C device
Example
with default parameter.
Spice Syntax
cf1 f2 0 500p
Verilog-A Syntax
capacitor #(500p) cf1(f2,gnd);
Example
with c,w,l,dtemp device parameters
Spice Syntax
c2 out gnd 1u l=10u w=1u dtemp=73
Verilog-A Syntax
capacitor #(.c(1u), .l(10u), .w(1u), .dtemp(73)) c2(out, gnd);
Example
with polynomial Capacitance
Spice Syntax
c3 in out POLY 2.0 0.5 0.01
Verilog-A Syntax
capacitor #(.type("POLY"), [2.0,0.5,0.01]) c3(in, out);
10.4.3: D device
Example
Spice Syntax
D1 n2 n3 DIODE IC=0.3 DTEMP=0.5
Verilog-A Syntax
diode #(.ic(0.3), .dtemp(0.5)) d1(n2, n3);
Note: the Verilog-A module name for a D device must have a corresponding spice model card.
Note: 1: Controlling nodes are specified in the port association list. ( See first example ). 2: Source types are specified by the
parameter name type and with a string argument. Several types can be specified in the same statement. Example:
..., .type(“VCR”), .type(“POLY”), ... 3: coefficient vectors specified by position are processed
following the source type. ( see next example ).
Example
VCVC with polynomial source.
Spice Syntax
Verilog-A Syntax
vcvc #(.type(“POLY(2)”),[0,0,0,0,1]) F12(n4,n7,vcc,vee);
Example
Linear VCVS source.
Spice Syntax
ef f1 gnd s1 gnd 1+pp1+pp2-pp3
Verilog-A Syntax
vcvs #(.gain(1+pp1+pp2-pp3)) ef(f1,gnd,s1,gnd);
Example
Delay Source.
Spice Syntax
edelay out gnd VCVS DELAY in gnd TD=0.01
Verilog-A Syntax
vcvs #(.type("VCVS"),.type("DELAY"),.TD(0.01)) edelay1(out,gnd,in,gnd);
Example
Transformer source
Spice Syntax
ew OUT 0 TRANSFORMER IN 0 10
Verilog-A Syntax
vcvs #(.type("TRANSFORMER"), 10) Ew(out, gnd, in, gnd);
Example
Delay source with TD,TC1,TC2,NPDELAY parameters.
Spice Syntax
Etd out 0 DELAY in 0 td=1n tc1=1.1e-10 tc2=1.2e-10 npdelay=25
Verilog-A Syntax
vcvs #(.type("DELAY"),.td(1n),.tc1(1.1e-10), .tc2(1.2e-10), .npdelay(25))
edelay2(out,gnd,in,gnd);
Example
CCCS source with default parameters.
Spice Syntax
VS1 s1 0 pwl( 0 1 3n 5v 23n 5 26n 1v ) ac 1
VDS n1 0 1
FF f2 f1 VS1 pp1
F11 n3 0 vds 4
Verilog-A Syntax
vsource #(.pwl([0,1,3n,5,23n,5,26n,1]), .ac(1)) vs1(s1,gnd);
vsource #(1) vds (n1,gnd);
cccs #(.vcontrolname("vs1"), .gain(pp1)) ff(f2,f1);
cccs #("vds",4) f11(n3,n0);
Example
CCVS source with and without default parameters.
Spice Syntax
HH h2 h1 HH pp1
Verilog-A Syntax
ccvs #(.vcontrolname("hh"), .trres(pp1)) hh(h2,h1);
ccvs #("hh), pp1) hh(h2,h1);
Example
VCCS linear source with default parameter.
Spice Syntax
G1 0 ggout in in_1 10
Verilog-A Syntax
vccs #(10) g1(gnd, ggout, in, in_1);
Example
VCCS Linear source.
Spice Syntax
gh1 h2 0 h1 0 1
Verilog-A Syntax
vccs #(.gm(1)) gh1(h2,gnd,h1,gnd);
Example
VCCS source with Polynomial coefficents.
Spice Syntax
Gp 11 12 POLY(4) 5 0 6 0 7 0 8 0 0 1 1 1 1 0 0 0 0 0 0 -1
Verilog-A Syntax
vccs #(.type(“POLY(4)”),[0,1,1,1,1,0,0,0,0,0,0,-1])
Gp(n11,n12,n5,gnd,n6,gnd,n7,gnd,n8,gnd);
Example
VCCS source with VCR and NAND parameters.
Spice Syntax
gAND d d1 VCR AND(3) g1 0 g2 0 g3 0
+ delta=0.1 scale=2 m=2 tc1=1.1e-10 tc2=1.2e-10
+ 0,1G 1,1G 2,1 5,1
Verilog-A Syntax
vccs #(.type("AND(3)"), type(“VCR”),[0,1G,1,1G,2,1,5,1],.m(2),.tc1(1.1e-10),
.tc2(1.2e-10)) G1(d, d1, g1, gnd, g2, gnd, g3, gnd);
10.4.5: I, V devices
Example
currrent source with default parameter.
Spice Syntax
Iee e 0 1m
Verilog-A Syntax
isource #(1m) Iee(e, gnd);
Example
PWL current source.
Spice Syntax
i1 in1 0 1 pwl(0 0 1n 10 2n 0 4n 10 6n 0 r=2n)
Verilog-A Syntax
isource #(.dc(1), .pwl([0,1,1n,1.4,2n,2,3n,1,4n,4])) vds(in1,gnd);
Example
SFFM voltage source.
Spice Syntax
v1 out1 0 sffm( 0 1M 20K 5 1K )
Verilog-A Syntax
vsource #(.sffm([0,1M,20K, 5, 1K])) v1(out1,gnd);
Spice Syntax
AM voltage source.
v1 out1 0 am( 10 1 100 1K 1m )
Verilog-A Syntax
vsource #(.am([10, 1, 100, 1k, 1m])) v1(out1,gnd);
Spice Syntax
PWL and AC voltage source.
vin1 in 0 AC 3 0 PWL 0 0 10n 5 25m 5 25.01M 0
Verilog-A Syntax
vsource #(.ac({3,0}), .pwl({0, 0, 10n, 5, 25m, 5, 25.01M,0 })) vin1(in,
gnd);
Example
Voltage SIN source.
Spice Syntax
vin1 source1 0 SIN(0 sqrt(2)*230 50 0 0 90)
Verilog-A Syntax
vsource #(.sin([0,sqrt(2)*230, 50, 0, 0, 90])) vin1(source1, gnd);
Example
PWL source with input file.
Spice Syntax
Verilog-A Syntax
vsource #(.dc(0), .pwlfiledesc([2, 0, 1u, 0, 3.3, 1n, 1n]),
.pwlfile("test3.dat")) V1(inp, gnd);
Example
PWL source with input file and delay parameter.
Spice Syntax
V1 inp 0 0 PWLFILEDESC(2 0 1u 0 3.3 1n 1n) PWLFILE DigitalEndBy1.pwl TD=3n
r=2n
Verilog-A Syntax
vsource #(0,.pwlfiledesc([2, 0, 1u, 0, 3.3, 1n, 1n]),
.pwlfile("DigitalEndBy1.pwl"), .td(3n), .r(2n)) vin1(out, gnd);
10.4.6: J device
Spice Syntax:
j1 1 2 3 0 Depl l=0.8e-6 w=20e-6
Verilog-A Syntax
Depl #(.l(0.8e-6), .w(20e-6)) j1(n1, n2, n3, gnd);
Note: the Verilog-A module name for a J device must have a corresponding spice model card.
10.4.7: K, L devices
Example
inductor with polynomial coefficients.
Spice Syntax
L99 in out POLY 4.0 0.35 0.01 R = 10
Verilog-A Syntax
inductor #(.type("POLY"), [4.0,0.35,0.01], .r(10)) L99(in,out);
Example
inductors and mutual inductors.
Spice Syntax
L_a n_0 p 6.0n
L_b p pp 8.0n
L_c pp 0 8.0n
KK_A_B l_a l_b k=0.7
Verilog-A Syntax
inductor #(.l(6.0n)) L_a(n_0,p);
inductor #(8.0n) L_b(p,pp);
inductor #(.l(8.0n)) L_c(pp,n0);
mutual #(.indnumber(2), .indnamen("l_a"), .indnamen("l_b"),
.coefficient(0.7)) KK_A_B();
10.4.8: M device
Spice Syntax
mm 2 1 0 0 modd w=5u l=5u m=10
Verilog-A Syntax
modd #(.w(5u),.l(5u),.m(10)) mm(n2, n1, gnd, gnd);
10.4.9: O device
Spice Syntax
O1 2 0 3 0 lline1 m=1
O2 2 0 3 0 lline2 length=.6095
Verilog-A Syntax
lline1 #(.m(1)) o1(n2,n0,n3,n0);
lline2 #(.length(0.6095)) o2(n2,n0,n3,n0);
Note: the Verilog-A module name for a O device must have a corresponding spice model card.
10.4.10: Q device
Spice Syntax
Q1 3 2 6 QNL IC=0.6,5.0
Q2 4 5 6 QNL OFF TEMP=50
Verilog-A Syntax
qnl #(.ic([0.6,5.0])) q1(n3,n2,n6);
qnl #(.off(),.temp(50)) q2(n4,n5,n6);
Note: the Verilog-A module name for a Q device must have a corresponding spice model card.
10.4.11: R device
Spice Syntax
r1 in1 in2 50
Verilog-A Syntax
resistor #(.r(50)) r1 (in1,in2);
10.4.12: S device
Spice Syntax
S1 np nn ncp ncn swmod M=2
Verilog-A Syntax
swmod #(.m(2)) S1(n1, n2, n3, n4);
Note: the Verilog-A module name for a S device must have a corresponding spice model card.
10.4.13: T device
Spice Syntax
T1 In1 0 Out1 0 Z0=50 TD=10ns l=0.1
Verilog-A Syntax
tline #(.z0(50),.td(10n),.l(0.1)) T1(In1,gnd,Out1);
Note: the Verilog-A module name for a T device must have a corresponding spice model card.
10.4.14: U device
Spice Syntax
u6 2 0 3 0 lline6 l=0.6095
Verilog-A Syntax
lline6 #(.l(0.6095)) U6(n2,gnd,n3,gnd);
Note: the Verilog-A module name for a U device must have a corresponding spice model card.
10.4.15: W device
Example
Spice Syntax
S_w1 25 23 21 22 24 26 0 FQMODEL=w1 TYPE=Y
Verilog-A Syntax
w1 #(.type("Y")) S_w1(n25, n23, n21, n22, n24, n26, gnd);
Note: the Verilog-A module name for a W device must have a corresponding spice model card.
endmodule
inout in;
electrical out;
parameter real l=8u, w=8u;
endmodule // modva_inv
endmodule
This fm_demodulator module sets the array parameter poles to a comma-separated list enclosed
by a set of square brackets.
Examples
The next fragment shows how one can set the pwl descriptor file name parameter to a vsource:
To set an enumerated parameter in a primitive instance, enclose the enumerated value in quotation
marks.
The next fragment sets the parameter type to the value pulse:
source_text ::=
{description}
description ::=
module_declaration | discipline_declaration | nature_declaration
module_declaration ::=
module module_identifier [ list_of_ports ] ;
[ module_items ]
endmodule
list_of_ports ::=
( port { , port } )
port ::=
[ port_expression ]
| . port_identifier ( [ port_expression ] )
port_expression ::=
port_identifier
| port_identifier [ constant_expression ]
| port_identifier [ msb_constant_expression : lsb_constant_expression ]
module_items ::=
{ module_item }
| analog_block
module_item ::=
module_item_declaration
| parameter_override
| module_instantiation
| analog_block
module_item_declaration ::=
parameter_declaration
| input_declaration
| output_declaration
| inout_declaration
| integer_declaration
| real_declaration
| node_declaration
| branch_declaration
| genvar_declaration
| analog_function_declaration
parameter_override ::=
defparam list_of_param_assignments ;
nature_declaration ::=
nature nature_name
[ nature_descriptions ]
endnature
nature_name ::=
nature_identifier
| nature_identifier : parent_identifier
parent_identifier ::=
nature_identifier
| discipline_identifier.flow
| discipline_identifier.potential
nature_descriptions ::=
nature_description
| nature_description nature_descriptions
nature_description ::=
attribute = constant_expression ;
attribute ::=
abstol | access | ddt_nature | idt_nature | units | identifier | huge |
blowup | maxdelta
discipline_declaration ::=
discipline discipline_identifier
[ discipline_descriptions ]
enddiscipline
discipline_descriptions ::=
discipline_description
| discipline_description discipline_descriptions
discipline_description ::=
nature_binding
| attr_description
nature_binding ::=
pot_or_flow nature_identifier ;
attr_description ::=
pot_or_flow . attribute_identifier = constant_expression ;
pot_or_flow ::=
potential | flow
parameter_declaration ::=
parameter [opt_type] list_of_param_assignments ;
opt_type ::=
real | integer
list_of_param_assignments ::=
declarator_init
| list_of_param_assignments , declarator_init
declarator_init ::=
parameter_identifier = constant_expression [ { opt_range } ]
opt_range ::=
from range_specifier
| exclude range_specifier
| exclude constant_expression
range_specifier ::=
start_paren expression1 : expression2 end_paren
start_paren ::=
[ | (
end_paren ::=
] | )
expression1 ::=
constant_expression | -inf
expression2 ::=
constant_expression | inf
input_declaration ::=
input [range] list_of_port_identifiers ;
output_declaration ::=
output [range] list_of_port_identifiers ;
inout_declaration ::=
inout [range] list_of_port_identifiers ;
list_of_port_identifiers ::=
port_identifier { , port_identifier }
integer_declaration ::=
integer list_of_identifiers ;
real_declaration ::=
real list_of_identifiers ;
list_of_identifiers ::=
var_name { , var_name }
var_name ::=
variable_identifier
| array_identifier range
node_declaration ::=
discipline_identifier [range] list_of_nodes ;
list_of_nodes ::=
node_identifier
| node_identifier , list_of_nodes
branch_declaration ::=
branch list_of_branches ;
list_of_branches ::=
list_of_parallel_branches
| list_of_parallel_branches , list_of_branches
list_of_parallel_branches ::=
terminals list_of_branch_identifiers
terminals ::=
( node_identifier )
| ( node_identifier , node_identifier )
list_of_branch_identifiers ::=
branch_identifier
| branch_identifier , list_of_branch_identifiers
genvar_declaration ::=
genvar list_of_genvar_identifiers ;
list_of_genvar_identifiers ::=
genvar_identifier {, genvar_identifier }
analog_function_declaration ::=
analog function [type] function_identifier ;
function_item_declaration { function_item_declaration }
statement
endfunction
type ::=
integer
| real
function_item_declaration ::=
input_declaration
| block_item_declaration
block_item_declaration ::=
parameter_declaration
| integer_declaration
| real_declaration
module_instantiation ::=
module_identifier [ parameter_value_assignment ] instance_list
instance_list ::=
module_instance { , module_instance } ;
module_instance ::=
name_of_instance ( [ list_of_module_connections ] )
name_of_instance ::=
module_instance_identifier
list_of_module_connections ::=
ordered_port_connection { , ordered_port_connection } |
named_port_connection { , named_port_connection }
ordered_port_connection ::=
[ net_expression ]
named_port_connection ::=
. port_identifier ( [ net_expression ] )
parameter_value_assignment ::=
# ( ordered_param_override_list )
| # ( named_param_override_list )
ordered_param_override_list ::=
constant_expression { , constant_expression }
named_param_override_list ::=
named_param_override { , named_param_override }
named_param_override ::=
. parameter_identifier ( constant_expression )
net_expression ::=
net_identifier
| net_identifier [ expression ]
| net_identifer [ msb_constant_expression : lsb_constant_expression ]
analog_block ::=
analog statement
statement ::=
null_statement
| block_statement
| branch_contribution
| procedural_assignment
| conditional_statement
| loop_statement
| case_statement
| generate_statement
| event_controlled_statement
| last_crossing_function
| system_task_enable
null_statement ::=
;
block_statement ::=
begin [ : block_identifier
{ block_item_declaration } ]
{ statement }
end
branch_contribution ::=
bvalue <+ expression ;
bvalue ::=
access_identifier ( analog_signal_list )
analog_signal_list ::=
branch_identifier
| node_or_port_identifier
| node_or_port_identifier , node_or_port_identifier
nexpr ::=
bvalue
| ddt ( bvalue )
| idt ( bvalue )
| idtmod ( bvalue )
procedural_assignment ::=
lexpr = expression ;
lexpr ::=
integer_identifier
| real_identifier
| array_element
array_element ::=
integer_identifier [ constant_expression ]
| real_identifier [ constant_expression ]
conditional_statement ::=
if ( expression ) statement [ else statement ]
case_statement ::=
case ( expression )
case_item {case_item}
endcase
case_item ::=
expression { , expression } : statement
| default [ : ] statement
loop_statement ::=
forever statement
| repeat ( expression ) statement
| while ( expression ) statement
| for ( procedural_assignment ; expression ; procedural_assignment )
statement
generate_statement ::=
statement
start_expr ::=
constant_expression
end_expr ::=
constant_expression
incr_expr ::=
constant_expression
event_controlled_statement ::=
@ ( event_expression ) statement
event_expression ::=
simple_event [ or event_expression ]
simple_event ::=
global_event
| event_function
| identifier
global_event ::=
initial_step [ ( analysis_list ) ]
| final_step [ ( analysis_list ) ]
analysis_list ::=
analysis_name { , analysis_name }
analysis_name ::=
" analysis_identifier "
event_function ::=
cross_function
| timer_function
cross_function ::=
cross ( expression [ , opt_args ] )
opt_args ::=
direction [ , time_tol [ , expression_tol ] ]
direction ::=
+1
| -1
time_tol ::=
expression
expression_tol ::=
expression
timer_function ::=
timer ( start_time [ , period ] )
start_time ::=
expression
period ::=
expression
last_crossing_function ::=
last_crossing ( expression [ , direction ] )
system_task_enable ::=
system_task_name [ ( expression { , expression } ) ] ;
range ::=
[ constant_expression : constant_expression ]
constant_expression ::=
constant_primary
| string
| unary_operator constant_primary
| constant_expression binary_operator constant_expression
| constant_expression ? constant_expression : constant_expression
constant_primary ::=
number
| parameter_identifier
expression ::=
primary
| unary_operator primary
| expression binary_operator expression
| expression ? expression : expression
| function_call
| access_function ( arg_list )
| built-in_function ( arg_list )
| system_function ( arg_list )
function_call ::=
function_identifier ( expression { , expression } )
arg_list ::=
expression { , expression }
access_function ::=
bvalue
unary_operator ::=
+ | - | ! | ~
binary_operator ::=
+ | - | * | / | % | == | != | && | || | < | <= | > | >= | & | | | ^ |
^~ | ~^ | >> | <<
primary ::=
number | identifier | identifier [ expression ] | nexpr | ( expression )
number ::=
decimal_number | real_number
decimal_number ::=
[ sign ] unsigned_num
real_number ::=
[ sign ] unsigned_num . unsigned_num
| [ sign ] unsigned_num [ . unsigned_num ] e [ sign ] unsigned_num | [ sign ]
unsigned_num [ . unsigned_num ] E [ sign ] unsigned_num
| [ sign ] unsigned_num [ . unsigned_num ] unit_letter
sign ::=
+ | -
unsigned_num ::=
decimal_digit { decimal_digit }
decimal_digit ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
unit_letter ::=
T | G | M | K | m | u | n | p | f | a
analog_function ::=
ddt | idt | idtmod | absdelay | transition | slew | analysis | flicker_noise
| noise_table | white_noise |laplace_zp | laplace_zd | laplace_np |
laplace_nd |
zi_zp | zi_zd | zi_np | zi_nd
built_in_function ::=
ln | log | exp | sqrt | min | max | abs | pow | sin | cos | tan | asin |
acos | atan | atan2 | sinh | cosh | tanh | asinh | acosh | atanh | hypot
|limexp | ceil | floor
system_function ::=
$realtime | $abstime | $temperature | $vt | $discontinuity | $bound_step
comment ::=
short_comment
| long_comment
short_comment ::=
// comment_text \n
long_comment ::=
/* comment_text */
comment_text ::=
{ Any_ASCII_character }
string ::=
" { Any_ASCII_character_except_newline } "
identifier ::=
simple_identifier
| escaped_identifier
simple_identifier ::=
[a-zA-Z]{a-zA-Z_$0-9}
escaped_identifier ::=
{ Any_ASCII_character_except_white_space }
white_space
white_space ::=
space | tab | newline
The following files, discipline.h and constants.h define the type of nature and discipline,
including mathematical and physical constants. The file discipline.h declares standard natures
and disciplines useful for analog systems. One can use these definitions as they are, change them, or
override them. For further details of using these files, see Chapter 2: “Makeup of Modules” and
Chapter 2: “The SmartSpice Verilog-A Simulation Flow”.
Example
In the VERILOG-A source file:
// Electrical
// Current in amperes
nature Current
units = "A";
access = I;
idt_nature = Charge;
’ifdef CURRENT_ABSTOL
abstol = ’CURRENT_ABSTOL;
’else
abstol = 1.0e-12;
’endif
endnature
// Charge in coulombs
nature Charge
units = "coul";
access = Q;
ddt_nature = Current;
’ifdef CHARGE_ABSTOL
abstol = ’CHARGE_ABSTOL;
’else
abstol = 1e-14;
’endif
endnature
// Potential in volts
nature Voltage
units = "V";
access = V;
idt_nature = Flux;
’ifdef VOLTAGE_ABSTOL
abstol = ’VOLTAGE_ABSTOL;
’else
abstol = 1e-6;
’endif
endnature
// Flux in Webers
nature Flux
units = "Wb";
access = Phi;
ddt_nature = Voltage;
’ifdef FLUX_ABSTOL
abstol = ’FLUX_ABSTOL;
’else
abstol = 1e-9;
’endif
endnature
// Conservative
discipline
discipline electrical
potential Voltage;
flow Current;
enddiscipline
// Signal flow
disciplines
discipline voltage
potential Voltage;
enddiscipline
discipline current
potential Current;
enddiscipline
// Magnetic
// Magneto_Motive_Force in Ampere-Turns
nature Magneto_Motive_Force
units = "A*turn";
access = MMF;
’ifdef MAGNETO_MOTIVE_FORCE_ABSTOL
abstol = ’MAGNETO_MOTIVE_FORCE_ABSTOL;
’else
abstol = 1e-12;
’endif
endnature
// Conservative discipline
discipline magnetic
potential Magneto_Motive_Force;
flow Flux;
enddiscipline
// Thermal
nature Temperature
units = "C";
access = Temp;
’ifdef TEMPERATURE_ABSTOL
abstol = ’TEMPERATURE_ABSTOL;
’else
abstol = 1e-4;
’endif
endnature
// Power in Watts
nature Power
units = "W";
access = Pwr;
’ifdef POWER_ABSTOL
abstol = ’POWER_ABSTOL;
’else
abstol = 1e-9;
’endif
endnature
// Conservative discipline
discipline thermal
potential Temperature;
flow Power;
enddiscipline
// Kinematic
// Position in
meters
nature Position
units = "m";
access = Pos;
ddt_nature = Velocity;
’ifdef POSITION_ABSTOL
abstol = ’POSITION_ABSTOL;
’else
abstol = 1e-6;
’endif
endnature
’ifdef ACCELERATION_ABSTOL
abstol = ’ACCELERATION_ABSTOL;
’else
abstol = 1e-6;
’endif
endnature
// Force in newtons
nature Force
units = "n";
access = F;
’ifdef FORCE_ABSTOL
abstol = ’FORCE_ABSTOL;
’else
abstol = 1e-6;
’endif
endnature
// Conservative disciplines
discipline kinematic
potential Position;
flow Force;
enddiscipline
discipline kinematic_v
potential Velocity;
flow Force;
enddiscipline
// Angle in radians
nature Angle
units = "rads";
access = Theta;
ddt_nature = Angular_Velocity;
’ifdef ANGLE_ABSTOL
abstol = ’ANGLE_ABSTOL;
’else
abstol = 1e-6;
endnature
// Force in newtons
nature Angular_Force
units = "n/m";
access = Tau;
’ifdef ANGULAR_FORCE_ABSTOL
abstol = ’ANGULAR_FORCE_ABSTOL;
’else
abstol = 1e-6;
’endif
endnature
// Conservative disciplines
discipline rotational
potential Angle;
flow Angular_Force;
enddiscipline
discipline rotational_omega
potential Angular_Velocity;
flow Angular_Force;
enddiscipline
‘ include "constants.h"
The content of the file is the following:
// Mathematical and physical constants
’ifdef CONSTANTS_H
’else
’define CONSTANTS_H
// M_ is a mathematical constant
’define M_E 2.7182818284590452354
’define M_LOG2E 1.4426950408889634074
’define M_LOG10E 0.43429448100325182765
’define M_LN2 0.69314718055994530942
’define M_LN10 2.30258509299404568402
’define M_PI 3.14159265358979323846
’define M_TWO_PI 6.28318530717958647652
’define M_PI_2 1.57079632679489661923
’define M_PI_4 0.78539816339744830962
’define M_1_PI 0.31830988618379067154
’define M_2_PI 0.63661977236758134308
’define M_2_SQRTPI 1.12837916709551257390
’define M_SQRT2 1.41421356237309504880
’define M_SQRT1_2 0.70710678118654752440
// P_ is a physical constants
// charge of electron in coulombs
’define P_Q 1.6021918e-19
// speed of light in vacuum in meters/sec
’define P_C 2.997924562e8
// Boltzman’s constant in joules/Kelvin
’define P_K 1.3806226e-23
// Plank’s constant in joules*sec
’define P_H 6.6260755e-34
// permittivity of vacuum in farads/meter
’define P_EPS0 8.85418792394420013968e-12
// permeability of vacuum in henrys/meter
’define P_U0 (4.0e-7 * ’M_PI)
The simulator flow with example of editing VERILOG file(s) and SMARTSPICE input deck, is shown in
Figure 13-1.
The first way will have a global effect: everytime SMARTSPICE is run, the VERILOG-A INTERFACE will use
the SILVACO C-INTERPRETER. In contrast the second implementation of, the switch will have an effect only
on the netlists run from the same directory as the config file.
Syntax
primitive_name #( parameter_override_list ) instance_name
( port_association_list );
Example
‘include "discipline.h"
endmodule // mva
Example
vsource #(.type("sine"), .ampl(5), .freq(0.995e06)) vin1(out1,gnode);
vpwl #(.wave([0, 2, 0.03u, 3])) vin2(out2,gnode);
vsource #(.type("pulse"), .val0(5), .val1(-5), .td(10n), .rise(10n),
.fall(10n), .width(40n), .period(100n)) vin3(out3,gnode);
Syntax
$pwr( expr )
where expr is an expression that specifies the power contribution.
Example
// Resistor with power contribution
‘include "discipline.h"
analog begin
V(pos,neg) <+ r * I(pos,neg);
$pwr(V(pos,neg)*I(pos,neg));
end
endmodule
Access to the power consumption from the netlist is done by using the following syntax:
@YVLGinst_name[_pwr]
Example
YVLGr1 in1 out1 Res r=1e3
YVLGr2 out1 0 Res r=1e3
Futhermore, like any other devices, the power consumption is displayed for each instance and then
added for each model. The following listing is the output after simulating a netlist with the 2 instances
YVLGr1 and YVLGr2:
subckt
element yvlgr2 yvlgr1
model Res Res
Example
In the module I_level_shift in the following listing, I(out) and I(in) are the only quantities to be
available through the print command. The potential quantities V(out) and V(in) are not accessible.
Verilog-A module:
module I_level_shift(in,out);
input in;
output out;
electrical in,out;
parameter real iout_offset = 0;
analog
I(out) <+ I(in) + iout_offset; // I(out) and I(in) can be used in the
//.PRINT and .PLOT commands
// V(out) and V(in) are not accessible
endmodule
* c sensor
.verilog "c_sensor.va"
vin 1 0 dc 0.1 PULSE (0 1 10n 10n 10n 20n 100n)
YVLGlevelShift 1 2 I_level_shift iout_offser=1
r2 2 0 1k
.op
.dc vin .1 10 1
.tran 1n 200n 1n
.print @YVLGlevelShift[I(out)]
.MODIF LOOP=2 YVLGlevelShift(iout_offset)+=1
Example
.verilog "resistor.va"
vin 1 0 1
YVLGrin 1 2 resistor
cin 2 0 1p
.TRAN 1n 10n UIC
.LET v1=v(1)
.LET v2=v(2)
.ST LIST YVLGrin(r) 1k 2k 5k
Examples
set_c_compiler_path /main/frlocal/sparc-solaris2/bin
add_include_path ../include/
The switches available are described in the next table.
Configuration commands for The VerilogA compiler
Command name arguments Description
set_switch <switch-name> <value> set a switch
add_include_path <path-name> add an include path
set_c_compiler_path <path-name> set path for the c
compiler
Switches for the VerilogA compiler
Switch Switch Name Values Default
Verilog Preprocessor Output VPP 0 | 1 0
SmartSpice User’s Manual - Volume 2
The switch VPP (Verilog Preprocessor Output Switch) is 1, the result of the preprocessor will be stored
in a file with the same name as the input file but with the extension vpp.
The switch GCC (Gnu C Compiler switch) indicates to use gcc instead of the native C compiler. By
default, GCC is set to 1.
The switch SCI (SILVACO C-INTERPRETER) indicates to use the SILVACO C-INTERPRETER instead of a C
compiler.
Examples
.verilog “resitor.va”
.verilog “../capacitor/capacitor.va”
.verilog “/export/home/lionelk/myLib/inductor/inductor.va”
Example
Example
* declares a VLG model card m_resistor that uses the Verilog-A module
* ’resistor’ and assign
.model m_resistor VLG MODULE=resistor thermal_resistance=4
and assign the value 4 to the parameter thermal_resistance
Netlist Example
The following netlist shows an RLC circuit. The VERILOG-A files containing the resistor, inductor and
capacitor modules are included with the .verilog card. The modules:
netlist:
* RLC circuit using Verilog-A modules
.verilog "resistor.va"
.verilog "inductor.va"
.verilog "capacitor.va"
VIN1 1 0 PWL 0 0 10n 5 25m 5 25.01M 0
YVLGr1 1 tmp resistor r=200
The next netlist shows a circuit where the same VERILOG-A module is instantiated several times, but
with a different number of ports. A model card is created for each value of the parameter size. Only the
relevant parts are shown in the listing.
netlist:
.verilog "and.va"
YVLGand1 1 2 3 4 and_3
YVLGand2 4 5 6 and_2
...
...
.model and_3 VLG MODULE = V_and size=3
.model and_2 VLG MODULE = V_and size=2
In this netlist, nodes 1, 2, 3 and 4 are assigned to node in[0], in[1], in[2] and in[3] respectively. The
following listing shows the code for the Verilog-A module V_and:
module V_and(in,out);
parameter real size = 2 from [2:inf);
input [0:size-1] in;
output out;
voltage in,out;
...
...
endmodule
The modules resistor, inductor and capacitor are instantiated respectivly with the names YVLGr1,
YVLGl1, YVLGc1
You can also set variables in the AUTOEXEC.BAT files through the following commands:
rem we supposed that Visual Studio has been installed in the directory
rem C:\Program Files\Microsoft\Visual Studio
set PATH=%PATH%;%MSVC_ROOT%\Common\Tools;
set PATH=%PATH%;%MSVC_ROOT%\Common\MSDEV98\BIN;
set PATH=%PATH%;%MSVC_ROOT%\VC98\BIN;
set INCLUDE=%MSVC_ROOT%\VC98\INCLUDE
set LIB=%MSVC_ROOT%\VC98\LIB
2. To set the SMARTSPICE VERILOG-A interface to use DLL with VC++ instead of the SILVACO C-
INTERPRETER, the user variable SMARTSPICE_VERILOGA_VCC has to be set 1. You can set it
through the “Properties” windows or with the following command in the AUTOEXEC.bat:
set SMARTSPICE_VERILOGA_VCC=1
3. To double check now that your system is correctly configured, you can execute the following
command in a MS-DOS prompt windows:
Microsoft(R) Windows NT(TM)
(C) Copyright 1985-1996 Microsoft Corp.
C:\>echo %PATH%
C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program
Files\Microsoft Visual
Studio\Common\Msdev98\BIN;C:\WINNT\system32;C:\WINNT;c:\Program
files\microsoft visual studio\vc98\bin;c\silvaco\bin;
C:\>cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
C:\>echo %SMARTSPICE_VERILOGA_VCC%
1
Example
"test1.va" at line 16: Error:
Unknown system task ’$last_cross’.
Once the error has been fixed, (here in the previous example, ‘$last_cross’ should have been
changed to ‘last_crossing’ ), re-source the netlist so SMARTSPICE will re-compile the VERILOG-A
source file.
• Simulation Errors (or warnings): run-time errors found during the SMARTSPICE simulation. Some
of these errors are domain or range checks that indicate that some VERILOG-A equations are
incomplete for some specific input values. It is the responsability of the user to create a model
where all possible input values are processed correctly. These error messages have the following
format:
Error: (VERILOGA): <error message>
Example
Error: (VERILOGA): Can not access verilog input file : ’test9.va’
Example
if ( analysis(AC) ) // ERROR: argument must be “AC”
• “Argument <number> of the concatenation operation has an unmatched type.”
Concatenation element type does not match the other element types.
Example
reg [8*14:1] stringvar;
stringvar = {"!!!",25}; // ERROR: string type expected for argument 2.
Example
integer val1;
val1 = “string val”; // ERROR: integer type expected in the right hand-side.
• “Cannot assign value to genvar <name>.”
genvar variables can only be incremented in for-loops.
Example
electrical node1;
F(node1) <+ R*I(node1); // ERROR: access function F is not valid.
Example
electrical node1;
thermal node2;
V(n1,n2) <+ cos(ph); // ERROR: n1 and n2 have incompatible disciplines.
• “Ordered parameter assignment in analog primitive instance <instance name> not allowed.”
Example
resistor #(200)r1(in,tmp); // ERROR:parameter assignment must be by name
// ex:.p(200)
• “Parameter <name> not found in analog primitive <name> for instance <name>.
Parameter not found in an analog primitive ( spice primitive, spice subcircuit, spice model card ).
Example
$ Smartspice netlist
.SUBCKT srlc2 in out w=10u
R1 in tmp 200
L1 tmp out 125m
C1 out 0 1u
.ENDS srlc
// Verilog-A source file
srlc1 #(.c(1u)) s1(out, grnd);
Example
‘define MY_MAX(x,y,z) if(x > y) then x + z else y + z
val = ‘MY_MAX(val0, val1); //ERROR: 3 arguments expected.
• “Preprocessor Error : Can not redefine <macro name>, already used as directive name.”
The macro name specified in the ‘define directive is already used. Rename macro name.
Example
‘define MY_MAX(x,y,z) if(x > y) then x + z else y + z
val = ‘MY_MAX; //ERROR: 3 arguments expected.
This means that the compiler is unable to determine the exact cause of the error. To find the problem,
look at the referenced line syntax. Look also at the preceding line to see if there is anything wrong
with it, such as a missing semicolon. For example, the following module is missing a semicolon in line
9.
Example
‘include "discipline.h"
module probe_v2(vout, vin_p, vin_n);
input vin_p, vin_n;
output vout;
electrical vout, vin_p, vin_n;
analog begin
$strobe("hi") // ERROR! Missing semicolon.
$strobe("lo");
V(vout) <+ V(vin_p,vin_n);
end
endmodule
Example
$strobe(int_val); // ERROR: string argument expected instead of integer
• “<task name> system task requires an integer variable as first argument (channel id).”
Wrong type for the first argument of a task. Example:
$fstrobe("=== first line ==="); // ERROR: missing channel id argument
• “Unknown discipline or type ’electrical’. To use ’electrical’ as a discipline, please include the
standard file ’discipline.h’.”
The line ‘include "discipline.h" has to be added at the beginning of the file so standard disciplines can
be referenced.
Example
analog function real chopper;
input sw, in;
V(if0) <+ gain * chopper(V(rf)); // ERROR: 2 arguments expected.
Example
if ( V(Control) > 1 )
I(a_T,b_T) <+ V(a_T,b_T)/Ron; // WARNING
• “Internal node <node name> not used. The design might not converged.”
Every internal nodes must be referenced at least once in a contribution statement. This will avoid
having a Spice singular matrix. In a hierarchical design, the condition has be true only at one
hierarchy level.
Example
defparam top.p = 2; // WARNING: top is not an instance name.
• (VERILOGA): error in absdelay for <expression>: delay amount argument has to be a positive
number (was <number>)
Delay argument in the absdelay analog function must be a positive number.
• (VERILOGA): <file name>, line <number>: Argument to <function name> function outside
domain range (<number>), returning sqrt(0.0)
Run-time domain error, make sure that arguments are within the function’s domain.
• (VERILOGA): <file name>, line <number>: division operand equals zero, returning 1.0
Run-time check for division operand.
Example
parameter real param1 = 5.0;
// ERROR : default value is outside validity range.
• (VERILOGA): Model <ident name> from file <file name> already exits as a model card.
Duplicate model name. Look at all VERILOG-A module names declared in the used VERILOG-A files and at
all VLG model cards. Supress or rename duplicates.
• (VERILOGA): Not enough channel files to open file: <file name>. Limit is 31.
Too many opened files.
• (VERILOGA): when setting real parameter id <number> with value <value> for analog primitive
<name>: <error message>
• Error: (VERILOGA): Wrong number of ports in input deck for instance <ident name>. Model
<ident name> requires <number> port(s). <number> found(s).
The number of ports in the netlist for a YVLG device does not match the number of ports in the
corresponding VERILOG-A module definition.
Example
$ In the smartspice netlist
YVLGper
1 2 zero_div $ ERROR: Only 1 port expected.
Example
p1B1 = W*cos(a1)*pow((fi_d-fi_sl),2.0)/
(pow(d_dep,2.0)*(tan(a1)+tan(a2)))*miu_sa1_var*eps_ox;
2 qε si NSUB ⋅ PHI
VTO = vfb + type ----------------------------------------------------
- + PHI
COX
where:
vfb = flatband voltage
type =1 for NMOS and -1 for PMOS
PHI (2φf ) is the surface potential
KP - Intrinsic Transconductance
The intrinsic transconductance, KP, may be specified. A specified value overrides any calculation or
default value in the model. If KP is not specified, but U0 and TOX (COX) are specified, then:
U 0 ⋅ ε ox
KP = U 0 ⋅ COX = -------------------
-
TOX
2 ⋅ q ⋅ ε si ⋅ NSUB
GAMMA = ------------------------------------------------
-
COX
If values for UCRIT and UEXP are not specified, default values of 1.0E4 V/cm and 0, respectively, are
assigned. A zero value for UEXP effectively removes all variable mobility effects from the model.
LD = 0.75 ⋅ XJ
vb -
x
--------
ibx = IS ⋅ e
VT
– 1 where x = S or D
KT
VT ( V thermal ) = ---------
q
The substrate to source and substrate to drain diode models contain a resistance in parallel with the
current generator described above. This shunt resistance has a default value of 1.0E12 ohms.
∫
Qi 1
VFB = PHIMS – ----------- – ------- ρox ( x )x dx
Cox ε ox 0
CBD and CBS - Zero Bias Substrate to Drain and Substrate to Source Junction
Capacitance
The zero bias substrate to drain and substrate to source capacitance may be specified or calculated:
CBX = CJ ⋅ AX where X = S or D.
If CBS or CBD is specified the CJ is overridden. The depletion capacitors are a function of the voltage
across the PN junction. The expression of this junction capacitance is divided into two regions:
VBX ( X = S or D ) ≥ FC ⋅ PB and VBX ≤ FC ⋅ PB to account for the high injection effects.
Energy Gap:
The energy gap width is defined by the expression:
2
t
EG ( t ) = 1.16 – 7.02 E – 4 ⋅ --------------------
t + 1108
Define:
EG EG
f = -------------------------- – -------------
vt ( tnom ) vt ( t )
f
----
N
IS ( t ) = IS ⋅ e
f
----
N
JS ( t ) = JS ⋅ e
f
----
N
JSW ( t ) = JSW ⋅ e
t t EG ( tnom ) EG ( t )
VJ ( t ) = VJ ⋅ --------------- – vt ( t ) ⋅ 3 ⋅ 1 n --------------
- + ----------------------------- – ----------------
tnom tnom vt ( tnom ) vt ( t )
VJ ( t )
CJ ( t ) = CJ ⋅ 1 + MJ ⋅ 4 ⋅ 10 e – 4 ⋅ ∆t – --------------- + 1
VJ
VJSW ( t )
CJSW ( t ) = CJSW ⋅ 1 + MJSW ⋅ 4 ⋅ 10 e – 4 ⋅ ∆t – ------------------------- + 1
VJSW
Surface Potential
t EG ( tnom ) EG ( t )
PHI ( t ) = PHI ⋅ --------------- – vt ( t ) ⋅ 3 ⋅ ln --------------
t
tnom - ⋅ ----------------------------- – ----------------
tnom vt ( tnom ) vt ( t )
Threshold Voltage
EG ( tnom ) – EG ( t ) PH ( t ) – PHI
VTO ( t ) = VTO + ---------------------------------------------------- + type ⋅ -----------------------------------
2 2
The capacitance of Figure 14-1 is separated into three types. The first type includes the capacitors
CBD and CBS which are associated with the back biased depletion region between the drain and
substrate, and the source and the substrate. The second type includes CGD, CGS and CGB which are
all common to the gate and are dependent upon the operating capacitor of the transistor. The third
type includes parasitic capacitors which are independent of the operating conditions.
The resistors RD and RS (Figure 14-1) represent the ohmic resistance of the drain and source
respectively. These resistors are transformed into conductances by taking their reciprocals:
drain conductance = 1.0/RD
and
source conductance = 1.0/RS
Figure 14-2: Large Signal Charge Storage Capacitors of the MOS Device
Figure 14-2 can also represent diodes, the pn junctions between the source and substrate, and the
drain and substrate. For proper transistor operation these diodes are always reversed biased. Their
purpose in the dc model is primarily to model leakage currents. These currents are expressed as:
i BD = IS exp -------------- – 1
VBD
KT
and
i BS = IS exp ------------- – 1
VBS
KT
The depletion capacitors are a function of the voltage across the pn junction. The expression of this
junction - depletion capacitance is divided into two regions in order to account for the high injection
effects. The first is given as:
– MJ
VBX
CBX = CJ ⋅ AX ⋅ 1 – -------------
PB
qε si NSUB
CJ ≅ ----------------------------
-
ZDPB
where:
PB = bulk junction Potential
FC = forward bias non-ideal junction capacitance coefficient
MJ = bulk junction grading coefficient
CJ ⋅ AX
1 – ( 1 + MJ )FC + MJ -------------
VBX
CBX = -----------------------------------
( 1 – FC )
1 + MJ PB
To more closely model the depletion capacitance, break it into bottom and side wall components.
For VBX ≤ FC ⋅ PB :
CJ ⋅ AX CJSW ⋅ PX
CBX = ---------------------------------------
MJ
- + -----------------------------------------------
-
VBX VBX MJSW
1 – ------------- 1 – -------------
PB PB
CJ ⋅ AX
1 – ( 1 + MJ )FC + MJ -------------
VBX
CBX = -----------------------------------
( 1 – FC )
1 + MJ PB
CJSW ⋅ PX
- 1 – ( 1 + MJSW )FC + ------------- MJSW
VBX
------------------------------------------
( 1 – FC )
1 + MJSW PB
where:
AX = area of source (X = S) or drain (X = D)
PX = perimeter of source (X = S) or drain (X = D)
CJSW = zero bias bulk-source/drain sidewall capacitance
MJSW = bulk - source/drain sidewall grading coefficient
MJ = bulk junction grading coefficient
CGXO (X = S or D) is the overlap capacitance in f/m for the gate - source or gate - drain overlap. The
difference between the mask W and the actual W is due to the encroachment of the field oxide under
the silicon nitride. The expressions for gate - source/drain overlap capacitance are:
where LD is the lateral diffusion component, Weff is the effective channel width, and CGXO (X = S or
D) is the overlap capacitance in F/M for the gate - source or gate - drain overlap.
A third overlap capacitance that can be significant is the overlap between the gate and the bulk. This
gate - bulk overlap capacitance is a function of the effective length of the channel. The gate - bulk
overlap capacitance is expressed by:
CGB = CGBO ⋅ Leff
The gate - channel capacitance is given as:
C 3 = Weff ( L – 2 LD ) ⋅ Cox = Weff ⋅ Leff ⋅ Cox
The term Leff is the effective channel length resulting from the mask - defined length being reduced by
the amount of lateral dopant diffusion. The channel to bulk, C 4, capacitance is a depletion capacitance
that will vary with voltage as CBS and CBD capacitances.
Cutoff Region
ids = 0 for vgs ≤ vth
Turn-on Region
where:
vde = min (vds, vdsat)
W eff W eff
beta = KP ⋅ ----------- = u eff ⋅ COX ⋅ -----------
L eff L eff
Leff = L – 2 ( LD ) Weff = W
and
GAMMA ⋅ fs
fb = fn + -----------------------------------------------
1⁄2
-
4 ⋅ ( PHI + vsb )
The narrow width effect is modeled by the parameter fn:
ε si ⋅ π ⋅ DELTA
fn = ----------------------------------------
-
2 ⋅ COX ⋅ W eff
1⁄2
wp = xd ⋅ ( PHI + vsb )
2 ⋅ ε si 1⁄2
xd = --------------------------
q ⋅ NSUB
Threshold Voltage
8.14 e – 22 ⋅ ETA 1⁄2
- ⋅ vds + GAMMA ⋅ fs ⋅ ( PHI + vsb ) + fn ⋅ ( PHI + vsb )
vth = vbi – ------------------------------------------
3
COX ⋅ Leff
where vbi = vgb + PHI
1⁄2
or vbi = VTO – GAMMA ⋅ PHI
Saturation Voltage
Saturation voltage is controlled by the parameter VMAX:
vgs – vth
vsat = -------------------------
1 + fb
2 2 1⁄2
vdsat = vsat + vc – ( vsat + vc )
where
VMAX ⋅ L eff
vc = ---------------------------------
usurf
If VMAX is specified:
usurf
u eff = -------------------- for VMAX > 0
vde
1 + ----------
vc
where cef is the critical electric field at the pinch-off point. It is computed as:
vc ⋅ ( vc + vdsat )
cef = --------------------------------------------
L eff ⋅ vdsat
ids
ids = -------------------
∆L
1 – ---------
L eff
Subthreshold Current
In the subthreshold region of operation, the subthreshold current is dominated by the fast surface
state parameter NFS.
Define:
von = vth + fast for NFS > 0
where:
1⁄2
KT q ⋅ NFS GAMMA ⋅ fs ⋅ ( PHI + vsb ) + fn ⋅ ( PHI + vsb )
fast = --------- ⋅ 1 + --------------------- + -----------------------------------------------------------------------------------------------------------------------------------
q COX 2 ⋅ ( PHI + vsb )
The drain ids current is:
Ids = Ids at Von, Vdmin,
and
Figure 14-3: Overlap Capacitances of a MOS Transistor and the imact on L and W
The five capacitance elements associated with the MOSFET model topology are described here. The
capacitances CBS and CBD are standard voltage variable junction capacitances. The remaining three
elements represent various gate capacitances, and contain both fixed and variable terms. The fixed
terms are specified as the parameters CGSO, CGDO, and CGBO in the model variable list. They
represent metallization overlap capacitances, as described in Figure 14-3. A variable portion of the
gate to channel capacitance is added to each of these fixed values, depending upon the region of
transistor operation. In the region below cutoff, the entire gate to channel capacitance is assigned to
CGB. As the device operation transitions into the saturated region, up to two-thirds of the channel
capacitance is transferred to CGS. The equation governing the transition is:
von – vgs
CGB = -------------------------- ⋅ ( COX ⋅ W ⋅ L + CGB 0 ⋅ Leff )
PHI ( T )
Setup Parameters
Basic Parameters
Matching Parameters
Noise Parameters
COX = ε ox ⁄ TOX
If NSUB is given and PHI is missing, the bulk Fermi-potential is evaluated using:
PHI = 2 ⋅ V t ⋅ ln ( NSUB ⁄ n i )
If VFB is given and VTO is missing, the long-channel threshold voltage is evaluated using:
UCEX
UCRIT ( T ) = UCRIT ⋅ --------------------
T
TNOM
where E g ( T ) andE g ( TNOM )are the energy gap of silicon evaluated at T and TNOM respectively.
V G = V GB = V GS – V BS
V S = V SB = – V BS
V D = V DB = V DS – V BS
The related transconductances are obtained through derivation of the drain current:
∂I DS
g mg =
∂VG
∂I DS
g ms = –
∂ VS
∂I DS
g md =
∂VD
The “standard” transconductances (related to the voltages where the source is taken as reference) are
evaluated using the following relationships:
∂I DS
gm = = gmg
∂ V GS
∂I DS
g mbs = = gms – g mg – g md
∂ V BS
∂I DS
g ds = = g md
∂ V DS
where:
k⋅T
V t = ------------
q
is the thermal voltage at the device operating temperature, n is the slope factor, β is the transconduc-
tance factor, i f is the forward normalized current and i′ r is the reverse normalized current.
AVTO
VTO a = VTO + ---------------------------------------------------------
NP ⋅ W eff ⋅ NS ⋅ L eff
KP a = KP ⋅ 1 + ---------------------------------------------------------
AKP
NP ⋅ W eff ⋅ NS ⋅ L eff
AGAMMA
GAMMA a = GAMMA + ---------------------------------------------------------
NP ⋅ W eff ⋅ NS ⋅ L eff
where:
2 ⋅ Q0 1
∆V RSCE = -------------- ⋅ ------------------------------------------------------------2-
COX
1 + --- ⋅ ( ξ + ξ + C ε )
1 2
2
L eff
ξ = C A ⋅ 10 ⋅ --------- – 1
LK
–3 2
C ε = 4 ⋅ ( 22 × 10 )
C A = 0.028
where:
1 2 2
V′ S ( D ) = --- ⋅ [ V S ( D ) + PHI + ( V S ( D ) + PHI ) + ( 4 ⋅ V t ) ]
2
and
GAMMA 2 GAMMA
V G′ – PHI – GAMMA a ⋅ V G′ + ---------------------------a- – ---------------------------a- ( V G′ > 0 )
VP0 = 2 2
– PHI ( V G′ ≤ 0 )
To prevent the effective substrate factor from becoming negative, the following equation is used:
1 o o2
γ′ = --- ⋅ ( γ + γ + 0.1 ⋅ V t )
2
Slope Factor
GAMMA a
n = 1 + --------------------------------------------------------
-
2 ⋅ V P + PHI + 4 ⋅ V t
2
-------------------------------------------------- ( v ≥ – 0.35 )
z 0 = 1.3 + v – ln ( v + 1.6 )
1.55 + exp ( – v ) ( – 15 ≤ v < – 0.35 )
2 + z0
z 1 = ---------------------------------
-
1 + v + ln ( z 0 )
1 + v + ln ( z )
---------------------------------
1
- ( v > – 15 )
2 + z1
y =
-----------------------------
1
2 + exp ( – v )- ( v ≤ – 15 )
F(v) = y ⋅ (1 + y)
1 Vt VC
--- + ------- ⋅ i f – --- ⋅ ln ( i f ) – --- + V t ⋅ ln ------------- – 0.6
3 1
V′ DSS = V C ⋅
4 V C
4 2 2 ⋅ V t
where
V C = UCRIT ⋅ NS ⋅ L eff
V P – V ds – V S – V′ DSS + ∆V + ( V ds – V′ DSS ) + ∆V
2 2 2 2
i′ r = F --------------------------------------------------------------------------------------------------------------------------------------------------
Vt
where:
VD – VS
V ds = --------------------
-
2
and:
V DSS
∆V = 4 ⋅ V t ⋅ ------ + LAMBDA ⋅ i f – ------------
1
-
64 Vt
1 Vt 1
V DSS = V C ⋅ --- + ------- ⋅ i f – ---
4 VC 2
The variable VDSS used in this formulation corresponds approximately to half the value of the actual
saturation voltage. However, the related output variable is estimated with a different expression
which gives more realistic values in weak inversion region.
L min = NS ⋅ L eff ⁄ 10
and:
V ds + V ip
L′ = NS ⋅ L eff – ∆L + -----------------------
-
UCRIT
2 2 2 2
V ip = V DSS + ∆V – ( V ds – V DSS ) + ∆V
ε si
LC = ------------- ⋅ XJ
COX
V ds – V ip
∆L = LAMBDA ⋅ L C ⋅ ln 1 + --------------------------------
-
L C ⋅ UCRIT
Transconductance Factor
β′ 0
β = ------------------------------------------------------------------------
COX
1 + ------------------ ⋅ V t ⋅ q B + η ⋅ q I
E 0 ⋅ ε si
where:
β′ 0 = β 0 ⋅ 1 + ------------------ ⋅ q B 0
COX
E 0 ⋅ ε si
NP ⋅ W eff
β 0 = KP a ⋅ -------------------------
L eq
q B 0 = GAMMA a ⋅ PHI
1 ⁄ 2 ( NMOS )
η =
1 ⁄ 3 ( PMOS )
The normalized depletion and inversion charges ( q B and q I respectively) are defined in the Charge
Equations section above.
For compatibility with EKV model versions prior to v2.6, the former mobility reduction model which
uses the parameter THETA is also available as an option. When THETA is given and E0 is not given,
the simpler expression is used:
β0
β = ---------------------------------------------
-
1 + THETA ⋅ V′ P
where:
1 2 2
V′ P = --- ⋅ ( V P + V P + 2 ⋅ V t )
2
– IBB ⋅ L C
- ⋅ V ib ⋅ exp --------------------------
IBA
I DS ⋅ ----------
IBB V ib
( V ib > 0 )
I DB =
0 ( V ib ≤ 0 )
IIRAT model parameter leads to direct a portion of the substrate current from the drain to the source.
1
xf = --- + i f
4
1
xr = --- + i r
4
and:
GAMMA a
n q = 1 + -----------------------------------------------------
-
–6
2 ⋅ V P + PHI + 10
Q ( D, S, G, B ) = C ox ⋅ V t ⋅ q ( D, S, G, B )
where:
C ox = COX ⋅ NP ⋅ W eff ⋅ NS ⋅ L eff
4 3 ⋅ x r + 6 ⋅ xr ⋅ x f + 4 ⋅ x r ⋅ x f + 2 ⋅ x f 1
3 2 2 3
q D = – n q ⋅ ------ ⋅ -------------------------------------------------------------------------------------------------
- – ---
15 2
2
( xf + xr )
3 2 2 3
4 3 ⋅ x f + 6 ⋅ x f ⋅ xr + 4 ⋅ x f ⋅ x r + 2 ⋅ xr 1
q S = – n q ⋅ ------ ⋅ -------------------------------------------------------------------------------------------------
- – ---
15 2
2
( xf + xr )
q G = – qI – q B
4 x f + x f ⋅ x r + xr
2 2
q I = q S + q D = – n q ⋅ --- ⋅ ------------------------------------------ – 1
3 x f + xr
where
2 x r + x r + x f ⁄ 2
2
c gs = --- ⋅ 1 – ------------------------------------
-
3 (x + x )
2
f r
2 x f + x f + x r ⁄ 2
2
c gd = --- ⋅ 1 – ------------------------------------
-
3 (x + x )
2
f r
nq – 1
c gb = --------------- ⋅ ( 1 – c gs – c gd )
nq
c sb = ( n q – 1 ) ⋅ c gs
c db = ( n q – 1 ) ⋅ c gd
9
This model is suitable for High Frequency analysis ( f > 10 GHz).
Flicker Noise
The expression is similar to the standard NLEV=2 flicker noise model:
2
KF ⋅ g m
S flicker = -----------------------------------------------------------------------------------
AF
-
NP ⋅ W eff ⋅ NS ⋅ L eff ⋅ COX ⋅ f
Control Parameters
All binnable model parameters are internally calculated using the same expression:
PL PW PP
P = P 0 + -------- - + --------------------------
- + ---------- -
L eff W eff L eff × W eff
The effective values of LREF and WREF are computed in a manner consistent with the effective
channel width and length (XW and XL are replaced by XWREF and XLREF, respectively).
DC Parameters
JSW Side wall junction saturation current density per unit A⋅m
–1 0.0
length
W and L Parameters
Bound Parameters
Process Parameters
A
W eff = W ⋅ SCALE ⋅ WMLT + XW ⋅ SCALM (for ACM equations)
IV Model
Bias-Independent Quantities:
A
W′ eff = W eff – 2 ⋅ dW′
where
WL WW WWL
dW′ = WINT + -----------------
WLN
+ ------------------
WWN
- + -----------------------------------------
WWN
-
WLN
L scaled W scaled L scaled ⋅ W scaled
LL LW LWL
dL = LINT + ----------------
LLN LWN
- + -----------------------------------------
- + ------------------ LLN LWN
-
L scaled W scaled L scaled ⋅ W scaled
Bias-Dependent Effective Channel Width (for Vdsat, Vasat, Vdseff, and Idso equations):
CV Model
L active = L ⋅ SCALE ⋅ LMLT + XL ⋅ SCALM – 2 ⋅ δL eff
A
W active = W eff – 2 ⋅ δW eff
where
WL WW WWL
δW eff = DWC + ----------------
WLN
- + ------------------
WWN
- + -----------------------------------------
WWN
-
WLN
L scaled W scaled L scaled ⋅ W scaled
LL LW LWL
δL eff = DLC + ----------------
LLN
- + ------------------
LWN
- + -----------------------------------------
LLN LWN
-
L scaled W scaled L scaled ⋅ W scaled
T
T ratio = --------------------
TNOM
where T is the instance temperature and TNOM is a model parameter corresponding to the
temperature at which model parameters have been extracted,
kB ⋅ T k B ⋅ TNOM
V t = --------------
- and V tnom = ------------------------------
-
q q
UTE
U 0 ( T ) = U 0 ⋅ ( T ratio )
UA ( T ) = UA + UA 1 ⋅ ( T ratio – 1 )
UB ( T ) = UB + UB 1 ⋅ ( T ratio – 1 )
UC ( T ) = UC + UC 1 ⋅ ( T ratio – 1 )
where
ε si ⋅ X dep
lt = ---------------------- ⋅ ( 1 + DVT 2 ⋅ V bseff )
COX
ε si ⋅ X dep
l tw = ---------------------- ⋅ ( 1 + DVT 2 W ⋅ V bseff )
COX
2 ⋅ ε si ⋅ ( φ s – V bseff )
X dep = -------------------------------------------------
q ⋅ NCH
ε si ⋅ X dep 0
lt0 = ------------------------
-
COX
2 ⋅ ε si ⋅ φ s
X dep 0 = -----------------------
q ⋅ NCH
2
V bseff = V bc + 0.5 ⋅ [ V bs – V bc – δ 1 + ( V bs – V bc – δ 1 ) – ( 4 ⋅ δ 1 ⋅ V bc ) ]
δ 1 = 0.001
K1
2
V bc = 0.9 ⋅ φ s – -----------------2 if K2 > 0, otherwise V bc = – 10
4 ⋅ K2
K1
2
V bc = 0.9 ⋅ φ s – -----------------2 if K2 < 0, otherwise V bc = – 30
4 ⋅ K2
In version 3.2, the following intermediate variables are computed to account for TOXM:
TOX TOX
K 1 ox = K 1 ⋅ ------------------- and K 2 ox = K 2 ⋅ -------------------
TOXM TOXM
The expressions of V bi and φ s are given in the paragraph related to temperature dependence.
Cd
n = 1 + NFACTOR ⋅ -------------
COX
L eff L eff
( CDSC + CDSCD ⋅ V ds + CDSCB ⋅ V bseff ) ⋅ exp – D VT 1 ⋅ ----------- + 2 exp – DVT 1 ⋅ ---------
2 ⋅ lt lt
+ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
COX
CIT
+ -------------
COX
ε si
C d = -----------
-
X dep
Mobility
MOBMOD = 1
U0
µ eff = ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------2
V gsteff + 2 ⋅ V th V gsteff + 2 ⋅ V th
1 + ( UA + UC ⋅ V bseff ) ⋅ --------------------------------------- + UB ⋅ ---------------------------------------
TOX TOX
MOBMOD = 2
U0
µ eff = -----------------------------------------------------------------------------------------------------------------------------------2
V gsteff V gsteff
1 + ( UA + UC ⋅ V bseff ) ⋅ ---------------- + UB ⋅ ----------------
TOX TOX
MOBMOD = 3
U0
µ eff = --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
V gsteff + 2 V th V gsteff + 2 V th 2
1 + UA ⋅ ----------------------------------- + UB ⋅ ----------------------------------- ⋅ ( 1 + UC ⋅ V bseff )
TOX TOX
2
–b – b – 4 ⋅ a ⋅ c
V dsat = ----------------------------------------------
2⋅a
2
c = ( V gsteff + 2 ⋅ V t ) ⋅ E sat ⋅ L eff + 2 ⋅ ( V gsteff + 2 ⋅ V t ) ⋅ W eff ⋅ VSAT ⋅ COX ⋅ R ds
λ = A 1 ⋅ V gsteff + A 2
For Rds = 0, λ = 1
K1 A 0 ⋅ L eff
A bulk = 1 + -------------------------------------- ⋅ ----------------------------------------------------
2 ⋅ φ s – V bseff L eff + 2 ⋅ XJ ⋅ X dep
2
L eff B0 1
⋅ 1 – AGS ⋅ V gsteff ⋅ ---------------------------------------------------- + ------------------------- ⋅ -----------------------------------------------
L eff + 2 ⋅ XJ ⋅ X dep W eff + B 1 1 + KETA ⋅ V bseff
2 ⋅ VSAT
E sat = -------------------------
µ eff
Effective Vds
1 2
V dseff = V dsat – --- ⋅ ( V dsat – V ds – DELTA + ( V dsat – V ds – DELTA ) + 4 ⋅ DELTA ⋅ V dsat )
2
Drain Current
I dso V ds – V dseff V ds – V dseff
I ds = --------------------------------- ⋅ 1 + -----------------------------
- ⋅ 1 + -----------------------------
-
R ds ⋅ I dso VA V ASCBE
1 + -----------------------
V dseff
V dseff
W eff ⋅ µ eff ⋅ COX ⋅ V gsteff ⋅ 1 – A bulk ⋅ ------------------------------------------------- ⋅ V dseff
2 ⋅ ( V gsteff + 2 ⋅ V t )
I dso = ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
L eff ⋅ [ 1 + V dseff ⁄ ( E sat ⋅ L eff ) ]
PVAG ⋅ V gsteff 1 –1
V A = V Asat + 1 + --------------------------------------- ⋅ ------------------ + -----------------------
1
E sat ⋅ L eff V ACLM V ADIBLC
L eff L eff
θ rout = PDIBLC 1 ⋅ exp – DROUT ⋅ ------------- + 2 ⋅ exp – DROUT ⋅ --------- + PDIBLC 2
2 ⋅ l t 0 lt 0
– PSCBE 1 ⋅ l itl
-------------------- = ------------------------- ⋅ exp ----------------------------------------
1 PSCBE 2
V ASCBE L eff V ds – V dseff
A bulk ⋅ V dsat
E sat ⋅ L eff + V dsat + 2 ⋅ R ds ⋅ VSAT ⋅ C OX ⋅ W eff ⋅ V gsteff ⋅ 1 – ------------------------------------------------ -
2 ⋅ ( V gsteff + 2 ⋅ V t )
V Asat = ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
2 ⁄ λ – 1 + R ds ⋅ VSAT ⋅ C OX ⋅ W eff ⋅ A bulk
ε si ⋅ TOX ⋅ XJ
l itl = -------------------------------------
ε ox
Substrate Current
I dso V ds – V dseff
I sub = -------------------------- + ALPHA 1 ⋅ ( V ds – V dseff ) ⋅ exp – ------------------------------ ⋅ --------------------------------- ⋅ 1 + -----------------------------
ALPHA 0 BETA 0
-
L eff V ds – V dseff R ds ⋅ I dso VA
1 + -----------------------
V dseff
V gs – V FB – φ s = V poly + V ox
ε ox
2
2
- ⋅ ( V gs – V FB – φ s – V poly ) – V poly = 0
---------------------------------------------------------------------
2 ⋅ q ⋅ ε si ⋅ N GATE ⋅ TOX 2
q ⋅ ε si ⋅ N GATE ⋅ TOX 2 2 ⋅ ε ox 2 ⋅ (V
gs – V FB – φ s )
V gseff = V FB + φ s + -------------------------------------------------------------- ⋅ 1 + -------------------------------------------------------------- – 1
ε ox
2
q ⋅ ε si ⋅ N GATE ⋅ TOX 2
Drain/Source Resistance
RDSW ⋅ [ 1 + PRWG ⋅ V gsteff + PRWB ⋅ ( φ s – V bseff – φ s ) ]
Rds = ----------------------------------------------------------------------------------------------------------------------------------------------------------------
WR
-
6
( 10 ⋅ W′ eff )
CAPMOD=0
Q overlap, s
------------------------- = ( CGSO + CF ) ⋅ V gs
W active
CAPMOD=1
if (Vgs < 0)
else
Q overlap, s
------------------------- = ( CGSO + CF + CKAPPA ⋅ CGSL ) ⋅ V gs
W active
CAPMOD=2
1 2
V gs, overlap = --- ⋅ ( V gs + δ ) – ( V gs + δ ) + 4 ⋅ δ where δ = 0.02
2
Instrinsic Charges
CAPMOD=0
• Accumulation region (Vgs < VFBCV + Vbs)
Q sub = – Q g
Q inv = 0
K1 4 ⋅ ( V gs – V bs – VFBCV )
2
Q b = – W active ⋅ L active ⋅ COX ⋅ ---------- ⋅ – 1 + 1 + ----------------------------------------------------------------
-
2 K1
2
Qg = –Qb
Q inv = 0
V gs – V th
V dsat, cv = -----------------------
-
A′ bulk
CLC CLE
A′ bulk = A bulk 0 ⋅ 1 + -------------
L eff
K1 A 0 ⋅ L eff B0 1
A bulk 0 = 1 + -------------------------------------- ⋅ ---------------------------------------------------
- + --------------------------- ⋅ -----------------------------------------
2 ⋅ φ s – V bseff L eff + 2 ⋅ XJ ⋅ X dep W′ eff + B 1 1 + KETA ⋅ V bs
V th = VFBCV + φ s + K 1 ⋅ φ s – V bseff
2
V ds A′ bulk ⋅ V ds
Q g = W active ⋅ L active ⋅ C OX ⋅ V gs – VFBCV – φ s – --------
- + ---------------------------------------------------------------------------
-
2
A′ bulk ⋅ V ds
12 ⋅ V gs – V th – -----------------------------
2
2
A′ bulk ⋅ V ds A′ bulk ⋅ V ds
2
Q inv = – W active ⋅ L active ⋅ C OX ⋅ V gs – V th – ----------------------------- + ---------------------------------------------------------------------------
-
2 A′ bulk
12 ⋅ V gs – V th – ---------------
- ⋅V
2 ds
2
( 1 – A′ bulk ) ⋅ V ds ( 1 – A′ bulk ) ⋅ A′ bulk ⋅ V ds
Q b = W active ⋅ L active ⋅ C OX ⋅ VFBCV – V th + φ s + ------------------------------------------
- + ---------------------------------------------------------------------------
-
2 A′ bulk
12 ⋅ V gs – V th – ---------------- ⋅ V ds
2
Q s = Q d = 0.5 ⋅ Q inv
2
A′ bulk ⋅ V ds A′ bulk ⋅ V ds
2
= – W active ⋅ L active ⋅ C OX ⋅ V gs – V th – ----------------------------- + ---------------------------------------------------------------------------
-
2 A′ bulk
12 ⋅ V gs – V th – ---------------- ⋅ V ds
2
Otherwise,
V dsat
Q g = W active ⋅ L active ⋅ C OX ⋅ V gs – VFBCV – φ s – -------------
3
1
Q s = Q d = – --- ⋅ W active ⋅ L active ⋅ C OX ⋅ ( V gs – V th )
3
( 1 – A′ bulk ) ⋅ V dsat
Q b = – W active ⋅ L active ⋅ COX ⋅ VFBCV + φ s – V th + -----------------------------------------------
-
3
2
V ds A′ bulk ⋅ V ds
Q g = W active ⋅ L active ⋅ C OX ⋅ V gs – VFBCV – φ s – --------
- + ---------------------------------------------------------------------------
-
2 A′ bulk ⋅ V ds
12 ⋅ V gs – V th – -----------------------------
2
2
A′ bulk ⋅ V ds A′ bulk ⋅ V ds
2
Q inv = – W active ⋅ L active ⋅ C OX ⋅ V gs – V th – ----------------------------- + ---------------------------------------------------------------------------
-
2 A′ bulk
12 ⋅ V gs – V th – ---------------- ⋅ V ds
2
2
( 1 – A′ bulk ) ⋅ V ds ( 1 – A′ bulk ) ⋅ A′ bulk ⋅ V ds
Q b = W active ⋅ L active ⋅ C OX ⋅ VFBCV – V th + φ s + ------------------------------------------
- – ---------------------------------------------------------------------------
-
2 A′ bulk
12 ⋅ V gs – V th – ---------------- ⋅ V ds
2
Q d = – W active ⋅ L active ⋅ C OX
( V gs – V th ) A′ bulk ⋅ V ds ⋅ ( V gs – V th ) ( A′ bulk ⋅ V ds )
2 2
Qs = –( Qg + Qb + Qd )
otherwise,
V dsat
Q g = W active ⋅ L active ⋅ C OX ⋅ V gs – VFBCV – φ s – -------------
3
4
Q d = – ------ ⋅ W active ⋅ L active ⋅ C OX ⋅ ( Vgs – V th )
15
( 1 – A′ bulk ) ⋅ V dsat
Q b = – W active ⋅ L active ⋅ C OX ⋅ VFBCV + φ s – V th + -----------------------------------------------
-
3
Qs = –( Qg + Qb + Qd )
2
V ds A′ bulk ⋅ V ds
Q g = W active ⋅ L active ⋅ C OX ⋅ V gs – VFBCV – φ s – --------
- + ---------------------------------------------------------------------------
-
2
A′ bulk ⋅ V ds
12 ⋅ V gs – V th – -----------------------------
2
2
A′ bulk ⋅ V ds A′ bulk ⋅ V ds
2
Q inv = – W active ⋅ L active ⋅ C OX ⋅ V gs – V th – ----------------------------- + ----------------------------------------------------------------------------
2 A′ bulk
12 ⋅ V gs – V th – ---------------- ⋅ V ds
2
2
( 1 – A′ bulk ) ⋅ V ds ( 1 – A′ bulk ) ⋅ A′ bulk ⋅ V ds
Q b = W active ⋅ L active ⋅ C OX ⋅ VFBCV – V th + φ s + ------------------------------------------
- – ---------------------------------------------------------------------------
-
2 A′ bulk
12 ⋅ V gs – V th – ---------------- ⋅ V ds
2
2
V gs – V th A′ bulk ( A′ bulk ⋅ V ds )
Q d = – W active ⋅ L active ⋅ C OX ⋅ -----------------------
- + ---------------- ⋅ V ds – ---------------------------------------------------------------------------
-
2 4 A′ bulk
24 ⋅ V gs – V th – ---------------- ⋅ V ds
2
Qs = –( Qg + Qb + Qd )
otherwise
V dsat
Q g = W active ⋅ L active ⋅ C OX ⋅ V gs – VFBCV – φ s – -------------
3
( 1 – A′ bulk ) ⋅ V dsat
Q b = – W active ⋅ L active ⋅ C OX ⋅ VFBCV + φ s – V th + -----------------------------------------------
-
3
Qd = 0
Qs = –( Qg + Qb )
CAPMOD=1
Define
and
else
K1
2 4 ⋅ ( V gs – V fb – V gsteffcv – V bs )
Q g 1 = W active ⋅ L active ⋅ C OX ⋅ ---------- ⋅ – 1 + 1 + ------------------------------------------------------------------------------
2 K1
2
Qb 1 = –Qg 1
V gsteffcv
V dsat, cv = --------------------
-
A′ bulk
CLC CLE
A′ bulk = A bulk 0 ⋅ 1 + -------------
L eff
K1 A 0 ⋅ L eff B0 1
A bulk 0 = 1 + ---------------------------- ⋅ ---------------------------------------------------
- + ------------------------- ⋅ -----------------------------------------
2 φ s – V bs L eff + 2 ⋅ XJ ⋅ X dep W eff + B 1 1 + KETA ⋅ V bs
In version 3.2, the model parameters NOFF and VOFFCV are supported:
V gs – V th – VOFFCV
V gsteffcv = NOFF ⋅ n ⋅ V t ⋅ ln 1 + exp ---------------------------------------------------------
NOFF ⋅ n ⋅ V t
2
V ds A′ bulk ⋅ V ds
Q g = Q g 1 + W active ⋅ L active ⋅ C OX ⋅ V gsteffcv – --------- + -------------------------------------------------------------------------
2 A′ bulk
12 ⋅ V gsteffcv – ---------------- ⋅ V ds
2
2
1 – A′ bulk ( 1 – A′ bulk ) ⋅ A′ bulk ⋅ V ds
Q b = Q b 1 + W active ⋅ L active ⋅ C OX ⋅ ------------------------- ⋅ V – -------------------------------------------------------------------------
2 A′ bulk
12 ⋅ V gsteffcv – ---------------- ⋅ V ds
ds
2
2
W active ⋅ L active ⋅ C OX A′ bulk A′ bulk ⋅ V ds
Q s = Q d = – ----------------------------------------------------------- ⋅ V gsteffcv – ---------------- ⋅ V ds + -------------------------------------------------------------------------
2 2 A′
12 ⋅ V gsteffcv – ---------------- ⋅ V ds
bulk
2
Qd = –( Qg + Qb + Qs )
W active ⋅ L active ⋅ C OX
2
A′ bulk ( A′ bulk ⋅ V ds )
Q s = – ----------------------------------------------------------- ⋅ V gsteffcv + ---------------- ⋅ V ds – -------------------------------------------------------------------------
2 2 A′ bulk
12 ⋅ V gsteffcv – ---------------- ⋅ V ds
2
Qd = –( Qg + Qb + Qs )
V dsat
Q g = Q g 1 + W active ⋅ L active ⋅ C OX ⋅ V gsteffcv – -------------
3
( V gsteffcv – V dsat )
Q b = Q b 1 – W active ⋅ L active ⋅ C OX ⋅ ----------------------------------------------
3
(i) 50/50 Channel-charge Partition
W active ⋅ L active ⋅ C OX
Q s = Q d = – ----------------------------------------------------------- ⋅ V gsteffcv
3
(ii) 40/60 Channel-charge Partition
2 ⋅ W active ⋅ L active ⋅ C OX
Q s = – ------------------------------------------------------------------- ⋅ V gsteffcv
5
Qd = –( Qg + Qb + Qs )
Qd = –( Qg + Qb + Qs )
capmod=2
The definition of Vfb is the same as in CAPMOD=1.
Q inv = Q s + Q d
2
V FBeff = V fb – 0.5 ⋅ V 3 + V 3 + 4 ⋅ δ 3 ⋅ V fb where V 3 = V fb – V gb – δ 3 and δ 3 = 0.02
V gsteff, cv
V dsat, cv = ----------------------
-
A′ bulk
CLE
A′ bulk = A bulk 0 ⋅ 1 + -----------------
CLC
L active
K1 A 0 ⋅ L eff B0 1
A bulk 0 = 1 + -------------------------------------- ⋅ ---------------------------------------------------
- + --------------------------- ⋅ -----------------------------------------------
2 ⋅ φ s – V bseff L eff + 2 ⋅ XJ ⋅ X dep W′ eff + B 1 1 + KETA ⋅ V bseff
V gs – V th – VOFFCV
V gsteffcv = NOFF ⋅ n ⋅ V t ⋅ ln 1 + exp ---------------------------------------------------------
NOFF ⋅ n ⋅ V t
2
V cveff = V dsat, cv – 0.5 ⋅ V 4 + V 4 + 4 ⋅ δ 4 ⋅ V dsat, cv where V 4 = V dsat, cv – V ds – δ 4 and δ 4 = 0.02
2
2
A′ bulk A′ ⋅ V
Q inv = – W active ⋅ L active ⋅ C OX ⋅ V gsteffcv – ---------------- ⋅ V cveff + -------------------------------------------------------------------------------
bulk cveff
2 A′
12 ⋅ V gsteffcv – ---------------- ⋅ V cveff
bulk
2
2
1 – A ′ bulk ( 1 – A′ bulk ) ⋅ A′ bulk ⋅ V cveff
δQ sub = W active ⋅ L active ⋅ C OX ⋅ ---------------------- ⋅ V cveff + -------------------------------------------------------------------------------
2 A′ bulk
12 ⋅ V gsteffcv – ---------------- ⋅ V cveff
2
Q s = Q d = 0.5 ⋅ Q inv =
2
W active ⋅ L active ⋅ C OX A′ bulk
2
A′ bulk ⋅ V cveff
– ----------------------------------------------------------- ⋅ V gsteffcv – ---------------- ⋅ V cveff + -------------------------------------------------------------------------------
2 2 A′ bulk
12 ⋅ V gsteffcv – ---------------- ⋅ V cveff
2
W active ⋅ L active ⋅ C OX
Q d = – -------------------------------------------------------------------------2-
A′ bulk
2 ⋅ V gsteffcv – ---------------- V cveff
2
V 3 5
– --- ⋅ V gsteffcv ⋅ A′ bulk ⋅ V cveff + V gsteff ⋅ ( A′ bulk ⋅ V cveff ) – --- ⋅ ( A′ bulk ⋅ V cveff )
2 2 1 3
gsteffcv 3 5
2
V gsteffcv A′ bulk ⋅ V ds ( A′ bulk ⋅ V ds )
Q s = – W active ⋅ L active ⋅ C OX ⋅ --------------------- + ----------------------------- – -------------------------------------------------------------------------------
2 4 A′ bulk
24 ⋅ V gsteffcv – ---------------- ⋅ V cveff
2
V gsteffcv 3 ⋅ A′ bulk ⋅ V cveff
2
( A′ bulk ⋅ V cveff )
Q d = – W active ⋅ L active ⋅ C OX ⋅ --------------------- + ------------------------------------------ – ----------------------------------------------------------------------------
2 4 A′ bulk
8 ⋅ V gsteffcv – ---------------- ⋅ V cveff
2
V fb = V th 0 – φ s – K 1 ox φ s – V bseff
1 2
V gbacc = --- ⋅ [ V 0 + V 0 + 4 ⋅ δ 3 ⋅ V fb ]
2
V 0 = V fb + V bseff – V gs – δ 3
2
V FBeff = V fb – 0.5 ⋅ V 3 + V 3 + 4 ⋅ δ 3 ⋅ V fb where V 3 = V fb – V gb – δ 3 and δ 3 = 0.02
COX ⋅ C cen
COX eff = -------------------------------
-
COX + C cen
C cen = ε si ⁄ X DC
2
K lox 4 ⋅ ( V gs – V FBeff – V bseffs – V gsteff, cv )
Q sub 0 = – W active ⋅ L active ⋅ C OX eff ⋅ ------------- ⋅ – 1 + 1 + ------------------------------------------------------------------------------------------------
2
2 K lox
1 2
V cveff = V dsat – --- ⋅ ( V 1 + V 1 + 4 ⋅ δ 3 ⋅ V dsat )
2
V 1 = V dsat – V ds – δ 3
V gsteff, cv – ϕ δ
V dsat = ----------------------------------
-
A′ bulk
2
1
2
A′ bulk ⋅ V cveff
V gsteff, cv – ϕ δ – --- ⋅ A bulk ′ ⋅ V cveff + --------------------------------------------------------------------------------------------------
-
2 12 ⋅ ( V gsteff, cv – ϕ δ – A′ bulk ⋅ V cveff
⁄ 2 )
2
1 – A′ bulk ( 1 – A′ bulk ) ⋅ A ′ bulk ⋅ V cveff
δQ sub = – W active ⋅ L active ⋅ C OX eff ⋅ ------------------------- ⋅ V cveff – --------------------------------------------------------------------------------------------------
-
2 12 ⋅ ( V gsteff, cv – ϕ δ – A′ bulk ⋅ V cveff ⁄ 2 )
∂Q s, d, g, b ∂Q s, d, g, b ∂V gsteffcv ∂V th ∂V th
- + ------------------------ ⋅ ------------------------ ⋅ ------------ + ------------
C ( s, d, g, b ) ,s = ----------------------
∂V ds ∂V gsteffcv ∂V gt ∂V ds ∂V bs
∂Q s, d, g, b ∂Qs, d, g, b ∂V gsteffcv ∂V th
- + ------------------------ ⋅ ------------------------ ⋅ ------------
C ( s, d, g, b ) ,d = ----------------------
∂V ds ∂V gsteffcv ∂V gt ∂V ds
∂Q s, d, g, b ∂Q s, d, g, b ∂V gsteffcv ∂V th
- + ------------------------ ⋅ ------------------------ ⋅ ------------
C ( s, d, g, b ) ,b = ----------------------
∂V bs ∂V gsteffcv ∂V gt ∂V bs
• The total gate, drain and bulk charges (Qg, Qd and Qb respectively) are calculated. These charges
contain the variable gate (qg), drain (qd) and bulk (qb) charges as well as the charge contribution of
the overlap, bulk-drain and bulk-source capacitances.
• Sixteen derivatives of the terminal charges with respect to the terminal voltages are computed as
follows:
∂Qn
-------------
∂Vm
where n and m are gate, source, drain or bulk. These derivatives are used as transcapacitances for
small signal AC analysis.
The following BSIM3v3 device parameters can be stored, printed and/or measured using the .save,
.probe, .print and .measure statements (see the table listing all output variables)
• The variable intrinsic transcapacitances:
cggb cdgb cbgb
cgdb cddb cbdb
cgsb cdsb cbsb
• The variable bulk-drain and bulk-source capacitances: capbd and capbs
• The total gate, drain and bulk charges Qg, Qd and Qb
capgdo, gate-drain overlap capacitance
capgso, gate-source overlap capacitance
capgbo, gate-bulk overlap capacitance
capgg, total gate capacitance (cggb + capgdo + capgso + capgbo)
Capacitances listed in the above table are used in .AC analysis. The capacitance matrix used in all
types of simulation in the frequency domain is shown in following table.
Q eq = – ( Q g + Q b )
1 1 1
g τ = --- = ------------ + ----------
τ τ drift τ diff
with
2
q ⋅ L eff
τ diff = --------------------------------
-
16 ⋅ µ eff ⋅ KT
and
3
COX ⋅ W eff ⋅ L eff ζ
τ drift = ----------------------------------------------------------- ≈ ------------
µ eff ⋅ ε ⋅ Q eq – α ⋅ Q def Q eq
where,
Control Parameters
IGCMOD Global model selector for Igs, Igd, Igcs and Igcd 0
Mobility Parameters
AIGC Parameter for Igs, Igd, Igcs and Igcd 2 –1 0.43 (NMOS)
F⋅s ⁄g⋅m 0.31 (PMOS)
XGW Distance from the gate contact to the channel edge m 0.0
CJD Bottom junction capacitance per unit area (Drain side) F⁄m
2 CJS
DMCG Distance from the contact center to the gate edge m 0.0
DMCI Distance in the channel length direction from the contact m DMCG
center to the isolation edge
XGW Distance from the gate contact to the channel edge m 0.0
W and L Parameters
W ⋅ SCALE
W scaled = -------------------------------- + XW
NF
IV model
Bias-Independent Quantities:
WL WW WWL
W′ eff = W scaled – 2 ⋅ WINT + -----------------
WLN
+ ------------------
WWN
-
- + -----------------------------------------
WWN
L scaled W scaled L scaled ⋅ W scaled WLN
CV model
EPSROX ⋅ ε
C oxp = -----------------------------------0-
TOXP
T
T ratio = --------------------
TNOM
where T is the instance temperature and TNOM is a model parameter corresponding to the tempera-
ture at which model parameters have been extracted,
kB ⋅ T k B ⋅ TNOM
V t = --------------
- and V tnom = ------------------------------
-
q q
as the thermal voltage at device and nominal temperature, respectively.
UTE
U 0 ( T ) = U 0 ⋅ ( T ratio )
UA ( T ) = UA + UA 1 ⋅ ( T ratio – 1 )
UB ( T ) = UB + UB 1 ⋅ ( T ratio – 1 )
UC ( T ) = UC + UC 1 ⋅ ( T ratio – 1 )
E g ( TNOM ) E g ( T )
-------------------------------
- – ---------------- + XTIx ⋅ ln ( T ratio )
V tnom Vt
J sx ( T ) = JSx ⋅ exp ---------------------------------------------------------------------------------------------------------
NJx
E g ( TNOM ) E g ( T )
-------------------------------
- – ---------------- + XTIx ⋅ ln ( T ratio )
V tnom Vt
J sswx ( T ) = JSSWx ⋅ exp ---------------------------------------------------------------------------------------------------------
NJx
E g ( TNOM ) E g ( T )
-------------------------------
- – ---------------- + XTIx ⋅ ln ( T ratio )
V tnom Vt
J sswgx ( T ) = JSSWGx ⋅ exp ---------------------------------------------------------------------------------------------------------
NJx
NDEP ⋅ NSD
V bi = V tnom ⋅ ln ------------------------------------
-
ni
2
otherwise
V fbsd = 0
L
V th = VTH 0 + KT 1 + KT 1 L ⋅ --------- + KT 2 ⋅ V bseff
L eff
LPEB
+ ( K 1 ox ⋅ φ s – V bseff – K 1 ⋅ φ s ) ⋅ 1 + ----------------- – K 2 ox ⋅ V bseff
L eff
DVT 0 W DVT 0
– 0.5 ⋅ ---------------------------------------------------------------------------------- + ---------------------------------------------------------- ⋅ ( V bi – φ s )
L ⋅ W′ L eff
cosh DVT 1 W ⋅ --------------------------- – 1 cosh DVT 1 ⋅ --------- – 1
eff eff
l tw lt
0.5
– ----------------------------------------------------------- ⋅ ( ETA 0 + ETAB ⋅ V bseff ) ⋅ V ds
L eff
cosh DSUB ⋅ --------- – 1
lt0
where
TOXE TOXE
K 1 ox = K 1 ⋅ ------------------- and K 2 ox = K 2 ⋅ -------------------
TOXM TOXM
2
V bseff = V bc + 0.5 ⋅ [ V bs – V bc – δ 1 + ( V bs – V bc – δ 1 ) – ( 4 ⋅ δ 1 ⋅ V bc ) ]
In version 3.0 and later, a smoothing function is added to set an upper bound for the body bias:
2
V′ bseff = 0.95 ⋅ φ s – 0.5 ⋅ ( 0.95 ⋅ φ s – V bseff – δ 1 + ( 0.95 ⋅ φ s – V bseff – δ 1 ) + 4 ⋅ δ 1 ⋅ 0.95 ⋅ φ s )
δ 1 = 0.001 V
K1
2
V bc = 0.9 ⋅ φ s – -----------------2 if K2 < 0, otherwise V bc = – 30
4 ⋅ K2
ε si ⋅ TOXE ⋅ X dep
l tw = --------------------------------------------- ⋅ ( 1 + DVT 2 W ⋅ V bseff )
EPSROX
ε si ⋅ TOXE ⋅ X dep
lt = - ⋅ ( 1 + DVT 2 ⋅ V bseff )
--------------------------------------------
EPSROX
2 ⋅ ε si ⋅ ( φ s – V bseff )
X dep = -------------------------------------------------
q ⋅ NDEP
ε si ⋅ TOXE ⋅ X dep 0
lt0 = ------------------------------------------------
EPSROX
2 ⋅ ε si ⋅ φ s
X dep 0 = -------------------------
-
q ⋅ NDEP
The expressions of the built-in voltage of the source/drain junctions V bi and the surface potential φ s
are given in the paragraph related to temperature dependence.
VOFFL
V′ off = VOFF + ----------------------
L eff
2
gm gm
MINV is incorporated to improve the accuracy of g m , ------- and ------- in the moderate inversion region via:
Id Id
* atan ( MINV )
m = 0.5 + ----------------------------------
π
to improve parameter optimization process.
The expression of the effective (Vgs-Vth) reads:
* V gseff – V th
n ⋅ V t ⋅ ln 1 + exp m ⋅ ------------------------------
n ⋅ Vt
V gsteff = -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
*
* 2 ⋅ φ ( 1 – m ) ⋅ ( V – V ) – V′
m + n ⋅ Coxe ⋅ ------------------------------------ s
- ⋅ exp – ------------------------------------------------------------------------------
gseff th off
q ⋅ ε si ⋅ NDEP n ⋅ V t
ε si
C dep = -----------
-
X dep
Mobility
Mobmod = 0
U0
µ eff = ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------2
V gsteff + 2 ⋅ V th V gsteff + 2 ⋅ V th
1 + ( UA + UC ⋅ V bseff ) ⋅ --------------------------------------- + UB ⋅ ---------------------------------------
TOXE TOXE
Mobmod = 1
U0
µ eff = --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
V gsteff + 2 V th V gsteff + 2 V th 2
1 + UA ⋅ ----------------------------------- + UB ⋅ ----------------------------------- ⋅ ( 1 + UC ⋅ V bseff )
TOXE TOXE
Mobmod = 2
U0
µ eff = -------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
V gsteff + C 0 ⋅ ( VTH 0 – VFB – φ s ) EU
1 + ( UA + UC ⋅ V bseff ) ⋅ ---------------------------------------------------------------------------------------
TOXE
where
LPEB
1 + ----------------- ⋅ K 1 ox
L eff TOXE
F doping - + K 2 ox – K 3 B ⋅ ----------------------------- ⋅ φ s
= ------------------------------------------------
2 ⋅ φ s – V bseff W′ eff + W 0
1
RDWMIN + R DW ⋅ – P RWB ⋅ V bd + -------------------------------------------------------------------
1 + PRWG ⋅ ( V gd – V fbsd )
R d = ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
WR
-
6
( 10 ⋅ W effcj ) ⋅ NF
1
RSWMIN + RSW ⋅ – P RWB ⋅ V bs + -------------------------------------------------------------------
1 + PRWG ⋅ ( V gs – V fbsd )
R s = -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
WR
-
6
( 10 ⋅ W effcj ) ⋅ NF
where V fbsd is the flat-band voltage between gate and source/drain calculated in the “Tunneling Cur-
rents” section.
2
–b – b – 4 ⋅ a ⋅ c
V dsat = ----------------------------------------------
2⋅a
2
c = ( V gsteff + 2 ⋅ V t ) ⋅ E sat ⋅ L eff + 2 ⋅ ( V gsteff + 2 ⋅ V t ) ⋅ W eff ⋅ VSAT ⋅ C oxe ⋅ R ds
where
2 ⋅ VSAT
E sat = -------------------------
µ eff
corresponds to the critical electrical field at which the carrier velocity becomes saturated.
To account for velocity overshoot:
1 + V ds – V dseff
2
-----------------------------
E ⋅ l
- – 1
= E sat ⋅ 1 + -------------------------- ⋅ --------------------------------------------------------
-
LAMBDA sat itl
E′ sat
L eff ⋅ µ eff V ds – V dseff 2
1 + ------------------------------ + 1
E sat ⋅ l itl
As GAMMA defaults to 0 and so ensures backward compatibility, this equation is supported by all ver-
sions of BSIM4.
Effective Vds
An effective Vds is used to ensure a smooth transition near Vdsat from electrode to saturation regions:
1 2
V dseff = V dsat – --- ⋅ ( V dsat – V ds – DELTA + ( V dsat – V ds – DELTA ) + 4 ⋅ DELTA ⋅ V dsat )
2
Drain Current
The current equation for both linear and saturation regions is expressed by
I ds 0 ⋅ NF VA V ds – V dseff V ds – V dseff V ds – V dseff
I ds = --------------------------------- ⋅ 1 + ------------ ⋅ ln -------------- ⋅ 1 + -----------------------------
1
- ⋅ 1 + -----------------------------
- ⋅ 1 + -----------------------------
-
R ds ⋅ I ds 0 C clm V Asat V ADIBL V ADITS V ASCBE
1 + -----------------------
V dseff
where
V dseff
W eff ⋅ µ eff ⋅ C oxeff ⋅ V gsteff ⋅ 1 – A bulk ⋅ ------------------------------------------------- ⋅ V dseff
2 ⋅ ( V gsteff + 2 ⋅ V t )
I dso = -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
L eff ⋅ [ 1 + V dseff ⁄ ( E sat ⋅ L eff ) ]
R ds ⋅ I ds 0 V dsat 1
C clm = ------------------- ⋅ F ⋅ F PVAG ⋅ 1 + ----------------------
1
- ⋅ L + ------------- ⋅ -------
PCLM V dseff eff E sat l itl
1
F = ------------------------------------------------------------------------------
L eff
1 + FPROUT ⋅ -------------------------------------
V gsteff + 2 ⋅ V t
V gsteff
F PVAG = 1 + PVAG ⋅ -------------------------
E sat ⋅ L eff
PDIBLC 1
θ rout = ----------------------------------------------------------------------------- + PDIBLC 2
L eff
2 ⋅ cosh DROUT ⋅ --------- – 1
lt0
– PSCBE 1 ⋅ l itl
-------------------- = ------------------------- ⋅ exp ----------------------------------------
1 PSCBE 2
V ASCBE L eff V ds – V dseff
A bulk ⋅ V dsat
E sat ⋅ L eff + V dsat + 2 ⋅ R ds ⋅ VSAT ⋅ Coxe ⋅ W eff ⋅ V gsteff ⋅ 1 – ------------------------------------------------ -
2 ⋅ ( V gsteff + 2 ⋅ V t )
V Asat = ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2 ⁄ λ – 1 + R ds ⋅ VSAT ⋅ C oxe ⋅ W eff ⋅ A bulk
ε si ⋅ TOXE ⋅ XJ
l itl = -----------------------------------------
EPSROX
1
V ADITS = -------------------- ⋅ F ⋅ [ 1 + ( 1 + PDITSL ⋅ L eff ) ⋅ exp ( PDITSD ⋅ V ds ) ]
PDITS
C oxe ⋅ C cen
C oxeff = ----------------------------
-
C oxe + C cen
ε si
C cen = ----------
-
X DC
–9
1.9 × 10
X DC = -------------------------------------------------------------------------------------------------------
-
V gsteff + 4 ⋅ ( VTH 0 – VFB – φ s ) 0.7
1 + -----------------------------------------------------------------------------------
2 ⋅ TOXP
A source end velocity limit model is introduced to account for the current saturation mechanism due to
the high electric field and strong velocity overshoot in nanoscale MOSFETs. It is supported in all ver-
sions of BSIM4 and is turned on if the model parameter VTL is set to a positive value. VTL defaults to
0:
I ds
I′ ds = --------------------------------------------------------------------
-
ν 2 ⋅ MM 1 ⁄ ( 2 ⋅ MM )
1 + ------------
sHD
ν sBT
where
I ds
ν sHD = ---------------------------------------------------
-
V gsteff ⋅ C oxeff ⋅ W eff
1–r L eff
ν sBT = ------------ ⋅ VTL and r = --------------------------------------
1+r XN ⋅ L eff + LC
MM = 2 is a constant value.
Substrate Currents
Impact Ionization Current
I ds 0 ⋅ NF VA V ds – V dseff V ds – V dseff
I dsNoSCBE = --------------------------------- ⋅ 1 + ------------ ⋅ ln -------------- ⋅ 1 + -----------------------------
1
- ⋅ 1 + -----------------------------
-
R ds ⋅ I ds 0 C clm V Asat V ADIBL V ADITS
1 + -----------------------
V dseff
The equivalent expression for the Gate-Induced Source Leakage (GISL) current has been added to
make the gate induced leakage component of the substrate current symmetric:
3
– V ds – V gdeff – EGIDL 3 ⋅ TOXE ⋅ BGIDL V sb
I GISL = AGIDL ⋅ W effcj ⋅ NF ⋅ ------------------------------------------------------------- ⋅ exp – -------------------------------------------------------------- ⋅ ------------------------------------
-
3 ⋅ TOXE – V ds – V gdeff – EGIDL CGIDL + V3
sb
Two global selectors are provided to turn on/off the tunneling components. Igcmod=1 turns on Igcs,
Igcd, Igs and Igd. Igbmod=1 turns on Igb.
V oxdepinv = K 1 ox ⋅ Φ s + V gsteff
where
1 2
V FBeff = V fbzb – --- ⋅ ( V fbzb – V gb – δ + ( V fbzb – V gb – δ ) + 4 ⋅ δ ⋅ V fbzb ) ( δ = 0.02 )
2
K 1 ox 4
Φ s = ------------ ⋅ 1 + ------------
2
⋅ ( V gseff – V gsteff – V FBeff – V bseff ) – 1
2 K 1 ox
Gate-to-Substrate Current
I gb = I gbacc + I gbinv
where
–2 2 0.5
A=4.97232e-7 A ⋅ V and B=7.45669e11 ( g ⁄ ( Fs ) )
NTOX
T oxRatio = ---------------------------
TOXREF 1
⋅ -------------------2-
TOXE TOXE
V gb – V fbzb
V aux = NIGBACC ⋅ V t ⋅ log 1 + exp – -----------------------------------------
-
NIGBACC ⋅ V t
and
I gbinv = W eff ⋅ L eff ⋅ A ⋅ T oxRatio ⋅ V gb ⋅ V aux
⋅ exp [ – B ⋅ TOXE ⋅ ( AIGBINV – BIGBINV ⋅ V oxdepinv ) ⋅ ( 1 + CIGBINV ⋅ V oxdepinv ) ]
–2 2 0.5
A=3.75956e-7 A ⋅ V and B=9.82222e11 ( g ⁄ ( Fs ) )
V oxdepinv – EIGBINV
V aux = NIGBINV ⋅ V t ⋅ log 1 + exp -----------------------------------------------------------
EIGBINV ⋅ V t
Gate-to-Channel Currents
–4
PIGCD ⋅ V ds + exp ( – PIGCD ⋅ Vds ) – 1 + 10
I gcs = I gc ⋅ -----------------------------------------------------------------------------------------------------------------------
2 –4
-
( PIGCD ⋅ V ds ) + 2.0 × 10
–4
1 – ( PIGCD ⋅ Vds + 1 ) ⋅ exp ( – PIGCD ⋅ V ds ) + 10
I gcd = I gc ⋅ ------------------------------------------------------------------------------------------------------------------------------------
2 –4
-
( PIGCD ⋅ V ds ) + 2.0 × 10
where
I gc = W eff ⋅ L eff ⋅ A ⋅ T oxRatio ⋅ V gseff ⋅ V aux
⋅ exp [ – B ⋅ TOXE ⋅ ( AIGC – BIGC ⋅ V oxdepinv ) ⋅ ( 1 + CIGC ⋅ V oxdepinv ) ]
–2 –2
A=4.97232e-7 A ⋅ V for NMOS and A=3.42537e-7 A ⋅ V for PMOS
2 0.5 2 0.5
B=7.45669e11 ( g ⁄ ( Fs ) ) for NMOS and B=1.16645e12 ( g ⁄ ( Fs ) ) for PMOS
V gseff – VTH 0
V aux = NIGC ⋅ V t ⋅ log 1 + exp --------------------------------------
NIGC ⋅ V t
B ⋅ TOXE V dseff
- ⋅ 1 – -----------------------
PIGCD = -------------------------- -
V gsteff
2 2 ⋅ V gsteff
The Gate-to-Channel currents are expressed as functions of V dseff instead of V ds to account for the
saturation effect observed at high Vds:
–4
PIGCD ⋅ V dseff + exp ( – PIGCD ⋅ V dseff ) – 1 + 10
I gcs = I gc ⋅ -----------------------------------------------------------------------------------------------------------------------------------
2 –4
-
( PIGCD ⋅ Vdseff ) + 2.0 × 10
–4
1 – ( PIGCD ⋅ Vdseff + 1 ) ⋅ exp ( – PIGCD ⋅ V dseff ) + 10
I gcd = I gc ⋅ -----------------------------------------------------------------------------------------------------------------------------------------------
2 –4
-
( PIGCD ⋅ V dseff ) + 2.0 × 10
Gate-to-S/D Currents
I gs = W eff ⋅ DLCIG ⋅ A ⋅ T oxRatioEdge ⋅ V gs ⋅ V′ gs
⋅ exp [ – B ⋅ TOXE ⋅ POXEDGE ⋅ ( AIGSD – BIGSD ⋅ V′ gs ) ⋅ ( 1 + CIGSD ⋅ V′ gs ) ]
and
I gd = W eff ⋅ DLCIG ⋅ A ⋅ T oxRatioEdge ⋅ V gd ⋅ V′ gd
⋅ exp [ – B ⋅ TOXE ⋅ POXEDGE ⋅ ( AIGSD – BIGSD ⋅ V′ gd ) ⋅ ( 1 + CIGSD ⋅ V′ gd ) ]
where
–2 –2
A=4.97232e-7 A ⋅ V for NMOS and A=3.42537e-7 A ⋅ V for PMOS
2 0.5 2 0.5
B=7.45669e11 ( g ⁄ ( Fs ) ) for NMOS and B=1.16645e12 ( g ⁄ ( Fs ) ) for PMOS
NTOX
T oxRatioEdge = -------------------------------------------------------
TOXREF 1
⋅ --------------------------------------------------------------2-
TOXE ⋅ POXEDGE ( TOXE ⋅ POXEDGE )
2 –4
V′ gd = ( V gd – V fbzd ) + 10
2 –4
V′ gs = ( V gs – V fbzd ) + 10
0 0 0
1 2 2
2 (default) 3 2
RgateMod = 0 (zero-resistance)
RgateMod = 1 (constant-resistance)
W effcj
RSHG ⋅ XGW + ------------------------------- -
3 ⋅ NGCON
Rgeltd = -------------------------------------------------------------------------------------
NGCON ⋅ ( L drawn – XGL ) ⋅ NF
For these two latter cases, NQS models should be deactivated (TrnqsMod=0 and AcnqsMod=0).
RbodyMod = 0 (Off)
No substrate resistance network is generated.
RbodyMod = 0 (On)
All five resistances in the substrate network are present simultaneously:
otherwise
Ax eff is computed from NF, DWJ, GeoMod, DMCG, DMCI, DMDG, DMCGT and MIN.
If Px is given
otherwise
Px eff is computed from NF, DWJ, GeoMod, DMCG, DMCI, DMDG, DMCGT and MIN.
DioMod=0 (resistance-free)
V bx
I bx = I sbx ⋅ exp -------------------------------
- – 1 ⋅ f breakdown + V bx ⋅ GMIN
NJx ⋅ V tnom
where
BVx + V bx
f breakdown = 1 + XJBVx ⋅ exp – -------------------------------
-
NJx ⋅ V tnom
DioMod=1 (breakdown-free)
IJTHxFWD > 0 (Current limiting feature)
Define
If V bx < V jxm
V bx
I bx = I sbx ⋅ exp -------------------------------
- – 1 + V bx ⋅ GMIN
NJx ⋅ V tnom
otherwise
IJTHxFWD + I sbx
I bx = IJTHxFWD + --------------------------------------------------- ⋅ ( V bx – V jxm )
NJx ⋅ Vtnom
V bx
I bx = I sbx ⋅ exp -------------------------------
- – 1 + V bx ⋅ GMIN
NJx ⋅ V tnom
If V bx < 0
V bx – MJx
C jbx = CJx ( T ) ⋅ 1 – --------------------
-
PBx ( T )
V bx – MJSWx
C jbxsw = CJSWx ( T ) ⋅ 1 – -------------------------------
PBSWx ( T )
V bx – MJSWGx
C jbxswg = CJSWGx ( T ) ⋅ 1 – ------------------------------------
PBSWGx ( T )
otherwise
V bx
C jbx = CJx ( T ) ⋅ 1 + MJx ⋅ ---------------------
PBx ( T )
V bx
C jbxsw = CJSWx ( T ) ⋅ 1 + MJSWx ⋅ -------------------------------
PBSWx ( T )
V bx
C jbxswg = CJSWGx ( T ) ⋅ 1 + MJSWGx ⋅ ------------------------------------
PBSWGx ( T )
otherwise
R sdiff is computed from NF, DWJ, GeoMod, DMCG, DMCI, DMDG, DMCGT, RSH and MIN.
otherwise
R ddiff is computed from NF, DWJ, GeoMod, DMCG, DMCI, DMDG, DMCGT, RSH and MIN.
The current equations for the collector current (ic) and the base current (ib) are:
ib = ibf
vbs
------------------
-
⋅ vt
ibs = ISS eff ⋅ e – 1
NS
when vbs > -10 · NS · vt
and:
otherwise
tan ( z ) – z
rbb = RBMeff + 3 ⋅ RBeff – RBMeff ⋅ -------------------------------------------
z ⋅ tan ( z ) ⋅ tan ( z )
where:
1⁄2
ib
– 1 + 1 + 144 ⋅ ----------------------------- -
π 2 ⋅ IRBeff
z = -----------------------------------------------------------------------------
1⁄2
-
24 ib
-----2- ⋅ ------------------------
n ( IRBeff )
Capacitance Equations
The total junction capacitance is computed as a sum of the depletion and diffusion capacitances. The
depletion capacitance dominates low current behavior. The diffusion capacitance dominates high
current behavior.
In the following equations, for depletion capacitance:
fc = FC
∂
cbediff = ------------- TF ⋅ --------
ibe
for ibe ≤ 0
∂vbe qb
∂ ibe
cbediff = ------------- TF ⋅ ( TF + 1 arg tf ) ⋅ -------- for ibe > 0
∂vbe qb
where:
vbc
----------------------------
2 1.44 ⋅ VTF
arg tf = XTF ⋅ -------------------------- ⋅ e
ibe
ibe + ITF
vbe – MJE
cbedep = CJEeff ⋅ 1 – ------------ for vbe < fc · VJE
VJE
vbe
1 – fc ⋅ ( 1 + MJE ) + MJE ⋅ ------------
VJE for vbe ≥ fc · VJE
cbedep = CJEeff ⋅ -----------------------------------------------------------------------------------
( 1 + MJE )
-
( 1 – fc )
vbc –MJC
cbcdep = XCJC ⋅ CJCeff ⋅ 1 – ------------ for vbc < fc · VJC
VJC
vbc
1 – fc ⋅ 1 + MJC + MJC ⋅ ------------
VJC
cbcdep = XCJC ⋅ CJCeff ⋅ ------------------------------------------------------------------------------- for vbc ≥ fc · VJC
( 1 – fc ) ( 1 + MJC )
vbcx –MJC
cbcx = CJCeff ⋅ ( 1 – XCJC ) ⋅ 1 – ------------- for vbcx < fc · VJC
VJC
vbcx
1 – fc ⋅ ( 1 + MJC ) + MJC ⋅ -------------
VJC
cbcx = CJCeff ⋅ ( 1 – XCJC ) ⋅ ------------------------------------------------------------------------------------
- for vbcx ≥ fc · VJC
( 1 – fc ) ( 1 + MJC )
Substrate Capacitance
– MJS
cs = CJSeff ⋅ 1 – ------------
vs
for vs < fc · VJS
VJS
vs
1 – fc ⋅ 1 + MJS + MJS ⋅ ------------
VJS
cs = CJSCeff ⋅ -----------------------------------------------------------------------------
( 1 + MJS )
- for vs ≥ fc · VJS
( 1 – fc )
where:
ccs = cs
vs = vsc
XTB
BR ( t ) = BR ⋅ ---------------
t
tnom
f
---------
ISE NE
ISE ( t ) = ------------------------------
XTB
⋅ e
--------------
t
-
tnom
f
ISC ---------
ISC ( t ) = -----------------------------
- ⋅ e NC
XTB
---------------
t
tnom
f
ISS ---------
ISS ( t ) = ------------------------------
XTB
⋅ e NS
--------------
t
-
tnom
IS ( t ) = IS ⋅ e f
f
---------
IBE ( t ) = IBE ⋅ e NF
f
---------
IBC ( t ) = IBC ⋅ e NR
t t EG ( tnom ) EG ( t )
VJX ( t ) = VJX ⋅ --------------- – vt ( t ) ⋅ 3 ⋅ 1 n --------------- + ----------------------------- – ----------------
tnom tnom vt ( tnom ) vt ( t )
VJX ( t )
CJX ( t ) = CJXO ⋅ 1 + MJX ⋅ 4 ⋅ 10 e – 4 ⋅ ∆t – -------------------- + 1
VJX
VJSW ( t )
CJSW ( t ) = CJSW ⋅ 1 + MJSW ⋅ 4 ⋅ 10 e – 4 ⋅ ∆t – ------------------------- + 1
VHSW
One can download Silvaco’s Verilog-A implementation of the Gummel-Poon BJT Model at
www.silvaco.com.
RE E1 In C2 Ic1c2 C1 RCC
E C
Ib1+Ib2 Iavl
Qte+Qbe+Qn Qtc+Qbc+Qepi
B2
Qb1b2 RBV
Ib1b2
ISb1 Iex+Isub+Ib3 Isub+XIsub-Isf
B1 S
SQte Qtex+Qex
Qts
RBC XIex+XIsub
XQtex+XQex
Qbeo Qbco
XIBI Part of ideal base current taht belongs to the sidewall - 0.00
XEXT Part of IEX, QEX, QTEX and ISUB that depends on the base- - 0.63
collector voltage VBC1 instead of VB1C1
MC_AJC = 2.0
MC_AJS = 2.0
Constants A and B for impact ionization depend on transistor type:
For NPN:
MC_An = 7.03 · 105 cm-1
MC_Bn = 1.23 · 106 V · cm-1
For PNP:
MC_An = 1.58 · 106 cm-1
MC_Bn = 2.04 · 106 V · cm-1
Temperature conversions
TK = TEMP + DTA + 273.15 + VdT
TK
T N = -------------
TRK
k
V T = --- ⋅ T K (Thermal voltage)
q
k
V TR = --- ⋅ T RK
q
1 1 1
---------- = ------- – ----------
V ∆T V T V TR
Resistances
–A
The various parameters A describe the mobility of the corresponding regions : µ ∼ t N . The
AQB 0
temperature dependence of the zero-bias charge goes as Q B 0 T ⁄ Q B 0 = t N.
Depletion Capacitances
The junction diffusion voltage VDX with respect to temperature is:
where:
V GAP = VGB
for the base-emitter junction:
X = E
V GAP = VGC
for the base-collector junction:
X = C
V GAP = VGS
for the collector-substrate junction:
X = S
The temperature scaling rule is the same for depletion capacitances CJE and CJS:
PX
CJX T = CJX ⋅ ----------------
VDX
VDX T
The collector depletion capacitance is divided up in a variable and constant part. The constant part is
temperature independent.
VDC PC
CJC T = CJC ⋅ ( 1 – XP ) ⋅ ----------------- + XP
VDC T
CJC
XP T = XP ⋅ ---------------
CJC T
Current Gain
DVGBF
BF T = BF ⋅ T N ( AE – AB – AQB 0 ) ⋅ exp – -----------------------
V ∆T
DVGBR
BRIT = BRI ⋅ exp – -----------------------
V ∆T
( 4 – AB – AQB 0 )
IS T = IS ⋅ T N ⋅ exp { – V GB ⁄ V ∆T }
( 1 – AB )
IK T = IK ⋅ T N
( 6 – 2 ⋅ MLF )
IBF T = IBF ⋅ T N ⋅ exp { ( – VGJ ) ⁄ ( MLF ⋅ V ∆T ) }
·
( AQB 0 ) VDC PC –1
VEF T = VEF ⋅ T N ( 1 – XP ) ⋅ ----------------- + XP
VDC T
( AQB 0 ) VDE – PE
VER T = VER ⋅ T N -----------------
VDE T
( 1 – AS ) IS T ISS
IKS T = IKS ⋅ T N ⋅ --------- ⋅ -------------
IS ISS T
( 1 – AS )
When either IS = 0 or ISST = 0 then IKS T = IKS ⋅ T N .
Transit Times
( AB – 2 )
TAUE T = TAUE ⋅ T N ⋅ exp { ( – DVGTE ) ⁄ V ∆T }
( AQB 0 + AB – 1 )
TAUB T = TAUB ⋅ T N
( AEPI – 1 )
TEPI T = TEPI ⋅ T N
TAUBT + TEPI T
TAUR T = TAUR ⋅ ----------------------------------------------
TAUB + TEPI
Avalanche constant
Note that this temperature rule is independent of TREF since we take MC_BN as a material constant.
–4 –6 2
Bn T = MC_BN [ 1 + 7.2 ⋅ 10 ( T K – 300 ) – 1.6 ⋅ 10 ( T K – 300 ) ]
Heterojunction features
( AQB 0 )
DEG T = DEG ⋅ T N
IS, IK, IBF, IBR, IHC, ISS, IKS, CJE, CJC, CJS, CTH, CBEO, CBCO are multiplied by MULT
RE, RBC, RBV, RCC, RCV, SCRCV, RTH are divided by MULT
and the flicker-noise coefficients are scaled as :
( 1 – AF )
KF → KF ⋅ MULT
1 – [ 2 ( MLF – 1 ) + AF ( 2 – MLF ) ]
KFN → KFN ⋅ MULT
V∗ B 2 C 2
I R = IS T ⋅ exp ------------------
VT
Model parameter: IS
The value of V∗ B 2 C 2 is not always the same as the node voltage VB2C2. The expression for
exp ( V∗ B 2 C 2 ⁄ V T ) will be given in variable collector resistance section.
Main Current IN
The Moll-Ross or integral charge-control relation is used to take into account high injection in the
base. To avoid dividing by zero at punch-through, the depletion charge term q0 is modified.
I VTE VTC
q 0 = 1 + ---------------- + ----------------
VER T VEF T
I I
I q 0 + ( q 0 ) 2 + 0.01
q 1 = -------------------------------------------------
2
= q 1 ⋅ 1 + --- n 0 + --- n B
I I 1 1
q B
2 2
IF – IR
I N = ----------------
I
-
qB
IS T VB 2E 1
I B 1 = ( 1 – XIBI ) ⋅ ----------- ⋅ exp --------------- – 1
BF T VT
Sidewall component:
IS T VB1E1
I B 1 = XIBI ⋅ ----------- ⋅ exp --------------- – 1
S
BF T VT
V B2E1
I B 2 = IBF T ⋅ exp -------------------------- – 1 + G MIN ⋅ V B 2 E 1
MLF ⋅ V T
VB 1C 1
exp --------------- – 1
VT
IB3 = IBR T ⋅ --------------------------------------------------------------------- + G MIN ⋅ V B 1 C 1
V
exp --------------- + exp ----------------
B 1 C 1 VLR T
2 ⋅ VT 2 ⋅ VT
The substrate current (holes injected from base to substrate), including high injection is given by:
VB 1 C 1
2 ⋅ ISS T ⋅ exp --------------- – 1
VT
I SUB = ---------------------------------------------------------------------------------------
IS T VB1C1
1 + 1 + 4 ⋅ -------------- ⋅ exp ---------------
IKS T VT
The current with substrate bias in forward is only included as a signal to the designer :
V SC 1
I SF = ISST ⋅ exp ------------ – 1
VT
The extrinsic base current (electrons injected from collector to extrinsic base, similar to IB1) is given
by:
VB 1 C 1
4 ⋅ IS T ⋅ exp ---------------
VT
g 1 = ----------------------------------------------------
IK T
g1
n BEX = --------------------------------
-
( 1 + 1 + g1 )
1 1
I EX = -------------- ⋅ --- ⋅ IK T ⋅ n BEX – IS T
BRI T 2
IAVL = 0
In forward mode we have the following gradient of the electric field for zero bias :
2 VAVL
dEdx 0 = ---------------------2
WAVL
The depletion layer thickness becomes :
2 VDC T – V B 2 C 1
XD = ----------------- ⋅ --------------------------------------
dEdx0 1 – I CAP ⁄ IHC
The current ICAP will be given in Intrisic collector depletion charge section.
The generation of avalanche current increases at high current levels. This is only taken into account
when flag EXAVL = 1.
For either value of EXAVL the thickness over which the electric field is important is :
x D ⋅ W eff
W D = --------------------------------
-
2 2
x D + W eff
The average electric field and the field at the base-collector junction are :
VDC T – V B 2 C 1
E AV = --------------------------------------
WD
I CAP
E 0 = E AV + --- ⋅ W D ⋅ dEdx0 ⋅ 1 – -----------
1
-
2 IHC
1 + SFH
E fi = ------------------------------
1 + 2 ⋅ SFH
IC1 C2
E W = E AV – --- ⋅ W D ⋅ dEdx 0 ⋅ E fi – -----------------------------
1
-
2 IHC ⋅ SHW
1 2 2
E M = --- ⋅ ( E W + E 0 + ( E W – E 0 ) + 0.1 ⋅ E AV ⋅ I CAP ⁄ IHC )
2
The injection thickness Xi / WEPI is given in Variable collector resistance section.
For either value of EXAVL the intersection point λ D and the generation factor GEM are :
EM ⋅ WD
λ D = ------------------------------------
-
2 ⋅ ( E M – E AV )
An – B nT – B nT W eff
G EM = ---------- ⋅ E M ⋅ λD ⋅ exp ------------- – exp ------------- ⋅ 1 + ----------
λ D
-
B nT EM E
M
When E M ≈ E AV the expression for λ D will diverge. Hence for (1-EAV/EM) < 10-7 we need to take the
appropriate analytical limit and get :
– B nT
G EM = A n ⋅ W eff ⋅ exp -------------
EM
The generation factor may not exceed 1 and may not exceed
I
VT qB RET
G MAX = ---------------------------------------------------------
- + ----------
- + ----------------------------------
-
I C 1 C 2 ⋅ ( RBC T + RB 2 ) BF T RBC T + RB 2
The variable base resistance RB2 at the end of section Variable base resistance. The base base charge
I
term q B was given in section Main current IN. The avalanche current then is :
G EM ⋅ G MAX
I AVL = I C 1 C 2 ⋅ --------------------------------------------------------------------
G EM ⋅ ( 1 + G MAX ) + G MAX
Series resistances:
emitter: RET = constant
base : RBCT = constant
collector: RCCT = constant
Q V TE V TC
q 0 = 1 + ---------------
- + ---------------
-
VER T VEF T
Q Q 2
Q q 0 + ( q 0 ) + 0.01
q 1 = ----------------------------------------------------
-
2
3 ⋅ RBV T
RB 2 = -----------------------
Q
-
q B
2 ⋅ VT VB 1B 2 VB 1B 2
I B 1 B 2 = -------------- ⋅ exp --------------- – 1 + --------------
-
RB 2 VT
RB 2
K0 = 1 + 4 ⋅ exp [ ( V B 2 C 2 – VDC T ) ⁄ V T ]
KW = 1 + 4 ⋅ exp [ ( V B 2 C 1 – VDC T ) ⁄ V T ]
2 ⋅ exp [ ( V B 2 C 1 – VDC T ) ⁄ V T ]
p W = ----------------------------------------------------------------------------
-
1 + KW
1
In version 1, p W derivatives are computed from an approximated equation : p W ≈ --- ⋅ ( K W – 1 )
2
K0 + 1
E C = V T ⋅ K 0 – K W – ln ------------------
K W + 1
E C + VC 1 C 2
I C 1 C 2 = ----------------------------
-
RCV T
In reverse mode the node voltage difference VB2C2 is the quantity that we use in further calculations.
In forward mode the relation between the voltage difference VB2C2 and the current IC1C2 is not smooth
enough. We will instead calculate V∗ B 2 C 2 that is to be used in subsequent calculations. It has
smoother properties than VB2C2 itself. In forward mode the node voltage VC2 is only used for K0 and
IC1C2. For the rest of the quantities in the epilayer model a distinction must be made between forward
and reverse mode.
I C 1 C 2 ⋅ RCV T
= VDC T + 2 ⋅ V T ⋅ ln ----------------------------------
- + 1 – V B 2 C 1
th
V qs
2 ⋅ VT
1 th th 2 2
V qs = --- V qs + ( V qs ) + 4 ⋅ ( 0.1 ⋅ VDC T )
2
V qs V qs + IHC ⋅ SCRCV
I qs = ---------------------- ⋅ -------------------------------------------------------
SCRCV V qs + IHC ⋅ RCV
which leads to
V qs
v = --------------------------------------
-
IHC ⋅ SCRCV
1 + 1 + 4 ⋅ α ⋅ v ⋅ (1 + v)
y i = ---------------------------------------------------------------
2 ⋅ α ⋅ (1 + v )
The injection thickness is given by :
xi yi
- = 1 – -------------------------
------------- -
W EPI 1 + pW ⋅ yi
I C 1 C 2 ⋅ RCV xi
g = -------------------------------- ⋅ --------------
2 ⋅ VT W EPI
g–1 2
p∗ 0 = ------------ + ------------ + 2 g + p W ⋅ ( p W + g + 1 )
g–1
2 2
V∗ B 2C2 ⁄ V T
e = p∗ 0 ⋅ ( p∗ 0 + 1 ) ⋅ exp ( VDC T ⁄ V T )
1
In version 1, p∗ 0 derivatives are computed from an approximated equation : p 0∗ ≈ --- ⋅ ( K 0 – 1 )
2
exp ( V∗ B 2 C 2 ⁄ V T ) = exp ( V B 2 C 2 ⁄ V T )
xi EC
- = --------------------------------------------------
------------- -
W EPI EC + VB 2C 2 – V B 2 C 1
–5 – 40
Numerical problems might arise for I C 1 C 2 ≈ 0 . When V C 1 C 2 < 10 ⋅ V T or E C < e ⋅ VT ⋅ ( K0 + KW )
approximate
p∗ 0 + p W
p av = ----------------------
2
xi p av
- = -----------------
-------------
W EPI p av + 1
VDE T 1 – PE
V TE = ----------------- ⋅ [ 1 – ( 1 – V jE ⁄ VDE T ) ] + a jE ⋅ ( V B2E1 – V jE )
1 – PE
Q TE = ( 1 – XCJE ) ⋅ CJET ⋅ V TE
VDE T
= XCJE ⋅ CJE T ⋅ ----------------- ⋅ [ 1 – ( 1 – V jE ⁄ VDE T ) ] + a jE ⋅ ( V B1E1 – V jE )
S S 1 – PE S
Q TE
1 – PE
1
B 1 = --- SCRCV ⋅ ( I C 1 C 2 – IHC )
2
2
V xi = 0 = B 1 + B 1 + B2
Vxi=0 = VC1C2
0.1 VDC T IC 1C 2 ≤ 0
V ch = IC 1 C2
VDC T ⋅ 0.1 + 2 ⋅ --------------------------
I C 1 C 2 + I qs
- IC1 C2 > 0
a jc – XP T
b jc = -----------------------
-
1 – XP T
– 1 ⁄ PC
V FC = VDC T ⋅ ( 1 – bjc )
IHC ⋅ I C 1 C 2
-------------------------------- IC 1 C2 > 0
I CAP = IHC + I C 1 C 2
I IC1 C2 ≤ 0
C1C2
I CAP MC
f I = 1 – -----------
-
IHC
VDC T 1 – PC
V CV = ----------------- ⋅ [ 1 – f I ⋅ ( 1 – V jc ⁄ VDC T ) ] + f I ⋅ b jc ⋅ ( V junc – V jc )
1 – PC
V TC = ( 1 – XP T ) ⋅ V CV + XP T ⋅ V B 2 C 1
Q TC = XCJC ⋅ CJC T ⋅ V TC
VDC T 1 – PC
VTEX V = ----------------- ⋅ [ 1 – ( 1 – V jCEX ⁄ VDC T ) ] + b jc ⋅ ( V B 1 C 1 – V jCEX )
1 – PC
VDC T 1 – PC
XVTEX V = ----------------- ⋅ [ 1 – ( 1 – XV jCEX ⁄ VDC T ) ] + b jc ⋅ ( V BC 1 – XV jC EX )
1 – PC
Depletion charge
– 1 ⁄ PS
V FS = VDS T ⋅ ( 1 – ajs )
VDS T 1 – PS
Q TS = CJS T ⋅ ----------------- ⋅ [ 1 – ( 1 – V jS ⁄ VDC T ) ] + a js ⋅ ( V SC 1 – V jS )
1 – PS
V B2E1 ⁄ MTAU ⋅ V T
QE = QE0 ⋅ ( e – 1)
4 ⋅ IS T V B2E1
f1 = ----------------- ⋅ exp --------------
IK T VT
f1
n 0 = --------------------------
-
1 + 1 + f1
1 Q
Q BE = --- ⋅ QB 0 ⋅ n 0 ⋅ q 1
2
4 ⋅ IS T V∗ B2C2
f2 = ----------------- ⋅ exp -----------------
IK T VT
f2
n B = --------------------------
-
1 + 1 + f2
1 Q
Q BC = --- ⋅ QB 0 ⋅ n B ⋅ q 1
2
V∗ B 2 C 2
The expression for exp ------------------ was given in section Variable collector resistance.
VT
1 xi
Q EPI = --- ⋅ Q EPI 0 ⋅ -------------- ⋅ ( p∗ 0 + p W + 2 )
2 W EPI
g2
p WEX = ---------------------------
-
1 + 1 + g2
TAUR T
Q EX = ---------------------------------------------- ⋅ --- ⋅ Q B 0 ⋅ n BEX + --- ⋅ Q EPI 0 ⋅ p WEX
1 1
TAUB T + TEPI T 2 2
The electron density nBEX was given in section Reverse base currentsExtended Modeling of the Reverse
Current Gain EXMOD = 1.
I EX = ( 1 – XEXT ) ⋅ I EX
I SUB = ( 1 – XEXT ) ⋅ I EX
A part XEXT of the base current of the extrinsic transistor is connected to the base terminal:
V BC 1
2 ⋅ ISS T ⋅ exp ------------- – 1
VT
XIM SUB = XEXT ⋅ -----------------------------------------------------------------------------
IS T V BC 1
1 + 1 + 4 -------------- exp -------------
IKS T VT
V BC 1
4 ⋅ IS T ⋅ exp -------------
VT
Xg 1 = --------------------------------------------------
IK T
Xg 1
Xn BEX = -------------------------------------
( 1 + 1 + Xg 1 )
In version 1, XnBEX derivatives are computed from an approximated equation : Xn Bex ≈ 1 + Xg1 + 1
To improve convergency behavior the conductivity of branch B-C1 is limited by a resistance of value
RCCT :
VT
V EX = V T 2 + ln ----------------------------------------------------------------------------------
XEXT ⋅ -------------- IS T
⋅ ISS T ⋅ RCC T
BRI T
( V BC 1 – V EX ) + ( V BC 1 – V EX ) 2 + 0.0121
VB EX = ---------------------------------------------------------------------------------------------------------
-
2
VB EX
F EX = ------------------------------------------------------------------------------------------------
-
RCC T ⋅ ( XIM EX + XIM SUB ) + VB EX
VB EX
F EX = ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
IS
XEXT ⋅ -------------- T
+ ISS T ⋅ RCC T + ( XIM EX + XIM SUB ) ⋅ RCC T + VB EX
BRI T
XI EX = F EX ⋅ XIM EX
Charges
The charge QEX is redefined:
Q EX = ( 1 – XEXT ) ⋅ Q EX
V BC 1 – VDC T
Xg 2 = 4 ⋅ exp ------------------------------------
VT
Xg 2
Xp WEX = --------------------------------
-
1 + 1 + Xg 2
In version 1, XpWEX derivatives are computed from an approximated equation : Xp Wex ≈ 1 + Xg2 + 1
TAUR T
XQ EX = F EX ⋅ XEXT ⋅ ---------------------------------------------- ⋅ --- ⋅ Q B 0 ⋅ Xn BEX + --- ⋅ Q EPI 0 ⋅ Xp WEX
1 1
TAUB T + TEPI T 2 2
1 ∂Q TE ∂Q BE ∂Q E
C B = --- ⋅ ----------------------- + ---------------------- -
- + ----------------------
5 ∂Q
B 2 E 1 ∂V B 2 E 1 ∂V B 2 E 1
1 ∂Q TE 1 Q ∂n 0 ∂Q E
C B = --- ⋅ ----------------------- + --- ⋅ Q B 0 ⋅ q 1 ⋅ -
+ ----------------------
5 ∂Q B 2 E 1 2 ∂ V B 2 E 1 ∂V B 2 E 1
∂Q B1B2
Moreover, version 1 accounts for all derivatives of Q B 1 B 2 . In version 0, only ----------------------- was computed.
∂V B 2 E 1
QB 1B 2 = C B ⋅ VB 1 B 2
For reasons of simplification, only the forward depletion and diffusion charges are taken into account.
The partial derivative of QB1B2 with respect to VB2E1 has to be neglected in the AC analysis. In
transient analysis the convergency behavior may be improved by approximating this derivative with:
∂Q B 1 B 2 ∂Q BE ∂Q E V B 1 B 2
------------------- = ------------------ - ⋅ ----------------
- + ------------------
∂V B 2 E 1 ∂V B 2 E 1 ∂V B 2 E 1 5 ⋅ VT
with
1
q C = ---
3
V TE DEGT – V TC DEGT
exp --------------- - + 1 ⋅ ----------------- – exp ---------------- ⋅ -----------------
I
VER T VT VEF T VT
q 0 → ---------------------------------------------------------------------------------------------------------------------------------
DEGT
exp ----------------- – 1
VT
Another feature that might be needed for SiGe transistors is recombination in the base. This changes
the forward ideal base current (when XREC ≠ 0 ).
IS T V B2E1
I B 1 → ----------- ⋅ ( 1 – XIBI ) ⋅ ( 1 – XREC ) ⋅ exp -------------- – 1 +
BF T VT
V B2E1 V∗ B 2 C 2 V TC
XREC ⋅ exp -------------- + exp ------------------ – 2 ⋅ 1 + ---------------
- ⋅ ( 1 + nB n0 )
VT VT VEF T
2 = 4 ⋅ k ⋅ TK
iN - ⋅ ∆f
----------------------
RE RE T
2 = 4 ⋅ k ⋅ TK
iN - ⋅ ∆f
----------------------
RBC RBC T
2 = 4 ⋅ k ⋅ TK
iN - ⋅ ∆f
----------------------
RCC RCC T
For the variable part of the base resistance a different formula is used, taking into account the effect of
current crowding on noise behavior.
VB 1B 2
4 exp --------------- + 5
4 ⋅ k ⋅ TK VT
iN 2 = ----------------------- ⋅ ------------------------------------------- ⋅ ∆f
RBV RB 2 3
For the variable part of the collector resistance we take base-widening into account :
4⋅k⋅T K EPI Q
iN - ⋅ 1 + --------------
2 = ---------------------- - ⋅ ∆f
RCV RCV T Q EPI 0
IB 1 AF
iN 2 = 2 q ⋅ [ I B 1 + I B 2 ] + --------- ⋅ ( 1 – XIBI ) ⋅ ----------------------- +
KF
f 1 – XIBI
B
KFN 2 ⋅ ( MLF – 1 ) + AF ⋅ ( 2 – MLF )
-------------- ⋅ I B 2 ⋅ ∆f
f
Emitter-base sidewall current shot noise and 1/f noise :
S AF
--------- ⋅ XIBI ⋅ -------------
2 = 2 ⋅ q ⋅ I S B 1 + KF I B1
iN
f
-
XIBI ⋅ ∆f
BS
Reverse base current shot noise and 1/f noise:
2 KF AF
iN B 3 = 2 ⋅ q ⋅ I B 3 + --------- ⋅ ( I B 3 ) ⋅ ∆f
f
2 KF AF
iN IEX = 2 ⋅ q ⋅ I EX + --------- ⋅ ( I EX ) ⋅ ∆f
f
If EXMOD = 1 we have :
I EX AF
iNIEX = 2 ⋅ q ⋅ I EX + --------- ⋅ ( 1 – XEXT ) ⋅ -------------------------- ⋅ ∆f
2 KF
f 1 – XEXT
XI EX AF
iN XIEX = 2 ⋅ q ⋅ XI EX + --------- ⋅ XEXT ⋅ ----------------- ⋅ ∆f
2 KF
f XEXT
2
iN ISUB = 2 ⋅ q ⋅ I SUB ⋅ ∆f
2
iN XISUB = 2 ⋅ q ⋅ XI SUB ⋅ ∆f
2 2 2
+V EE 1 ⁄ RE T + V CC 1 ⁄ RCC T + V BB 1 ⁄ RBC T
S
+ I B 1 B 2 ⋅ V B 1 B 2 + ( I B 1 + I B 2 ) ⋅ V B2E1 + I B1 ⋅ V B1E1
+ ( XI SUB + I SUB – I SF ) ⋅ V C 1 S
One can download Silvaco’s Verilog-A implementation of the Mextram Model at www.silvaco.com.
Equivalent Circuit
General Parameters
BULK Name of the global node used to connect the substrate - “0”
when the terminal ns of the device is unspecified. (gnd)
DT0H Time constant for base and BC SCR width modulation s 2.1e-12
TBVL Time constant for modeling carrier jam at low Vcei s 4.0e-12
VLIM Voltage defining the limit between high and low electric V 0.7
fields in the collector
Intermmediate variables
All temperatures are internally converted to Kelvin:
T = TEMP + 273.15
T 0 = TNOM + 273.15
V T = --- ⋅ T
k
q
V T 0 = --- ⋅ T 0
k
q
and
T
T r = ------
T0
∆T = T – T 0
Transfer Current
C 10 ( T ) = C 10 ⋅ T N ⋅ exp -------------- ⋅ ( T r – 1 )
3 VGB
VT
ZEI VDEI ( T )
QP 0 ( T ) = QP 0 ⋅ 1 + ----------- ⋅ 1 – --------------------------
2 VDEI
Saturation Currents
Define the correction term: α T = ALB ⋅ ∆T
VGB
and the factor R T = -------------- ⋅ ( T r – 1 )
VT
MCF ⋅ R
⋅ exp -------------------------T- – α T
3 ⁄ MBEI
IBEIS ( T ) = IBEIS ⋅ T r
MBEI
MCF ⋅ R
⋅ exp -------------------------T- – α T
3 ⁄ MBEP
IBEPS ( T ) = IBEPS ⋅ T r
MBEP
MCF ⋅ R T
⋅ exp --------------------------
3 ⁄ MREI
IREIS ( T ) = IREIS ⋅ T r
MREI
MCF ⋅ R T
⋅ exp --------------------------
3 ⁄ MREP
IREPS ( T ) = IREPS ⋅ T r
MREP
MCF ⋅ R T
⋅ exp --------------------------
3 ⁄ MBCI
IBCIS ( T ) = IBCIS ⋅ T r
MBCI
MCF ⋅ R T
⋅ exp --------------------------
3 ⁄ MBCX
IBCXS ( T ) = IBCXS ⋅ T r
MBCX
Saturation currents have been made temperature-dependent in version 2.1. This results in the
division of the parameter ITSS (saturation current for the parasitic PNP device) into forward and
reverse components :
RT
⋅ exp --------------
3 ⁄ MSF
ITSFS ( T ) = ITSS ⋅ Tr
MSF
RT
⋅ exp --------------
3 ⁄ MSR
ITSRS ( T ) = ITSS ⋅ T r
MSR
RT
⋅ exp --------------
3 ⁄ MSC
ISCS ( T ) = ISCS ⋅ T r
MSC
Series Resistances
ZETARCI
RCI 0 ( T ) = RCI 0 ⋅ T r
ZETARBI
RBI 0 ( T ) = RBI 0 ⋅ T r
ZETARBX
RBX ( T ) = RBX ⋅ T r
ZETARCX
RCX ( T ) = RCX ⋅ T r
ZETARE
RE ( T ) = RE ⋅ T r
A smoothing function has been introduced in order to prevent VLIM(T) to become negative at very
high temperature:
VLIM ( T ) unsmoothed
VLIM ( T ) = V T ⋅ 1.0 + ln 1.0 + exp ----------------------------------------------------
- – 1.0
VT
Tr
TEF 0 ( T ) = TEF 0 ⋅ -----------------------------------
1 + ALB ⋅ ∆T
Depletion Capacitances
The junction diffusion voltage is defined by the classical expression:
EG ( T 0 ) EG ( T )
VDx ( T ) = VDx ⋅ T r – V T ⋅ 3 ⋅ ln ( T r ) + -------------------- – ------------------
VT 0 VT
with the bandgap voltage at device and nominal temperatures given by:
2
T
EG ( T ) = VGB – GAP 1 ⋅ --------------------------------
( T + GAP 2 )
and
2
T0
EG ( T 0 ) = VGB – GAP 1 ⋅ ----------------------------------
( T 0 + GAP 2 )
If the model parameter GAP1 is set to zero, the expression reduces to the original formulation:
Moreover, a smoothing function has been introduced in order to prevent VDx(T) to become negative at
very high temperature:
VDx ( T ) unsmoothed – VD α
VDx ( T ) = VD α + V T ⋅ ln 1.0 + exp -------------------------------------------------------------------
VT
with
VDx
VD α = 1.001 ⋅ ---------------
ALJx
If ALJx is not available as a model parameter, an internal built-in value (set to 2.4) is used.
VDx Zx
CJx ( T ) = CJx 0 ⋅ ----------------------
VDx ( T )
The control parameters used to limit the capacitance value at high forward bias are defined by:
VDEI ( T )
ALJEI ( T ) = ALJEI ⋅ --------------------------
VDEI
VDEP ( T )
ALJEP ( T ) = ALJEP ⋅ ---------------------------
VDEP
Avalanche
FAVL ( T ) = FAVL ⋅ exp ( ALFAV ⋅ ∆T )
Tunneling
VDEP ( T ) CJEP 0 ( T )
2
IBETS ( T ) = IBETS ⋅ --------------------------- ⋅ -----------------------------
VDEP CJEP 0
VDEP ( T )
ABET ( T ) = ABET ⋅ ---------------------------
VDEP
All other parameters are assumed to be temperature independent.
14.10.3: DC Equations
Internal Voltages
Define:
Vbei = V ( B′ ) – V ( E′ )
Vbci = V ( B′ ) – V ( C′ )
Vbep = V ( B * ) – V ( E′ )
Vbcp = V ( B * ) – V ( C′ )
Vsci = V ( S′ ) – V ( C′ )
I Tf 1
I Tf = I Tf 1 ⋅ 1 + ----------- I Tf 1 = ---------- ⋅ exp --------------------------
C 10 Vbei
- with:
ICH Q pT MCF ⋅ V T
Q jEI and Q jCI are the depletion charges stored at the BE and BC junction,
In general, the minority charges Q fT and Q rT are non-linearly dependent on I Tf and I Tr . For this
case, the implicit equation involving the common variable Q pT is solved internally by using a simple
iteration process.
Model parameters: QP0, HJEI and HJCI.
V ceff 2 –3
1 x + x + 10
I CK = ------------------------ ⋅ ------------------------------------------------ ⋅ 1 + ------------------------------------
RCI 0 ( T ) V ceff 2 2
1 + --------------------------
VLIM ( T )
with:
V ceff – VLIM ( T )
x = --------------------------------------------
-
VPT
V
V ceff = V T ⋅ 1 + ln 1 + exp ------c- – 1
VT
with:
Q f 0 corresponds to the low-current component and the other components correspond to the emitter,
base and collector contributions at high collector current densities. It is important to notice that Q fCT
is not the actual collector minority charge because it includes a bias-dependent weighting function due
to the lateral current spreading.
CJCI 0 ( T ) C jCI
τ f 0 = T 0 + DT 0 H ⋅ ---------------------------- – 1 + TBVL ⋅ ---------------------------
- – 1
C jCI CJCI 0 ( T )
with C jCI as the internal Base-Collector depletion capacitance (evaluated without punch-through
effect to cover all regions).
Model parameters: T0, DT0H and TBVL.
2
i + i + ALHC I CK
w = ----------------------------------------- and i = 1 – --------
-
1 + 1 + ALHC I Tf
2
i + i + ALHC I CK
i ck = 1 – ----------------------------------------- with i = 1 – --------
-
1 + 1 + ALHC I Tf
2 ln ( 1 + LATL ⋅ w ) ln ( 1 + LATB ⋅ w )
fCT = ----------------------------------------- ⋅ ---------------------------------------------- – ----------------------------------------------
LATB – LATL LATL LATB
1 + LATL ick – 1
κ = ---------------------------
1 + LATB
• LATB = LATL
2
- ⋅ [ z ⋅ ln ( z ) – LATB ⋅ w ]
f CT = --------------------------
2
LATB ⋅ z
with z = ( 1 + LATB ⋅ w )
and the normalized injection width:
1 – i ck
w = -------------------------------------
-
1 + LATB ⋅ i ck
Q r = TR ⋅ I Tr
with:
Q0 = QP 0 ( T ) ⋅ ( 1 + FDQR 0 )
∆Q p = Q jEI + Q jCI + Q f
The depletion charges, Q jEI , Q jCI and the actual minority charge, Q f are described in the charge
section below.
Model parameters: RBI0, FGEO, FDQR0, FCRBI, FQI and QR0.
QAVL ( T )
I AVL = I Tf ⋅ FAVL ( T ) ⋅ V CBeff ⋅ exp – --------------------------------
C jCI ⋅ V CBeff
with:
V CBeff = VDCI ( T ) – Vbci
2
i + i + ALHC I CK
i ck = 1 – ----------------------------------------- with i = 1 – --------
-
1 + 1 + ALHC I Tf
1 + LATB ick – 1
κ = --------------------------- as in DC equations.
1 + LATL
with:
LATL + LATB 2 LATL ⋅ LATB 3
fCi = w + ----------------------------------------- ⋅ w + --------------------------------------- ⋅ w
2 3
2 3
z ⋅ { 2 ⋅ ln ( z ) – 1 } + 1 z ⋅ { 3 ⋅ ln ( z ) – 1 } + 1
f Cb = 1 – ----------------- ⋅ ------------------------------------------------------- + ----------------- ⋅ -------------------------------------------------------
LATL LATL
LATB 4 ⋅ LATB LATB 9 ⋅ LATB
with: z = 1 + LATB ⋅ w ,
f Cl has the same form as f Cb but with LATB and LATL interchanged.
• LATB = LATL
2 1 + LATB ⋅ w ⁄ 3
f C = w ⋅ -------------------------------------------
1 + LATB ⋅ w
with the normalized injection width:
1 – i ck
w = -------------------------------------
-
1 + LATB ⋅ i ck
1
– -----------
ZEI
V f = VDEI ( T ) ⋅ 1 – ALJEI ( T )
The expressions of the peripheral Base-Emitter capacitance C jEP and corresponding charge Q jEP are
obtained by inserting the related model parameters as well as the voltage Vbep in the previous
equations.
Model parameters: CJEP0, VDEP, ZEP and ALJEP.
1
– -----------
ZCI
V fCI = VDCI ( T ) ⋅ 1 – 2.4
and
ν jm = – ( VPTCI – VDCI ( T ) ) + V r ⋅ ln ( 1 + e m )
with:
VPTCI – VDCI ( T ) + ν jr
e m = exp -----------------------------------------------------------------
Vr
and the voltage at which the transition from medium to large reverse bias starts.
V r = 0.1 ⋅ ( VPTCI – VDCI ( T ) ) + 4 ⋅ V T
with the term corresponding to the classical equation at medium bias and
CJCI 0 ( T ) em er
- ⋅ ---------------
C jCIcl = -----------------------------------------------------------
ZCI e + 1 e + 1
- ⋅ -------------
-
( 1 – ν jm ⁄ VDCI ( T ) ) m r
and the term corresponding to the large reverse bias region beyond punch-through;
CjCI 0 r 1
- ⋅ ----------------
C jCIpt = -------------------------------------------------------------
ZCIR e + 1
( 1 – ν jr ⁄ VDCI ( T ) ) m
with:
ν jr ( 1 – ZCIR )
Q jCIr = ------------------------ ⋅ 1 – 1 – -------------------------
-
CjCI 0 r
1 – ZCIR VDCI ( T )
EG ( T 0 ) EG ( T )
VDx ( T ) = VDx ⋅ T r – V T ⋅ 3 ⋅ ln ( T r ) + -------------------- – ------------------
VT 0 VT
with the bandgap voltage at device and nominal temperatures given by:
2
T
EG ( T ) = VGB – GAP 1 ⋅ --------------------------------
( T + GAP 2 )
and
2
T0
EG ( T 0 ) = VGB – GAP 1 ⋅ ----------------------------------
( T 0 + GAP 2 )
Equivalent circuit
s CBCO c
RS RCX
si
Ibcp Qbcp
RBIP/qbp cx
bp
Itfp−Itrp
Ibep Qbep
RCI
ci
Qbcx Qbc
Ibc−Igc
RBX RBI/qb
b bx bi
RE
CBEO
CTH Qcxf
Ith RTH Itzf 1Ω
tl
thermal network excess phase network
Figure 2-8: Equivalent Circuit of the VBIC Bipolar Model (large signal)
General Parameters
VERSION Version parameter. Only 1.1 (if REV=5) and 1.2 (if REV= - 1.2
0) are permitted, otherwise 1.2 is assumed.
General Parameters
BULK Name of the global node used to connect the substrate - “0”
when the terminal ns of the device is unspecified. (gnd)
Partioning Parameters
Resistance Parameters
Epilayer Parameters
Noise Parameters
The expression of ideal reverse current has been modified to account for a separate saturation current
IS in reverse operation (HBTs).
or
Base Charge
2
q1 q1 + 4 ⋅ q2
qb = ------ + --------------------------------- (v1.1.5)
2 2
with:
qdbe qdbc
q 1 = 1.0 + -------------- + ------------- (a zero value means infinity for VER and VEF)
VER VEF
Itfi Itri
q 2 = ------------ + ----------- (a zero value means infinity for IKR and IKF)
IKR IKF
qdbe and qdbc are the normalized depletion charges.
if: (QBM < 0.5)
1.0 NKF
-------------
NKF
-
q1 + 4 ⋅ q 2
q1
qb = ------ + -----------------------------------------------------
2 2
else,
q1 NKF
qb = ------ ⋅ [ 1.0 + ( 1.0 + 4.0 ⋅ q 2 ) ] (SGP)
2
Itfp = ISP ⋅ WSP ⋅ exp ---------------------------- + ( 1.0 – WSP ) ⋅ exp ---------------------------- – 1.0
Vbep Vbci
NFP ⋅ Vtd NFP ⋅ Vtd
1 1 + 4 ⋅ q2p
qbp = --- + -------------------------------
2 2
Itfp
q 2 p = ----------- (a zero value means infinity for IKP)
IKP
Parameters: ISP, WSP, NFP, IKP.
1.0 + GAMM ⋅ exp -------------
Vbci
RCI > 0.0
Kbci = Vtd
0.0 RCI ≤ 0.0
1.0 + GAMM ⋅ exp --------------
Vbcx
RCI > 0.0
Kbcx = Vtd
0.0 RCI ≤ 0.0
Parameters: RCI, GAMM.
The intrinsic collector current is modeled with the enhanced Kull quasi-saturation model:
Iohm
Irci = --------------------------------
2
1.0 + derf
where:
RCI ⋅ Iohm
derf = ----------------------------------------------------
2
Vrci + 0.01
VO + ------------------------------------
2.0 ⋅ HRCF
VO and HRCF are model parameters for which a zero value means infinity.
A simple qb modulation model is used and leads to:
Vrbi ⋅ qb
Irbi = ------------------------
RBI
Parameter: RBI
A similar expression is used to model the qbp modulation in parasitic device:
Vrbp ⋅ qbp
Irbp = ------------------------------
RBP
Parameter: RBP
Ibe = WBE ⋅ IBEI ⋅ exp --------------------------- – 1.0 + IBEN ⋅ exp ------------------------------ – 1.0
Vbei Vbei
NEI ⋅ Vtd NEN ⋅ Vtd
Ibex = ( 1.0 – WBE ) ⋅ IBEI ⋅ exp --------------------------- – 1.0 + IBEN ⋅ exp ------------------------------ – 1.0
Vbex Vbex
NEI ⋅ Vtd NEN ⋅ Vtd
else,
2
( PC – Vbci ) + 0.01 + PC – Vbci
vl = ------------------------------------------------------------------------------------------
2
Parameters: PC, MC, AVC1, AVC2.
dvh ⋅ Mx
1.0 – Mx 1.0 – FC + ------------------------
1.0 – ( 1.0 – FC ) 2.0 ⋅ Px
qj = Px ⋅ -------------------------------------------------------- + dvh ⋅ ----------------------------------------------------
-
1.0 – Mx ( 1.0 – FC )
1.0 + Mx
else,
V 1.0 – Mx
1.0 – 1.0 – -------
Px
qj = Px ⋅ --------------------------------------------------------
1.0 – Mx
where:
Mx (x=C,E or S) is the junction grading coefficient.
Single piece model
If the smoothing coefficient AJx (x=C,E or S) is positive, the single piece depletion capacitance model is
used to compute depletion charges.
Define: dv 0 = – FC ⋅ Px
VRT + dv 0
vn 0 = ------------------------------ (v1.2 only)
VRT – dv 0
2 ⋅ vn 0
vnl 0 = ---------------------------------------------------------------------------------------------------------------------------------------------- (v1.2 only)
( vn 0 – 1.0 ) + 4 ⋅ AJx + ( vn 0 + 1.0 ) + 4 ⋅ ART 2
2 2 2
2.0 ⋅ V + VRT + dv 0
vn = ---------------------------------------------------- (v1.2 only)
VRT – dv 0
2 ⋅ vn
vnl = ---------------------------------------------------------------------------------------------------------------------------------------- (v1.2 only)
( vn – 1.0 ) + 4 ⋅ AJx + ( vn + 1.0 ) + 4 ⋅ ART 2
2 2 2
VRT –Mx
crt = 1.0 + ----------- (v1.2 only)
Px
cmx = ( 1.0 – FC )
– Mx
(v1.2 only)
2
vl = 0.5 ⋅ ( V – FC ⋅ Px – ( V – FC ⋅ Px ) + AJx ) + FC ⋅ Px (v1.1.5)
or:
2 2
vl = 0.5 ⋅ ( V – FC ⋅ Px – ( V – FC ⋅ Px ) + 4 ⋅ AJx ) + FC ⋅ Px (v1.2)
and:
2
vl 0 = 0.5 ⋅ ( – FC ⋅ Px – ( – FC ⋅ Px ) + AJx ) + FC ⋅ Px (v1.1.5)
or:
2 2
vl 0 = 0.5 ⋅ ( – FC ⋅ Px – ( – FC ⋅ Px ) + 4 ⋅ AJx ) + FC ⋅ Px (v1.2)
Parameters: AJx, Px, Mx (x=C,E or S), FC, VRT (v1.2), ART (v1.2).
Base-Emitter Charge
The base-emitter charge is partitioned between Qbe and Qbex.
Qbe contains also a diffusion charge component.
Base-Collector Charge
The intrinsic base-collector charge Qbc contains contributions of depletion and diffusion charges. As
the extrinsic charge Qbcx, it also includes a term corresponding to the charge associated with the base
pushout into the collector.
The intrinsic base-collector charge is
Qbc = CJC ⋅ qdbc + TR ⋅ Itri + QC 0 ⋅ Kbci
qdbc is the normalized depletion charge calculated using the algorithm described above:
qdbc = qj ( Vbci, PC, MC, FC, AJC )
Parameters: CJC, TR, QC0, PC, MC, FC, AJC.
The extrinsic base-collector charge is
Qbcx = QC 0 ⋅ Kbcx
Parameter: QC0.
TNOM is the temperature at which the model parameters have been extracted. T corresponds to the
dynamic temperature Td if self-heating is turned on. Otherwise, T corresponds to the operating
temperature. The capacitance Cth is assumed to be temperature indepdendent.
k k Td
V td = --- ⋅ T d V tnom = --- ⋅ T nom and r td = ------------
-
q q T nom
Parasitic Resistors
XRC
RCX ( T d ) = RCX ⋅ ( r td )
XRC
RCI ( T d ) = RCI ⋅ ( r td )
XRB
RBX ( T d ) = RBX ⋅ ( r td )
XRB
RBI ( T d ) = RBI ⋅ ( r td )
XRE
RE ( T d ) = RE ⋅ ( r td )
XRS
RS ( T d ) = RS ⋅ ( r td )
XRC
RBP ( T d ) = RBP ⋅ ( rtd ) (v1.1.5)
Saturation Currents
XIS
-----------
EA 1.0 – r td
⋅ exp – --------- ⋅ --------------------
NF
IS ( T d ) = IS ⋅ ( r td )
NF V td
XIS
-------------
EA 1.0 – r td
⋅ exp – ------------- ⋅ --------------------
NFP
ISP ( T d ) = ISP ⋅ ( r td )
NFP V td
XIKF
IKF ( T d ) = IKF ⋅ ( r td ) (v1.2 only)
XISR
----------------
DEAR 1.0 – r td
⋅ exp – ------------------ ⋅ --------------------
NR
ISRR ( T d ) = ISRR ⋅ ( r td )
NR V td
XII
------------
EAIE 1.0 – r td
⋅ exp – ---------------- ⋅ --------------------
NEI
IBEI ( T d ) = IBEI ⋅ ( r td )
NEI V td
XIN
---------------
EANE 1.0 – r td
⋅ exp – ------------------ ⋅ --------------------
NEN
IBEN ( T d ) = IBEN ⋅ ( r td )
NEN V td
XII
------------
EAIC 1.0 – r td
⋅ exp – ---------------- ⋅ --------------------
NCI
IBCI ( T d ) = IBCI ⋅ ( r td )
NCI V td
XIN
---------------
EANC 1.0 – r td
⋅ exp – ------------------ ⋅ --------------------
NCN
IBCN ( T d ) = IBCN ⋅ ( r td )
NCN V td
XII
------------
EAIC 1.0 – r td
⋅ exp – ---------------- ⋅ --------------------
NCI
IBEIP ( T d ) = IBEIP ⋅ ( r td )
NCI V td
XIN
---------------
EANC 1.0 – r td
⋅ exp – ------------------ ⋅ --------------------
NCN
IBENP ( T d ) = IBENP ⋅ ( r td )
NCN V td
XII
-----------------
EAIS 1.0 – r td
⋅ exp – ---------------- ⋅ --------------------
NCIP
IBCIP ( T d ) = IBCIP ⋅ ( r td )
NCIP V td
XIN
-------------------
EANS 1.0 – r td
⋅ exp – ------------------- ⋅ --------------------
NCNP
IBCNP ( T d ) = IBCNP ⋅ ( r td )
NCNP V td
2
VBBE ( T d ) = VBBE ⋅ ( 1.0 + TVBBE 1 ⋅ ( T d – T nom ) + TVBBE 2 ⋅ ( T d – T nom ) )
VBBE ( T d )
EBBE ( T d ) = exp – -------------------------------------------
-
NBBE ( T d ) ⋅ V td
Built-in Potentials
PE, PC and PS are scaled using the corresponding parameters EAIE, EAIC, EAIS, and the following
algorithm (Px means PE, PC, or PS and EAIx means EAIE, EAIC, or EAIS).
where:
psiin = psiio ⋅ r td – 3.0 ⋅ V td ⋅ log ( r td ) – EAIx ⋅ ( rtd – 1.0 )
In v1.2, the expression psiio has been updated and reads now:
Zero-Bias Capacitances
ME
CJE ( T d ) = CJE ⋅ --------------------
PE
PE ( T d )
MC
CJC ( T d ) = CJC ⋅ --------------------
PC
PC ( T d )
MC
CJEP ( T d ) = CJEP ⋅ --------------------
PC
PC ( T d )
MS
CJCP ( T d ) = CJCP ⋅ -------------------
PS
PS ( T d )
Epilayer Parameters
1.0 – r td
⋅ exp – EA ⋅ --------------------
XIS
GAMM ( T d ) = GAMM ⋅ ( r td )
V td
XVO
VO ( T d ) = VO ⋅ ( r td )
One can download Silvaco’s Verilog-A implementation of the VBIC Model at www.silvaco.com.
Syntax
.VERILOG "model_name.va"
YVLGmodel_name < ports> params
Syntax
.VERILOG "model_name.va"
YVLGmodel_name < ports> params
The complete SPICE deck for a DC analysis of a VERILOG-A implemented EKV model with extrinsic
capacitance is shown below.
Where %Pn represents pin names and paramn=@paramn allows values for paramn to be entered
from the schematic.
The SPICE deck must contain the following:
.VERILOG "model_name.va"
and the
.verilog “file.va” name of the file that contains the Verilog-A module(s)
that will be used within this input deck.
or
Examples
*Spice deck no VLG Model Card
.verilog “resistor.va”
.verilog “inductor.va”
.verilog “capacitor.va”
*voltage source
vin in 0 sin (0 5 10e06 0 0)
.tran 1n 800n
.print v(in) v(out)
.end
or
.verilog “resistor.va”
.verilog “inductor.va”
.verilog “capacitor.va”
*voltage source
vin in 0 sin (0 5 10e06 0 0)
YVLGres in 2 paramsR
YVLGind 2 out paramsL
YVLGcap out 0 paramsC
.tran in 800n
.print v(in) v(out)
.end
This chapter provides VERILOG-A examples from simple digital gates to complex behavioral models of a
Phase Lock loop.
15.1.1: Inverter
Figure 15-1 shows the Inverter circuit symbol.
in out
Logic Table
IN OUT
1
0
‘Include "discipline.h"
module inv(in, out);
input in;
output out;
electrical in,out;
endmodule
15.1.2: Buffer
Figure 15-3 is the Buffer circuit symbol.
Logic Table
IN OUT
0 0
1 1
‘include "discipline.h"
module inv(in,out);
input in;
output out;
electrical in,out;
endmodule
15.1.3: Nand
Figure 15-5 is a well known Nand circuit symbol.
in1
out
in2
Logic Table
IN1 IN2 Out
0 0 1
0 1 1
1 0 1
1 1 0
‘include "discipline.h"
module dnand(in,out);
integer in_state[0:size-1],i;
integer out_state;
real vout;
analog
begin
@(initial_step)
for(i=0;i<size;i=i+1) in_state[i]=0;
generate i (0,size-1)
begin
@(cross(V(in[i]) - vth))
begin
in_state[i] = V(in[i]) > vth;
out_state = 1;
for (i=0;i<size;i=i+1)
if (!(out_state && in_state[i])) out_state = 0;
if (out_state) vout = vout_low; // inversion of output
else vout = vout_high;
end
end
.tran 1n 40u
.iplot v(in1)
+ ’v(in2)+10’
+ ’v(out)+20’
.probe all
.end
The number of input is limited by size, so if you want more input, you had better set "size = number" as
is needed.
Example
If you want 4 input nand,
‘include "discipline.h"
module dnand(in,out); you don’t need change
.options iplot_one
.iplot v(in1)
+ ’v(in2)+10’
+ ’v(in3)+20’
+ ’v(in4)+30’
+ ’v(out)+40’
.probe all
.end
15.1.4: NOR
Figure 15-8 is a well known 2 input NOR circuit.
In1
out
in2
Logic Table
IN1 IN2 Out
0 0 1
0 1 0
1 0 0
1 1 0
‘include "discipline.h"
module dnor(in,out);
integer in_state[0:size-1],i;
integer out_state;
real vout;
analog
begin
@(initial_step)
for(i=0;i<size;i=i+1) in_state[i]=0;
generate i (0,size-1)
begin
@(cross(V(in[i]) - vth))
begin
in_state[i] = V(in[i]) > vth;
out_state = 0;
for (i=0;i<size;i=i+1)
if (in_state[i]) out_state = 1;
if (out_state) vout = vout_low;
else vout = vout_high;
end
end
v01 vcc 0 dc 5
v02 in1 0 pulse(0 5 1u 1n 1n 1u 2u)
v03 in2 0 pulse(0 5 2u 1n 1n 2u 4u)
*
YVLG_OR in1 in2 out dnor
.tran 1n 20u
.iplot v(in1)
+’v(in2)+10’
+’v(out)+20’
.probe all
.end
This example can also expand the number of input. If you want more (ex. the number is 3), change the
VERILOG-A source and Spice inputdeck as follows.
*
YVLG_OR in1 in2 in3 out nor size=3
.tran 1n 20u
.iplot v(in1)
+ ’v(in2)+10’
+ ’v(in3)+20’
+ ’v(out)+30’
.probe all
.end
15.1.5: EXOR
Figure 15-11 is a well-known 2 input XOR circuit.
in1
out
in2
Logic Table
IN1 IN2 Out
0 0 0
0 1 1
1 0 1
1 1 0
‘include "discipline.h"
module dxor(in,out);
parameter real vh=5,
vl=0,
vth=1.5,
tdelay=10n,
trise=5n,
tfall=5n;
input [0:1] in;
output out;
voltage in,out;
real vout;
analog
begin
if ( V(in[0])==V(in[1]) ) vout=vl;
else vout=vh;
generate i (0,1)
begin
@(cross(V(in[i]) - vth))
begin
if ( V(in[0])==V(in[1]) ) vout=vl;
else vout=vh;
end
end
v01 vcc 0 dc 5
v02 in1 0 pulse(0 5 1u 1n 1n 1u 2u)
v03 in2 0 pulse(0 5 2u 1n 1n 2u 4u)
*
YVLG_OR in1 in2 out dxor
.tran 10n 40u
.iplotv(in1)
+’v(in2)+10’
+’v(out)+20’
.probe all
.end
D Q
CLK Q
Logic Table
CLK D Q Q_bar
0 0 0 1
0 1 0 1
1 1 1 0 (CLK:L - >H)
1 0 0 1 (CLK:L - >H)
‘include "discipline.h"
integer x;
analog
begin
@(initial_step) x = 0;
.tran 1n 50u
*.probe all
.let v1=’v(q1)+6’
.let v2=’v(q2)+12’
.let v3=’v(q3)+18’
.let v4=’v(q4)+24’
.iplot v(clk) v1 v2 v3 v4
.end
Q1 Q2 Q3
Data D Q D Q D Q D Q
H (s
Figure 15-15: 4bitShift Resistor
Spice Inputdeck(4bit_shift_reg.in):
.tran 1n 50u
*.probe all
.let v1=’v(q1)+6’
.let v2=’v(q2)+12’
.let v3=’v(q3)+18’
.let v4=’v(q4)+24’
.iplot v(clk) v1 v2 v3 v4
.end
Q1 Q2 Q3
D Q D Q D Q D Q
C
CL CLKQ CLKQ CLKQ CLK Q
Spice inputdeck(4bit_dcount.in):
.tran 1n 50u
.let v1=’v(q1)+10’
.let v2=’v(q2)+20’
.let v3=’v(q3)+30’
.let v4=’v(q4)+40’
.iplot v(clk) v1 v2 v3 v4
.probe all
.end
15.2.1: LPF
LPF is called "differentialtor" (or differential circuit), as is shown as Figure 15-19.
Vin(t) Vout(t)
R
1
H ( s ) = ---------------------------------------------
1 + ( 1 ⁄ 2 Πfreq )S
We can write this equation for VERILOG-A using Laplace function.
Laplace_nd means "n: numerator" and "d: dominator". The numerator of above transfer function is
"1", and the dominator above transfer function are 1+(1/2pai*frq)*S
We can write:
-3db
Freq(Hz)
‘include "discipline.h"
‘include "Constants.h"
module lpf1(in,out);
input in;
output out;
voltage in,out;
endmodule
v01 in 0 2.5 ac 1
YVLG_lpf in out lpf
c01 out 0 1p
.options use degrees
.ac oct 10 1 1g
.let vdb=vdb(out)
.let vp=vp(out)
.iplot vdb
.end
15.2.2: HPF
HPF can be described as an Integrate(C-R) circuit (see Figure 15-22).
Vin(t)
Vout(t)
C
R
( 1 ⁄ 2 Πfreq )S
H ( s ) = ---------------------------------------------
1 + ( 1 ⁄ 2 Πfreq )S
We can write the above equation to VERILOG-A as follows:
‘include "discipline.h"
module hpf(in,out);
input in;
output out;
voltage in,out;
analog
V(out) <+ laplace_nd(V(in), {0,1/(‘M_TWO_PI*freq_p1)} , {1,1/
(‘M_TWO_PI*freq_p1)} );
endmodule
v01 in 0 2.5 ac 1
YVLG_lpf in out hpf
*c01 out 0 1p
.ac oct 10 1 1g
.let vdb=vdb(out)
.let vp=vp(out)
.iplot vdb
*.iplot vp
.end
15.2.3: BPF
BPF can be described using LPF and HPF.
BPF characteristics are shown in Figure 15-24.
-3db
Frq_p1 Frq_p2
Freq(Hz)
Figure 15-24: BPF Characteristics
If the input signal Frequency is "f", then BPF behavior is shown as:
• f <Freq_p1: input signal can't through
• Freq_p1 < f <Freq_p2: input signal can through
• Freq_p2 < f: input signal can't through
BPF is described in two ways:
1. One is to describe it by the transfer function
2. Or, description by LPF and HPF.
The later way can be described simply as the following
YVLG_LPF 2 IN LPF
YVLG_HPF OUT 2 HPF
The former way is difficult unless you can understand transfer function.
BPF transfer function shows the following equation:
( 1 ⁄ 2 Πfreq )S
H ( s ) = ------------------------------------------------------------------------------------------2
1 + ( 1 ⁄ 2 Πfreq )S + ( 1 ⁄ 2 Πfreq )S
We can describe transfer function like the following using laplace function of VERILOG-A:
analog
V(out) <+ laplace_nd(V(in), {0,1/(‘M_TWO_PI*freq_p1)} ,
{1,1/(‘M_TWO_PI*freq_p1),pow(1/(‘M_TWO_PI*freq_p2),2)} );
endmodule
v01 in 0 2.5 ac 1
YVLG_lpf in out bpf
c01 out 0 1p
.ac oct 10 10 1g
.let vdb=vdb(out)
.let vp=vp(out)
.iplot vdb
.end
R2
Gain = -------
R1
We can also describe the following for Vout:
R2
Vout – Vref = – ------- × ( Vin – Vref )
R1
// simple opamp
‘include "descipline.h"
module amp(in,out);
input in;
output out;
electrical in,out;
// parameter real gain=10;
parameter avcc=5;//Analog supply voltage soruce
parameter avss=0;//Analog ground reference
parameter vref=2.5;//input reference voltage
parameter real R1=1k;//initial resistance
parameter real R2=1k;//initial resistance
real A,gain,vout;
analog
begin
@(initial_step)
begin
gain=R2/R1;
A=-1*gain;//invert signal
end
vout=A*(V(in) - vref) + vref;
if( vout > avcc )
vout=avcc;
if( vout < avss )
vout=avss;
.probe all
.end
As for the above Spice inputdeck, the amplitude of input signal is 0.1(V) and R2 is set to 10k, so
Gain=R2/R1=10k/1k=10. We can expect Vout as 10 times of the INPUT signal voltage.
Running spice simulation above inputdeck by these conditions, we get Figure 15-27.
In other words, when CLK is high at t, Vout(t) is Vin(t). When CLK changes high to low at t+dt,
Vout(t+dt) is Vin(t)
‘include "descipline.h"
module sample_hold(in,out,clk);
input in,clk;
output out;
voltage in,out,clk;
parameter real clk_vth = 2.5;
real v;
analog
begin
@(initial_step)
v=V(in);
if (analysis("static") || (V(clk) > clk_vth))
v = V(in); // passing phase
@(cross(V(clk)-clk_vth,0))
v = V(in); // sampling phase
V(out)<+v;
end
endmodule
electrical in,clk;
electrical [bit-1:0] out;
real sample;
integer result[bit-1:0]; // integer array
integer i; // index loop
analog begin
@( cross(V(clk)-vth, +1) ) begin
sample = V(in);
for( i=bit-1;i>=0;i=i-1 ) begin
if( sample>vth )
begin
result[i] = 5.0;
sample = sample - vth;
end else begin
result[i] = 0.0;
end
sample = 2.0 * sample;
end
end
for(i=0;i<bit;i=i+1 ) begin
V(out[i]) <+ transition(result[i], dly, ttime);
end
end
endmodule
Spice inputdeck(adc.in):
*----- 8bit pipelined ADC -----*
.verilog "adc.va"
.options iplot_one
* voltage sources
vvin vin 0 sin (2.5 2.5 1meg 0 0 )
vvclk vclk 0 PULSE (0 5 10n 1n 1n 5n 20n)
* analysis
.tran 1n 1000n
.let msb=’v(msb)/5+20’
.let7bit=’v(7bit)/5+18’
.let6bit=’v(6bit)/5+16’
.let5bit=’v(5bit)/5+14’
.let4bit=’v(4bit)/5+12’
.let3bit=’v(3bit)/5+10’
.let2bit=’v(2bit)/5+8’
.letlsb=’v(lsb)/5+6’
.letclk=’v(vclk)/5’
* save all data
.iplot v(vin) clk msb 7bit 6bit 5bit 4bit 3bit 2bit lsb
.end
analog begin
@(initial_step)
begin
vth=fullscale/2 ;
for( i=1;i <= maxbit; i=i+1) begin
vlump[i]=fullscale/pow(2,i) ;
end
end
for (i=1 ;i<= bit; i=i+1) begin
if( V(in[i-1])>vth ) begin
code[i-1]=1 ;
end else begin
code[i-1]=0 ;
end
vout[i]=vlump[i]*code[i-1] ;
end
if (bit<maxbit) begin
for( i=maxbit;i>bit;i=i-1 ) begin
vout[i]=0 ;
end
end
outv=vout[1]+vout[2]+vout[3]+vout[4]+vout[5]+vout[6]+vout[7]+vout[9]+vout[10
] ;
end
endmodule
Spice inputdeck:
*----- 8bit DAC -----*
.verilog "dac.va"
.verilog "dff.va"
.options iplot_one
v03 clk 0 pulse(0 5 0u 1n 1n 0.5u 1u)
*
YVLG_dff1 q1 d1 clk d1 dff
YVLG_dff2 q2 d2 q1 d2 dff
YVLG_dff3 q3 d3 q2 d3 dff
YVLG_dff4 q4 d4 q3 d4 dff
YVLG_dff5 q5 d5 q4 d5 dff
YVLG_dff6 q6 d6 q5 d6 dff
YVLG_dff7 q7 d7 q6 d7 dff
YVLG_dff8 q8 d8 q7 d8 dff
*
YVLG_DAC d8 d7 d6 d5 d4 d3 d2 d1 out dac bit=8
.tran 1n 500u
.let LSB=’v(d1)/5+6’
.let BIT2=’v(d2)/5+8’
.let BIT3=’v(d3)/5+10’
.let BIT4=’v(d4)/5+12’
.let BIT5=’v(d5)/5+14’
.let BIT6=’v(d6)/5+16’
.let BIT7=’v(d7)/5+18’
.let MSB=’v(d8)/5+20’
*.let BIT9=’v(d9)/5+22’
*.let MSB=’v(d10)/5+24’
.iplot v(out) LSB BIT2 BIT3 BIT4 BIT5 BIT6 BIT7 MSB
.probe all
.end
Verilog-A source(delta_sigma.va):
‘include "discipline.h"
‘include "Constants.h"
module delta_sigma(in,clk,out);
input in,clk;
output out;
voltage in,clk,out;
parameter real quantizer_vth=2.5;
parameter real clk_vth=0;
parameter real d2a_gain=1.0;
real vsum;
real vd;
real vint;
real vout;
real hi,lo;
analog
begin
@(initial_step)
begin
vd=0;vint=0;vout=0;
hi = 5; lo = 0;
end
@(cross(V(clk) - clk_vth,1))
begin
// summing junction
vsum = V(in) - vd ;
// integrator
vint = vint + vsum;
// quantizer
if (vint > quantizer_vth) vout = hi ;
else vout = lo ;
// D to A
vd = d2a_gain*vout ;
end
V(out) <+ vd ;
end
endmodule
.options iplot_one
v01 vcc 0 dc 5
v02 clk 0 pulse(0 5 10n 0.1n 0.1n 10n 20n)
v03 in 0 SFFM (2.5 2.5 44.1k 1000 10 )
*
YVLG_sigmdelata in clk out delta_sigm
*
.tran 1n 20u
.let vin=’v(in)+6’
.let vout=’v(out)+6’
.let vclk=v(clk)
.iplot vout vin vclk
.end
‘include "discipline.h"
‘include "constants.h"
@(cross(V(clk)-vth,+1))
begin
if(V(clr) < vth) state=0 ;
else state=(V(d) > vth) ;
if(state) td=td_l2h ;
else begin
td=td_h2l ; tf=tf_clk ;
end
end
@(cross(V(clr)-vth,-1))
begin
state=0 ; td=td_clr ; tf=tf_clr ;
end
In the module description, three capacitors are introduced to represent input capacitance of module
ports; d, clk and clr. The capacitance values are derived from transistor level simulation, and should
match to the equivalent gate capacitance of MOSFET at each module port. For rough estimation, the
following capacitance equation can be used to calculate gate capacitance.
Cgate = EPSox*L*W/TOX
where EPXox is gate oxide permittivity = 3.453143e-11 [F/m]
L and W are channel length and width in meter
TOX is gate oxide thickness in meter
Another technique for achieving accurate model is the introduction of complex formula to model delay
time and rise/fall transition time of flip-flop. Generally, the delay time is the function of fanout and
ramp-time of clock pulse, and can be formulated as follows;
In this example, the parameter SLOPE is replaced by (SLOPE - SLOPEnom), where SLOPEnom is the
nominal slope at which T0 and T1 are extracted.
The transition time is formulated in the same manner as delay time, except the fanout dependency
term is excluded, and is defined as following formula;
Note that since the delay time of high data and low data are not identical, the different delay
parameters are introduced to calculate each delay formula of high and low data. In addition, the
different delay parameters are introduced to calculate the clear time. Likely, the different transition
parameters are introduced to calculate rise and fall time individually.
Simulation Results:
Simulation results are shown in Figure 15-39 through Figure 15-41. These figures show that the
waveforms obtained from VERILOG-A simulation (solid lines) are well matched to those obtained from
transistor level simulation (dot lines).
‘include "discipline.h"
‘include "constants.h"
analog begin
@(cross( V(in_ref) - vdd/2 , 1 , ttol )) state = state - 1;
@(cross( V(in_fb) - vdd/2 , 1 , ttol )) state = state + 1;
if ( state > 1 ) state = 1 ;
if ( state < -1 ) state = -1;
V(out_dn) <+ transition( (state + 1)/2*vdd , delay , ttime );
V(out_up) <+ transition( (state - 1)/2*vdd+vdd , delay , ttime );
end
endmodule
‘include "discipline.h"
‘include "constants.h"
analog begin
freq = fc + gain * (V(in) - vnom) ;
V(out) <+ amp * sin( 2 * ‘M_PI * idt(freq) ) + offset ;
end
endmodule
‘include "discipline.h"
‘include "constants.h"
analog begin
@( cross( V(in) - vdd/2 , +1 ) ) begin
if ( count >= div_num/2 ) begin
state = !state ;
count = 0 ;
end
count = count + 1 ;
end
V(out) <+ transition( state * vdd, delay , ttime ) ;
end
endmodule
Note that the parameters gain and vnom used in VCO module, are derived from transistor level
simulation, therefore the phase-lock characteristic obtained from the VERILOG-A simulation would be
matched to that obtained from transistor level simulation.
The input deck is shown in the following Example.
.tran 1n 2u
.ic v(lpf)=1.1
.save v(ref) v(fb) v(up) v(down) v(lpf) v(ckout)
.end
Simulation Results:
Simulation results are shown in Figure 15-43 through Figure 15-45.
Figure 15-43 shows the phase-frequency difference between reference clock and feedback clock at
time=0s. After 1.5us of transient simulation, the feedback clock is locked to the reference clock as
shown in Figure 15-44. The VCO input voltage supplied from charge pump keeps constant value of
1.27v which is consistent with the given value of parameter vnom in VCO module.
Figure 15-45 shows the phase-lock characteristic of VERILOG-A mixed simulation and full transistor
level simulation.
C E
Capacitance Equations..................................................... 14-42 EA ............................................................................ 14-127
Capacitance Temperature Equations................................... 14-45 EAIC ......................................................................... 14-127
Case ................................................................................ 5-5 EAIE ......................................................................... 14-127
CBCO ........................................................................ 14-125 EAIS ......................................................................... 14-127
CBEO......................................................................... 14-125 EANC ........................................................................ 14-127
CCSO ........................................................................ 14-125 EANE ........................................................................ 14-127
Charge and Capacitance Equations .................................. 14-133 EANS ........................................................................ 14-127
Chi-Square Distribution ...................................................... 9-14 EAP .......................................................................... 14-127
Circular Integrator Operator................................................. 6-13 Early Voltage Parameters .............................................. 14-124
CJC .................................................... 14-47, 14-60, 14-126 EKV MOSFET Model ...................................................... 14-29
CJCP ......................................................................... 14-126 Emission Coefficient Parameters ..................................... 14-123
CJE .................................................... 14-47, 14-59, 14-125 Emitter depletion charges................................................. 14-72
CJEP ......................................................................... 14-126 Empty Disciplines............................................................. 4-14
CJS ................................................................. 14-48, 14-61 Epilayer Parameters ........................................ 14-126, 14-139
Closing a File ................................................................... 9-24 Equivalent circuit.......................................................... 14-122
Collector Current Contributions ........................................ 14-129 Equivalent Circuit for Large Signal Analysis.......................... 14-58
Collector Resistance........................................................ 14-70 Equivalent Circuit of the VBIC
Compatibility of Disciplines.................................................. 4-11 Bipolar Model (large signal)......................................... 14-122
Compiler Directives ............................................................. 3-9 Erlang Distribution ............................................................ 9-15
Concatenations ................................................................ 6-10 Escaped........................................................................... 3-6
Conditional Statement .......................................................... 5-4 Event Detection ................................................................. 8-1
conservative system ............................................................ 1-3 Event OR Operator............................................................. 6-9
Control Flow .................................................................... 2-11 EXAVL......................................................................... 14-59
Converting Real Numbers to Integer Numbers ........................... 4-2 Excess Phase Network.................................................. 14-136
Correlated noise ................................................................. 9-4 exclude ............................................................................ 4-5
cross function..................................................................... 8-4 EXMOD ....................................................................... 14-58
current crowding ............................................................. 14-77 EXPHI ......................................................................... 14-59
Current Gain .................................................................. 14-63 Exponential Distribution ..................................................... 9-12
Currents and Voltages...................................................... 14-64 Extended Modeling of the Reverse
Current Gain EXMOD = 1 ............................................. 14-75
Currents in Modulated Resistors....................................... 14-130
External Base-Internal Collector
Junction Capacitance .................................................. 14-44
D Extrinsic collector depletion charges ................................... 14-73
dc.................................................................................... 9-1
DC Current Equations .................................................... 14-128 F
DC current Equations....................................................... 14-65
FC ................................................................. 14-47, 14-125
DEAR......................................................................... 14-127
flicker_noise...................................................................... 9-3
Declaring .......................................................................... 2-2
For.................................................................................. 5-6
Depletion Capacitances.................................................... 14-63
Z
Zero-Bias Capacitances ................................................. 14-139
zi_nd .............................................................................. 6-27
zi_np .............................................................................. 6-27
zi_zd .............................................................................. 6-26
zi_zp .............................................................................. 6-26
Z-Transform..................................................................... 6-25