IBIS models with fields of 0.0 produce simulation errors

For SI simulation purposes I downloaded the 74AVC1T45 IBIS model from nexperia: 74AVC1T45 - Dual-supply voltage level translator/transceiver; 3-state | Nexperia
Then I used one instance of this translator as source producing a square wave and a second instance as device:

As soon as there are fields like the follows then the simulation in ngspice will not produce the configured square wave but converge to 0.
[GND_clamp]
| voltage I(typ) I(min) I(max)
|

-2.0000E-02 -3.9750E-10 -6.4377E-09 -4.8780E-12
0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00
3.8333E-01 0.0000E+00 0.0000E+00 0.0000E+00
7.6667E-01 0.0000E+00 0.0000E+00 0.0000E+00
1.1500E+00 0.0000E+00 0.0000E+00 0.0000E+00
1.5333E+00 0.0000E+00 0.0000E+00 0.0000E+00
1.9167E+00 0.0000E+00 0.0000E+00 0.0000E+00
2.3000E+00 0.0000E+00 0.0000E+00 0.0000E+00
2.6833E+00 0.0000E+00 0.0000E+00 0.0000E+00
3.0667E+00 0.0000E+00 0.0000E+00 0.0000E+00
3.4500E+00 0.0000E+00 0.0000E+00 0.0000E+00
3.8333E+00 0.0000E+00 0.0000E+00 0.0000E+00
4.2167E+00 0.0000E+00 0.0000E+00 0.0000E+00
4.6000E+00 0.0000E+00 0.0000E+00 0.0000E+00

I made two projects showing the effects as an example. The failing one will not be able to produce the configured square wave and the working one does… doing a diff of the two files avc1t45.ibs reveals the problem.
Failing:

When I replace the field with the 0.0 by some very small numbers the whole thing simulates:

KiCAD version info:
Application: KiCad x86_64 on x86_64
Version: 8.0.1, release build
Libraries:
wxWidgets 3.2.4
FreeType 2.13.2
HarfBuzz 8.1.1
FontConfig 2.15.0
libcurl/8.6.0-DEV OpenSSL/3.1.5 zlib/1.3.1 libidn2/2.3.4 libpsl/0.21.2 nghttp2/1.58.0
Platform: Freedesktop SDK 23.08 (Flatpak runtime), 64 bit, Little endian, wxGTK, X11, gnome, x11
Build Info:
Date: Mar 14 2024 14:27:53
wxWidgets: 3.2.4 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.84.0
OCC: 7.7.2
Curl: 8.5.0-DEV
ngspice: 42
Compiler: GCC 13.2.0 with C++ ABI 1018
avc1t45_ibis_simulation.zip (273.2 KB)

This might well be a ngspice issue, not KiCad, but please generate an issue report on this on the Gitlab tracker

IBIS is handled by Eeschema. ngspice should receive a ready-to-simulate input.

Eeschema generates two files for this purpose, U1.cache and U2.cache, both stored in C:\Users\"YourName"\AppData\Local\kicad\8.0\ibis (if you are on MS Windows, for Linux I don’t know the location). These will be used by ngspice.

In the given examples, both U1.cache are vastly different (e.g. file size working 270kB, non-working 10kB).

So this is either an IBIS model problem, a user bug or a bug in Eeschema, in its IBIS code.

Hello David and Holger,

I posted an issue in Gitlab for further investigation… since I know the cause of the issue I’m able to implement a work around.

Cheers
Goran

1 Like

This issue

When you create an issue report, it’s a good idea to give a link to it

For Linux the location is ~/.cache/kicad/8.0/ibis

I hit the same problem, but with some IBIS models that required considerable enhancements to the KiCad IBIS parser, so I couldn’t create a simple reproducer.

The problem occurs when KiCad runs a preliminary simulation to generate the Vku and Vkd pwl values used in the U1.cache file. That simulation is done on the fly in memory, so I patched KiCad to write the input deck out to a temporary file. For the models I was using, changing all the 0.0 values to a very small value (1.0e-15) didn’t always fix the problem, but changing every other 0.0 value did. Again I patched KiCad to do this for me.

The attached zip file contains those two patches, plus the temporary files created before and after applying the second patch for the test case provided here by gmarinkovic.
ibis-simulation-bug.zip (27.2 KB)

The problem is apparent when you run these simulations using ngspice on the command line.

% ngspice original_input.spice
******
** ngspice-42 : Circuit level simulation program
** Compiled with KLU Direct Linear Solver
...
Warning: singular matrix:  check node x2.gc_gnd0

Warning: singular matrix:  check node x2.gc_gnd0

Warning: singular matrix:  check node x2.gc_gnd0

doAnalyses: TRAN:  Timestep too small; time = 1.6e-11, timestep = 1.25e-22: trouble with node "x1.gc_gnd0"

run simulation(s) aborted

ASCII raw file "original_output.spice"
ngspice-42 done

compared with

% ngspice modified_input.spice 
******
** ngspice-42 : Circuit level simulation program
** Compiled with KLU Direct Linear Solver
...
No. of Data Rows : 5104
ASCII raw file "modified_output.spice"
ngspice-42 done

(both trimmed to just show the interesting parts).

I’m not a SPICE expert, so can’t say if the problem lies in the model KiCad generates or in ngspice.

@martin-w,

The issue is as well reported and discussed in git… just make sure to check there as well if you look for updates.

Cheers
Goran