Why is NGspice missing from KiCad 7

Trying to simulate a simple RC circuit with 1k resistor, 1uf cap, 1 volt dc supply…
On the Simulation Model Editor Dialog - using the “Built in” spice model:

  • Device = Voltage Source
  • Type = Pulse
  • Parameters
    … initial value = 0
    … pulsed value = 1v
    … Delay = 0
    … Risetime = 1ns
    … Fall Time = 1ns
    … Pulse Width = 1s
    … Period = 2s

Simulator - Simulation Command - Transient Tab:

Here are my KiCad & NGspice Versions…

Application: KiCad x64 on x64
Version: 7.0.6, release build
Libraries:
wxWidgets 3.2.2
FreeType 2.12.1
HarfBuzz 6.0.0
FontConfig 2.14.1
libcurl/7.88.1-DEV Schannel zlib/1.2.13
Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Date: Jul 6 2023 04:56:45
wxWidgets: 3.2.2 (wchar_t,wx containers)
Boost: 1.81.0
OCC: 7.6.3
Curl: 7.88.1-DEV
ngspice: 40
Compiler: Visual C++ 1936 without C++ ABI
Build settings:
KICAD_SPICE=ON

Can some kind soul tell me what is going on and why ngspice is not available as a choice under Compatibility Mode?
Thanks for any help.

BTW, the simulation seems to be working fine as the plot appears correct showing the charging capacitor.

https://ngspice.sourceforge.io/docs/ngspice-html-manual/manual.xhtml#sec_Compatibility

“ngspice” is not one of the options for ngspice. Nothing is missing.

ngSpice is not missing, see your version info:
image

I guess there is no need to add an “compatibility” mode for itself. I assume it’s always compatible with itself. But I agree it is a bit confusing setting for beginners. I also admit I don’t know how that compatibility mode works, or why you have to set it yourself.

The ngSpice website advises to set it to “PSpice and LTSpice”, but I guess it depends on the models you are using in your simulation.

Yes/no.

The “spice” option in the drop-down is actually NGSPICE_COMPATIBILITY_MODE::NGSPICE in our code.

It unsets all compat modes when running.

1 Like

Note to marekr, setting the Compatibility Mode = spice
worked!

Note to Paulvdh, yes, I need to upgrade to ngspice 41 but I’m unsure how to do it.

Note to Craftyjon, the link you provided gave me an error in both Chrome and Firefox.
This page contains the following errors:
error on line 279 at column 93: Opening and ending tag mismatch: link line 279 and head
That said I managed to get there and search the pdf version here…

Thanks to everyone for their help.

1 Like

Upgrade to KiCad 7.0.8.

My KiCad V7.0.8 is currently running ngSpice 38. And that is after I did some fiddling because the spice version that KiCad installed by default had some bug / missing feature. I did not want to imply you should update your ngSpice version, I just wanted to point out that ngSpice is installed and it shows the version in your version info.

If you’re running simulations then I’d suggest installing 7.99 alongside 7.0.x.

Note that you don’t want to modify any of your schematics in 7.99 (as 7.0.x won’t be able to read them then). But the simulator is much improved in 7.99.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.