Top Qs
Timeline
Chat
Perspective

Ngspice

Analog circuit simulator software From Wikipedia, the free encyclopedia

Ngspice
Remove ads

Ngspice[2][3][4] is an open-source mixed-level/mixed-signal electronic circuit simulator. It is a successor of the latest stable release of Berkeley SPICE, 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.

Quick facts Original author, Developers ...

Ngspice is based on three open-source free-software packages: Spice3f5, Xspice and Cider1b1:

  • SPICE[5] is the origin of most modern electronic circuit simulators, its successors are widely used in the electronics community.
  • Xspice[6] 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[7] 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.[8]
Remove ads

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:[9]

  • Noise 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
  • Fast event-based digital co-simulation
Remove ads

Device models

Ngspice implements various circuits elements, like resistors, capacitors, inductors (single or mutual), transmission lines and a growing number of semiconductor devices like diodes, bipolar transistors, MOSFETs (both bulk and SOI), MESFETs, JFETs and HFETs. Verilog-A compact device models[10] are supported.

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. Open source Process design kits (PDKs)[11][12][13] are fully supported, HSPICE compatible PDKs as far as possible.

Mixed-signal simulation

Ngspice makes available mixed-signal simulation, where ngspice is responsible for the analogue part, and the digital part is provided by Verilog, compiled with Verilator or Icarus Verilog, or in case of VHDL compiled with GHDL. The interface is provided by a dedicated code model (d_cosim), as described in chapters 8.4.25 and 10.3 of the ngspice manual[14].

Defining new models

For mixed-signal circuit simulation with new internal code models 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 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[15] 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.
Remove ads

Available ngspice variants

Ngspice has a command line input interface and offers plotting capability. An open source GUI with schematic entry, simulation and plotting is provided by Qucs-S. A GUI focussing on IC development is XSCHEM.

In addidtion to its standard executable, ngspice may be compiled into a 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. tclspice, another shared library version, offers an interface to Tcl/Tk (software) for better integration with software like XCircuits.

Remove ads

Miscellaneous

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,[16][17] EAGLE (program),[18] CoolSPICE, Altium and others.


Ngspice progress has been continuously presented at FOSDEM[19] and FSiC[20] conferences since 2019.

See also

Notes

  1. Over 67 contributors have worked on ngspice over time
  2. Compiler dependent. See C language compilers like GCC, clang, or MS Visual C++ for specific ISA and supported platforms.

References

Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.

Remove ads