Ngspice Users Manual
ngspice-28
(ngspice release version)
Holger Vogt, Marcel Hendrix, Paolo Nenzi
May 27, 2018
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 Chapt. 24.3. More is surely
needed. You are invited to report bugs, missing items, wrongly described items, bad English
style etc.
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.
License
This document is covered by the Creative Commons Attribution Share-Alike (CC-BY-SA)
v4.0..
Part of chapters 12 and 25-27 are in the public domain.
Chapter 30 is covered by New BSD (chapt. 33.3.2).
Part I
Ngspice User Manual
3
Contents
I Ngspice User Manual 3
1 Introduction 33
1.1 Simulation Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.1.1 Analog Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.1.2 Digital Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
1.1.3 Mixed-Signal Simulation . . . . . . . . . . . . . . . . . . . . . . . . . 35
1.1.4 Mixed-Level Simulation . . . . . . . . . . . . . . . . . . . . . . . . . 36
1.2 Supported Analyses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.2.1 DC Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
1.2.8 Periodic Steady State Analysis . . . . . . . . . . . . . . . . . . . . . . 40
1.3 Analysis at Different Temperatures . . . . . . . . . . . . . . . . . . . . . . . . 40
1.4 Convergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
1.4.1 Voltage convergence criterion . . . . . . . . . . . . . . . . . . . . . . 42
1.4.2 Current convergence criterion . . . . . . . . . . . . . . . . . . . . . . 42
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