bsim6.va, work around "case"

This commit is contained in:
rlar 2017-05-08 19:54:49 +02:00
parent a6ce771ca2
commit 56355eca9e
1 changed files with 44 additions and 52 deletions

View File

@ -165,14 +165,14 @@
`define BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEnd, rgeo, TYPE, Rend) \ `define BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEnd, rgeo, TYPE, Rend) \
if (TYPE == 1) begin \ if (TYPE == 1) begin \
case(rgeo) \ if(rgeo == 1 || rgeo == 2 || rgeo == 5) \
1, 2, 5: begin \ begin \
if (nuEnd == 0.0) \ if (nuEnd == 0.0) \
Rend = 0.0; \ Rend = 0.0; \
else \ else \
Rend = Rsh * DMCG / (Weffcj * nuEnd); \ Rend = Rsh * DMCG / (Weffcj * nuEnd); \
end \ end \
3, 4, 6: begin \ else if(rgeo == 3 || rgeo == 4 || rgeo == 6) begin \
if ((DMCG + DMCI) == 0.0) \ if ((DMCG + DMCI) == 0.0) \
`STROBE("(DMCG + DMCI) can not be equal to zero"); \ `STROBE("(DMCG + DMCI) can not be equal to zero"); \
if (nuEnd == 0.0) \ if (nuEnd == 0.0) \
@ -180,22 +180,21 @@
else \ else \
Rend = Rsh * Weffcj / (3.0 * nuEnd * (DMCG + DMCI)); \ Rend = Rsh * Weffcj / (3.0 * nuEnd * (DMCG + DMCI)); \
end \ end \
default: begin \ else begin \
`STROBE2("Warning: (instance %M) Specified RGEO = %d not matched (BSIM6RdsEndIso), \ `STROBE2("Warning: (instance %M) Specified RGEO = %d not matched (BSIM6RdsEndIso), \
Rend is set to zero.", rgeo); \ Rend is set to zero.", rgeo); \
Rend = 0.0; \ Rend = 0.0; \
end \ end \
endcase \
end \ end \
else begin \ else begin \
case(rgeo) \ if(rgeo == 1 || rgeo == 3 || rgeo == 7) \
1, 3, 7: begin \ begin \
if (nuEnd == 0.0) \ if (nuEnd == 0.0) \
Rend = 0.0; \ Rend = 0.0; \
else \ else \
Rend = Rsh * DMCG / (Weffcj * nuEnd); \ Rend = Rsh * DMCG / (Weffcj * nuEnd); \
end \ end \
2, 4, 8: begin \ else if(rgeo == 2 || rgeo == 4 || rgeo == 8) begin \
if ((DMCG + DMCI) == 0.0) \ if ((DMCG + DMCI) == 0.0) \
`STROBE("(DMCG + DMCI) can not be equal to zero"); \ `STROBE("(DMCG + DMCI) can not be equal to zero"); \
if (nuEnd == 0.0) \ if (nuEnd == 0.0) \
@ -203,26 +202,25 @@
else \ else \
Rend = Rsh * Weffcj / (3.0 * nuEnd * (DMCG + DMCI)); \ Rend = Rsh * Weffcj / (3.0 * nuEnd * (DMCG + DMCI)); \
end \ end \
default: begin \ else begin \
`STROBE2("Warning: (instance %M) Specified RGEO=%d not matched (BSIM6RdsEndIso \ `STROBE2("Warning: (instance %M) Specified RGEO=%d not matched (BSIM6RdsEndIso \
type 2), Rend is set to zero.", rgeo); \ type 2), Rend is set to zero.", rgeo); \
Rend = 0.0; \ Rend = 0.0; \
end \ end \
endcase \
end end
`define BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEnd, rgeo, TYPE, Rend) \ `define BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEnd, rgeo, TYPE, Rend) \
begin \ begin \
if (TYPE == 1) begin \ if (TYPE == 1) begin \
case(rgeo) \ if(rgeo == 1 || rgeo == 2 || rgeo == 5) \
1, 2, 5: begin \ begin \
if (nuEnd == 0.0) \ if (nuEnd == 0.0) \
Rend = 0.0; \ Rend = 0.0; \
else \ else \
Rend = Rsh * DMCG / (Weffcj * nuEnd); \ Rend = Rsh * DMCG / (Weffcj * nuEnd); \
end \ end \
3, 4, 6: begin \ else if (rgeo == 3 || rgeo == 4 || rgeo == 6) begin \
if (DMCG == 0.0) \ if (DMCG == 0.0) \
`STROBE("DMCG can not be equal to zero"); \ `STROBE("DMCG can not be equal to zero"); \
if (nuEnd == 0.0) \ if (nuEnd == 0.0) \
@ -230,22 +228,21 @@
else \ else \
Rend = Rsh * Weffcj / (6.0 * nuEnd * DMCG); \ Rend = Rsh * Weffcj / (6.0 * nuEnd * DMCG); \
end \ end \
default: begin \ else begin \
`STROBE2("Warning: (instance %M) Specified RGEO = %d not matched (BSIM6RdsEndSha), \ `STROBE2("Warning: (instance %M) Specified RGEO = %d not matched (BSIM6RdsEndSha), \
Rend is set to zero.", rgeo); \ Rend is set to zero.", rgeo); \
Rend = 0.0; \ Rend = 0.0; \
end \ end \
endcase \
end \ end \
else begin \ else begin \
case(rgeo) \ if(rgeo == 1 || rgeo == 3 || rgeo == 7) \
1, 3, 7: begin \ begin \
if (nuEnd == 0.0) \ if (nuEnd == 0.0) \
Rend = 0.0; \ Rend = 0.0; \
else \ else \
Rend = Rsh * DMCG / (Weffcj * nuEnd); \ Rend = Rsh * DMCG / (Weffcj * nuEnd); \
end \ end \
2, 4, 8: begin \ else if (rgeo == 2 || rgeo == 4 || rgeo == 8) begin \
if (DMCG == 0.0) \ if (DMCG == 0.0) \
`STROBE("DMCG can not be equal to zero"); \ `STROBE("DMCG can not be equal to zero"); \
if (nuEnd == 0.0) \ if (nuEnd == 0.0) \
@ -253,12 +250,11 @@
else \ else \
Rend = Rsh * Weffcj / (6.0 * nuEnd * DMCG); \ Rend = Rsh * Weffcj / (6.0 * nuEnd * DMCG); \
end \ end \
default: begin \ else begin \
`STROBE2("Warning: (instance %M) Specified RGEO=%d not matched (BSIM6RdsEndSha \ `STROBE2("Warning: (instance %M) Specified RGEO=%d not matched (BSIM6RdsEndSha \
type 2), Rend is set to zero.", rgeo); \ type 2), Rend is set to zero.", rgeo); \
Rend = 0.0; \ Rend = 0.0; \
end \ end \
endcase \
end \ end \
end end
@ -279,8 +275,8 @@
Rint = Rsh * DMCG / ( Weffcj * nuIntD); \ Rint = Rsh * DMCG / ( Weffcj * nuIntD); \
end \ end \
end \ end \
case(geo) \ if (geo == 0) \
0: begin \ begin \
if (TYPE == 1) \ if (TYPE == 1) \
`BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndS, \ `BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndS, \
rgeo, 1, Rend) \ rgeo, 1, Rend) \
@ -288,7 +284,7 @@
`BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndD, \ `BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndD, \
rgeo, 0, Rend) \ rgeo, 0, Rend) \
end \ end \
1: begin \ else if (geo == 1) begin \
if (TYPE == 1) \ if (TYPE == 1) \
`BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndS, \ `BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndS, \
rgeo, 1, Rend) \ rgeo, 1, Rend) \
@ -296,7 +292,7 @@
`BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndD, \ `BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndD, \
rgeo, 0, Rend) \ rgeo, 0, Rend) \
end \ end \
2: begin \ else if (geo == 2) begin \
if (TYPE == 1) \ if (TYPE == 1) \
`BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndS, \ `BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndS, \
rgeo, 1, Rend) \ rgeo, 1, Rend) \
@ -304,7 +300,7 @@
`BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndD, \ `BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndD, \
rgeo, 0, Rend) \ rgeo, 0, Rend) \
end \ end \
3: begin \ else if (geo == 3) begin \
if (TYPE == 1) \ if (TYPE == 1) \
`BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndS, \ `BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndS, \
rgeo, 1, Rend) \ rgeo, 1, Rend) \
@ -312,14 +308,14 @@
`BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndD, \ `BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndD, \
rgeo, 0, Rend) \ rgeo, 0, Rend) \
end \ end \
4: begin \ else if (geo == 4) begin \
if (TYPE == 1) \ if (TYPE == 1) \
`BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndS, \ `BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndS, \
rgeo, 1, Rend) \ rgeo, 1, Rend) \
else \ else \
Rend = Rsh * DMDG / Weffcj; \ Rend = Rsh * DMDG / Weffcj; \
end \ end \
5: begin \ else if (geo == 5) begin \
if (TYPE == 1) \ if (TYPE == 1) \
`BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndS, \ `BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndS, \
rgeo, 1, Rend) \ rgeo, 1, Rend) \
@ -330,14 +326,14 @@
Rend = Rsh * DMDG / (Weffcj * nuEndD); \ Rend = Rsh * DMDG / (Weffcj * nuEndD); \
end\ end\
end \ end \
6: begin \ else if (geo == 6) begin \
if (TYPE == 1) \ if (TYPE == 1) \
Rend = Rsh * DMDG / Weffcj; \ Rend = Rsh * DMDG / Weffcj; \
else \ else \
`BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndD, \ `BSIM6RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndD, \
rgeo, 0, Rend) \ rgeo, 0, Rend) \
end \ end \
7:begin \ else if (geo == 7) begin \
if (TYPE == 1) begin \ if (TYPE == 1) begin \
if (nuEndS==0) \ if (nuEndS==0) \
Rend = 0; \ Rend = 0; \
@ -347,10 +343,10 @@
`BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndD, \ `BSIM6RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEndD, \
rgeo, 0, Rend) \ rgeo, 0, Rend) \
end \ end \
8: begin \ else if (geo == 8) begin \
Rend = Rsh * DMDG / Weffcj; \ Rend = Rsh * DMDG / Weffcj; \
end \ end \
9: begin /* all wide contacts assumed for geo = 9 and 10 */\ else if (geo == 9) begin /* all wide contacts assumed for geo = 9 and 10 */\
if (TYPE == 1) begin \ if (TYPE == 1) begin \
Rend = 0.5 * Rsh * DMCG / Weffcj; \ Rend = 0.5 * Rsh * DMCG / Weffcj; \
if (nf == 2.0) \ if (nf == 2.0) \
@ -363,7 +359,7 @@
Rint = Rsh * DMCG / (Weffcj * nf); \ Rint = Rsh * DMCG / (Weffcj * nf); \
end \ end \
end \ end \
10: begin \ else if (geo == 10) begin \
if (TYPE == 1) begin \ if (TYPE == 1) begin \
Rend = 0.0; \ Rend = 0.0; \
Rint = Rsh * DMCG / (Weffcj * nf); \ Rint = Rsh * DMCG / (Weffcj * nf); \
@ -376,12 +372,11 @@
Rint = Rsh * DMCG / (Weffcj * (nf - 2.0)); \ Rint = Rsh * DMCG / (Weffcj * (nf - 2.0)); \
end \ end \
end \ end \
default: begin \ else begin \
`STROBE2("Warning: (instance %M) Specified RGEO=%d not matched (BSIM6RdseffGeo \ `STROBE2("Warning: (instance %M) Specified RGEO=%d not matched (BSIM6RdseffGeo \
), Rint is set to zero.", rgeo); \ ), Rint is set to zero.", rgeo); \
Rint = 0.0; \ Rint = 0.0; \
end \ end \
endcase \
if (Rint <= 0.0) \ if (Rint <= 0.0) \
Rtot = Rend; \ Rtot = Rend; \
else if (Rend <= 0.0) \ else if (Rend <= 0.0) \
@ -412,74 +407,74 @@
ADsha = DMCG * Weffcj;\ ADsha = DMCG * Weffcj;\
ASmer = DMDG * Weffcj; \ ASmer = DMDG * Weffcj; \
ADmer = DMDG * Weffcj; \ ADmer = DMDG * Weffcj; \
case(geo) \ if(geo == 0) \
0: begin \ begin \
Ps = nuEndS * PSiso + nuIntS * PSsha;\ Ps = nuEndS * PSiso + nuIntS * PSsha;\
Pd = nuEndD * PDiso + nuIntD * PDsha;\ Pd = nuEndD * PDiso + nuIntD * PDsha;\
As = nuEndS * ASiso + nuIntS * ASsha;\ As = nuEndS * ASiso + nuIntS * ASsha;\
Ad = nuEndD * ADiso + nuIntD * ADsha;\ Ad = nuEndD * ADiso + nuIntD * ADsha;\
end \ end \
1: begin \ else if(geo == 1) begin \
Ps = nuEndS * PSiso + nuIntS * PSsha;\ Ps = nuEndS * PSiso + nuIntS * PSsha;\
Pd = (nuEndD + nuIntD) * PDsha;\ Pd = (nuEndD + nuIntD) * PDsha;\
As = nuEndS * ASiso + nuIntS * ASsha;\ As = nuEndS * ASiso + nuIntS * ASsha;\
Ad = (nuEndD + nuIntD) * ADsha;\ Ad = (nuEndD + nuIntD) * ADsha;\
end \ end \
2: begin \ else if(geo == 2) begin \
Ps = (nuEndS + nuIntS) * PSsha;\ Ps = (nuEndS + nuIntS) * PSsha;\
Pd = nuEndD * PDiso + nuIntD * PDsha;\ Pd = nuEndD * PDiso + nuIntD * PDsha;\
As = (nuEndS + nuIntS) * ASsha;\ As = (nuEndS + nuIntS) * ASsha;\
Ad = nuEndD * ADiso + nuIntD * ADsha;\ Ad = nuEndD * ADiso + nuIntD * ADsha;\
end \ end \
3: begin \ else if(geo == 3) begin \
Ps = (nuEndS + nuIntS) * PSsha;\ Ps = (nuEndS + nuIntS) * PSsha;\
Pd = (nuEndD + nuIntD) * PDsha;\ Pd = (nuEndD + nuIntD) * PDsha;\
As = (nuEndS + nuIntS) * ASsha;\ As = (nuEndS + nuIntS) * ASsha;\
Ad = (nuEndD + nuIntD) * ADsha;\ Ad = (nuEndD + nuIntD) * ADsha;\
end \ end \
4: begin \ else if(geo == 4) begin \
Ps = nuEndS * PSiso + nuIntS * PSsha;\ Ps = nuEndS * PSiso + nuIntS * PSsha;\
Pd = nuEndD * PDmer + nuIntD * PDsha;\ Pd = nuEndD * PDmer + nuIntD * PDsha;\
As = nuEndS * ASiso + nuIntS * ASsha;\ As = nuEndS * ASiso + nuIntS * ASsha;\
Ad = nuEndD * ADmer + nuIntD * ADsha;\ Ad = nuEndD * ADmer + nuIntD * ADsha;\
end \ end \
5: begin \ else if(geo == 5) begin \
Ps = (nuEndS + nuIntS) * PSsha;\ Ps = (nuEndS + nuIntS) * PSsha;\
Pd = nuEndD * PDmer + nuIntD * PDsha;\ Pd = nuEndD * PDmer + nuIntD * PDsha;\
As = (nuEndS + nuIntS) * ASsha;\ As = (nuEndS + nuIntS) * ASsha;\
Ad = nuEndD * ADmer + nuIntD * ADsha;\ Ad = nuEndD * ADmer + nuIntD * ADsha;\
end \ end \
6: begin \ else if(geo == 6) begin \
Ps = nuEndS * PSmer + nuIntS * PSsha;\ Ps = nuEndS * PSmer + nuIntS * PSsha;\
Pd = nuEndD * PDiso + nuIntD * PDsha;\ Pd = nuEndD * PDiso + nuIntD * PDsha;\
As = nuEndS * ASmer + nuIntS * ASsha;\ As = nuEndS * ASmer + nuIntS * ASsha;\
Ad = nuEndD * ADiso + nuIntD * ADsha;\ Ad = nuEndD * ADiso + nuIntD * ADsha;\
end \ end \
7: begin \ else if(geo == 7) begin \
Ps = nuEndS * PSmer + nuIntS * PSsha;\ Ps = nuEndS * PSmer + nuIntS * PSsha;\
Pd = (nuEndD + nuIntD) * PDsha;\ Pd = (nuEndD + nuIntD) * PDsha;\
As = nuEndS * ASmer + nuIntS * ASsha;\ As = nuEndS * ASmer + nuIntS * ASsha;\
Ad = (nuEndD + nuIntD) * ADsha;\ Ad = (nuEndD + nuIntD) * ADsha;\
end \ end \
8: begin \ else if(geo == 8) begin \
Ps = nuEndS * PSmer + nuIntS * PSsha;\ Ps = nuEndS * PSmer + nuIntS * PSsha;\
Pd = nuEndD * PDmer + nuIntD * PDsha;\ Pd = nuEndD * PDmer + nuIntD * PDsha;\
As = nuEndS * ASmer + nuIntS * ASsha;\ As = nuEndS * ASmer + nuIntS * ASsha;\
Ad = nuEndD * ADmer + nuIntD * ADsha;\ Ad = nuEndD * ADmer + nuIntD * ADsha;\
end \ end \
9: begin \ else if(geo == 9) begin \
Ps = PSiso + (nf - 1.0) * PSsha;\ Ps = PSiso + (nf - 1.0) * PSsha;\
Pd = nf * PDsha;\ Pd = nf * PDsha;\
As = ASiso + (nf - 1.0) * ASsha;\ As = ASiso + (nf - 1.0) * ASsha;\
Ad = nf * ADsha;\ Ad = nf * ADsha;\
end \ end \
10: begin \ else if(geo == 10) begin \
Ps = nf * PSsha;\ Ps = nf * PSsha;\
Pd = PDiso + (nf - 1.0) * PDsha;\ Pd = PDiso + (nf - 1.0) * PDsha;\
As = nf * ASsha;\ As = nf * ASsha;\
Ad = ADiso + (nf - 1.0) * ADsha;\ Ad = ADiso + (nf - 1.0) * ADsha;\
end \ end \
default: begin \ else begin \
`STROBE2("Warning: (instance %M) Specified GEO=%d not matched (BSIM6RdseffGeo \ `STROBE2("Warning: (instance %M) Specified GEO=%d not matched (BSIM6RdseffGeo \
), PS,PD,AS,AD set to zero.", geo); \ ), PS,PD,AS,AD set to zero.", geo); \
Ps = 0;\ Ps = 0;\
@ -487,7 +482,6 @@
As = 0;\ As = 0;\
Ad = 0;\ Ad = 0;\
end \ end \
endcase \
end \ end \
//****************************************************** //******************************************************
@ -3977,8 +3971,7 @@ DevTemp = $temperature + DTEMP;
thetanoisq = T4 * T4; thetanoisq = T4 * T4;
cm_igid=0; //Initialization cm_igid=0; //Initialization
case(TNOIMOD) if(TNOIMOD == 0) begin
0: begin
`endif `endif
QSi = - NF * Weff * Leff * Cox *Vt * Qs; QSi = - NF * Weff * Leff * Cox *Vt * Qs;
QDi = - NF * Weff * Leff * Cox *Vt * Qd; QDi = - NF * Weff * Leff * Cox *Vt * Qd;
@ -3989,7 +3982,7 @@ DevTemp = $temperature + DTEMP;
I(`IntrinsicDrain, `IntrinsicSource) <+ white_noise(sidn, "id"); I(`IntrinsicDrain, `IntrinsicSource) <+ white_noise(sidn, "id");
`ifdef __TNOISW__ `ifdef __TNOISW__
end end
1: begin else if(TNOIMOD == 1) begin
Vtn = 2.0 * nq * nVt; Vtn = 2.0 * nq * nVt;
T0 = ueff * Dptwg * Moc * Cox * Vtn; T0 = ueff * Dptwg * Moc * Cox * Vtn;
T1 = 0.5 * (qs + qdeff); T1 = 0.5 * (qs + qdeff);
@ -4028,7 +4021,6 @@ DevTemp = $temperature + DTEMP;
I(`IntrinsicGate,`IntrinsicSource) <+ ddt(0.5 * ((1.0 + sigvds) * mig * Cox * Weff * NF * Leff * V(NC))); I(`IntrinsicGate,`IntrinsicSource) <+ ddt(0.5 * ((1.0 + sigvds) * mig * Cox * Weff * NF * Leff * V(NC)));
I(`IntrinsicGate,`IntrinsicDrain) <+ ddt(0.5 * ((1.0 - sigvds) * mig * Cox * Weff * NF * Leff * V(NC))); I(`IntrinsicGate,`IntrinsicDrain) <+ ddt(0.5 * ((1.0 - sigvds) * mig * Cox * Weff * NF * Leff * V(NC)));
end end
endcase
I(N2) <+ V(N2); I(N2) <+ V(N2);
I(NR) <+ V(NR); I(NR) <+ V(NR);