''Ngspice'' is an
open-source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
mixed-level/
mixed-signal electronic circuit simulator. It is a successor of the latest stable release of Berkeley
SPICE
In the culinary arts, a spice is any seed, fruit, root, Bark (botany), bark, or other plant substance in a form primarily used for flavoring or coloring food. Spices are distinguished from herbs, which are the leaves, flowers, or stems of pl ...
, version 3f.5, which was released in 1993. A small group of maintainers and the user community contribute to the ''ngspice project'' by providing new features, enhancements and bug fixes.
Ngspice is based on three
open-source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
free-software packages:
Spice3f5,
Xspice and
Cider1b1:
*
SPICE
In the culinary arts, a spice is any seed, fruit, root, Bark (botany), bark, or other plant substance in a form primarily used for flavoring or coloring food. Spices are distinguished from herbs, which are the leaves, flowers, or stems of pl ...
is the origin of most modern electronic circuit simulators, its successors are widely used in the electronics community.
* Xspice is an extension to Spice3 that provides additional C language code models to support analog behavioral modeling and co-simulation of digital components through a fast event-driven algorithm.
* Cider adds a numerical device simulator to ngspice. It couples the circuit-level simulator to the device simulator to provide enhanced simulation accuracy (at the expense of increased simulation time). Critical devices can be described with their technology parameters (numerical models), all others may use the original ngspice compact models. It is the successor to CODECS.
Overview
Analysis types
Ngspice implements three classes of analysis:
*Nonlinear DC analyses
*Nonlinear transient analyses
*Linear AC analyses
Transient analysis includes transient noise simulation. AC analysis includes small-signal noise simulation, pole-zero and transfer function analysis:
*
Noise
Noise is sound, chiefly unwanted, unintentional, or harmful sound considered unpleasant, loud, or disruptive to mental or hearing faculties. From a physics standpoint, there is no distinction between noise and desired sound, as both are vibrat ...
analysis
** Small signal noise (AC)
** Transient noise
* Operating point analysis — determines the dc operating point of the circuit with inductors shorted and capacitors opened.
* Operating point sweep analysis — determines the values of output variables while one or two specified independent voltage or current source is stepped over
* Pole-zero analysis (AC)
* Small-Signal distortion analysis and frequency response analysis (AC)
* Sensitivity analysis (DC/AC)
* Transfer function analysis
* Transient analysis
* Periodic steady state analysis
* S-parameter analysis
Device models
Ngspice implements various circuits elements, like
resistor
A resistor is a passive two-terminal electronic component that implements electrical resistance as a circuit element. In electronic circuits, resistors are used to reduce current flow, adjust signal levels, to divide voltages, bias active e ...
s,
capacitor
In electrical engineering, a capacitor is a device that stores electrical energy by accumulating electric charges on two closely spaced surfaces that are insulated from each other. The capacitor was originally known as the condenser, a term st ...
s,
inductor
An inductor, also called a coil, choke, or reactor, is a Passivity (engineering), passive two-terminal electronic component, electrical component that stores energy in a magnetic field when an electric current flows through it. An inductor typic ...
s (single or mutual),
transmission line
In electrical engineering, a transmission line is a specialized cable or other structure designed to conduct electromagnetic waves in a contained manner. The term applies when the conductors are long enough that the wave nature of the transmis ...
s and a growing number of semiconductor devices like
diode
A diode is a two-Terminal (electronics), terminal electronic component that conducts electric current primarily in One-way traffic, one direction (asymmetric electrical conductance, conductance). It has low (ideally zero) Electrical resistance ...
s,
bipolar transistor
A bipolar junction transistor (BJT) is a type of transistor that uses both electrons and electron holes as charge carriers. In contrast, a unipolar transistor, such as a field-effect transistor (FET), uses only one kind of charge carrier. A ...
s,
MOSFET
upright=1.3, Two power MOSFETs in amperes">A in the ''on'' state, dissipating up to about 100 watt">W and controlling a load of over 2000 W. A matchstick is pictured for scale.
In electronics, the metal–oxide–semiconductor field- ...
s (both bulk and SOI),
MESFETs,
JFETs and
HFETs.
Netlists
Ngspice supports parametric netlists (i.e. netlists can contain parameters and expressions).
PSPICE compatible parametric macromodels, often released by manufacturers, can be imported as-is into the simulator. Polynomial sources are available. Ngspice provides an internal scripting language to facilitate complex simulation and evaluation control flows.
Defining new models
For mixed signal circuit simulation ngspice allows users to create a user-defined node definition file (UDN) of a new device model interface. The implementation of the node is created and simulated by using
C language
C (''pronounced'' '' – like the letter c'') is a general-purpose programming language. It was created in the 1970s by Dennis Ritchie and remains very widely used and influential. By design, C's features cleanly reflect the capabilities o ...
with macros which is compiled by standard C/C++ compilers.
New models can be added to the simulator using:
* Behavioral modeling: Internal B-, E-, and G-sources, as well as R, C and L devices, offer modeling by mathematical expressions, driven by node voltages, branch currents, parameters and constants.
* The Xspice codemodel interface: This is a C-code interface that helps the modeling process by simplifying the access to simulator's internal structure.
* Verilog-A compact models: OSDI interface for dynamically loading
OpenVAF compiled Verilog-A models.
* C language coded models with spice format: As an open-source project, Ngspice allows new models to be linked to the sources and compiled.
Development
Ngspice may be compiled into
shared library(*.dll or *.so) readily to be integrated into a calling program. Its interface provides access to all simulation parameters, input and output data
another shared library version, offers an interface to
Tcl/
Tk (software) for better integration with software like
XCircuits.
Ngspice is licensed under the
BSD-3-Clause license. This permissive open source license allows its integration as a simulation engine into several —
proprietary or
free/libre — EDA tools such as
KiCad
KiCad ( ) is a free software suite for electronic design automation (EDA). It facilitates the design and simulation of electronic hardware for PCB manufacturing. It features an integrated environment for schematic capture, Printed circuit boar ...
,
EAGLE (program)
EAGLE is a scriptable electronic design automation (EDA) application with schematic capture, printed circuit board (PCB) layout, auto-router and computer-aided manufacturing (CAM) features. EAGLE stands for Easily Applicable Graphical L ...
,
CoolSPICE,
Altium
Altium Limited is an American multinational software company that provides electronic design automation software to engineers who design printed circuit boards. Founded as Protel Systems Pty Ltd in Australia in 1985, the company has regional he ...
an
others
Ngspice has a command line input interface and offers plotting capability. An open source GUI with schematic entry, simulation and plotting is provided b
Qucs-S
Ngspice progress was presented at
FOSDEM
Free and Open source Software Developers' European Meeting (FOSDEM) is an annual software engineering conference. It is non-commercial and volunteer-organized with a focus on free and open-source software. Initiated in 2000, it is usually held d ...
and FSiC conferences in 2019.
See also
*
LTspice
*
Comparison of EDA Software
This page is a comparison of electronic design automation (EDA) software which is used today to design the near totality of electronic devices. Modern electronic devices are too complex to be designed without the help of a computer. Electronic dev ...
*
List of free electronics circuit simulators
Notes
References
External links
*
*
ngspice manual
{{CAD software
Free simulation software
Electronic circuit simulators
Electronic design automation software for Linux
Free software programmed in C