Hi everyone,
I’m trying to build a Python application for interactive circuit simulation using ngspice as the backend, and I’ve run into an issue with a specific op-amp model.
My project works perfectly with a generic op-amp model. When I use the official PSpice model for the OPAx322 from TI the simulation fails when I run ngspice directly.The strange part is that the exact same circuit and OPAx322 model file work inside the KiCad simulator
When I try to run it outside of KiCad using the ngspice library I consistently get a set of parsing errors:
Error: no such function 'if'
Error: unknown subckt: ...
Error: Undefined parameter [flw]
MIF-ERROR - unable to find definition of model ...
This makes me think that KiCad isn’t just calling ngspice but is also doing some pre-processing on the netlist or model files to make them compatible.
Can anyone shed some light on this? Does KiCad have a built-in compatibility layer that automatically fixes PSpice syntaxbefore sending it to the ngspice engine that i need to implement in my code? Any insights would be very much appreciated!
Thanks!