Netlisting for spice simulation


I am relatively new to KiCad but I have built a number of boards with it, and they work. I have much more experience with gEDA. Also, I have some experience with spice but I am in no way an expert.

I am trying to simulate some simple circuits (and some not so simple) using ngspice as the simulation engine and KiCad Eeschema as the schematic capture tool. I have read numerous websites on this and viewed a number of YouTube videos to get the gist of how it all works.

I am stymied at the first step. I have created the schematic the same way that I did for the other boards that I designed with KiCad. The circuit is an inverting op-amp circuit. I limited myself to the parts in pspice.libexcept that I restricted myself to the parts in pspice.lib except for the op amp (there isn’t one in my pspice.lib).

When I click on the “NET” icon to get a netlist, I get the Netlist window. I selected Spiceand clicked on “default”, “Prefix references ‘U’ and ‘IC’ with ‘X’”, and “Use net numbers as net name”. I entered “ngspice” in Simulator command, <project_name>.cir in Default Netlist Filename, and clicked Generate. In the Save Netlist File screen I clicked “Save”, answered “Replace” to the query regarding replacing the current file (I have done this many times), and then listed the file as it appears on disc.

The resulting file has no nodes numbered 0. The ground symbol that I used comes from the pspice.lib library so the file should have the ground node as 0. In some cases, it is 1. In others, it is some other non-zero number. In one case, it was 6 and some, not all, of the other nodes were less than 6.

Clearly, I cannot simulate this circuit from this netlist.

What am I doing wrong?

Best regards,


Have you seen this guide? It says

Use the “0” component from a SPICE component library rather than the GND symbol.
“0” is the official name of ground node in SPICE. Some engines may translate GND into 0, some may not.

I am aware of that. That is the reason that I selected all my parts (except the op amp) from pspice.lib. The ground from that library is labelled ‘0’, not ‘Gnd’. As well, I also tried labelling the nets with global net labels because one of the web postings suggested that using global labels avoided the leading forward slash. When I labelled the nets, that included the ground, which I labelled ‘0’. None of it helped.

Best regards,