
Ngspice Users Manual Version 26 (Describes ngspice-26 release version) Paolo Nenzi, Holger Vogt January 11, 2014 2 Locations The project and download pages of ngspice may be found at Ngspice home page http://ngspice.sourceforge.net/ Project page at sourceforge http://sourceforge.net/projects/ngspice/ Download page at sourceforge http://sourceforge.net/projects/ngspice/files/ Git source download http://sourceforge.net/scm/?type=cvs&group_id=38962 Status This manual is a work in progress. Some to-dos are listed in the following. More is surely needed. You are invited to report bugs, missing items, wrongly described items, bad English style etc. To Do 1. Review of chapt. 1.3 2. hfet1,2 model descriptions How to use this manual The manual is a “work in progress”. It may accompany a specific ngspice release, e.g. ngspice- 24 as manual version 24. If its name contains “Version xxplus”, it describes the actual code status, found at the date of issue in the Git Source Code Management (SCM) tool. The manual is intended to provide a complete description of the ngspice functionality, its features, commands, or procedures. It is not a book about learning spice usage, but the novice user may find some hints how to start using ngspice. Chapter 21.1 gives a short introduction how to set up and simulate a small circuit. Chapter 32 is about compiling and installing ngspice from a tarball or the actual Git source code, which you may find on the ngspice web pages. If you are running a specific LINUX distribution, you may check if it provides ngspice as part of the package. Some are listed here. Part I Ngspice User Manual 3 Contents I Ngspice User Manual3 1 Introduction 33 1.1 Simulation Algorithms.............................. 34 1.1.1 Analog Simulation............................ 34 1.1.2 Digital Simulation............................ 35 1.1.3 Mixed-Mode Simulation......................... 35 1.1.4 Mixed-Level Simulation......................... 36 1.2 Supported Analyses................................ 37 1.2.1 DC Analyses............................... 37 1.2.2 AC Small-Signal Analysis........................ 38 1.2.3 Transient Analysis............................ 38 1.2.4 Pole-Zero Analysis............................ 38 1.2.5 Small-Signal Distortion Analysis.................... 39 1.2.6 Sensitivity Analysis........................... 39 1.2.7 Noise Analysis.............................. 40 1.2.8 Periodic Steady State Analysis..................... 40 1.3 Analysis at Different Temperatures........................ 40 1.4 Convergence................................... 42 1.4.1 Voltage convergence criterion...................... 42 1.4.2 Current convergence criterion...................... 43 1.4.3 Convergence failure........................... 43 2 Circuit Description 45 2.1 General Structure and Conventions........................ 45 2.1.1 Input file structure............................ 45 2.1.2 Circuit elements (device instances)................... 45 2.1.3 Some naming conventions........................ 47 5 6 CONTENTS 2.2 Basic lines..................................... 48 2.2.1 .TITLE line................................ 48 2.2.2 .END Line................................ 48 2.2.3 Comments................................ 49 2.2.4 End-of-line comments.......................... 49 2.3 .MODEL Device Models............................. 49 2.4 .SUBCKT Subcircuits............................... 50 2.4.1 .SUBCKT Line.............................. 51 2.4.2 .ENDS Line................................ 52 2.4.3 Subcircuit Calls.............................. 52 2.5 .GLOBAL..................................... 52 2.6 .INCLUDE.................................... 52 2.7 .LIB........................................ 53 2.8 .PARAM Parametric netlists........................... 53 2.8.1 .param line................................ 53 2.8.2 Brace expressions in circuit elements:.................. 54 2.8.3 Subcircuit parameters........................... 54 2.8.4 Symbol scope............................... 55 2.8.5 Syntax of expressions.......................... 55 2.8.6 Reserved words............................. 58 2.8.7 Alternative syntax............................ 58 2.9 .FUNC....................................... 58 2.10 .CSPARAM.................................... 59 2.11 .TEMP....................................... 59 2.12 .IF Condition-Controlled Netlist......................... 60 2.13 Parameters, functions, expressions, and command scripts............ 61 2.13.1 Parameters................................ 61 2.13.2 Nonlinear sources............................. 61 2.13.3 Control commands, Command scripts.................. 61 3 Circuit Elements and Models 63 3.1 General options and information......................... 63 3.1.1 Simulating more devices in parallel................... 63 3.1.2 Technology scaling............................ 64 3.1.3 Model binning.............................. 64 CONTENTS 7 3.1.4 Multiplier m, initial conditions...................... 64 3.2 Elementary Devices................................ 65 3.2.1 Resistors................................. 65 3.2.2 Semiconductor Resistors......................... 66 3.2.3 Semiconductor Resistor Model (R)................... 66 3.2.4 Resistors, dependent on expressions (behavioral resistor)........ 68 3.2.5 Capacitors................................ 68 3.2.6 Semiconductor Capacitors........................ 69 3.2.7 Semiconductor Capacitor Model (C)................... 69 3.2.8 Capacitors, dependent on expressions (behavioral capacitor)...... 71 3.2.9 Inductors................................. 72 3.2.10 Inductor model.............................. 72 3.2.11 Coupled (Mutual) Inductors....................... 73 3.2.12 Inductors, dependent on expressions (behavioral inductor)....... 74 3.2.13 Capacitor or inductor with initial conditions.............. 75 3.2.14 Switches................................. 76 3.2.15 Switch Model (SW/CSW)........................ 77 4 Voltage and Current Sources 79 4.1 Independent Sources for Voltage or Current................... 79 4.1.1 Pulse................................... 80 4.1.2 Sinusoidal................................. 81 4.1.3 Exponential................................ 81 4.1.4 Piece-Wise Linear............................ 82 4.1.5 Single-Frequency FM.......................... 82 4.1.6 Amplitude modulated source (AM)................... 83 4.1.7 Transient noise source.......................... 83 4.1.8 Random voltage source.......................... 84 4.1.9 External voltage or current input..................... 84 4.1.10 Arbitrary Phase Sources......................... 85 4.2 Linear Dependent Sources............................ 85 4.2.1 Gxxxx: Linear Voltage-Controlled Current Sources (VCCS)...... 85 4.2.2 Exxxx: Linear Voltage-Controlled Voltage Sources (VCVS)...... 86 4.2.3 Fxxxx: Linear Current-Controlled Current Sources (CCCS)...... 86 4.2.4 Hxxxx: Linear Current-Controlled Voltage Sources (CCVS)...... 86 4.2.5 Polynomial Source Compatibility.................... 87 8 CONTENTS 5 Non-linear Dependent Sources (Behavioral Sources) 89 5.1 Bxxxx: Nonlinear dependent source (ASRC).................. 89 5.1.1 Syntax and usage............................. 89 5.1.2 Special B-Source Variables time, temper, hertz............. 92 5.1.3 par(’expression’)............................. 92 5.1.4 Piecewise Linear Function: pwl..................... 92 5.2 Exxxx: non-linear voltage source*........................ 95 5.2.1 VOL................................... 95 5.2.2 VALUE.................................. 95 5.2.3 TABLE.................................. 95 5.2.4 POLY................................... 95 5.2.5 LAPLACE................................ 96 5.3 Gxxxx: non-linear current source*........................ 97 5.3.1 CUR................................... 97 5.3.2 VALUE.................................. 97 5.3.3 TABLE.................................. 97 5.3.4 POLY................................... 98 5.3.5 LAPLACE................................ 98 5.3.6 Example................................. 98 5.4 Debugging a behavioral source.......................... 99 6 Transmission Lines 101 6.1 Lossless Transmission Lines........................... 101 6.2 Lossy Transmission Lines............................ 102 6.2.1 Lossy Transmission Line Model (LTRA)................ 102 6.3 Uniform Distributed RC Lines.......................... 104 6.3.1 Uniform Distributed RC Model (URC)................. 104 6.4 KSPICE Lossy Transmission Lines........................ 105 6.4.1 Single Lossy Transmission Line (TXL)................. 105 6.4.2 Coupled Multiconductor Line (CPL)................... 106 7 Diodes 107 7.1 Junction Diodes.................................. 107 7.2 Diode Model (D)................................. 107 7.3 Diode Equations.................................. 109 CONTENTS 9 8 BJTs 115 8.1 Bipolar Junction Transistors (BJTs)....................... 115 8.2 BJT Models (NPN/PNP)............................. 115 9 JFETs 121 9.1 Junction Field-Effect Transistors (JFETs).................... 121 9.2 JFET Models (NJF/PJF)............................. 121 9.2.1 JFET level 1 model with Parker Skellern modification......... 121 9.2.2 JFET level 2 Parker Skellern model................... 123 10 MESFETs 125 10.1 MESFETs..................................... 125 10.2 MESFET Models (NMF/PMF).......................... 125 10.2.1 Model by Statz e.a............................. 125 10.2.2 Model by Ytterdal e.a........................... 126 10.2.3 hfet1..................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages586 Page
-
File Size-