Ngspice User Manual V27
User Manual: Pdf
Open the PDF directly: View PDF
Page Count: 624 [warning: Documents this large are best viewed by clicking the View PDF Link!]
- I Ngspice User Manual
- 1 Introduction
- 2 Circuit Description
- 3 Circuit Elements and Models
- 3.1 General options and information
- 3.2 Elementary Devices
- 3.2.1 Resistors
- 3.2.2 Semiconductor Resistors
- 3.2.3 Semiconductor Resistor Model (R)
- 3.2.4 Resistors, dependent on expressions (behavioral resistor)
- 3.2.5 Capacitors
- 3.2.6 Semiconductor Capacitors
- 3.2.7 Semiconductor Capacitor Model (C)
- 3.2.8 Capacitors, dependent on expressions (behavioral capacitor)
- 3.2.9 Inductors
- 3.2.10 Inductor model
- 3.2.11 Coupled (Mutual) Inductors
- 3.2.12 Inductors, dependent on expressions (behavioral inductor)
- 3.2.13 Capacitor or inductor with initial conditions
- 3.2.14 Switches
- 3.2.15 Switch Model (SW/CSW)
- 4 Voltage and Current Sources
- 5 Non-linear Dependent Sources (Behavioral Sources)
- 5.1 Bxxxx: Nonlinear dependent source (ASRC)
- 5.2 Exxxx: non-linear voltage sourceTo get this functionality, the compatibility mode has to be set in spinit or .spiceinit by set ngbehavior=all.
- 5.3 Gxxxx: non-linear current sourceTo get this functionality, the compatibility mode has to be set in spinit or .spiceinit by set ngbehavior=all.
- 5.4 Debugging a behavioral source
- 6 Transmission Lines
- 7 Diodes
- 8 BJTs
- 9 JFETs
- 10 MESFETs
- 11 MOSFETs
- 11.1 MOSFET devices
- 11.2 MOSFET models (NMOS/PMOS)
- 11.2.1 MOS Level 1
- 11.2.2 MOS Level 2
- 11.2.3 MOS Level 3
- 11.2.4 MOS Level 6
- 11.2.5 Notes on Level 1-6 models
- 11.2.6 BSIM Models
- 11.2.7 BSIM1 model (level 4)
- 11.2.8 BSIM2 model (level 5)
- 11.2.9 BSIM3 model (levels 8, 49)
- 11.2.10 BSIM4 model (levels 14, 54)
- 11.2.11 EKV model
- 11.2.12 BSIMSOI models (levels 10, 58, 55, 56, 57)
- 11.2.13 SOI3 model (level 60)
- 11.2.14 HiSIM models of the University of Hiroshima
- 12 Mixed-Mode and Behavioral Modeling with XSPICE
- 12.1 Code Model Element & .MODEL Cards
- 12.2 Analog Models
- 12.2.1 Gain
- 12.2.2 Summer
- 12.2.3 Multiplier
- 12.2.4 Divider
- 12.2.5 Limiter
- 12.2.6 Controlled Limiter
- 12.2.7 PWL Controlled Source
- 12.2.8 Filesource
- 12.2.9 multi_input_pwl block
- 12.2.10 Analog Switch
- 12.2.11 Zener Diode
- 12.2.12 Current Limiter
- 12.2.13 Hysteresis Block
- 12.2.14 Differentiator
- 12.2.15 Integrator
- 12.2.16 S-Domain Transfer Function
- 12.2.17 Slew Rate Block
- 12.2.18 Inductive Coupling
- 12.2.19 Magnetic Core
- 12.2.20 Controlled Sine Wave Oscillator
- 12.2.21 Controlled Triangle Wave Oscillator
- 12.2.22 Controlled Square Wave Oscillator
- 12.2.23 Controlled One-Shot
- 12.2.24 Capacitance Meter
- 12.2.25 Inductance Meter
- 12.2.26 Memristor
- 12.2.27 2D table model
- 12.2.28 3D table model
- 12.3 Hybrid Models
- 12.4 Digital Models
- 12.4.1 Buffer
- 12.4.2 Inverter
- 12.4.3 And
- 12.4.4 Nand
- 12.4.5 Or
- 12.4.6 Nor
- 12.4.7 Xor
- 12.4.8 Xnor
- 12.4.9 Tristate
- 12.4.10 Pullup
- 12.4.11 Pulldown
- 12.4.12 D Flip Flop
- 12.4.13 JK Flip Flop
- 12.4.14 Toggle Flip Flop
- 12.4.15 Set-Reset Flip Flop
- 12.4.16 D Latch
- 12.4.17 Set-Reset Latch
- 12.4.18 State Machine
- 12.4.19 Frequency Divider
- 12.4.20 RAM
- 12.4.21 Digital Source
- 12.4.22 LUT
- 12.4.23 General LUT
- 12.5 Predefined Node Types for event driven simulation
- 13 Verilog A Device models
- 14 Mixed-Level Simulation (ngspice with TCAD)
- 15 Analyses and Output Control (batch mode)
- 15.1 Simulator Variables (.options)
- 15.2 Initial Conditions
- 15.3 Analyses
- 15.3.1 .AC: Small-Signal AC Analysis
- 15.3.2 .DC: DC Transfer Function
- 15.3.3 .DISTO: Distortion Analysis
- 15.3.4 .NOISE: Noise Analysis
- 15.3.5 .OP: Operating Point Analysis
- 15.3.6 .PZ: Pole-Zero Analysis
- 15.3.7 .SENS: DC or Small-Signal AC Sensitivity Analysis
- 15.3.8 .TF: Transfer Function Analysis
- 15.3.9 .TRAN: Transient Analysis
- 15.3.10 Transient noise analysis (at low frequency)
- 15.3.11 .PSS: Periodic Steady State Analysis
- 15.4 Measurements after AC, DC and Transient Analysis
- 15.5 Safe Operating Area (SOA) warning messages
- 15.6 Batch Output
- 15.7 Measuring current through device terminals
- 16 Starting ngspice
- 16.1 Introduction
- 16.2 Where to obtain ngspice
- 16.3 Command line options for starting ngspice and ngnutmeg
- 16.4 Starting options
- 16.5 Standard configuration file spinit
- 16.6 User defined configuration file .spiceinit
- 16.7 Environmental variables
- 16.8 Memory usage
- 16.9 Simulation time
- 16.10 Ngspice on multi-core processors using OpenMP
- 16.11 Server mode option -s
- 16.12 Ngspice control via input, output fifos
- 16.13 Compatibility
- 16.14 Tests
- 16.15 Reporting bugs and errors
- 17 Interactive Interpreter
- 17.1 Introduction
- 17.2 Expressions, Functions, and Constants
- 17.3 Plots
- 17.4 Command Interpretation
- 17.5 Commands
- 17.5.1 Ac*: Perform an AC, small-signal frequency response analysis
- 17.5.2 Alias: Create an alias for a command
- 17.5.3 Alter*: Change a device or model parameter
- 17.5.4 Altermod*: Change model parameter(s)
- 17.5.5 Asciiplot: Plot values using old-style character plots
- 17.5.6 Aspice*: Asynchronous ngspice run
- 17.5.7 Bug: Mail a bug report
- 17.5.8 Cd: Change directory
- 17.5.9 Cdump: Dump the control flow to the screen
- 17.5.10 Circbyline*: Enter a circuit line by line
- 17.5.11 Codemodel*: Load an XSPICE code model library
- 17.5.12 Compose: Compose a vector
- 17.5.13 Dc*: Perform a DC-sweep analysis
- 17.5.14 Define: Define a function
- 17.5.15 Deftype: Define a new type for a vector or plot
- 17.5.16 Delete*: Remove a trace or breakpoint
- 17.5.17 Destroy: Delete an output data set
- 17.5.18 Devhelp: information on available devices
- 17.5.19 Diff: Compare vectors
- 17.5.20 Display: List known vectors and types
- 17.5.21 Echo: Print text
- 17.5.22 Edit*: Edit the current circuit
- 17.5.23 Edisplay: Print a list of all the event nodes
- 17.5.24 Eprint: Print an event driven node
- 17.5.25 Eprvcd: Dump event nodes in VCD format
- 17.5.26 FFT: fast Fourier transform of vectors
- 17.5.27 Fourier: Perform a Fourier transform
- 17.5.28 Gnuplot: Graphics output via gnuplot
- 17.5.29 Hardcopy: Save a plot to a file for printing
- 17.5.30 Help: Print summaries of Ngspice commands
- 17.5.31 History: Review previous commands
- 17.5.32 Inventory: Print circuit inventory
- 17.5.33 Iplot*: Incremental plot
- 17.5.34 Jobs*: List active asynchronous ngspice runs
- 17.5.35 Let: Assign a value to a vector
- 17.5.36 Linearize*: Interpolate to a linear scale
- 17.5.37 Listing*: Print a listing of the current circuit
- 17.5.38 Load: Load rawfile data
- 17.5.39 Meas*: Measurements on simulation data
- 17.5.40 Mdump*: Dump the matrix values to a file (or to console)
- 17.5.41 Mrdump*: Dump the matrix right hand side values to a file (or to console)
- 17.5.42 Noise*: Noise analysis
- 17.5.43 Op*: Perform an operating point analysis
- 17.5.44 Option*: Set a ngspice option
- 17.5.45 Plot: Plot vectors on the display
- 17.5.46 Pre_<command>: execute commands prior to parsing the circuit
- 17.5.47 Print: Print values
- 17.5.48 Quit: Leave Ngspice or Nutmeg
- 17.5.49 Rehash: Reset internal hash tables
- 17.5.50 Remcirc*: Remove the current circuit
- 17.5.51 Reset*: Reset an analysis
- 17.5.52 Reshape: Alter the dimensionality or dimensions of a vector
- 17.5.53 Resume*: Continue a simulation after a stop
- 17.5.54 Rspice*: Remote ngspice submission
- 17.5.55 Run*: Run analysis from the input file
- 17.5.56 Rusage: Resource usage
- 17.5.57 Save*: Save a set of outputs
- 17.5.58 Sens*: Run a sensitivity analysis
- 17.5.59 Set: Set the value of a variable
- 17.5.60 Setcirc*: Change the current circuit
- 17.5.61 Setplot: Switch the current set of vectors
- 17.5.62 Setscale: Set the scale vector for the current plot
- 17.5.63 Settype: Set the type of a vector
- 17.5.64 Shell: Call the command interpreter
- 17.5.65 Shift: Alter a list variable
- 17.5.66 Show*: List device state
- 17.5.67 Showmod*: List model parameter values
- 17.5.68 Snload*: Load the snapshot file
- 17.5.69 Snsave*: Save a snapshot file
- 17.5.70 Source: Read a ngspice input file
- 17.5.71 Spec: Create a frequency domain plot
- 17.5.72 Status*: Display breakpoint information
- 17.5.73 Step*: Run a fixed number of time-points
- 17.5.74 Stop*: Set a breakpoint
- 17.5.75 Strcmp: Compare two strings
- 17.5.76 Sysinfo*: Print system information
- 17.5.77 Tf*: Run a Transfer Function analysis
- 17.5.78 Trace*: Trace nodes
- 17.5.79 Tran*: Perform a transient analysis
- 17.5.80 Transpose: Swap the elements in a multi-dimensional data set
- 17.5.81 Unalias: Retract an alias
- 17.5.82 Undefine: Retract a definition
- 17.5.83 Unlet: Delete the specified vector(s)
- 17.5.84 Unset: Clear a variable
- 17.5.85 Version: Print the version of ngspice
- 17.5.86 Where*: Identify troublesome node or device
- 17.5.87 Wrdata: Write data to a file (simple table)
- 17.5.88 Write: Write data to a file (Spice3f5 format)
- 17.5.89 Wrs2p: Write scattering parameters to file (Touchstone® format)
- 17.5.90 Xgraph: use the xgraph(1) program for plotting.
- 17.6 Control Structures
- 17.7 Internally predefined variables
- 17.8 Scripts
- 17.9 Scattering parameters (s-parameters)
- 17.10 MISCELLANEOUS
- 17.11 Bugs
- 18 Ngspice User Interfaces
- 19 ngspice as shared library or dynamic link library
- 20 TCLspice
- 21 Example Circuits
- 22 Statistical circuit analysis
- 23 Circuit optimization with ngspice
- 24 Notes
- II XSPICE Software User's Manual
- 25 XSPICE Basics
- 26 Execution Procedures
- 27 Example circuits
- 28 Code Models and User-Defined Nodes
- 29 Error Messages
- 29.1 Preprocessor Error Messages
- 29.2 Simulator Error Messages
- 29.3 Code Model Error Messages
- 29.3.1 Code Model aswitch
- 29.3.2 Code Model climit
- 29.3.3 Code Model core
- 29.3.4 Code Model d_osc
- 29.3.5 Code Model d_source
- 29.3.6 Code Model d_state
- 29.3.7 Code Model oneshot
- 29.3.8 Code Model pwl
- 29.3.9 Code Model s_xfer
- 29.3.10 Code Model sine
- 29.3.11 Code Model square
- 29.3.12 Code Model triangle
- III CIDER
- 30 CIDER User’s Manual
- IV Appendices
- 31 Model and Device Parameters
- 31.1 Accessing internal device parameters
- 31.2 Elementary Devices
- 31.3 Voltage and current sources
- 31.3.1 ASRC - Arbitrary source
- 31.3.2 Isource - Independent current source
- 31.3.3 Vsource - Independent voltage source
- 31.3.4 CCCS - Current controlled current source
- 31.3.5 CCVS - Current controlled voltage source
- 31.3.6 VCCS - Voltage controlled current source
- 31.3.7 VCVS - Voltage controlled voltage source
- 31.4 Transmission Lines
- 31.5 BJTs
- 31.6 MOSFETs
- 31.6.1 MOS1 - Level 1 MOSFET model with Meyer capacitance model
- 31.6.2 MOS2 - Level 2 MOSFET model with Meyer capacitance model
- 31.6.3 MOS3 - Level 3 MOSFET model with Meyer capacitance model
- 31.6.4 MOS6 - Level 6 MOSFET model with Meyer capacitance model
- 31.6.5 MOS9 - Modified Level 3 MOSFET model
- 31.6.6 BSIM1 - Berkeley Short Channel IGFET Model
- 31.6.7 BSIM2 - Berkeley Short Channel IGFET Model
- 31.6.8 BSIM3
- 31.6.9 BSIM4
- 32 Compilation notes
- 32.1 Ngspice Installation under Linux (and other 'UNIXes')
- 32.1.1 Prerequisites
- 32.1.2 Install from Git
- 32.1.3 Install from a tarball, e.g. ngspice-rework-27.tgz
- 32.1.4 Compilation using an user defined directory tree for object files
- 32.1.5 Advanced Install
- 32.1.6 Compilers and Options
- 32.1.7 Compiling For Multiple Architectures
- 32.1.8 Installation Names
- 32.1.9 Optional Features
- 32.1.10 Specifying the System Type
- 32.1.11 Sharing Defaults
- 32.1.12 Operation Controls
- 32.2 Ngspice Compilation under Windows OS
- 32.2.1 Compile ngspice with MS Visual Studio 2015 or 2017
- 32.2.2 How to make ngspice with MINGW and MSYS
- 32.2.3 64 Bit executables with MINGW-w64
- 32.2.4 make ngspice with pure CYGWIN
- 32.2.5 ngspice mingw or cygwin console executable w/o graphics
- 32.2.6 ngspice for MS Windows, cross compiled from Linux
- 32.2.7 make ngspice with CYGWIN and external MINGW32
- 32.2.8 make ngspice with CYGWIN and internal MINGW32 (use config.h made above)
- 32.3 Reporting errors
- 32.1 Ngspice Installation under Linux (and other 'UNIXes')
- 33 Copyrights and licenses
- 31 Model and Device Parameters