Can IBIS models be used in simulations?

I’m trying to include a Monostable Multivibrator in my SPICE simulation but now I’m stuck.
I can’t find a SPICE model for the SN74LV123A or any similar device. I do however find a few IBIS models.

Is there an easy way to include an IBIS model in the simulation or to get an 74123 multivibrator as a SPICE model?

Application: kicad
Version: (5.0.0-rc2-dev-393-gbaef22df9), release build

1 Like

No, a feature that would be awesome for high speed digital (or a nice to have feature in qucs)…

You could try this out and see if you can get a good spice model, I haven’t tried it though:

On the TI website there is a PSPICE model for the 74123. This is not immediately compatible to ngspice-27. You may adapt this model to ngspice, a hint is given in https://sourceforge.net/p/ngspice/discussion/ngspice-tips/thread/d2048be2/ .

There is a new ngspice version under develoment that understands PSPICE device models. A description is available at https://sourceforge.net/p/ngspice/discussion/ngspice-tips/thread/7838169b/ . It is not yet decided if this will be part of ngspice-28.

2 Likes

So it would be best to leave this to the ngspice developers? What is most important to support? PSpice or IBIS-models?

PSPICE compatibility in ngspice is quasi ready.

The IBIS 6.1 spec is a book of 260 pages. So adding this to ngspice may be useful only if there is a real, real need for IBIS.

I tried to go through the conversion of the 555 timer, but it is not a trivial process. To be able to do the conversion on another model would require skills that I don’t possess. It would be quite useful if this finds it’s way into ngSpice-28. Do you know when it is expected to be released? And will it be an easy fix to replace ngSpice 27 from KiCad with ngSpice 28?

If you are with MS Windows, using a KiCad nightly, you might give the PSPICE compatible ngspice a try by doing the following:

Download the source code from http://ngspice.sourceforge.net/experimental/ngspice-27-ps-64.7z.

Copy from the 7z zipped directory Spice64\bin-dll the two files ngspice.dll and vcomp140.dll into C:\Programs\KiCad\bin.

In directory KiCad\bin

Rename libngspice-0.dll to libngspice-0-orig.dll

Rename ngspice.dll to libngspice-0.dll

Put a file named .spiceinit into your home directory (C:\users\your-name). This file should contain the two lines

<empty line>
set ngbehavior=ps

And off you go!

I think I was able to make the swap but I was not able to do a proper simulation with an Texas Instruments TLC555 timer chip.

Please see the attached project and pspice file.
SpiceTest.zip (3.7 KB)

This is the simulator output:

Circuit: KiCad schematic
Original line no.: 268, new internal line no.: 32:
Undefined number [VT]
Original line no.: 268, new internal line no.: 32:
Expression err: vtlog(1+5.0m/isz))
Original line no.: 268, new internal line no.: 32:
Formula() error.
.param nz={0.3/(vt
log(1+5.0m/isz))}
Original line no.: 269, new internal line no.: 387:
Undefined number [NZ]
Original line no.: 269, new internal line no.: 387:
Cannot compute substitute
Original line no.: 0, new internal line no.: 111:
Undefined number [VT]
Original line no.: 0, new internal line no.: 111:
Expression err: VTLOG(1+IDIN/IS))
Original line no.: 0, new internal line no.: 111:
Formula() error.
W1=170U;L1=18U;M1=1;W2=170U;L2=18U;M2=1;IDIN=1U;IS=1E-12;L1E=L1-LDN;L2E=L2-LDN;B1=M1
(W1/L1)(KPN/2);NN=VTON/(VTLOG(1+IDIN/IS));MR= M2W2/L2E/(M1W1/L1E);RDS=1/(2SQRT(M2(W2/L2E)(KPN/2)IDIN));
Original line no.: 0, new internal line no.: 329:
Undefined number [MR]
Original line no.: 0, new internal line no.: 329:
Cannot compute substitute
Original line no.: 0, new internal line no.: 334:
Undefined number [RDS]
Original line no.: 0, new internal line no.: 334:
Cannot compute substitute
Original line no.: 0, new internal line no.: 337:
Undefined number [NN]
Original line no.: 0, new internal line no.: 337:
Cannot compute substitute
Original line no.: 0, new internal line no.: 112:
Undefined number [VT]
Original line no.: 0, new internal line no.: 112:
Expression err: VT
LOG(1+IDIN/IS))
Original line no.: 0, new internal line no.: 112:
Formula() error.
W1=13U;L1=26U;M1=1;W2=52U;L2=13U;M2=2;IDIN=50N;IS=1E-12;L1E=L1-LDN;L2E=L2-LDN;B1=M1
(W1/L1)(KPN/2);NN=VTON/(VTLOG(1+IDIN/IS));MR= M2W2/L2E/(M1W1/L1E);RDS=1/(2SQRT(M2(W2/L2E)(KPN/2)IDIN));
Original line no.: 0, new internal line no.: 329:
Undefined number [MR]
Original line no.: 0, new internal line no.: 329:
Cannot compute substitute
Original line no.: 0, new internal line no.: 334:
Undefined number [RDS]
Original line no.: 0, new internal line no.: 334:
Cannot compute substitute
Original line no.: 0, new internal line no.: 337:
Undefined number [NN]
Original line no.: 0, new internal line no.: 337:
Cannot compute substitute
Original line no.: 0, new internal line no.: 113:
Undefined number [VT]
Original line no.: 0, new internal line no.: 113:
Expression err: VT
LOG(1+IO/IS))
Original line no.: 0, new internal line no.: 113:
Formula() error.
W=112U;L=15U;M=2;IO=2U;MP=1;WP=13U;LPE=36U-LDP;IS=1E-12;LE=L-LDP;B1=(KPP/2
MPWP/LPE)VBMUL ;N=VTOHP/(VTLOG(1+IO/IS));MR= MW/LE/(MPWP/LPE)/VBMUL ;
Original line no.: 0, new internal line no.: 276:
Undefined number [MR]
Original line no.: 0, new internal line no.: 276:
Cannot compute substitute
Original line no.: 0, new internal line no.: 281:
Undefined number [N]
Original line no.: 0, new internal line no.: 281:
Cannot compute substitute
Original line no.: 0, new internal line no.: 114:
Undefined number [VT]
Original line no.: 0, new internal line no.: 114:
Expression err: VT
LOG(1+IO/IS))
Original line no.: 0, new internal line no.: 114:
Formula() error.
W=18U;L=26U;M=1;IO=100N;MP=1;WP=13U;LPE=36U-LDP;IS=1E-12;LE=L-LDP;B1=(KPP/2MPWP/LPE)VBMUL ;N=VTOHP/(VTLOG(1+IO/IS));MR= MW/LE/(MPWP/LPE)/VBMUL ;
Original line no.: 0, new internal line no.: 276:
Undefined number [MR]
Original line no.: 0, new internal line no.: 276:
Cannot compute substitute
Original line no.: 0, new internal line no.: 281:
Undefined number [N]
Original line no.: 0, new internal line no.: 281:
Cannot compute substitute
Original line no.: 0, new internal line no.: 115:
Undefined number [VT]
Original line no.: 0, new internal line no.: 115:
Expression err: VTLOG(1+IO/IS))
Original line no.: 0, new internal line no.: 115:
Formula() error.
W=112U;L=15U;M=2;IO=2U;MP=1;WP=13U;LPE=36U-LDP;IS=1E-12;LE=L-LDP;B1=(KPP/2
MPWP/LPE)VBMUL ;N=VTOHP/(VTLOG(1+IO/IS));MR= MW/LE/(MPWP/LPE)/VBMUL ;
Original line no.: 0, new internal line no.: 276:
Undefined number [MR]
Original line no.: 0, new internal line no.: 276:
Cannot compute substitute
Original line no.: 0, new internal line no.: 281:
Undefined number [N]
Original line no.: 0, new internal line no.: 281:
Cannot compute substitute
Original line no.: 0, new internal line no.: 116:
Undefined number [VT]
Original line no.: 0, new internal line no.: 116:
Expression err: VT
LOG(1+IDIN/IS))
Original line no.: 0, new internal line no.: 116:
Formula() error.
W1=172U;L1=15U;M1=1;W2=172U;L2=15U;M2=1;IDIN=1U;IS=1E-12;L1E=L1-LDP;L2E=L2-LDP;B1=M1*(W1/L1)(KPP/2);NP=VTOP/(VTLOG(1+IDIN/IS));MR=M2W2/L2E/(M1W1/L1E);RDS=1/(2SQRT(M2(W2/L2E)(KPP/2)IDIN));
Original line no.: 0, new internal line no.: 301:
Undefined number [MR]
Original line no.: 0, new internal line no.: 301:
Cannot compute substitute
Original line no.: 0, new internal line no.: 306:
Undefined number [RDS]
Original line no.: 0, new internal line no.: 306:
Cannot compute substitute
Original line no.: 0, new internal line no.: 309:
Undefined number [NP]
Original line no.: 0, new internal line no.: 309:
Cannot compute substitute
Original line no.: 0, new internal line no.: 404:
Undefined number [IF]
Original line no.: 0, new internal line no.: 404:
Expression err: IF((DELAYLH<1E-9),1E-9,DELAYLH)
Original line no.: 0, new internal line no.: 404:
Formula() error.
ROUT=ROUT;DELAYLH=1N;DELAYHL=1N;VOUTH=VOUTH;VOUTL=VOUTL;VTHRES1=0.5
(VOUTH-VOUTL);VTHRES2=VTOCN;TDELLH=IF((DELAYLH<1E-9),1E-9,DELAYLH);TDELHL=IF((DELAYHL<1E-9),1E-9,DELAYHL);TDEL=(TDELLH+TDELHL)/2;RO=IF((TDEL>1E-15)&(ROUT<1),1,ROUT);COUT=TDEL/(0.693
(RO+1U));RDELLH=TDELLH/(0.693*(COUT+1F));RDELHL=TDELHL/(0.693*(COUT+1F));
Original line no.: 0, new internal line no.: 431:
Undefined number [RDELLH]
Original line no.: 0, new internal line no.: 431:
Cannot compute substitute
Original line no.: 0, new internal line no.: 433:
Undefined number [COUT]
Original line no.: 0, new internal line no.: 433:
Cannot compute substitute
Original line no.: 0, new internal line no.: 405:
Undefined number [IF]
Original line no.: 0, new internal line no.: 405:
Expression err: IF((DELAYLH<1E-9),1E-9,DELAYLH)
Original line no.: 0, new internal line no.: 405:
Formula() error.
ROUT=ROUT;DELAYLH=15N;DELAYHL=1N;VOUTH=VOUTH;VOUTL=VOUTL;VTHRES1=VTOCP;VHYST1=0;VTHRES2=VTOCN;VHYST2=0;VTHRES3=0.49*(VOUTH-VOUTL);VHYST3=0;VREFN=(15-VTOHN);VREFP=(15-VTOHP);TDELLH=IF((DELAYLH<1E-9),1E-9,DELAYLH);TDELHL=IF((DELAYHL<1E-9),1E-9,DELAYHL);TDEL=(TDELLH+TDELHL)/2;RO=IF((TDEL>1E-15)&(ROUT<1),1,ROUT);COUT=TDEL/(0.693*(RO+1U));RDELLH=TDELLH/(0.693*(COUT+1F))VREFP;RDELHL=TDELHL/(0.693(COUT+1F))*VREFN;
Original line no.: 0, new internal line no.: 462:
Undefined number [RDELLH]
Original line no.: 0, new internal line no.: 462:
Cannot compute substitute
Original line no.: 0, new internal line no.: 468:
Undefined number [COUT]
Original line no.: 0, new internal line no.: 468:
Cannot compute substitute
Copies=484 Evals=627 Placeholders=167 Symbols=262 Errors=67
Numparam expansion errors: Problem with input file.
Error: ngspice.dll cannot recover and awaits to be detached
Note: can’t find init file.


** ngspice-27 shared library
** Creation Date: Mar 7 2018 20:39:38


Error: there aren’t any circuits loaded.

This is the netlist

.title KiCad schematic
.include “C:\Users\arild\Downloads\TLC555_PSPICE_AIO\TLC555.LIB”
V1 Net-R1-Pad1 GND dc 10
XU1 Net-C1-Pad1 Net-C2-Pad1 GND Net-R1-Pad1 Net-R2-Pad2 Net-C1-Pad1 Net-R1-Pad1 GND TLC555
R2 Net-R1-Pad1 Net-R2-Pad2 1k
C2 Net-C2-Pad1 GND 1u
R1 Net-R1-Pad1 Net-C1-Pad1 9.1k
C1 Net-C1-Pad1 GND 0.01u
.save @v1[i]
.save @r2[i]
.save @c2[i]
.save @r1[i]
.save @c1[i]
.save V(GND)
.save V(Net-C1-Pad1)
.save V(Net-C2-Pad1)
.save V(Net-R1-Pad1)
.save V(Net-R2-Pad2)
.tran 0.1m 20m
.end

My KiCad version

Application: kicad
Version: (5.0.0-rc2-dev-605-g458f9f5c9), release build
Libraries:
wxWidgets 3.0.3
libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.60.0
Curl: 7.54.1
Compiler: GCC 7.1.0 with C++ ABI 1011

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_SPICE=ON

The .spiceinit file is missing or is not found.

Place the .spiceinit file into directory KiCad/bin.

Where should I look to find the .spiceinit file? I did a search in the KiCad install directory and also in the downloaded ngspice27 files without luck.

Arild

You have to create a new text file with name .spiceinit .

First line empty, second line

set ngbehavior=ps

Put this file into /KiCad/bin

No effect with the filename .spiceinit
I did try to change it to spiceinit without the leading dot and that seems to have done something. These are the new error messages.

Circuit: KiCad schematic
Warning: Model issue on line 116 :
.model tlc55x_nmosd_hv nmos level=3 l=10u w=100u kp=    6.00000000000000 ...
unrecognized parameter (lambda) - ignored
Warning: Model issue on line 144 :
.model tlc55x_pmosd_hv pmos level=3 l=10u w=100u kp=    3.00000000000000 ...
unrecognized parameter (lambda) - ignored
Error on line 0 :
a.xu1.xmn15.as1 %vd xu1.qff 0 %gd xu1.gout 0 xu1.xmn15:aswn
MIF-ERROR - unable to find definition of model xu1.xmn15:aswn
Warning: Model issue on line 0 :
.model xu1.xmn15:aswn aswitch(cntl_on=    5.50000000000000044e-01   cntl ...
Unknown model type aswitch - ignored
Error on line 0 :
a.xu1.xmp15.as1 %vd xu1.qff 0 %gd xu1.gout net-_r1-pad1_ xu1.xmp15:aswn
MIF-ERROR - unable to find definition of model xu1.xmp15:aswn
Warning: Model issue on line 0 :
.model xu1.xmp15:aswn aswitch(cntl_on=    4.89999999999999991e-01   cntl ...
Unknown model type aswitch - ignored
Error on line 0 :
a.xu1.xmn9.as1 %vd xu1.reso 0 %gd xu1.trgo 0 xu1.xmn9:aswn
MIF-ERROR - unable to find definition of model xu1.xmn9:aswn
Warning: Model issue on line 0 :
.model xu1.xmn9:aswn aswitch(cntl_on=    1.14000000000000012e+00   cntl_ ...
Unknown model type aswitch - ignored
Reducing trtol to 1 for xspice 'A' devices
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000
Warning: singular matrix:  check nodes xu1.gout and xu1.gout
Note: Starting dynamic gmin stepping
Trying gmin =   1.0000E-03 Note: One successful gmin step
Trying gmin =   1.0000E-04 Note: One successful gmin step
Trying gmin =   1.0000E-05 Note: One successful gmin step
Trying gmin =   1.0000E-06 Note: One successful gmin step
Trying gmin =   1.0000E-07 Note: One successful gmin step
Trying gmin =   1.0000E-08 Note: One successful gmin step
Trying gmin =   1.0000E-09 Note: One successful gmin step
Trying gmin =   1.0000E-10 Note: One successful gmin step
Trying gmin =   1.0000E-11 Note: One successful gmin step
Trying gmin =   1.0000E-12 Note: One successful gmin step
Trying gmin =   1.0000E-12 Note: One successful gmin step
Warning: singular matrix:  check nodes xu1.gout and xu1.gout
Warning: Dynamic gmin stepping failed
Note: Starting source stepping
Supplies reduced to   0.0000% Warning: singular matrix:  check nodes xu1.gout and xu1.gout
Trying gmin =   1.0000E-02 Note: One successful gmin step
Trying gmin =   1.0000E-03 Note: One successful gmin step
Trying gmin =   1.0000E-04 Note: One successful gmin step
Trying gmin =   1.0000E-05 Note: One successful gmin step
Trying gmin =   1.0000E-06 Note: One successful gmin step
Trying gmin =   1.0000E-07 Note: One successful gmin step
Trying gmin =   1.0000E-08 Note: One successful gmin step
Trying gmin =   1.0000E-09 Note: One successful gmin step
Trying gmin =   1.0000E-10 Note: One successful gmin step
Trying gmin =   1.0000E-11 Note: One successful gmin step
Trying gmin =   1.0000E-12 Note: One successful gmin step
Note: One successful source step
Supplies reduced to   0.1000% Warning: singular matrix:  check nodes xu1.gout and xu1.gout
Supplies reduced to   0.0000% Warning: singular matrix:  check nodes xu1.gout and xu1.gout
Warning: source stepping failed
Transient solution failed -
Last Node Voltages
------------------
Node                                   Last Voltage        Previous Iter
----                                   ------------        -------------
net-_r1-pad1_                                     0         3.59664e-109
net-_c1-pad1_                         -1.75474e-150        -5.45201e-161
net-_c2-pad1_                         -1.48327e-126        -4.60857e-137
net-_r2-pad2_                          -9.9811e-215                    0
xu1.resi                               -2.0484e-171        -6.36443e-182
xu1.trgi                               -2.0484e-171        -6.36443e-182
xu1.thri                              -1.81804e-150        -5.64869e-161
xu1.conti                             -1.48327e-126        -4.76313e-137
xu1.gout                                          0                    0
xu1.trgo                                7.26031e-97         7.00654e-108
xu1.xmn3.10                                       0        -6.44512e-108
xu1.23                                            0                    0
xu1.thrs                               -1.35518e-53         -1.15174e-64
xu1.xmn5.10                                       0          9.42161e-65
xu1.25                                 -1.4013e-177         -1.7074e-189
xu1.reso                               1.08799e-164          1.6706e-176
xu1.15                                            0                    0
xu1.xmp9.10                                       0         -1.6706e-176
xu1.xmp6.10                                       0          1.7074e-189
xu1.trgs                               -5.95576e-97        -1.83558e-108
xu1.xmp5.10                                       0         9.14497e-109
xu1.thro                               -5.34054e-70          -4.7409e-81
xu1.xmp1.10                                       0           4.7409e-81
xu1.29                                            0                    0
xu1.xib.gb_int1                                   0                    0
xu1.xrsff.xu1.out_vmeas                           1                    0 *
xu1.xrsff.xu1.eout_int1                           1                    0 *
xu1.qff                                           0                    0
xu1.30                                            1                    0 *
xu1.xrsff.xu2.out_vmeas                           0                    0
xu1.xrsff.xu2.eout_int1                           0                    0
xu1.xrsff.xu2.1                                 100                    0 *
xu1.xrsff.xu2.e1_int1                           100                    0 *
xu1.trgc                              -3.35307e-127         2.34208e-139
xu1.32                                -2.31858e-127         7.99939e-140
xu1.33                                -8.00053e-127         5.28314e-139
xu1.34                                  -1.856e-156        -1.43519e-168
b.xu1.xrsff.xu2.be1#branch                        0                  100 *
b.xu1.xrsff.xu2.beout#branch                      0                    0
v.xu1.xrsff.xu2.v_eout#branch                     0                    0
b.xu1.xrsff.xu1.beout#branch                      0                    1 *
v.xu1.xrsff.xu1.v_eout#branch                     0                    0
b.xu1.xib.bgb#branch                              0                    0
v.xu1.xmp1.v1#branch                   -1.00756e-81                    0
v.xu1.xmn5.v1#branch                    2.96497e-66                    0
v.xu1.xmn3.v1#branch                  -1.01329e-108                    0
e.xu1.xrsff.xu2.e1#branch                         0                    0
e.xu1.xrsff.xu2.eout#branch                       0                    0
e.xu1.xrsff.xu1.eout#branch                       0                    0
v.xu1.xmp5.v1#branch                  -8.88022e-109                    0
v.xu1.xmp6.v1#branch                  -9.73471e-183                    0
v.xu1.xmp9.v1#branch                   3.25648e-176                    0
v1#branch                               1.48107e-81                    0
doAnalyses: iteration limit reached
run simulation(s) aborted

Now the TLC555 library is read, but then an XSPICE code model for the switch is missing: obviously the code models are not loaded.

Unfortunately a file named spiceinit (without dot) is a bad choice. This is a filename looked for internally by eeschema. If found, it assumes that the code model load commands are given in this file. If the file is not found, it starts another attempt to load the code models, typically successfully.

.spiceinit should work, but you have to restart eeschema (or KiCad) because the file is read only after startup. spinit may be an alternative.

Even with restart of the software the .spiceinit file did no do anything. spiceinit without the leading dot did get me from the first to the second error message. Renaming the file spinit brought me back to the initial error message.

If I understood you correctly the file discussed here is the one I created earlier with two lines - the first one empty and the second one with set ngbehavior=ps

Could the problem be releated to me running on Win 10 or a Newline format issue? This is my file in HEX
0D 0A 73 65 74 20 6E 67 62 65 68 61 76 69 6F 72 3D 70 73

That is a good point, indeed!

In your hex code the 0D 0A is missing at the end of the line.

For input files to ngspice there is a general rule to always add a newline to the end of the file.

Hopefully this will be the remedy for your problems.

I don’t think I’m able to get the spinit file loaded. To troubleshoot I have replaced my circuit with the pspice model with a simple filter circuit. Do you know if there is anything that I can put in the spinit file to verify that it is actually loaded?

How can I verify that the .spiceinit or spinit file has been loaded?

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