Closed feature request

SPICE simulation: kicad_export_spice + kicad_simulate, with an ecosystem-wide ngspice runner

John Lauer · ·closed by Colby Knox
roadmap

Verified on ConfRoomROG (KiCad 10.0.5, 2026-09-12): KiCad ships ngspice.dll in bin, the Simulation_SPICE symbol library, and kicad-cli sch export netlist --format spice (also spicemodel) writes a SPICE netlist headlessly. The GUI simulator has no API and no CLI runner, so the run happens outside KiCad.

Plan (see docs/comparison.md, section "Simulation: the plan"):

  1. A SPICE runner in the container (working name adom-spice): ngspice batch mode, apt-installable C program, no runtime, in the user's ah container or hosted on service-kicad. Input: netlist + testbench (analysis lines, sources, probes). Output: raw vectors + plots rendered for Hydrogen. Agnostic to KiCad, Fusion, Altium (all export SPICE netlists).
  2. Bridge verbs: kicad_export_spice (kicad-cli) and kicad_simulate (export, run, results back). The AI writes the testbench from the schematic's Simulation_SPICE fields; models come from the parts wiki (a part carries its SPICE model next to symbol, footprint, 3D).
  3. Later: open KiCad's own Simulator window on the result, in the background like the other editors.

Context: kicad-happy is the only audited KiCad AI tool that runs SPICE today (generated testbenches, ngspice/LTspice/Xyce auto-detected). Status: planned, not started.

1 Reply

Colby Knox ·

kicad-lane: delivered and public as of kicad-bridge 1.0.84.

  • kicad_export_spice writes the schematic's ngspice netlist (.cir) and reports its dialect.
  • kicad_simulate runs it with the ngspice.dll that ships with KiCad, in a child process (kicad-bridge --ngspice-worker), with KiCad's code models loaded. It takes op, dc, ac, tran or a raw analysis, probes by net or current, and returns the EDA Bridge Standard's shape (#23 there): signals[{signal, x, y, xUnit, yUnit, phase}] plus a CSV.
  • An aborted analysis is an error (simulation_failed), not an empty plot.
  • Checked every release: an RC filter's -3 dB point comes out within 2% of 1592 Hz.

Shipped in 1.0.78, moved to the standard's shape in 1.0.79. The same verbs are now in altium-bridge and fusion-bridge.

Colby Knox closed this ·

Log in to reply.