Xspice doesn't work

Xspice doesn’t work in simulator. How to be certain that it is installed and enabled?

How is this a KiCad issue? Ngspice is the integrated simulator.

If it is about ngspice distributed with KiCad, it is a KiCad problem.

Unfortunately Russel does not tell us. His “bug report” lacks too much info as to allow me to give any answer.

Btw. the title is wrong. “Xspice” as part of ngspice does work, as I have shown in Simulation with XSPICE code models , with my setup of KiCad 9.0.6 on MS Windows 11. And many of the device models used in Simulation examples for KiCad8/KiCad9/Eeschema/ngspice apply Xspice under the hood.

2 Likes

XSPICE is always enabled by default in ngspice and I actually don’t think you can disable it.

Which ngspice/kicad version do you have installed?

Go to Help → About KiCad → Version

You can also check which version of ngspice is called from KiCad by adding a text block to your schematic with the following content:

.control
version
.endc

Do other simulations work for you (without XSPICE)?

Thanks Holger. I have several Xspice sims running in Windows 10 just fine. The title is coarse to be sure, but elicited helpful responses. I am trying out KiCad on Linux using a simple test that works in Windows 10 Kicad. (Vpulse->ad_bridge→ da_bridge→resistor). I have tried several ways to install KiCad in Linux Mint (I know it is not supported by Kicad but others have had success. If I need a different repo then I can change.) My last attempt was installing KiCad from the Software manager which installed KiCad 9.06 with NGspice 45, no mention of Xspice. I tried several simulations that have worked before. The all-analog sims work well. The digital ones requiring Xspice not so much. This means to me that Xspice is either not included with the distribution or it is not enabled. Hence my question.

Can you help?

XSPICE is always enabled by default in ngspice and I actually don’t think you can disable it.

Thanks Lucas. My understanding as well.

KiCad 9.06. NGspice 45

Do other simulations work for you (without XSPICE)?

Analog YES, Digital NO.

When you attempt to run a simulation in KiCad. It logs a lot of informational and error messages. Copy that text and post it here, in between “reformatted text” tags.

There may be this reason:

KiCad with ngspice on Debian is not complete. The XSPICE code models are missing.

Now I guess (but I am not sure) Debian–>Ubuntu–>Mint.

May be the same here with Mint. I will have to talk to the Debian package manager how to solve this issue.

In the meantime it may help to install KiCad, but also install plain ngspice. The code models are part of the plain ngspice installation. A potential disadvantage of this approach: If ngspice within KiCad and plain ngspice do have different version numbers, problems may occur, as the code models are somewhat version specific.

Please try this approach and report the results here.

Thanks Holger. I installed KiCad using the Software Manager. NGspice included version 42. The Xspice digital symbols did not work. In fact the symbol editor showed no simulation model, built-in or otherwise. I installed NGspice 42 using the Software Manager as you suggested. Still no digital symbols had a simulation model.

The Software manager had a Flatpack version that included NGspice 45. I installed it. I had to launch from the Software manager. The terminal command line could not find it. It was installed in /var. The simulation models worked well except for the digital models as before.

I tried to install NGspice45 from a tarball. There were many missing dependencies. I think I got them all, but the installation directories were unfilled. I checked the config.log. I found several items that did not make sense, at least to me. I am way over my head now. So I do not know if the installation was done correctly.
I am suspecting that this is a Mint problem.

How can I resolve this.? Do I need a different distro?

The problem is that you try to describe the issue with your own words, which then I do not understand.

What does it mean: The XSPICE digital symbols did not work? What are XSPICE digital symbols?

What input did you give to KiCad, what is the exact simulator response?

1 Like