You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
176 lines
5.4 KiB
176 lines
5.4 KiB
7 months ago
|
//VerilogA for pd,pinpd,veriloga
|
||
|
`include "constants.vams"
|
||
|
`include "disciplines.vams"
|
||
|
|
||
|
module pinpd(Vin,Ipow,Iphase,Ilam,Gnd);
|
||
|
parameter real Idi = 1 from [0:1];
|
||
|
parameter real A = 12000E-12 from (0:inf);
|
||
|
parameter real Wn = 2u from (0:inf);
|
||
|
parameter real Wi = 4.2u from (0:inf);
|
||
|
parameter real Wp = 2u from (0:inf);
|
||
|
parameter real R = 0.35 from (0:1);
|
||
|
parameter real ALFn = 0.01 from (0:inf);
|
||
|
parameter real ALFi = 3000 from (0:inf);
|
||
|
parameter real ALFp = 3000 from (0:inf);
|
||
|
parameter real Vbi = 0.8 from (0:inf);
|
||
|
parameter real Nin = 3.3E12 from (0:inf);
|
||
|
parameter real Nip = 7.3E17 from (0:inf);
|
||
|
parameter real Nd = 5E24 from (0:inf);
|
||
|
parameter real Na = 5E24 from (0:inf);
|
||
|
parameter real Un = 1.05 from (0:inf);
|
||
|
parameter real Vsn = 1E5 from (0:inf);
|
||
|
parameter real Fth = 350000 from (0:inf);
|
||
|
parameter real Up = 0.03 from (0:inf);
|
||
|
parameter real Vsp = 1E5 from (0:inf);
|
||
|
parameter real Tp = 1n from (0:inf);
|
||
|
parameter real Tn = 0.2n from (0:inf);
|
||
|
parameter real Tnr = 0.2n from (0:inf);
|
||
|
parameter real Dp = 5.2E-4 from (0:inf);
|
||
|
parameter real Dn = 260E-4 from (0:inf);
|
||
|
parameter real EPSs = 12 from (0:inf);
|
||
|
parameter real Eg = 0.75 from (0:inf);
|
||
|
parameter real Mc = 0.041 from (0:inf);
|
||
|
parameter real GAM = 1.1 from (0:inf);
|
||
|
parameter real Rd = 1e10 from (0:inf);
|
||
|
parameter real Cs = 1.0p from (0:inf);
|
||
|
parameter real Rs = 5 from [0:inf);
|
||
|
parameter real Cno = 1e-12 from (0:inf);
|
||
|
parameter real Rgnd = 50 from [0:inf);
|
||
|
|
||
|
input Vin,Ipow,Iphase,Ilam;
|
||
|
inout Gnd;
|
||
|
electrical Vin,Ipow,Iphase,Ilam,Gnd;
|
||
|
electrical Nvin,Ngnd,Npn,Npp,Npi;
|
||
|
|
||
|
real PLANCK2PI=`P_H/`M_TWO_PI;
|
||
|
real m0=9.10938356E-31;
|
||
|
|
||
|
real Np0,Pn0,Ln,Lp,SIT1,SIT2,HV;
|
||
|
real EAWn,EAWp,EAWi;
|
||
|
real Vop,Voi,Von;
|
||
|
real Rp,Rn,Rnr;
|
||
|
real CHPN,SHPN,CHNP,SHNP;
|
||
|
real Rnd,Rpd,In0,Ip0,Ln2,ALFp2,Lp2,ALFn2;
|
||
|
real BEATn0,BEATn,BEATp0,BEATp,Cj;
|
||
|
real Rnt,Tnt,F,LMD;
|
||
|
real Vn,Vp;
|
||
|
|
||
|
real UA,UWn,UWi,UWp,ULMD;
|
||
|
real UALFn,UALFi,UALFp;
|
||
|
real UNin,UNip,UNd,UNa;
|
||
|
real UUn,UVsn,UFth,UUp,UVsp;
|
||
|
real UDp,UDn;
|
||
|
real ULSPEED,UEPS0;
|
||
|
|
||
|
branch (Nvin,Ngnd) CCs,CCj,RRd,Ii,Id,Ip;
|
||
|
branch (Gnd,Npn) IVN;
|
||
|
branch (Npn,Gnd) CCnoN,RRn,Iin;
|
||
|
branch (Gnd,Npp) IVP;
|
||
|
branch (Npp,Gnd) CCnoP,RRp,Iip;
|
||
|
branch (Gnd,Npi) IVI,Iini;
|
||
|
branch (Npi,Gnd) CCnoI,RRnr,Iii;
|
||
|
|
||
|
analog begin
|
||
|
LMD=V(Ilam);
|
||
|
|
||
|
UA=A*1e12;
|
||
|
UWn=Wn*1e6;
|
||
|
UWi=Wi*1e6;
|
||
|
UWp=Wp*1e6;
|
||
|
ULMD=LMD*1e6;
|
||
|
UALFn=ALFn*1e-6;
|
||
|
UALFi=ALFi*1e-6;
|
||
|
U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