* SPICE netlist
V1 Vin 0 12
V2 PSU_en 0 PULSE(0 5 1m 10u 10u 3m)
R3 PSU_en G {WC1(1k,0.05,0)}
R4 G 0 {WC1(100k,0.05,1)}
D1 0 Vin_mon BZX84-C3V3
R2 Vin N001 {WC1(3k3,0.05,2)}
R6 N001 0 {WC1(6k8,0.01,3)}
V3 STEPPING 0 {STEPPING}
V4 THERSHOLD 0 2.475
R1 Vin_mon 0 1Meg
M1 N001 G Vin_mon Vin_mon NMOS
.tran 5m startup
+ IS = 7.035E-16
+ N = 0.9809
+ BV = 3.3
+ IBV = 0.005
+ RS = 0.3487
+ CJO = 3.162E-10
+ VJ = 0.6687
+ M = 0.3164
+ FC = 0.5
.FUNC MOD(a,b) {a-FLOOR(a/b)*b}
.FUNC BIT(x) {if(MOD(STEPPING,2**(X+1))>=2**x,1,0)}
.FUNC EVA1 (nom, tol, param_num) {if(STEPPING == -1, nom, nom*(1-tol)+2*nom*tol*BIT(param_num))}
.FUNC EVA2 (nom, min, max, param_num) {if(STEPPING == -1, nom, IF(BIT(param_num),max,min))}
.FUNC WC1 (nom, tol, param_num) EVA1(nom, tol, param_num)
.FUNC WC2 (nom, min, max, param_num) EVA2(nom, min, max, param_num)
.step param STEPPING -1 15 1
.SUBCKT BSS169_L1 drain gate source PARAMS: dVth=0 dRdson=0 dgfs=0 dC=0
.PARAM Rs=0.074 Rg=10 Ls=3n Ld=1n Lg=3n
.PARAM Inn=0.05 Unn=0 Rmax=12
.PARAM act=0.25
X1 d1 g s Tj K_100_d_var PARAMS: a={act} dVth={dVth} dR={dRdson} Inn={Inn} Unn={Unn}
+Rmax={Rmax} dgfs={dgfs} Rs={Rs} dC={dC} heat=0
Rg g1 g {Rg}
Lg gate g1 {Lg*if(dgfs==99,0,1)}
Gs s1 s VALUE={V(s1,s)/(Rs*(1+(limit(V(Tj),-200,999)-25)*4m))}
Rsa s1 s 1Meg
Ls source s1 {Ls*if(dgfs==99,0,1)}
Ld drain d1 {Ld*if(dgfs==99,0,1)}
E1 Tj w VALUE={TEMP}
R1 w 0 1u
.SUBCKT K_100_d_var dd g s Tj PARAMS: a=1 dVth=0 dR=0 dgfs=0 Inn=1 Unn=1 Rmax=1
+gmin=1 Rs=1 Rp=1 dC=0 heat=1
.PARAM Vth0=-1.8 beta4c=0.303 ph0=20 ph1=0.026 Ubr=150
.PARAM Rd=0.6 nmu=2.6 Rf=0.2 rpa=0.02925 lnIsj=-24.6
.PARAM Rdi=0.073
.PARAM Tref=298 T0=273 auth=3m c=0.82 mu_bet=0.4
.PARAM f_bet=-2 ndi=1.2 UTnbr=207m lnBr=-23 kbq=85.8u
.PARAM Wcml={beta4c*4*c}
.PARAM aubr={0.93m*UBr}
.PARAM dvgs={0.1-0.06*Vth0}
.PARAM f1=118p f2=118p f3=207p f4=330p f5=217p
.PARAM U0=0.5 nd=0.42 nc=0.5 g1=4 bb=-10.8
.PARAM sl=30p remp=0p ta=60n td=20n
.PARAM Vmin=-2.9 Vmax=-1.8 dCmax=0.35
.PARAM Vth={Vth0+(Vmax-Vth0)*limit(dVth,0,1)-(Vmin-Vth0)*limit(dVth,-1,0)}
.PARAM p0={Wcml*a*((1-f_bet)*(T0/Tref)**mu_bet+f_bet) }
.PARAM Rlim={(Rmax-Rs-(Unn-Vth0-Inn*Rs-SQRT((Unn-Vth0-Inn*Rs)**2-4*c*Inn/p0))/(2*c*Inn))/(1+rpa*(Inn/a)**2)}
.PARAM dRd={Rd/a+if(dVth==0,limit(dR,0,1)*max(Rlim-Rd/a,0),0)}
.PARAM bet={Wcml}
.PARAM dC1={1+dCmax*limit(dC,0,1)}
.PARAM Cox={f1*a*dC1}
.PARAM Cds0={f2*a*dC1}
.PARAM Cgs0={f3*a*dC1}
.PARAM Cox1={f5*a*dC1}
.PARAM Crand={remp*SQRT(a)}
.PARAM dRdi={Rdi/a}
.FUNC U1(Uds,T) {(SQRT(1+4*(0.4+(T-T0-25)*2m)*abs(Uds))-1)/2/(0.4+(T-T0-25)*2m)}
.FUNC I2(p,Uee,z1,pp) {if(Uee>pp,(Uee-c*z1)*z1,p*(pp-p)/c*exp((Uee-pp-(min(0,Uee))**2)/p))}
.FUNC Ig(Uds,T,p,Uee) {bet*((1-f_bet)*(T0/T)**mu_bet+f_bet)*I2(p,Uee,min(Uds,Uee/(2*c)),min(2*p,p+c*Uds))}
.FUNC Iges(Uds,Ugs,T)
+{a*(sgn(Uds)*Ig(U1(Uds,T),T,1/(ph0-ph1*T),Ugs-Vth+auth*(T-Tref))+exp(min(lnBr+(abs(Uds)-UBr-aubr*(T-Tref))/UTnbr,25)))}
.FUNC Isjt(Tj) {exp(min(lnIsj+(Tj/Tref-1)*1.12/(ndi*kbq*Tj),9))*(Tj/Tref)**1.5}
.FUNC Idiode(Usd,Tj,Iss) {exp(min(log(Iss)+Usd/(ndi*kbq*Tj),9))-Iss}
.FUNC Idiod(Usd,Tj) {a*Idiode(Usd,Tj,Isjt(Tj))}
.FUNC QCdg(x,z) {if(f4>f5,(f5**2-(f4-z*sl)**2)/(2*sl)+f5*min(x,(f4-f5)/sl),f4*z-sl*z**2/2-f5*max((f4-f5)/sl-x,0))}
E_Edg d ox VALUE {V(d,g)-(min(V(d,g),-bb)+1/(g1*(1-nc))*((1/(1+g1*max(V(d,g)+bb,0)))**(nc-1)-1))}
C_Cdg ox g {Cox}
E_Edg1 d ox1 VALUE {V(d,g)-QCdg(V(d,g),limit(V(d,g),(f4-f5)/sl,f4/sl))/f5}
C_Cdg1 ox1 g {Cox1}
C_Cdg2 d g {Crand}
E_Eds d edep VALUE {(V(d2,s)-I(V_sense3)/Cds0)}
C_Cds edep s {Cds0}
C_Cds2 d2 s {Cds0/500}
C_Cgs g s {Cgs0}
G_chan d s VALUE={Iges(V(d,s),V(g,s),T0+limit(V(Tj),-200,350))}
E_RMos d1 d VALUE={I(V_sense)*(Rf*dRd+(1-Rf)*dRd*((limit(V(Tj),-200,999)+T0)/Tref)**nmu)*(1+rpa*(I(V_sense)/a)**2)}
V_sense dd d1 0
G_diode s d2 VALUE={Idiod(V(s,d2),T0+limit(V(Tj),-200,499))}
R_Rdio d2 d3 {dRdi}
V_sense2 d1 d3 0
L_L001 a c {td/(ta+td)}
R_R001 a b {1/ta}
V_sense3 c f 0
R_sense3 f 0 1
E_E001 b 0 VALUE {I(V_sense2)}
E_E002 e 0 VALUE {1Meg*Cds0*(1/(1-nd)*U0**nd*(limit(U0+V(d2,s),U0/2,2*UBr))**(1-nd)+2**nd*min(V(d2,s)+U0/2,0))}
R_R002 e c 1Meg
R1 g s 1G
Rd01 d s 500Meg
Rd02 d2 s 500Meg
Rd03 d1 d 10k
G_TH 0 Tj VALUE = {heat*LIMIT(I(V_sense)*V(dd,s),0,100k)}

* LTspice schematic (.asc)
Version 4
SHEET 1 1312 1376
WIRE -592 -688 -656 -688
WIRE -336 -688 -384 -688
WIRE -656 -656 -656 -688
WIRE -384 -656 -384 -688
WIRE -656 -560 -656 -576
WIRE -384 -544 -384 -576
WIRE -160 80 -512 80
WIRE -512 96 -512 80
WIRE -160 144 -160 80
WIRE -512 192 -512 176
WIRE -160 288 -160 224
WIRE 256 288 -160 288
WIRE 432 288 352 288
WIRE 544 288 432 288
WIRE 656 288 544 288
WIRE -160 320 -160 288
WIRE 432 336 432 288
WIRE 544 336 544 288
WIRE -160 432 -160 400
WIRE 432 432 432 416
WIRE 544 432 544 400
WIRE -224 560 -336 560
WIRE -16 560 -144 560
WIRE 208 560 -16 560
WIRE 336 560 336 336
WIRE 336 560 208 560
WIRE -336 592 -336 560
WIRE -16 592 -16 560
WIRE -336 688 -336 672
WIRE -16 688 -16 672
FLAG -16 688 0
FLAG -336 688 0
FLAG -512 192 0
FLAG 656 288 Vin_mon
FLAG 544 432 0
FLAG -160 432 0
FLAG -336 560 PSU_en
FLAG -512 80 Vin
FLAG -656 -560 0
FLAG -592 -688 STEPPING
IOPIN -672 48 Out
FLAG -336 -688 THERSHOLD
IOPIN -416 48 Out
FLAG -384 -544 0
FLAG 208 560 G
FLAG 432 432 0
SYMBOL voltage -512 80 R0
SYMATTR InstName V1
SYMATTR Value 12
SYMBOL voltage -336 576 R0
SYMATTR Value PULSE(0 5 1m 10u 10u 3m)
SYMATTR InstName V2
SYMBOL res -240 576 R270
SYMATTR InstName R3
SYMATTR Value {WC1(1k,0.05,0)}
SYMBOL res -32 576 R0
SYMATTR Value {WC1(100k,0.05,1)}
SYMATTR InstName R4
SYMBOL zener 560 400 R180
SYMATTR InstName D1
SYMATTR Value BZX84-C3V3
SYMBOL res -176 128 R0
SYMATTR InstName R2
SYMATTR Value {WC1(3k3,0.05,2)}
SYMBOL res -176 304 R0
SYMATTR InstName R6
SYMATTR Value {WC1(6k8,0.01,3)}
SYMBOL voltage -656 -672 R0
SYMATTR InstName V3
SYMATTR Value {STEPPING}
SYMBOL voltage -384 -672 R0
SYMATTR InstName V4
SYMATTR Value 2.475
SYMBOL res 416 320 R0
SYMATTR InstName R1
SYMATTR Value 1Meg
SYMBOL nmos 256 336 R270
SYMATTR InstName M1