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.

108 lines
2.8 KiB

7 months ago
//VerilogA for laser,dhld,veriloga
`include "constants.vams"
`include "disciplines.vams"
module dhld(Vin,Vlam,Gnd,OpowL,OphaseL,OlamL,OpowR,OphaseR,OlamR);
input Vin,Vlam;
output OpowL,OphaseL,OlamL,OpowR,OphaseR,OlamR;
inout Gnd;
electrical Vin,Vlam,Gnd,Nlight,Nv,OpowL,OphaseL,OlamL,OpowR,OphaseR,OlamR;
parameter real L = 250u from (0:inf);
parameter real W = 1u from (0:inf);
parameter real D = 0.15u from (0:inf);
parameter real An1 = 1.0E8 from [0:inf);
parameter real An2 = 1.1E-17 from [0:inf);
parameter real An3 = 2.0E-41 from [0:inf);
parameter real An4 = 0 from [0:inf);
parameter real A = 3.5 from (3:inf);
parameter real Ar1 = 4.2E8 from [0:inf);
parameter real Ar2 = 1.5E-16 from [0:inf);
parameter real GAM = 0.3 from (0:1];
parameter real G0 = 1.4E-12 from (0:inf);
parameter real Ntr = 1.5E24 from (0:inf);
parameter real EPS = 1E-25 from [0:inf);
parameter real B = 1 from [0:inf);
parameter real Bsp = 1E-3 from [0:1];
parameter real ALFA = 2000 from [0:inf);
parameter real Rl = 0.3 from [0:1);
parameter real Rr = 0.3 from [0:1);
parameter real Ne = 7.8E7 from (0:inf);
parameter real EIT = 2 from (0:inf);
parameter real Nr = 3.5 from (0:inf);
parameter real Vbi = 1.13 from (0:inf);
parameter real Csc0 = 10p from [0:inf);
parameter real Rs = 5 from [0:inf);
parameter real Cp = 1p from [0:inf);
parameter real Rd = 1E15 from [0:inf);
real VT=`P_K*$temperature/`P_Q;
real Vact;
real Tph;
real QV;
real Cph,Rph;
real CPL,CPR;
real N,N0,LMD;
real G;
real Cd;
real Csc;
real Rn;
real Rra;
real aca,acp;
branch (Nv,Gnd) R2,C1,C2,C3,B1,B2,B3;
branch (Gnd,Nlight) B4,B5,R3,C4;
analog begin
LMD=V(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