@holger Herr Holger, I keep running into some bugs that indicates something is very wrong either with the file name or with some kind of automatic updates of the SPICE fields in the symbols. I hope you are aware of some of these issues or you can understand where is the problem, and maybe you can point me in the right direction.
I attached here two examples. Everything is identical between them, except for the name of the ngspice file model: one is named X1-DIG_FLIPD_SN74LVC2G74DCUR.sp, the other one X1_DIG_FLIPD_SN74LVC2G74DCUR.sp (a “minus” character was replaced by an underline character).
For reasons I cannot understand, the project using the minus character in the file name automatically messed-up the pin mapping in the symbol Sim.Pins = 1=2 2=1 3=7 4=6 5=5 6=3 7=4 8=8 instead of Sim.Pins = 1=1 2=2 3=3 4=4 5=5 6=6 7=7 8=8
What is even worse, the ngspice model clearly has the pins mapped one to one without any compromise. Even assuming there is some kind or automatic re-annotation that I am not aware of, still I cannot explain why the pin order is messed-up, not keeping the normal one-to-one matching annotation.
* PINSEQ: 1 = NULL FORBIDDEN, VECTOR NO, digital, input clk
* | 2 = NULL FORBIDDEN, VECTOR NO, digital, input data
* | | 3 = NULL FORBIDDEN, VECTOR NO, digital, output inverted data
* | | | 4 = NULL FORBIDDEN, VECTOR NO, analog, local floating V- reference
* | | | | 5 = NULL FORBIDDEN, VECTOR NO, digital, output data
* | | | | | 6 = NULL FORBIDDEN, VECTOR NO, digital, input asynch. reset
* | | | | | | 7 = NULL FORBIDDEN, VECTOR NO, digital, input asynch. set
* | | | | | | | 8 = NULL FORBIDDEN, VECTOR NO, analog, local floating V+ reference
* | | | | | | | |
.SUBCKT SN74LVC2G74DCUR 1 2 3 4 5 6 7 8 PARAMS:
The circuit works as expected when the mapping is not changed, but when the pins are scrambled I get an error message Fatal error: instance b.x2.b_qn is a shorted ASRC
I have no idea how is possible to end up with the pins scrambled automatically in this order:
And finally, my pulse source V4 is defined y1=0 y2=8 td=1u tr=29u tf=29u tw=1u per=60u but for some very weird reason I will end up with y1=0 y2=1 td=2n tr=2n tf=2n tw=50n per=100n, my ngspice definition is replaced automatically! I an not quite sure why, I suspect that when I use the schematic menu Tools > Update Symbols from Library the custom paramer values are automatically replaced by some hidded default values.
NOTE: any automatic changes in the ngspice-specific fields executed by by the schematic or symbol editor must be treated as a fatal bug! Any SPICE-specific stuff must be understood as something absolutely different from symbol graphical stuff (pins, lines, positions and colors).
If a field that is called Sim.Something is automatically messed-up by the schematic or the symbol editor, there will be zero chance to ever run simulations in KiCad.
1_Logic_Driver.7z (1.2 MB)
2_Logic_Driver.7z (1.2 MB)
EDIT:
I figured out KiCad is not really providing a self-contained archive of a project, and a demo circuit can end up with missing files, especially model files. I updated here the test files with some missing models. Unfortunately, even so, one must edit the declared location of the model file that is embedded in the symbols. KiCad is not smart enough to look first in the project directory for the needed model files. This is the best I can do under these circumstances. Also note, this is the demo from Linux, the path in the models must be converted accordingly for your operating system.
test_002.tar.gz (1.3 MB)