VerilogA Reference Manual

Verilog-A Reference Manual

Table of Contents

Verilog-A Reference Manual

Chapter 1: Introduction ....................................................................................................................... 6 Analog Modeling ...................................................................................................................................... 6 Hardware Description Languages .......................................................................................................... 6 Verilog-A................................................................................................................................................... 7 Systems..................................................................................................................................................... 7 Conservative Systems .......................................................................................................................... 8 Natures and Disciplines....................................................................................................................... 8 Signal Flow System.............................................................................................................................. 9 Conventions Used in this Document ...................................................................................................... 9

Chapter 2: Verilog-A Modules ........................................................................................................... 11 Declaring Modules ................................................................................................................................. 11 Module Definition............................................................................................................................... 11 Ports........................................................................................................................................................ 12 Describing Analog Behavior.................................................................................................................. 13 Branches ................................................................................................................................................. 13 Analog Signals........................................................................................................................................ 14 Accessing Net and Branch Signals.................................................................................................... 14 Indirect branch assignment .................................................................................................................. 14 Branch Contribution Statement ........................................................................................................... 15 Switch Branches .................................................................................................................................... 15 Hierarchical Structures ......................................................................................................................... 17 Module Instance Parameter Value Assignment .............................................................................. 17 By Order .......................................................................................................................................... 17 By Name .......................................................................................................................................... 18 Paramsets ........................................................................................................................................... 18 Ports Assignments.............................................................................................................................. 21 Port Assignment ................................................................................................................................. 21 By Order .......................................................................................................................................... 21 Hierarchical system parameters ................................................................................................... 22 Scope.................................................................................................................................................... 23 User-defined Analog Functions............................................................................................................. 23

Chapter 3: Lexical Conventions ........................................................................................................ 26 White Space............................................................................................................................................ 26 Comments............................................................................................................................................... 26 Operators .................................................................................................................................................. 2 Strings ...................................................................................................................................................... 2 Numbers ................................................................................................................................................... 2 Integer Numbers .................................................................................................................................. 2 Real Numbers ....................................................................................................................................... 3 Scale Factors......................................................................................................................................... 3 Keywords .................................................................................................................................................. 4 Identifiers ................................................................................................................................................. 4 Escaped Identifiers .................................................................................................................................. 4 System Tasks and Functions .................................................................................................................. 5 Compiler Directives ................................................................................................................................. 5 Attributes ................................................................................................................................................. 5

Chapter 4: Data Types ......................................................................................................................... 7 Integer ...................................................................................................................................................... 7 Real ........................................................................................................................................................... 7

2

Verilog-A Reference Manual

Output variables ...................................................................................................................................... 7 Type Conversion....................................................................................................................................... 8 Net Discipline........................................................................................................................................... 8 Ground Declaration ................................................................................................................................. 9 Implicit Nets........................................................................................................................................... 10 Genvar .................................................................................................................................................... 10 Parameters ............................................................................................................................................. 11 Chapter 5: Analog Block Statements................................................................................................ 15 Sequential Block .................................................................................................................................... 15 Conditional Statement (if-else) ............................................................................................................. 15 Case Statement ...................................................................................................................................... 16 Repeat Statement .................................................................................................................................. 17 While Statement .................................................................................................................................... 17 For Statement ........................................................................................................................................ 18 Chapter 6: Mathematical Functions and Operators ........................................................................ 19 Unary/Binary/Ternary Operators ......................................................................................................... 19

Arithmetic Operators ......................................................................................................................... 19 Relational Operators .......................................................................................................................... 20 Logical Operators ............................................................................................................................... 20 Bit-wise Operators ............................................................................................................................. 21 Shift Operators ................................................................................................................................... 22 Conditional (Ternary) Operator ........................................................................................................ 22 Precedence .......................................................................................................................................... 23 Concatenation Operator..................................................................................................................... 23 Expression Evaluation ....................................................................................................................... 24 Arithmetic Conversion ....................................................................................................................... 24 Mathematical Functions........................................................................................................................ 24 Standard Mathematical Functions ................................................................................................... 24 Transcendental Functions ................................................................................................................. 25 Statistical Functions.............................................................................................................................. 26 The $random Function....................................................................................................................... 26 The $dist_uniform and $rdist_uniform Functions........................................................................... 27 The $dist_normal and $rdist_normal Functions.............................................................................. 27 The $dist_exponential and $rdist_exponential Functions .............................................................. 28 The $dist_poisson and $rdist_poisson Functions............................................................................. 28 The $dist_chi_square and $rdist_chi_square Functions ................................................................. 29 The $dist_t and $rdist_t Functions ................................................................................................... 30 The $dist_erlang and $rdist_erlang Functions ................................................................................ 30 Chapter 7: Analog Operators and Filters ......................................................................................... 32 Tolerances............................................................................................................................................... 32 Parameters ............................................................................................................................................. 33 Time Derivative Operator ..................................................................................................................... 33 Time Integrator Operator...................................................................................................................... 33 Circular Integrator Operator ................................................................................................................ 34 Derivative Operator............................................................................................................................... 35 Absolute Delay Operator ....................................................................................................................... 35 Transition Filter..................................................................................................................................... 36 Slew Filter .............................................................................................................................................. 38 Last Crossing Function ......................................................................................................................... 39 Limited Exponential .............................................................................................................................. 40 Laplace Transform Filters..................................................................................................................... 40 laplace_zp() ......................................................................................................................................... 40 laplace_zd() ......................................................................................................................................... 41 laplace_np()......................................................................................................................................... 42

3

Verilog-A Reference Manual

laplace_nd()......................................................................................................................................... 43 Z-Transform Filters ............................................................................................................................... 43

zi_zp() .................................................................................................................................................. 44 zi_zd() .................................................................................................................................................. 44 zi_np().................................................................................................................................................. 45 zi_nd().................................................................................................................................................. 46 Chapter 8: Analog Events.................................................................................................................. 48 Global Events ......................................................................................................................................... 48 The initial_step Event........................................................................................................................ 48 The final_step Event .......................................................................................................................... 49 Global Event Return Codes ............................................................................................................... 49 Monitored Events................................................................................................................................... 50 The cross Function ............................................................................................................................. 50 Above Function................................................................................................................................... 51 The timer Function ............................................................................................................................ 52 Event or Operator .................................................................................................................................. 53 Event Triggered Statements ................................................................................................................. 54 Chapter 9: Verilog-A and the Simulator........................................................................................... 55 Environment Parameter Functions...................................................................................................... 55 The temperature Function................................................................................................................. 55 The abstime Function ........................................................................................................................ 55 The realtime Function ....................................................................................................................... 56 The Thermal Voltage Function ......................................................................................................... 56 The Simulator Parameter Function.................................................................................................. 56 Controlling Simulator Actions .............................................................................................................. 58 Bounding the Time Step .................................................................................................................... 58 Limiting Functions............................................................................................................................. 58 Announcing Discontinuities .............................................................................................................. 60 Analysis Dependent Functions ............................................................................................................. 61 Analysis Function............................................................................................................................... 61 AC Stimulus Function........................................................................................................................ 62 Noise Functions .................................................................................................................................. 62

White Noise Function ..................................................................................................................... 63 Flicker Noise Function ................................................................................................................... 63 Noise Table Function............................................................................................................................. 64 Chapter 10: System Tasks and I/O Functions.................................................................................... 65 Interpolation (table model) Function.................................................................................................... 65 Table Model Inputs ............................................................................................................................ 67 Table Data Source.................................................................................................................................. 67 Table Control String .......................................................................................................................... 68 Table Interpolation Degree................................................................................................................ 68 Extrapolation Control String............................................................................................................. 69 File Input/Output Operations ............................................................................................................... 70 The fopen Function ............................................................................................................................ 71 The fclose Function ............................................................................................................................ 71 The fstrobe Function .......................................................................................................................... 72 The fdisplay Function ........................................................................................................................ 72 The fwrite Function............................................................................................................................ 73 Display Output Operations ................................................................................................................... 73 Strobe Function .................................................................................................................................. 73 Display Function ................................................................................................................................ 74 Debug Function .................................................................................................................................. 74 Format Specification .......................................................................................................................... 74 Simulator Control Operations............................................................................................................... 75

4

Verilog-A Reference Manual

The $finish Simulator Control Operation......................................................................................... 76 The $stop Simulator Control Operation ........................................................................................... 76 Chapter 11: The Verilog-A Preprocessor ............................................................................................ 77 Defining Macros ..................................................................................................................................... 77 Including Files ....................................................................................................................................... 78 Conditional Compilation ....................................................................................................................... 79 Default transition .................................................................................................................................. 80 Predefined Macros ................................................................................................................................. 80 Verilog-AMS and Verilog 1364 1995/2001 Directives ......................................................................... 80 Unsupported Directives......................................................................................................................... 81 The disciplines.vams File ...................................................................................................................... 86 The constants.vams File........................................................................................................................ 91 Verilog-A Module Template .................................................................................................................. 93 Analog Operators and Filters................................................................................................................ 94 Mathematical Functions........................................................................................................................ 96 Transcendental Functions..................................................................................................................... 97 AC Analysis Stimuli .............................................................................................................................. 97 Noise Functions...................................................................................................................................... 97 Analog Events ........................................................................................................................................ 98 Timestep Control.................................................................................................................................... 99 Input/Output Functions ...................................................................................................................... 100 Simulator Environment Functions ..................................................................................................... 100 Module Hierarchy ................................................................................................................................ 101

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download