📖 Architectural & Engineering Overview

Ngspice is the preeminent open-source general-purpose circuit simulation engine for analog, RF, and mixed-signal electronics. Built upon legendary Berkeley SPICE3f5, Georgia Tech's XSPICE code models, and Cider numerical device simulators, Ngspice provides transistor-level accuracy for everything from discrete op-amp circuits to sub-micron FinFET integrated circuits. It supports modern compact models (BSIM4, BSIM-CMG, PSP, HiSIM) and is embedded as the default simulation engine within KiCad, eSim, and open-source semiconductor PDKs.

Role in the Hardware Ecosystem: Analog, RF & Mixed-Signal Transistor-Level Circuit Simulation. Whether deployed in academic research labs or continuous integration pipelines at silicon startups, Ngspice provides a dependable, license-free pillar of the open-source electronics movement.

⚡ Key Capabilities & Features

  • ✔ Full suite of simulation analyses: DC Operating Point, AC Frequency Sweep, Transient, Noise, Fourier, and Monte Carlo
  • ✔ Advanced compact transistor models: BSIM3v3, BSIM4, BSIM-CMG (FinFET), EKV, and BJT models
  • ✔ XSPICE digital event-driven modeling for fast mixed-signal co-simulation
  • ✔ Shared library mode (libngspice) allowing direct embedding into Python, C++, and GUI tools
  • ✔ Batch and interactive terminal simulation modes with flexible Nutmeg plotting
  • ✔ Standard engine powering simulation in KiCad Eeschema and open PDK characterization

💻 Practical Workflow Example: CMOS Inverter Transient Analysis (inverter.sp)

* CMOS Inverter Dynamic Response
.include sky130_fd_pr__models.spider.pm3.spice

Vdd vdd 0 1.8V
Vin in 0 PULSE(0 1.8V 0 100ps 100ps 2ns 4ns)

X1 out in vdd 0 sky130_fd_pr__nfet_01v8 W=1u L=0.15u
X2 out in vdd vdd sky130_fd_pr__pfet_01v8 W=2u L=0.15u
Cload out 0 10fF

.tran 10ps 10ns
.control
run
plot v(in) v(out)
.endc
.end

⚖️ Engineering Evaluation: Strengths & Limitations

✔ Key Advantages

  • + The industry benchmark for open-source analog SPICE simulation accuracy
  • + Complete compatibility with industry SPICE models provided by Texas Instruments, Analog Devices, and foundries
  • + Decades of active refinement, bug fixing, and numerical convergence enhancements

✖ Engineering Trade-offs

  • − Single-core transient solver on standard models can be slower than commercial multi-threaded parallel SPICE on huge circuits
  • − Convergence issues can require manual tuning of `.options reltol`, `gmin`, and `abstol`