Cannot able to run the spice model for allegro current sense

I cannot able to run the allegro current sense whole spice file is attached. Which is perfectly working in LTSpice
I think the issue related to universal operational amplifier library.

.subckt ACS732/3 IP+ IP- VCC VOC FAULT Viout PROGRAM DUT_GND
Rp IP+ IP- 1.0m
XSet_BW N002 N003 N002 opamp Aol=100K GBW=1MEG
B§OutputStage N003 DUT_GND V=if({polarity}==2, delay(((V(IP+)-V(IP-))/1.0m*{sensitivity}(V(Vcc)/VCC_typ)+(V(Vcc)/2)), .016u), delay(((V(IP+)-V(IP-))/1.0m{sensitivity}(V(Vcc)/VCC_typ)+(V(Vcc)/10)), .016u))
M2 FAULT N006 DUT_GND N007 NMOS l=1u w=84u
B§Compare1 N005 DUT_GND V=if(I(Rp)>=(((V(VOC)/V(VCC))5IRpMAX)), V(VCC), 0)
B§Compare2 N008 DUT_GND V=if(I(Rp)<=(((V(VOC)/V(VCC))5IRpMAX)-(0.05
IRpMAX)), V(VCC),0)
A1 N005 N008 0 0 0 0 Q 0 SRFLOP Vhigh=3.3
B§Set_Delay N006 DUT_GND V=delay(V(Q), 500n)
B§VSat_High N001 DUT_GND V=V(VCC)-0.3
XBuffer N002 Viout N001 N004 Viout level.2 Avol=1Meg GBW=10Meg Slew=10Meg ilimit=25m rail=0 Vos=0 phimargin=45 en=0 enk=0 in=0 ink=0 Rin=500Meg
B§ICC DUT_GND VCC I=if({VCC_typ}==5, 24mA, 20mA)
B§VSat_Low N004 DUT_GND V=if({VCC_typ}==5, 500m, 300m)
.model NMOS NMOS
.model PMOS PMOS
.lib opamp.sub
.lib UniversalOpamps2.sub
.backanno
.ends 732/3
.end

Hi Arunsarma,

You can run it, but it requires some tedious modifications to the model listings.

The followings are what I did.

  1. In ASC732_3.lib, change the A1 device to a ¥1 device and add a 3.3V voltage source.
    image

  2. In ASC732_3.lib, change the model name from level.2 to level2.

  3. In UniversalOpAmp2.lib, copy all the level.2 models, create a new file named level2.lib, paste them, and rename level.2 to level2 in its list.
    'UniversalOpAmp2.lib’ can be found in your LTSpice installation folder, for example, LTspice\lib\sub.
    Copy all the lines from .subckt level.2 to .ends level.2.

  4. In level2.lib, change the A1 device to an Ã1 device and add a voltage source.

  5. In level2.lib, change .model Q SW … to .model Q SW ( Ron=10 Roff=10Meg Vt=0 Vh=-.1 ).

Hi @EL34

Thanks a lot for your support. The model is working Perfectly