Is spinit or .spiceinit loaded (ngspice init files)

I’m trying to get a development version of ngspice to run pspice code on a nightly build of KiCad. Currently I’m stuck and I’m not able to tell if the spinit or the .spiceinit files are loaded.

Can anyone think of a way to check whether or not these files are being loaded by ngspice?

The KiCad installation of ngspice does not use spinit or .spiceinit. All commands, also the commands to set up the simulator, are given via the command interface.

Standard ngspice (also its dll) firstly loads and processes spinit. spinit is typically set by the installation procedure. Afterwards the user definable .spiceinit is loaded and processed. It may be used to set personal preferences.

To check if either is loaded, you may add ‘set ngdebug’ to spinit or .spiceinit. If I do so with my KiCad installation, I see additional debug output during the simulation (e.g. percentage of simulation done).

I have set up KiCad on a Windows 10 machine, and in fact .spiceinit is not loaded when it is in the Programs/KiCad/bin directory or in the user’s home directory, in contrast to the Windows 7 I have used so far.

An analysis with Procmon shows that it is searched only in the Programs/KiCad directory (tested for now with the libngspice-0.dll provided with KiCad).

So place .spiceinit into Programs/KiCad and give it another try.

1 Like

That worked!
Also, by including the SET NGDEBUG parameter I got three debug files in C:\Program Files\KiCad

I did however get quite a lot of other error messages but at least I’m slowly moving forward. I’ll update you on the progress as soon as I have deciphered the debug files.

Arild

When I run your circuit, I get the message “doAnalyses: Too many iterations without convergence
run simulation(s) aborted”.

This may be due to the fact that an oscillator may not aquire a stable operating point at the beginning of the simulation.

Skipping the op calculation and immediately starting with transient simulation may sometimes help. This can be achieved by selecting the simulator “Settings”, and then “Custom”. Adding UIC to the .tran line will start transient simulation with node voltage 0, if not specified elsewhere (see chapt. 15.3.9 of the manual).

The circuit then oscillates, but looks somewhat unstable (e.g. missing pulses).

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