The manufacturer supplies a PSPICE model that I am attempting to translate into a format that is interpretable by XYCE. In TI’s TINA simulator, they provide a circuit and results that I think can be useful for verification/validation, as pictured below:
In gschem I have attempted to recreate a simpler version of the schematic, as pictured below:
The symbol for INA225, IDA225.sym, has the following appearance:
• I replaced all variable statements such as ES0 NS0 0 VALUE = {0.5*(1 + SGN(V(GS0)-VTHR))} with ES0 NS0 0 VALUE = '0.5*(1 + SGN(V(GS0)-VTHR))'
• I replaced parameters such as .PARAM GPSRR = {PWR(10,-PSRR/20)/RPSRR} with .FUNC GPSRRF(PWR,PSRR,RPSRR) {PWR(10,-PSRR/20)/RPSRR}
• I replaced statements such as VSENSE VI VO DC = 0 with VSENSE VI VO DC 0
• I moved some global param from the subcircuit level up
• I recompiled Xyce with --enable-verbose_nonlinear--enable-verbose_time, but have not had any success in understanding exactly what is failing.
Do you have any advice on how to proceed further with respect to the debugging? Would you recommend I recompile and debug using something like gdb?
I replaced all variable statements such as ES0 NS0 0 VALUE = {0.5*(1 + SGN(V(GS0)-VTHR))} with ES0 NS0 0 VALUE = '0.5*(1 + SGN(V(GS0)-VTHR))'
This is unnecessary. Xyce's native expression delimiter is the curly brace. The single-quote delimiter is an HSPICE compatibility hack that is translated at an early stage of parsing into the brace delimited version. You should leave these as is.
I replaced parameters such as .PARAM GPSRR = {PWR(10,-PSRR/20)/RPSRR} with .FUNC GPSRRF(PWR,PSRR,RPSRR) {PWR(10,-PSRR/20)/RPSRR}
This is also unnecessary, and possibly an error. Xyce should handle ".PARAM GPSRR = {PWR(10,-PSRR/20)/RPSRR}" just fine, and given your netlist, should end up setting GPSRR to 1e-7.
Neither of those things is likely to be the source of your convergence problems. However...
You've got a large number of warnings about nodes that are connected to only one device. These warnings are usually the sign of a real problem that can result in convergence problems, and Xyce is trying to tell you that there's a problem. Of the warnings I've looked at in your circuit, most appear to be nodes of voltage-controlled voltage sources that are then not connected to anything, but whose values are used in expressions later. This is a real connectivity error, and may very well be responsible for your problems. For example, Xyce is complaining:
Netlist warning: Voltage Node (X1:X_U14:NOUTMAX) connected to only 1 device
EOUTMAX NOUTMAX GNDF VALUE = {MAX(MIN(GL*(VpinDelta-V(OUT,VCC)),1),0)}
ERO NRO GNDF VALUE = {V(NREFMAX,GNDF)*V(NOUTMAX,GNDF)*V(NREFMIN,GNDF)
+ *V(NOUTMIN,GNDF)}
EOUTMAX NOUTMAX GNDF VALUE = {MAX(MIN(GL*(VpinDelta-V(OUT,VCC)),1),0)}
ROUTMAX NOUTMAX GNDF 1
ERO NRO GNDF VALUE = {V(NREFMAX,GNDF)*V(NOUTMAX,GNDF)*V(NREFMIN,GNDF)
+ *V(NOUTMIN,GNDF)}
RRO NRO GNDF 1