I use ngspice with kicad 4.0.7 for a long time without trouble. I have built a 5.0rc2 on Debian/Testing as official 4.0.7 now segfaults on Debian. Kicad runs as expected but I have some trouble with ngspice.
I used -PSPICE and +PSPICE symbols to add spice directives. With 5.0rc2, these directives don’t work anymore. How can I add spice directives directly in eeshema ?
Second problem. First letters of all symbols are duplicated. For example:
I have modified my libraries (new Spice fields) and I have fixed duplicated letters and .include. But the last point has to be fixed : how can I add Spice directives (.tran for example) ?
I’ve only played with this a little. If, big IF, I remember correctly the nightlies put that ‘/’ in for local lables and I think that was a problem. It works OK for the simulator in the program but causes problems if you try and use ngspice from the command line. I don’t remember if the ‘export’ function had the same problem.
I thought it might have been KiCad trying to assign a model prefix, as in C… R… etc, but if I misname C1 as xC1, it emits xxC1, so it seems to be simply duplicating a character, not doing anything like mapping.
Which exact version did you try ?
Maybe with the internal spice, external netlist generate has been less-tested, and had a regression ?
Addit: I did find this thread - not exactly this issue, but may expose another useful workaround pathway.
Looks like they quite recently added internal-spice netlist visibility, so that might give a more-tested spice netlist ?
Did you find the newly added internal-spice netlist visibility, and does it show the same effect ?
If it does, you could raise the issue in that bugtracker link above ?
I tried xC12, and it gives xxC12, which rather blows a hole in the clever-prefix argument.
That was my first guess, so I tried to see if Prefix was assigned.
As for conventions, well, I’ve not seen any OTHER spice programs trying to be clever in the background like this, they all expect R,C, prefixes, and users who want to model in spice, do have to expect to follow some spice rules.
They have to manage models
If they ARE going to add a prefix, then all user fields, should have the same rule applied invisibly, so you can write “K1 L1 L2 0.98” as that is spice portable.
What they have chosen to do, is NOT spice portable.
Addit: Here is one of many examples out there, of a Spice Schematic, and the Spice netlist.
I tested some more, and this prefix does work, provided you have defined the Spice model info.
I tested a circuit that did correctly fix one prefix, and then I edited another. (C1 -> N1)
In that list, only U1 and N1 need a prefix fixup, so I’ve suggested that on the bug list, (tho that may be closed?)
The suggested fix I gave of only adding a prefix fixup when needed, would have the netlist in #1, report normally.
In code terms this is trivial - if the added prefix letter does not change existing letter, skip the addition.
Just noticed seems there is good news, a small nudge, and they fixed this back in April 27th
Maciej Suminski (orsonmmz) wrote on 2018-04-27: #10 I have pushed a fix for the bug, as it turned out to be a simple and low risk change in exchange for much greater benefit.