* Cider<ref>{{Cite web |last=Gates |first=David A. |date=June 1993 |title=Design-Oriented Mixed-Level Circuit and Device Simulation – PhD thesis |url=https://www2.eecs.berkeley.edu/Pubs/TechRpts/1993/ERL-93-51.pdf |access-date=2023-08-28 |website=[[University of California, Berkeley]]}}</ref> 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.<ref>CODECS: A Mixed-Level Circuit and Device Simulator, K. Mayaram, Memorandum No. UCB/ERL M88/71, Berkeley, 1988, http://www.eecs.berkeley.edu/Pubs/TechRpts/1988/ERL-88-71.pdf {{Webarchive|url=https://web.archive.org/web/20210123043002/https://www2.eecs.berkeley.edu/Pubs/TechRpts/1988/ERL-88-71.pdf |date=2021-01-23 }}</ref>
* Cider<ref>{{Cite web |last=Gates |first=David A. |date=June 1993 |title=Design-Oriented Mixed-Level Circuit and Device Simulation – PhD thesis |url=https://www2.eecs.berkeley.edu/Pubs/TechRpts/1993/ERL-93-51.pdf |access-date=2023-08-28 |website=[[University of California, Berkeley]]}}</ref> 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.<ref>CODECS: A Mixed-Level Circuit and Device Simulator, K. Mayaram, Memorandum No. UCB/ERL M88/71, Berkeley, 1988, http://www.eecs.berkeley.edu/Pubs/TechRpts/1988/ERL-88-71.pdf {{Webarchive|url=https://web.archive.org/web/20210123043002/https://www2.eecs.berkeley.edu/Pubs/TechRpts/1988/ERL-88-71.pdf |date=2021-01-23 }}</ref>
==Overview==
Ngspice implements three classes of analysis:
Ngspice implements three classes of analysis:
*Nonlinear DC analyses
*Nonlinear DC analyses
* Periodic steady state analysis
* Periodic steady state analysis
* S-parameter analysis
* S-parameter analysis
* Fast event-based digital co-simulation
== Device models ==
== Device models ==
Ngspice implements various circuits elements, like [[resistor]]s, [[capacitor]]s, [[inductor]]s (single or mutual), [[transmission line]]s and a growing number of semiconductor devices like [[diode]]s, [[bipolar transistor]]s, [[MOSFET]]s (both bulk and SOI), [[MESFET]]s, [[JFET]]s and [[HFET]]s.
Ngspice implements various circuits elements, like [[resistor]]s, [[capacitor]]s, [[inductor]]s (single or mutual), [[transmission line]]s and a growing number of semiconductor devices like [[diode]]s, [[bipolar transistor]]s, [[MOSFET]]s (both bulk and SOI), [[MESFET]]s, [[JFET]]s and [[HFET]]s.
=== Netlists ===
== 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 kit]]s (PDKs)<ref>{{cite web|url=https://github.com/IHP-GmbH/IHP-Open-PDK |title=IHP-Open-PDK | access-date=2025-11-15}}</ref><ref>{{cite web|url=http://opencircuitdesign.com/open_pdks/ |title=Open_PDKs version 1.0 PDK Installer for open-source tools| access-date=2025-11-15}}</ref><ref>{{cite web|url=https://github.com/RTimothyEdwards/open_pdks |title=OpenPDKs | access-date=2025-11-15}}</ref> are fully supported, [[HSPICE]] compatible PDKs as far as possible.
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 kit]]s (PDKs)<ref>{{cite web|url=https://github.com/IHP-GmbH/IHP-Open-PDK |title=IHP-Open-PDK | access-date=2025-11-15}}</ref><ref>{{cite web|url=http://opencircuitdesign.com/open_pdks/ |title=Open_PDKs version 1.0 PDK Installer for open-source tools| access-date=2025-11-15}}</ref><ref>{{cite web|url=https://github.com/RTimothyEdwards/open_pdks |title=OpenPDKs | access-date=2025-11-15}}</ref> are fully supported, [[HSPICE]] compatible PDKs as far as possible.
=== Defining new models ===
== 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 (programming language)|C language]] with macros which is compiled by standard C/C++ compilers.
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 (programming language)|C language]] with macros which is compiled by standard C/C++ compilers.
* C language coded models with spice format: As an open-source project, Ngspice allows new models to be linked to the sources and compiled.
* 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 ==
== ==
==Miscellaneous==
Ngspice is licensed under the [[BSD licenses|BSD-3-Clause]] license. This permissive open source license allows its integration as a simulation engine into several — [[Proprietary software|proprietary]] or [[Free software|free/libre]] — EDA tools such as [[KiCad]],<ref>{{cite web|url=https://ngspice.sourceforge.net/ngspice-eeschema.html |title=Tutorial: how to set up ngspice and Eeschema for KiCad |publisher=ngspice | access-date=2019-07-18}}</ref><ref>Integrated Spice Simulation with Kicad, T. Wlostowski, FOSDEM, Brussels 2017, https://archive.fosdem.org/2017/schedule/event/spice_kicad/</ref> [[EAGLE (program)]],<ref>SPICE Simulation Part 1, S. Sattel, Autodesk Support and Learning, 2017, https://www.autodesk.com/products/eagle/blog/spice-simulation-part-1/</ref> [[CoolSPICE]], [[Altium]] and [http://ngspice.sourceforge.net/resources.html others].
Ngspice is licensed under the [[BSD licenses|BSD-3-Clause]] license. This permissive open source license allows its integration as a simulation engine into several — [[Proprietary software|proprietary]] or [[Free software|free/libre]] — EDA tools such as [[KiCad]],<ref>{{cite web|url=https://ngspice.sourceforge.net/ngspice-eeschema.html |title=Tutorial: how to set up ngspice and Eeschema for KiCad |publisher=ngspice | access-date=2019-07-18}}</ref><ref>Integrated Spice Simulation with Kicad, T. Wlostowski, FOSDEM, Brussels 2017, https://archive.fosdem.org/2017/schedule/event/spice_kicad/</ref> [[EAGLE (program)]],<ref>SPICE Simulation Part 1, S. Sattel, Autodesk Support and Learning, 2017, https://www.autodesk.com/products/eagle/blog/spice-simulation-part-1/</ref> [[CoolSPICE]], [[Altium]] and [http://ngspice.sourceforge.net/resources.html others].
Ngspice progress has been continuously presented at [[FOSDEM]]<ref>{{cite web|url=https://archive.fosdem.org/2025/schedule/event/fosdem-2025-5619-ngspice-xspice-elemental-devices-made-available-in-kicad/ |title=ngspice – xspice elemental devices made available in kicad |publisher=Free and Open source Software Developers’ European Meeting (FOSDEM) | access-date=2025-11-16}}</ref> and FSiC conferences since 2019.<ref>{{cite web |url=https://wiki.f-si.org/index.php?title=Ngspice_-_status_update,_and_degradation_simulation |title=Ngspice_-_status_update,_and_degradation_simulation |publisher=Free Silicon Foundation (F-Si) | access-date=2025-11-16 |url-status=live }}</ref>
Ngspice progress has been continuously presented at [[FOSDEM]]<ref>{{cite web|url=https://archive.fosdem.org/2025/schedule/event/fosdem-2025-5619-ngspice-xspice-elemental-devices-made-available-in-kicad/ |title=ngspice – xspice elemental devices made available in kicad |publisher=Free and Open source Software Developers’ European Meeting (FOSDEM) | access-date=2025-11-16}}</ref> and FSiC conferences since 2019.<ref>{{cite web |url=https://wiki.f-si.org/index.php?title=Ngspice_-_status_update,_and_degradation_simulation |title=Ngspice_-_status_update,_and_degradation_simulation |publisher=Free Silicon Foundation (F-Si) | access-date=2025-11-16 |url-status=live }}</ref>
Analog circuit simulator software
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.
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]
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
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.
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)[10][11][12] are fully supported, HSPICE compatible PDKs as far as possible.
Defining new models
[edit]
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 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[13] 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.
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.
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,[14][15] EAGLE (program),[16] CoolSPICE, Altium and others.
Ngspice progress has been continuously presented at FOSDEM[17] and FSiC conferences since 2019.[18]
- ^ Over 67 contributors have worked on ngspice over time
- ^ Compiler dependent. See C language compilers like GCC, clang, or MS Visual C++ for specific ISA and supported platforms.
- ^ “Ngspice circuit simulator – Authors”. ngspice.sourceforge.net. Retrieved 2022-05-26.
- ^ NGSPICE: recent progresses and future plans, P. Nenzi e.a., MOS-AK, Bucharest 2014, http://www.mos-ak.org/bucharest/ Archived 2022-07-06 at the Wayback Machine
- ^ “The NGSPICE circuit simulator”. archive.fosdem.org. Retrieved 2024-02-15.
- ^ “ngspice, current status and future developments”. archive.fosdem.org. Retrieved 2024-02-15.
- ^ Analysis of Performance and Convergence Issues for Circuit Simulation, T. Quarles, PhD dissertation, Memorandum No. UCB/ERL M89/42, Berkeley 1989, http://www.eecs.berkeley.edu/Pubs/TechRpts/1989/ERL-89-42.pdf
- ^ Code-level modeling in XSPICE, F. L. Cox e.a., Proceedings IEEE International Symposium on Circuits and Systems, 1992 (ISCAS 92), vol. 2, pp. 871-874, 10–13 May 1992
- ^ Gates, David A. (June 1993). “Design-Oriented Mixed-Level Circuit and Device Simulation – PhD thesis” (PDF). University of California, Berkeley. Retrieved 2023-08-28.
- ^ CODECS: A Mixed-Level Circuit and Device Simulator, K. Mayaram, Memorandum No. UCB/ERL M88/71, Berkeley, 1988, http://www.eecs.berkeley.edu/Pubs/TechRpts/1988/ERL-88-71.pdf Archived 2021-01-23 at the Wayback Machine
- ^ “ngspice / ngspice / [c4efe2] /ANALYSES”. sourceforge.net. Archived from the original on 2022-05-26. Retrieved 2022-05-26.
- ^ “IHP-Open-PDK”. Retrieved 2025-11-15.
- ^ “Open_PDKs version 1.0 PDK Installer for open-source tools”. Retrieved 2025-11-15.
- ^ “OpenPDKs”. Retrieved 2025-11-15.
- ^ “OpenVAF-Reloaded”. Retrieved 2025-11-15.
- ^ “Tutorial: how to set up ngspice and Eeschema for KiCad”. ngspice. Retrieved 2019-07-18.
- ^ Integrated Spice Simulation with Kicad, T. Wlostowski, FOSDEM, Brussels 2017, https://archive.fosdem.org/2017/schedule/event/spice_kicad/
- ^ SPICE Simulation Part 1, S. Sattel, Autodesk Support and Learning, 2017, https://www.autodesk.com/products/eagle/blog/spice-simulation-part-1/
- ^ “ngspice – xspice elemental devices made available in kicad”. Free and Open source Software Developers’ European Meeting (FOSDEM). Retrieved 2025-11-16.
- ^ “Ngspice_-_status_update,_and_degradation_simulation”. Free Silicon Foundation (F-Si). Retrieved 2025-11-16.
{{cite web}}: CS1 maint: url-status (link)

