Verilog-A release version.
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.

98 lines
2.9 KiB

//VerilogA for laser,qwld,veriloga
`include "constants.vams"
`include "disciplines.vams"
module qwld(Vin,Vlam,Gnd,OpowL,OphaseL,OlamL,OpowR,OphaseR,OlamR);
input Vin,Vlam;
inout Gnd;
output OpowL,OphaseL,OlamL,OpowR,OphaseR,OlamR;
electrical Vin,Vlam,Gnd,OpowL,OphaseL,OlamL,OpowR,OphaseR,OlamR,Nin1,Nlight;
parameter real Vw = 6e-18 from (0:inf);
parameter real Vs = 6e-17 from (0:inf);
//parameter real Gws = 0.1;
//parameter real Alpha_w = 9.6e-37;
//parameter real Alpha_s = 9.12e-36;
parameter real tau_s = 6p from (0:inf);
parameter real tau_e = 200p from (0:inf);
parameter real tau_n = 0.125n from (0:inf);
parameter real tau_p = 1p from (0:inf);
parameter real Gamma = 0.4 from (0:1];
parameter real xi = 1.5e-23 from (0:inf);
parameter real beta = 1e-4 from [0:1];
parameter real g0 = 7.2e-12 from (0:inf);
parameter real Nom = 1e24 from (0:inf);
parameter real eta = 2 from (0:inf);
parameter real Cn = 1 from (0:inf);
parameter real Rl = 0.3 from [0:1];
parameter real Rr = 0.3 from [0:1];
parameter real Nr = 3.5 from (0:inf);
parameter real L = 500u from (0:inf);
real Gws=Vw/Vs;
real VT=`P_K*$temperature/`P_Q;
//real Gws=Alpha_w/Alpha_s;
real Alpha_w=`P_Q*Vw;
real Alpha_s=`P_Q*Vs;
real Rsch;
real Csch;
real Cch;
real Rch;
real Nw,G;
real CPL,CPR;
real TEMPR=$temperature;
branch (Vin,Gnd) RRsch,CCsch;
branch (Gnd,Vin) G1;
branch (Nin1,Gnd) Gn,Ga,RRgnd;
branch (Gnd,Nin1) Gs;
branch (Nin1,Nlight) Gst;
branch (Gnd,Nlight) Gb;
branch (Nlight,Gnd) RRch,CCch;
real UAlpha_w,UNom,Ug0,Uxi;
analog begin
UAlpha_w=Alpha_w*1e18;
U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