Cascode model works in LTspice but not in QSPICE

This model does not seem to work on QSPICE, but does on LTspice. I can’t figure out what it doesn’t like about the model --I’m assuming QSPICE doesn’t understand something in the way one of the internal subcircuits is defined:

  • UnitedSiC G4 1200V-12mohm SiC Cascode Spice Circuit Model preliminary
  • Copyright 2022 United Silicon Carbide, Inc.
  • The model does not include all possible conditions and effects,
  • in particular it doesn’t include:
  • Self heating
  • leakage current in blocking state
  • Drain to source breakdown is notional only

*** UF4SC120012K4S ***
.subckt UF4SC120012K4S nd ng ns nss
Ld nd nd1 5n
Lmd ns1 nd2 1p
Ljg ng1 ns3 1n
Lmg ng ng2 10n
Lms ns2 ns3 1n
Ls ns3 ns 2p
xj1 nd1 ng1 ns1 jfet_G4_1200V_Ron params: Ron=9.36m Rg=0.7
xm1 nd2 ng2 ns2 mfet233
Lss ns2 nss 10n

*** 1200V JFETs ***
.subckt jfet_G4_1200V_Ron d g s params: Ron=0 Rg=0
.param Ron1={Ron}
.param Rgon1={Rg}
.param Rgoff1={Rg}
.param a= {4.55m/{Ron1}}
X1 di gi s jfet_G4_1200V params: ascale={a}
XCgs gi s Cgs_G4_1200V params: acgs={a}
XCgd gi di Cgd_G4_1200V params: acgd={a}
Rd d di Rtemp {4.2m/{a}}
.MODEL Rtemp RES (TC1=4.9e-3, TC2=4.421e-5)
GRg g gi value={if(v(g,gi)>0,v(g,gi)/{Rgon1},v(g,gi)/{Rgoff1})}
.ends jfet_G4_1200V_Ron

.subckt jfet_G4_1200V d g s Params: ascale=0
.param Fc1=0.5
.param Pb1=3.25
.param M1=0.5
.param Vd0=800
.param Vg0=20
.param gos={0.910*{ascale}}
.param gfs={1100*{ascale}}
.param f=1.763
.param vth=-9

.param cgs1=5.73n
.param cgd1=0.313n

.param bt={({f}{gfs}+2{gos}{Vd0}/{vth})/2/(-{vth})}
.param lamd={1
.param cgs0={pwr((1+{Vg0}/{Pb1}),{M1}){cgs1}}
.param cgd0={pwr((1+{Vd0}/{Pb1}),{M1})

J1 d g s jfet_1200
Dgs g s Dgs_iv
Dgd g d Dgd_iv
Rgs g s 1Meg
Rgd g d 10Meg

.MODEL jfet_1200 NJF(

  • Beta={{bt}} BetaTce=-0.578 Vto={vth} VtoTc=-1.626e-3 lambda={lamd}
  • Is=1e-60
  • Cgs={{cgs0}{ascale}} Cgd={{cgd0}{ascale}} Fc={Fc1} Pb={Pb1}
  • M={M1})

.MODEL Dgs_iv D (CJO=0 BV=120 IS=1e-50 ISR=1e-50 Eg=3.5 Rs=0)
.MODEL Dgd_iv D (CJO=0 BV=1600 IBV=1m IS=1e-50 ISR=1e-50 Eg=3.5 Rs={15.1m/{ascale}})

.ends jfet_G4_1200V

  • Cgs network
    .subckt Cgs_G4_1200V g s params: acgs=0
    .param c0=1n
    .param vsgmin=-2
    .param vsgmax=15
    .param a1={1.512n{acgs}}
    .param b1=0.1
    .func Qgs1(u) {- {a1} / {b1} *(exp(- {b1} *u)-1)}

.param a2={0*{acgs}}
.param b2=0.5
.param c2=8.7

.func Qgs2(u)

  • {if(abs(u)<{vsgmax},
  • {a2}u + {a2}(-{b2})*log(cosh((u-{c2})/-{b2}))
  • -{a2}*(-{b2})*log(cosh(-{c2}/-{b2})),
  • {a2}{vsgmax} + {a2}(-{b2})*log(cosh(({vsgmax}-{c2})/-{b2}))
  • -{a2}*(-{b2})*log(cosh(-{c2}/-{b2})))}

E1 s m1 value={v(s,g)-Qgs1(v(s,g))/{c0}}
C01 m1 g {c0}
E2 s m2 value={v(s,g)-Qgs2(limit(v(s,g),-{vsgmax},{vsgmax}))/{c0}}
C02 m2 g {c0}

.ends Cgs_G4_1200V

  • Cgd network
    .subckt Cgd_G4_1200V g d params:acgd=0

.param c0=1n
.param a1={1.52.5n{acgd}}
.param b1=2
.param c1=11
.param vdgmax1=50

.func Qgd1(u)

  • {if(abs(u)<{vdgmax1},
  • {a1}u + {a1}(-{b1})*log(cosh((u-{c1})/-{b1}))
  • -{a1}*(-{b1})*log(cosh(-{c1}/-{b1})),
  • {a1}{vdgmax1} + {a1}(-{b1})*log(cosh(({vdgmax1}-{c1})/-{b1}))
  • -{a1}*(-{b1})*log(cosh(-{c1}/-{b1})))}

.param a2={0*{acgd}}
.param b2=0.5
.param c2=6
.param vdgmax2=15

.func Qgd2(u)

  • {if(abs(u)<{vdgmax2},
  • (-1)*({a2}u + {a2}(-{b2})*log(cosh((u-{c2})/-{b2}))
  • -{a2}*(-{b2})*log(cosh(-{c2}/-{b2}))),
  • (-1)({a2}{vdgmax2} + {a2}*(-{b2})*log(cosh(({vdgmax2}-{c2})/-{b2}))
  • -{a2}*(-{b2})*log(cosh(-{c2}/-{b2}))))}

E1 d m1 value={v(d,g)-Qgd1(limit(v(d,g),-{vdgmax1},+{vdgmax1}))/{c0}}
C01 m1 g {c0}
E2 d m2 value={v(d,g)-Qgd2(limit(v(d,g),-{vdgmax2},+{vdgmax2}))/{c0}}
C02 m2 g {c0}

.ends Cgd_G4_1200V

*** Si MOS Model ***
.SUBCKT mfet233 4 1 2

*Gate–>1 Drain–>4 Src–>2
.param Ascale= 3.30
*Ascale used to scale the active area of the mosfet.It could be any positive data
M1 3 5 9 9 NMOS W={ {Ascale}
2 } L= 0.00000033
M2 9 5 9 3 PMOS W={ {Ascale}
2 } L= 0.00000036
Ld 4 7 0.1p
Ls 9 2 0.1p
Lg 1 8 0.1p
R1 7 3 RTEMP { 0.0051021 / {Ascale} }
RG 8 5 5
CGS 5 9 { 3.575E-10 * {Ascale} }


  • TOX = 6.00E-08
  • NSUB = 3.8E+17
  • VTO= 5.8
  • THETA = 0
  • kp= 1.788E-05
  • eta = 0.0015
  • TPG = 1 )


  • TOX = 6.00E-08
  • NSUB = 4.8E+16
  • TPG = -1 )

.MODEL DBD D (CJO={ {Ascale} * 2.6E-10 }

  • VJ= 0.7
  • M= 0.5
  • RS= {0.007/ {Ascale} }
  • IS= { {AScale} * 1.706E-12 }
  • TT= 8.00E-09
  • BV= 25
  • IBV= 0.00025 )


*** End of File ***

the error is , “Fatal error: Unknown subckt: xj1•m4 nd1•m4 ng1•m4 ns1•m4 jfet_g4_1200v_ron•m4 params•m4:” in this circuit:

  • C:\QSPICE\Ckts\SiC_mosfet_gate_leakage.qsch
    R1 N01 N02 10
    V1 N01 0 700
    V2 N07 N04 Pulse -2 18 0 3n 3n 5.88µ 11.76µ
    R2 N05 N03 6
    D1 N07 N05 UJ3D1202
    R3 N06 N03 1K
    V4 N09 0 18V
    R4 N08 N07 1K
    C1 N08 0 1n
    R5 N10 N03 1
    D2 N10 N07 UJ3D1202
    S1 N09 N06 N08 0 SW1
    R6 N13 N07 33
    R7 N09 N11 33
    R8 N12 N11 100
    Q2 N08 N12 0 0 2N2222 NPN
    Q3 N11 N13 0 0 2N2222 NPN
    X†M4 N02 N03 0 N04 UF4SC120012K4S
    .tran 100µ 0 10n
    .model SW1 SW (Ron=1 Roff=10Meg Vt=5.66 vh=1)
    .lib “C:\LTspiceXVII\lib\Models\Mosfet\DMG3406L.spice.txt”
    .model 2N2222 NPN(IS=1E-14 VAF=100 BF=200 IKF=0.3 XTB=1.5 BR=3 CJC=8E-12 CJE=25E-12 TR=100E-9 TF=400E-12 ITF=1 VTF=2 XTF=3 RB=10 RC=.3 RE=.2 Vceo=30 Icrating=800m mfg=NXP)
    .inc “C:\LTspiceXVII\lib\Models\Cascodes\spice options.txt”
    .lib “C:\LTspiceXVII\lib\Models\Cascodes\UF4SC120012K4S.TXT”
    .lib SiCdiode.txt

I had the same issue and contacted Mike a few days ago. He fixed it today. Update and try it again.

1 Like

Please e-mail the model to the address on the Help=>About box. The forum corrupts the content.

That’s actually where all these problems should go.


1 Like

Tried it… all good now. Thank you!

Seems like it was already taken care of. If you still need the model, please let me know.
Thank you!

If your happy, I’m happy. For future reference, please just e-mail it to me because the forum software corrupts the netlist(specifically, it’s interprets your input as something called “mark down” text). Also, it’s be nice if this forum became a valuable searchable asset, instead of a bunch of obsolete information.

Do parameters in “.model” listings in sub-circuits work well in QSpice? I tested the following circuit:

  • C:\QSPICE\QSPICE_DATA\test_X_Diode_model_with_param.qsch
    I1 0 n_VA 1
    X1 n_VA 0 XDtest1
    I2 0 n_VA2 1
    X2 n_VA2 0 XDtest2
    .plot v(n_VA)
    .plot v(n_VA2)
    .subckt XDtest1 A K
    .param dtest_IS=1オ
    .model Dtest D(IS={dtest_IS})
    D1 A K Dtest
    .ends XDtest1
    .subckt XDtest2 A K
    .model Dtest2 D(IS=1オ)
    D1 A K Dtest2
    .ends XDtest2
    Both V(n_VA) and V(n_VA2) should be 0.026V * Ln(1A/1uA) = 0.36V.
    However, in the top circuit, the “.param” listings are ignored and the default “Is” value of 1E-14[A] is used. In LTSpice, it works well.

Now Qspice ignores parameters not only in subcircuits. What broke during the next adjustment of the program.

I think QSPICE doing the right thing. The deck below has locally scoped values for loc and each diode leaks that local value(1uA or 1nA). But if you comment out the .param statement scoped to the subcircuit, it uses the global value.

I was careful to use only characters that the forum platform would not corrupt:

V1 1 0 1
X1 0 1 foo
V2 2 0 1
X2 0 2 bar
.param loc=1m

.subckt foo a b
D1 a b xx
.param loc=1u
.model xx D is=loc

.subckt bar a b
D1 a b xx
.param loc=1n
.model xx D is=loc

.meas foo param -I(V1)
.meas bar param -I(V2)

Hi, Thank you for your comment, but I think your statement about the model is not correct.

It works well.

1 Like

It seems that a space is needed before or after the curly braces to pass parameters correctly for QSpice.

I tried to use Infineon’s CoolMOS CFD7 Spice model (L0 model) and noticed this issue. In Infineon’s CoolMOS CFD7 Spice model (L0 model), you can see the listing as follows:
.MODEL Dbt D(BV={Dbt_BV} M={Dbt_M} CJO={Dbt_CJ0} VJ={Dbt_VJ} T_ABS=25)
Is this incorrect for Spice?

Oh, I think it might work now. I made parenthesis used as spaces in .model statements is better tolerated.

Historically people used parenthesis as space characters. E.g.,

.model 1N4148 D(Is=5n)

instead of the way any SPICE really sees it:

.model 1N4148 D Is=5n

I will make QSPICE read any archaic syntax you find, but it might turn out to be a better practice for you if you don’t add characters that really shouldn’t or needed be there. Another example of unnecessary characters are the curly braces(and HSPICE single quotes) for user-defined parameters. I have to write code to ignore them since the QSPICE lexicon and grammar simply reads expressions instead of mere tokens.


Thanks! Now it works well.

It’s better and simpler not to use parentheses or curly braces. I like it!