MIF-ERROR - unable to find definition of model xu1.x_s1:a_s1

Hello,

I am new to KiCad and have been following the tutorial for KiCad Schematic and the ngspice simulation for the OPA1641 op amp.

I found the model library as suggested on TI’s website. The current version is in “sbom627d.zip”

When I run the simulation I keep getting the following error -

Error on line:
a.xu1.x_s1.as_s1 %gd xu1.n2992267 xu1.clamp %gd xu1.n2992267 xu1.clamp xu1.x_s1:a_s1
MIF-ERROR - unable to find definition of model xu1.x_s1:a_s1

After searching the web I found that others had the same problem with KiCad 7 as described below (between the lines of asterisks) -


@DonHaig-k9b

1 year ago

I have been following your tutorials. Thank you for posting them! When I get to the transient simulation in this tutorial it throws the following error: Error on line 0 : a.xu1.x_s1.as_s1 %gd xu1.n2992267 xu1.clamp %gd xu1.n2992267 xu1.clamp xu1.x_s1:a_s1 MIF-ERROR - unable to find definition of model xu1.x_s1:a_s1 Error: circuit not parsed. Error: vector time not found! Error: vector time not found! As I am new to using this tool, I am at a loss. What am I missing? (KiCad 8 on Ubuntu 22.04) Thanks again.

@DonHaig-k9b

1 year ago

For others who may run into this issue. I upgraded from KiCad 7 to Kicad 8 using: sudo add-apt-repository ppa:kicad/kicad-8.0-releases sudo apt update sudo apt install kicad The following commands resolved the issue: sudo apt remove “ngspice” sudo apt install kicad Thank you to dsa-t on the KiCad Info Forum for the answer

@yusufferhatyilman6962

9 months ago

@DonHaig-k9b ran into the same issue, this fixed the problem. thx


Seems the problem was fixed in KiCad 8. The version I am using is the latest -

Version: 9.0.4-9.0.4-0~ubuntu24.04.1, release build

Has the fix in V8 not been applied to V9?

Any help will be appreciated to get past this stumbling block and build confidence in the use of KiCad.

Thanks.

The fix in the quoted section looks like changing the ngspice version to me. Since 9.0.4, KiCad has gone up another ngspice version, which may affect this issue.

Set the compatibility mode to PSPICE and LTSPICE at
Eeschema–>Inspect–>Simulator–>Edit Analysis Tab

If this does not help, it may be the installation problem, as mentioned above. This is neither a KiCad nor a ngspice issue, but a problem with packaging both on Ubuntu.

As you probably have seen, the fix has been to uninstall plain ngspice before installing KiCad. Did you do that with
sudo apt remove ngspice
?

On Ubuntu 24.04 the ngspice location after installing KiCad is:

/usr/lib/libngspice.so.0.0.12
/usr/lib/ngspice/analog.cm
/usr/lib/ngspice/digital.cm
etc.

libngspice.so is ngspice compiled as a shared library, loaded by KiCad/Eeschema. The code model library analog.cm contains the missing model.

I compile standard ngspice myself and install it as

usr/local/bin/ngspice
usr/local/lib/ngspice/analog.cm
...

so the analog.cm etc. from ngspice do not interfere with analog.cm etc. from libngspice in KiCad.