Ngspice User Manual

Ngspice User Manual

Ngspice Users Manual Version 23 Paolo Nenzi, Holger Vogt June 1, 2011 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/ CVS 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. describe .func 3. hfet1,2, jfet2 model descriptions 4. tclspice compilation chapt. 20.5 5. more examples (chapt. 20) 6. LINUX graphics interface chapt. 19.2 Part I Ngspice User Manual 3 Contents I Ngspice User Manual3 1 Introduction 31 1.1 Simulation Algorithms.............................. 32 1.1.1 Analog Simulation............................ 32 1.1.2 Digital Simulation............................ 33 1.1.3 Mixed-Mode Simulation......................... 33 1.1.4 Mixed-Level Simulation......................... 34 1.2 Supported Analyses................................ 35 1.2.1 DC Analyses............................... 35 1.2.2 AC Small-Signal Analysis........................ 36 1.2.3 Transient Analysis............................ 36 1.2.4 Pole-Zero Analysis............................ 36 1.2.5 Small-Signal Distortion Analysis.................... 37 1.2.6 Sensitivity Analysis........................... 37 1.2.7 Noise Analysis.............................. 38 1.3 Analysis at Different Temperatures........................ 38 1.4 Convergence................................... 40 1.4.1 Voltage convergence criterion...................... 40 1.4.2 Current convergence criterion...................... 40 1.4.3 Convergence failure........................... 41 2 Circuit Description 43 2.1 General Structure and Conventions........................ 43 2.2 Basic lines..................................... 45 2.2.1 .TITLE line................................ 45 2.2.2 .END Line................................ 45 2.2.3 Comments................................ 46 5 6 CONTENTS 2.2.4 End-of-line comments.......................... 46 2.3 Device Models.................................. 46 2.4 Subcircuits.................................... 47 2.4.1 .SUBCKT Line.............................. 48 2.4.2 .ENDS Line................................ 49 2.4.3 Subcircuit Calls.............................. 49 2.5 .GLOBAL..................................... 49 2.6 .INCLUDE.................................... 49 2.7 .LIB........................................ 50 2.8 .PARAM Parametric netlists........................... 50 2.8.1 .param line................................ 50 2.8.2 Brace expressions in circuit elements:.................. 51 2.8.3 Subcircuit parameters........................... 51 2.8.4 Symbol scope............................... 52 2.8.5 Syntax of expressions.......................... 52 2.8.6 Reserved words............................. 54 2.8.7 Alternative syntax............................ 55 2.9 .func........................................ 55 2.10 Parameters, functions, expressions, and command scripts............ 56 2.10.1 Parameters................................ 56 2.10.2 Nonlinear sources............................. 56 2.10.3 Control commands, Command scripts.................. 56 3 Circuit Elements and Models 57 3.1 General options and information......................... 57 3.1.1 Simulating more devices in parallel................... 57 3.1.2 Technology scaling............................ 58 3.1.3 Model binning.............................. 58 3.1.4 Transistors and Diodes.......................... 58 3.2 Elementary Devices................................ 59 3.2.1 Resistors................................. 59 3.2.2 Semiconductor Resistors......................... 60 3.2.3 Semiconductor Resistor Model (R)................... 60 3.2.4 Resistors, dependent on expressions (behavioral resistor)........ 61 3.2.5 Capacitors................................ 62 CONTENTS 7 3.2.6 Semiconductor Capacitors........................ 63 3.2.7 Semiconductor Capacitor Model (C)................... 63 3.2.8 Capacitors, dependent on expressions (behavioral capacitor)...... 64 3.2.9 Inductors................................. 65 3.2.10 Inductor model.............................. 66 3.2.11 Coupled (Mutual) Inductors....................... 67 3.2.12 Inductors, dependent on expressions (behavioral inductor)....... 67 3.2.13 Capacitor or inductor with initial conditions.............. 68 3.2.14 Switches................................. 69 3.2.15 Switch Model (SW/CSW)........................ 70 4 Voltage and Current Sources 73 4.1 Independent Sources for Voltage or Current................... 73 4.1.1 Pulse................................... 74 4.1.2 Sinusoidal................................. 75 4.1.3 Exponential................................ 75 4.1.4 Piece-Wise Linear............................ 76 4.1.5 Single-Frequency FM.......................... 76 4.1.6 Amplitude modulated source (AM)................... 76 4.1.7 Transient noise source.......................... 77 4.1.8 Random voltage source.......................... 78 4.1.9 Arbitrary Phase Sources......................... 78 4.2 Linear Dependent Sources............................ 79 4.2.1 Linear Voltage-Controlled Current Sources (VCCS).......... 79 4.2.2 Linear Voltage-Controlled Voltage Sources (VCVS).......... 79 4.2.3 Linear Current-Controlled Current Sources (CCCS)........... 80 4.2.4 Linear Current-Controlled Voltage Sources (CCVS).......... 80 4.2.5 Polynomial Source Compatibility.................... 80 5 Non-linear Dependent Sources (Behavioral Sources) 81 5.1 B source (ASRC)................................. 81 5.2 E source (non-linear voltage source)*...................... 87 5.3 G source (non-linear current source)*...................... 87 8 CONTENTS 6 Transmission Lines 89 6.1 Lossless Transmission Lines........................... 89 6.2 Lossy Transmission Lines............................ 90 6.2.1 Lossy Transmission Line Model (LTRA)................ 90 6.3 Uniform Distributed RC Lines.......................... 92 6.3.1 Uniform Distributed RC Model (URC)................. 92 6.4 KSPICE Lossy Transmission Lines........................ 93 6.4.1 Single Lossy Transmission Line (TXL)................. 93 6.4.2 Coupled Multiconductor Line (CPL)................... 94 7 Diodes 95 7.1 Junction Diodes.................................. 95 7.2 Diode Model (D)................................. 95 7.3 Diode Equations.................................. 97 8 BJTs 103 8.1 Bipolar Junction Transistors (BJTs)....................... 103 8.2 BJT Models (NPN/PNP)............................. 103 9 JFETs 109 9.1 Junction Field-Effect Transistors (JFETs).................... 109 9.2 JFET Models (NJF/PJF)............................. 109 9.2.1 Model by Parker and Skellern...................... 109 9.2.2 Modified Parker Skellern model..................... 110 10 MESFETs 113 10.1 MESFETs..................................... 113 10.2 MESFET Models (NMF/PMF).......................... 113 10.2.1 Model by Statz e.a............................. 113 10.2.2 Model by Ytterdal e.a........................... 114 10.2.3 hfet1................................... 114 10.2.4 hfet2................................... 114 CONTENTS 9 11 MOSFETs 115 11.1 MOSFET devices................................. 115 11.2 MOSFET models (NMOS/PMOS)........................ 116 11.2.1 MOS Level 1............................... 116 11.2.2 MOS Level 2............................... 116 11.2.3 MOS Level 3............................... 116 11.2.4 MOS Level 6............................... 118 11.2.5 Notes on Level 1-6 models........................ 118 11.2.6 BSIM Models............................... 121 11.2.7 BSIM1 model (level 4).......................... 122 11.2.8 BSIM2 model (level 5).......................... 124 11.2.9 BSIM3 model (levels 8, 49)....................... 124 11.2.10 BSIM4 model (levels 14, 54)....................... 124 11.2.11 EKV model................................ 125 11.2.12 BSIMSOI models (levels 10, 58, 55, 56, 57)............... 125 11.2.13 SOI3 model (level 60).......................... 126 11.2.14 HiSIM models of the University of Hiroshima.............. 126 12 Mixed-Mode and Behavioral Modeling with XSPICE 127 12.1 Code Model Element & .MODEL Cards.................... 127 12.2 Analog Models.................................. 131 12.2.1 Gain.................................... 131 12.2.2 Summer.................................. 132 12.2.3 Multiplier................................. 133 12.2.4 Divider.................................. 134 12.2.5 Limiter.................................. 136 12.2.6 Controlled Limiter............................ 137 12.2.7 PWL Controlled Source......................... 139 12.2.8 Analog Switch.............................. 141 12.2.9 Zener Diode............................... 142 12.2.10 Current Limiter.............................. 143 12.2.11 Hysteresis Block............................. 146 12.2.12 Differentiator............................... 147 12.2.13 Integrator................................. 149 12.2.14 S-Domain Transfer Function....................... 150 10 CONTENTS 12.2.15 Slew Rate Block............................. 153 12.2.16 Inductive Coupling............................ 154 12.2.17 Magnetic Core.............................. 155 12.2.18 Controlled

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    517 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us