Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
4Activity

Table Of Contents

Ngspice User Manual
Introduction
1.1 Simulation Algorithms
1.1.1 Analog Simulation
1.1.2 Digital Simulation
1.1.3 Mixed-Mode Simulation
1.1.4 Mixed-Level Simulation
1.2 Supported Analyses
1.2.1 DC Analyses
1.2.2 AC Small-Signal Analysis
1.2.3 Transient Analysis
1.2.4 Pole-Zero Analysis
1.2.5 Small-Signal Distortion Analysis
1.2.6 Sensitivity Analysis
1.2.7 Noise Analysis
1.2.8 Periodic Steady State Analysis
1.3 Analysis at Different Temperatures
1.4 Convergence
1.4.1 Voltage convergence criterion
1.4.2 Current convergence criterion
1.4.3 Convergence failure
Circuit Description
2.1 General Structure and Conventions
2.2 Basic lines
2.2.1 .TITLE line
2.2.2 .END Line
2.2.3 Comments
2.2.4 End-of-line comments
2.3 Device Models
2.4 Subcircuits
2.4.1 .SUBCKT Line
2.4.2 .ENDS Line
2.4.3 Subcircuit Calls
2.5 .GLOBAL
2.6 .INCLUDE
2.7 .LIB
2.8 .PARAM Parametric netlists
2.8.1 .param line
2.8.2 Brace expressions in circuit elements:
2.8.3 Subcircuit parameters
2.8.4 Symbol scope
2.8.5 Syntax of expressions
2.8.6 Reserved words
2.8.7 Alternative syntax
2.9 .func
2.10 Parameters, functions, expressions, andcommandscripts
2.10.1 Parameters
2.10.2 Nonlinear sources
2.10.3 Control commands, Command scripts
Circuit Elements and Models
3.1 General options and information
3.1.1 Simulating more devices in parallel
3.1.2 Technology scaling
3.1.3 Model binning
3.1.4 Transistors and Diodes
3.2.13 Capacitor or inductor with initial conditions
3.2.14 Switches
3.2.15 Switch Model (SW/CSW)
Voltage and Current Sources
4.1 Independent Sources for Voltage or Current
4.1.1 Pulse
4.1.2 Sinusoidal
4.1.3 Exponential
4.1.4 Piece-Wise Linear
4.1.5 Single-Frequency FM
4.1.6 Amplitude modulated source (AM)
4.1.7 Transient noise source
4.1.8 Random voltage source
4.1.9 Arbitrary Phase Sources
4.2. LINEAR DEPENDENT SOURCES 79
4.2 Linear Dependent Sources
4.2.1 Linear Voltage-Controlled Current Sources (VCCS)
4.2.2 Linear Voltage-Controlled Voltage Sources (VCVS)
4.2.3 Linear Current-Controlled Current Sources (CCCS)
4.2.4 Linear Current-Controlled Voltage Sources (CCVS)
4.2.5 Polynomial Source Compatibility
Non-linear Dependent Sources (Behavioral Sources)
5.1 B source (ASRC)
5.2. E SOURCE (NON-LINEAR VOLTAGE SOURCE)* 87
5.2 E source (non-linear voltage source)*
5.3 G source (non-linear current source)*
Transmission Lines
6.1 Lossless Transmission Lines
6.2 Lossy Transmission Lines
6.2.1 Lossy Transmission Line Model (LTRA)
6.3 Uniform Distributed RC Lines
6.3.1 Uniform Distributed RC Model (URC)
6.4. KSPICE LOSSY TRANSMISSION LINES 93
6.4 KSPICE Lossy Transmission Lines
6.4.1 Single Lossy Transmission Line (TXL)
6.4.2 Coupled Multiconductor Line (CPL)
7.1 Junction Diodes
7.2 Diode Model (D)
7.3 Diode Equations
8.1 Bipolar Junction Transistors (BJTs)
8.2 BJT Models (NPN/PNP)
9.1 Junction Field-Effect Transistors (JFETs)
9.2 JFET Models (NJF/PJF)
9.2.1 Model by Parker and Skellern
9.2.2 Modified Parker Skellern model
10.1 MESFETs
10.2 MESFET Models (NMF/PMF)
10.2.1 Model by Statz e.a
10.2.2 Model by Ytterdal e.a
10.2.3 hfet1
10.2.4 hfet2
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
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 Analog Switch
12.2.10 Zener Diode
12.2.11 Current Limiter
12.2.12 Hysteresis Block
12.2.13 Differentiator
12.2.14 Integrator
12.2.15 S-Domain Transfer Function
12.2.16 Slew Rate Block
12.2.17 Inductive Coupling
12.2.18 Magnetic Core
12.2.19 Controlled Sine Wave Oscillator
12.2.20 Controlled Triangle Wave Oscillator
12.2.21 Controlled Square Wave Oscillator
12.2.22 Controlled One-Shot
12.2.23 Capacitance Meter
12.2.24 Inductance Meter
12.3 Hybrid Models
12.3.1 Digital-to-Analog Node Bridge
12.3.2 Analog-to-Digital Node Bridge
12.3.3 Controlled Digital Oscillator
12.3.4 Node bridge from digital to real with enable
12.3.5 A Z**-1 block working on real data
12.3.6 A gain block for event-driven real data
12.3.7 Node bridge from real to analog voltage
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.5 Predefined Node Types
12.5.1 Real Node Type
12.5.2 Int Node Type
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.4. MEASUREMENTS AFTER OP, AC, AND TRANSIENT ANALYSIS 227
15.3.11 .PSS: Periodic Steady State Analysis
15.4 Measurements after Op, Ac, and Transient Analysis
15.4.1 .meas(ure)
15.4.2 batch versus interactive mode
15.4.3 General remarks
15.4.4 Input
15.4.5 Trig Targ
15.4.6 Find ... When
15.4.7 AVG|MIN|MAX|PP|RMS|MIN_AT|MAX_AT
15.4.8 Integ
15.4.9 param
15.4.10 par(’expression’)
15.4.11 Deriv
15.4.12 More examples
15.5 Batch Output
15.5.1 .SAVE: Name vector(s) to be saved in raw file
15.5.2 .PRINT Lines
15.5.3 .PLOT Lines
15.5.4 .FOUR: Fourier Analysis of Transient Analysis Output
15.5.5 .PROBE: Name vector(s) to be saved in raw file
15.5.6 par(’expression’): Algebraic expressions for output
15.5.7 .width
Starting ngspice
16.1 Introduction
16.2 Where to obtain ngspice
16.3 Command line options for starting ngspice and ngnut- meg
16.4 Starting options
16.4.1 Batch mode
16.4.2 Interactive mode
16.4.3 Interactive mode with control file or control section
16.5 Standard configuration file spinit
16.6 User defined configuration file .spiceinit
16.7. ENVIRONMENTAL VARIABLES 245
16.7 Environmental variables
16.7.1 Ngspice specific variables
16.7.2 Common environment variables
16.8 Memory usage
16.9 Simulation time
16.10 Ngspice on multi-core processors using OpenMP
16.10.1 Introduction
16.10.2 Some results
16.10.3 Usage
16.10.4 Literature
16.11 Server mode option -s
16.12 Ngspice control via input, output fifos
16.13 Reporting bugs and errors
Interactive Interpreter
17.1 Expressions, Functions, and Constants
17.2 Plots
17.3 Command Interpretation
17.4 Commands
17.4.1 Ac*: Perform an AC, small-signal frequency response analysis
17.4.2 Alias: Create an alias for a command
17.4.3 Alter*: Change a device or model parameter
17.4.4 Altermod*: Change model parameter(s)
17.4.5 Asciiplot: Plot values using old-style character plots
17.4.6 Aspice*: Asynchronous ngspice run
17.4.7 Bug: Mail a bug report
17.4.8 Cd: Change directory
17.4.9 Cdump: Dump the control flow to the screen
17.4.10 Codemodel*: Load an XSPICE code model library
17.4.11 Compose: Compose a vector
17.4.12 Dc*: Perform a DC-sweep analysis
17.4.13 Define: Define a function
17.4.14 Deftype: Define a new type for a vector or plot
17.4.15 Delete*: Remove a trace or breakpoint
17.4.16 Destroy: Delete an output data set
17.4.17 Devhelp: information on available devices
17.4.18 Diff: Compare vectors
17.4.19 Display: List known vectors and types
17.4.20 Echo: Print text
17.4.21 Edit*: Edit the current circuit
17.4.22 Eprint*: Print an event driven node (only used with XSPICE op- tion)
17.4.23 FFT: fast Fourier transform of vectors
17.4.24 Fourier: Perform a Fourier transform
17.4.25 Gnuplot: Graphics output via Gnuplot
17.4.26 Hardcopy: Save a plot to a file for printing
17.4.27 Inventory: Print circuit inventory
17.4.28 Help: Print summaries of Ngspice commands
17.4.29 History: Review previous commands
17.4.30 Iplot*: Incremental plot
17.4.31 Jobs*: List active asynchronous ngspice runs
17.4.32 Let: Assign a value to a vector
17.4.33 Linearize*: Interpolate to a linear scale
17.4.34 Listing*: Print a listing of the current circuit
17.4.35 Load: Load rawfile data
17.4.36 Meas*: Mesurements on simulation data
17.4.37 Noise*: Noise analysis
17.4.38 Op*: Perform an operating point analysis
17.4.39 Option*: Set a ngspice option
17.4.40 Plot: Plot values on the display
17.4.41 .Print: Print values
17.4.42 Quit: Leave Ngspice or Nutmeg
17.4.43 Rehash: Reset internal hash tables
17.4.44 Reset*: Reset an analysis
17.4.45 Reshape: Alter the dimensionality or dimensions of a vector
17.4.46 Resume*: Continue a simulation after a stop
17.4.47 Rspice*: Remote ngspice submission
17.4.48 Run*: Run analysis from the input file
17.4.49 Rusage: Resource usage
17.4.50 Save*: Save a set of outputs
17.4.51 Sens*: Run a sensitivity analysis
17.4.52 Set: Set the value of a variable
17.4.53 Setcirc*: Change the current circuit
17.4.54 Setplot: Switch the current set of vectors
17.4.55 Setscale: Set the scale vector for the current plot
17.4.56 Settype: Set the type of a vector
17.4.57 Shell: Call the command interpreter
17.4.58 Shift: Alter a list variable
17.4.59 Show*: List device state
17.4.60 Showmod*: List model parameter values
17.4.61 Source: Read a ngspice input file
17.4.62 Spec: Create a frequency domain plot
17.4.63 Status*: Display breakpoint information
17.4.64 Step*: Run a fixed number of time-points
17.4.65 Stop*: Set a breakpoint
17.4.66 Strcmp: Compare two strings
17.4.67 Sysinfo*: Print system information
17.4.68 Tf*: Run a Transfer Function analysis
17.4.69 Trace*: Trace nodes
17.4.70 Tran*: Perform a transient analysis
17.4.71 Transpose: Swap the elements in a multi-dimensional data set
17.4.72 Unalias: Retract an alias
17.4.73 Undefine: Retract a definition
17.4.74 Unlet: Delete the specified vector(s)
17.4.75 Unset: Clear a variable
17.4.76 Version: Print the version of ngspice
17.4.77 Where*: Identify troublesome node or device
17.4.78 Wrdata: Write data to a file (simple table)
17.4.79 Write: Write data to a file (Spice3f5 format)
17.4.80 Wrs2p: Write scattering parameters to file(Touchstone® format)
17.4.81 Xgraph: use the xgraph(1) program for plotting
17.5 Control Structures
17.5.1 While - End
17.5.2 Repeat - End
17.5.3 Dowhile - End
17.5.4 Foreach - End
17.5.5 If - Then - Else
17.5.6 Label
17.5.7 Goto
17.5.8 Continue
17.5.9 Break
17.6 Variables
17.7 Scripts
17.7.1 Variables
17.7.2 Vectors
17.7.3 Commands
17.7.4 control structures
17.7.5 Example script ’spectrum’
17.7.6 Example script for random numbers
17.7.7 Parameter sweep
17.8 Scattering parameters (s-parameters)
17.8.1 Intro
17.8.2 S-parameter measurement basics
17.8.3 Usage
17.9 MISCELLANEOUS (old stuff, has to be checked for relevance)
17.10 Bugs (old stuff, has to be checked for relevance)
Ngspice User Interfaces
18.1 MS Windows Graphical User Interface
18.2 MS Windows Console
18.3 LINUX
18.4 CygWin
18.5 Postscript printing options
18.6 Gnuplot
18.7 Integration with CAD software and “third party” GUIs
18.7.1 KJWaves
18.7.2 GNU Spice GUI
18.7.3 XCircuit
18.7.4 GEDA
19.1 tclspice framework
19.2 tclspice documentation
19.3 spicetoblt
19.4 Running TCLspice
19.5 examples
19.5.1 Active capacitor measurement
19.5.2 Optimization of a linearization circuit for a Thermistor
19.5.3 Progressive display
19.6 Compiling
19.6.1 LINUX
19.6.2 MS Windows
Example Circuits
20.1 AC coupled transistor amplifier
20.2 Differential Pair
20.3. MOSFET CHARACTERIZATION 329
20.3 MOSFET Characterization
20.4 RTL Inverter
20.5 Four-Bit Binary Adder (Bipolar)
21.6 Data evaluation with Gnuplot
Circuit optimization with ngspice
22.1 Optimization of a circuit
22.2 ngspice optimizer using ngspice scripts
22.3 ngspice optimizer using tclspice
22.4 ngspice optimizer using a Python script
22.5 ngspice optimizer using ASCO
22.5.1 Three stage operational amplifier
22.5.2 Digital inverter
22.5.3 Bandpass
22.5.4 Class-E power amplifier
23.1 Glossary
23.2 Acronyms and Abbreviations
XSPICE Software User’s Manual
24.1 ngspice with the XSPICE option
24.2 The XSPICE Code Model Subsystem
24.3 XSPICE Top-Level Diagram
Execution Procedures
25.1 Simulation and Modeling Overview
25.1.1 Describing the Circuit
25.2. CIRCUIT DESCRIPTION SYNTAX 363
25.2 Circuit Description Syntax
25.2.1 XSPICE Syntax Extensions
25.3 How to create code models
Example circuits
26.1 Amplifier with XSPICE model “gain”
26.2 XSPICE advanced usage
26.2.1 Circuit example C3
26.2.2 Running example C3
Code Models and User-Defined Nodes
27.1 Code Model Data Type Definitions
27.2 Creating Code Models
27.3 Creating User-Defined Nodes
27.4 Adding a new code model library
27.5 Compiling and loading the new code model (library)
27.6 Interface Specification File
27.6.1 The Name Table
27.6.2 The Port Table
27.6.3 The Parameter Table
27.6.4 Static Variable Table
27.7 Model Definition File
27.7.1 Macros
27.7.2 Function Library
27.8 User-Defined Node Definition File
27.8.1 Macros
27.8.2 Function Library
27.8.3 Example UDN Definition File
Error Messages
28.1 Preprocessor Error Messages
28.2 Simulator Error Messages
28.3 Code Model Error Messages
28.3.1 Code Model aswitch
28.3.2 Code Model climit
28.3.3 Code Model core
28.3.4 Code Model d_osc
28.3.5 Code Model d_source
28.3.6 Code Model d_state
28.3.7 Code Model oneshot
28.3.8 Code Model pwl
28.3.9 Code Model s_xfer
28.3.10 Code Model sine
28.3.11 Code Model square
28.3.12 Code Model triangle
CIDER User’s Manual
29.1 SPECIFICATION
29.1.1 Examples
29.2 BOUNDARY, INTERFACE
29.2.1 DESCRIPTION
29.2.2 PARAMETERS
29.2.3 EXAMPLES
29.3 COMMENT
29.3.1 DESCRIPTION
29.3.2 EXAMPLES
29.4 CONTACT
29.4.1 DESCRIPTION
29.4.2 PARAMETERS
29.4.3 EXAMPLES
29.4.4 SEE ALSO
29.5 DOMAIN, REGION
29.5.1 DESCRIPTION
29.5.2 PARAMETERS
29.5.3 EXAMPLES
29.5.4 SEE ALSO
29.6 DOPING
29.6.1 DESCRIPTION
29.6.2 PARAMETERS
29.6.3 EXAMPLES
29.6.4 SEE ALSO
29.7 ELECTRODE
29.7.1 DESCRIPTION
29.7.2 PARAMETERS
29.7.3 EXAMPLES
29.7.4 SEE ALSO
29.8 END
29.8.1 DESCRIPTION
29.9 MATERIAL
29.9.1 DESCRIPTION
29.9.2 PARAMETERS
29.9.3 EXAMPLES
29.9.4 SEE ALSO
29.10.1 DESCRIPTION
29.10.2 Parameters
29.10.3 Examples
29.11 Mobility
29.11.1 Description
29.11.2 Parameters
29.11.3 Examples
29.11.4 SEE ALSO
29.11.5 BUGS
29.12.1 DESCRIPTION
29.12.2 Parameters
29.12.3 Examples
29.12.4 See also
29.12.5 Bugs
29.13 OPTIONS
29.13.1 DESCRIPTION
29.13.2 Parameters
29.13.3 Examples
29.13.4 See also
29.14.1 DESCRIPTION
29.14.2 Parameters
29.14.3 Examples
29.14.4 SEE ALSO
29.15.1 DESCRIPTION
29.15.2 EXAMPLES
29.15.3 BUGS
29.16.1 DESCRIPTION
29.16.2 Parameters
29.16.3 EXAMPLES
29.16.4 SEE ALSO
29.17.1 DESCRIPTION
29.17.2 Parameters
29.17.3 EXAMPLES
29.17.4 SEE ALSO
29.17.5 BUGS
29.18.1 DESCRIPTION
29.18.2 Parameters
29.18.3 EXAMPLES
29.18.4 SEE ALSO
29.18.5 BUGS
29.19.1 DESCRIPTION
29.19.2 Parameters
29.19.3 EXAMPLES
29.19.4 SEE ALSO
29.20 Cider examples
Appendices
Model and Device Parameters
30.1 Elementary Devices
30.1.1 Resistor
30.1.2 Capacitor - Fixed capacitor
30.1.3 Inductor - Fixed inductor
30.1.4 Mutual - Mutual Inductor
30.2 Voltage and current sources
30.2.1 ASRC - Arbitrary source
30.2.2 Isource - Independent current source
30.2.3 Vsource - Independent voltage source
30.2.4 CCCS - Current controlled current source
30.2.5 CCVS - Current controlled voltage source
30.2.6 VCCS - Voltage controlled current source
30.2.7 VCVS - Voltage controlled voltage source
30.3 Transmission Lines
30.3.1 CplLines - Simple Coupled Multiconductor Lines
30.3.2 LTRA - Lossy transmission line
30.3.3 Tranline - Lossless transmission line
30.3.4 TransLine - Simple Lossy Transmission Line
30.3.5 URC - Uniform R. C. line
30.4 BJTs
30.4.1 BJT - Bipolar Junction Transistor
30.4.2 BJT - Bipolar Junction Transistor Level 2
30.4.3 VBIC - Vertical Bipolar Inter-Company Model
30.5 MOSFETs
30.5.1 MOS1 - Level 1 MOSFET model with Meyer capacitance model
30.5.2 MOS2 - Level 2 MOSFET model with Meyer capacitance model
30.5.3 MOS3 - Level 3 MOSFET model with Meyer capacitance model
30.5.4 MOS6 - Level 6 MOSFET model with Meyer capacitance model
30.5.5 MOS9 - Modified Level 3 MOSFET model
30.5.7 BSIM2 - Berkeley Short Channel IGFET Model
30.5.8 BSIM3
30.5.9 BSIM4
Compilation notes
31.1.1 Prerequisites
31.1.2 Install from CVS
31.1.3 Install from a tarball, e.g. ngspice-rework-23.tgz
31.1.4 Advanced Install
31.1.5 Compilation using an user defined directory tree for object files
31.1.6 Compilers and Options
31.1.7 Compiling For Multiple Architectures
31.1.8 Installation Names
31.1.9 Optional Features
31.1.10 Specifying the System Type
31.1.11 Sharing Defaults
31.2. NGSPICE COMPILATION UNDER WINDOWS OS 521
31.1.12 Operation Controls
31.2 NGSPICE COMPILATION UNDER WINDOWS OS
31.2.1 How to make ngspice with MINGW and MSYS
31.2.2 64 Bit executables with MINGW-w64
31.2.3 make ngspice with MS Visual Studio 2008
31.2.4 make ngspice with pure CYGWIN
31.2.5 make ngspice with CYGWIN and external MINGW32
31.2.6 make ngspice with CYGWIN and internal MINGW32 (use con- fig.h made above)
31.3 Reporting errors
Copyrights and licenses
32.1 Documentation license
32.1.1 Spice documentation copyright
32.1.2 XSPICE SOFTWARE copyright
32.2 ngspice license
32.2.1 “Modified” BSD license
32.2.2 Linking to GPLd libraries (e.g. readline):
0 of .
Results for:
No results containing your search query
P. 1
Ngspice Manual

Ngspice Manual

Ratings: (0)|Views: 12,139|Likes:
Published by Kiel Dizon Gonzales

More info:

Published by: Kiel Dizon Gonzales on Nov 20, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

02/17/2013

pdf

text

original

You're Reading a Free Preview
Pages 11 to 58 are not shown in this preview.
You're Reading a Free Preview
Pages 69 to 208 are not shown in this preview.
You're Reading a Free Preview
Pages 219 to 331 are not shown in this preview.
You're Reading a Free Preview
Pages 342 to 502 are not shown in this preview.
You're Reading a Free Preview
Pages 513 to 530 are not shown in this preview.

Activity (4)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Ivan Lopes liked this
hadbodutt3 liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->