📄 mos3dset.c
字号:
sqphbs = sqphis/(1.0+lvbs/ (here->MOS3tPhi+here->MOS3tPhi)); EqualDeriv(&d_sqphbs,&d_q); d_sqphbs.value = lvbs; TimesDeriv(&d_sqphbs,&d_sqphbs,1/(here->MOS3tPhi+here->MOS3tPhi)); d_sqphbs.value += 1.0; InvDeriv(&d_sqphbs,&d_sqphbs); TimesDeriv(&d_sqphbs,&d_sqphbs,sqphis); phibs = sqphbs*sqphbs; MultDeriv(&d_phibs,&d_sqphbs,&d_sqphbs); } /* *.....short channel effect factor */ if ( (model->MOS3junctionDepth != 0.0) && (model->MOS3coeffDepLayWidth != 0.0) ) { wps = model->MOS3coeffDepLayWidth*sqphbs; TimesDeriv(&d_wps,&d_sqphbs,model->MOS3coeffDepLayWidth); oneoverxj = 1.0/model->MOS3junctionDepth;/*const*/ xjonxl = model->MOS3junctionDepth*oneoverxl;/*const*/ djonxj = model->MOS3latDiff*oneoverxj;/*const*/ wponxj = wps*oneoverxj; TimesDeriv(&d_wponxj,&d_wps,oneoverxj); wconxj = coeff0+coeff1*wponxj+coeff2*wponxj*wponxj; TimesDeriv(&d_wconxj,&d_wponxj,coeff2); d_wconxj.value += coeff1; MultDeriv(&d_wconxj,&d_wconxj,&d_wponxj); d_wconxj.value += coeff0; arga = wconxj + djonxj; EqualDeriv(&d_arga,&d_wconxj); d_arga.value += djonxj; argc = wponxj/(1.0+wponxj); EqualDeriv(&d_argc,&d_wponxj); d_argc.value += 1.0; InvDeriv(&d_argc,&d_argc); MultDeriv(&d_argc,&d_argc,&d_wponxj); argb = sqrt(1.0-argc*argc); MultDeriv(&d_argb,&d_argc,&d_argc); TimesDeriv(&d_argb,&d_argb,-1.0); d_argb.value += 1.0; SqrtDeriv(&d_argb,&d_argb); fshort = 1.0-xjonxl*(arga*argb-djonxj); MultDeriv(&d_fshort,&d_arga,&d_argb); d_fshort.value -= djonxj; TimesDeriv(&d_fshort,&d_fshort,-xjonxl); d_fshort.value += 1.0; } else { fshort = 1.0; EqualDeriv(&d_fshort,&d_zero); d_fshort.value = 1.0; } /* *.....body effect */ gammas = model->MOS3gamma*fshort; TimesDeriv(&d_gammas,&d_fshort,model->MOS3gamma); fbodys = 0.5*gammas/(sqphbs+sqphbs); DivDeriv(&d_fbodys,&d_gammas,&d_sqphbs); TimesDeriv(&d_fbodys,&d_fbodys,0.25); fbody = fbodys+model->MOS3narrowFactor/here->MOS3w; EqualDeriv(&d_fbody,&d_fbodys); d_fbody.value += fbody - fbodys; onfbdy = 1.0/(1.0+fbody); EqualDeriv(&d_onfbdy,&d_fbody); d_onfbdy.value += 1.0; InvDeriv(&d_onfbdy,&d_onfbdy); qbonco =gammas*sqphbs+model->MOS3narrowFactor*phibs/here->MOS3w; EqualDeriv(&d_dummy,&d_phibs); TimesDeriv(&d_dummy,&d_dummy,model->MOS3narrowFactor*here->MOS3w); MultDeriv(&d_qbonco,&d_gammas,&d_sqphbs); PlusDeriv(&d_qbonco,&d_qbonco,&d_dummy); /* *.....static feedback effect */ vbix = here->MOS3tVbi*model->MOS3type-eta*(lvds); EqualDeriv(&d_vbix,&d_r); d_vbix.value = vbix; d_vbix.d1_r = -eta; /* *.....threshold voltage */ vth = vbix+qbonco; PlusDeriv(&d_vth,&d_vbix,&d_qbonco); /* *.....joint weak inversion and strong inversion */ von = vth; EqualDeriv(&d_von,&d_vth); if ( model->MOS3fastSurfaceStateDensity != 0.0 ) { csonco = CHARGE*model->MOS3fastSurfaceStateDensity * 1e4 /*(cm**2/m**2)*/ *EffectiveLength*here->MOS3w/OxideCap;/*const*/ cdonco = 0.5*qbonco/phibs; DivDeriv(&d_cdonco,&d_qbonco,&d_phibs); TimesDeriv(&d_cdonco,&d_cdonco,0.5); xn = 1.0+csonco+cdonco; EqualDeriv(&d_xn,&d_cdonco); d_xn.value += 1.0 + csonco; von = vth+vt*xn; TimesDeriv(&d_von,&d_xn,vt); PlusDeriv(&d_von,&d_von,&d_vth); } else { /* *.....cutoff region */ if ( lvgs <= von ) { cdrain = 0.0; EqualDeriv(&d_cdrain,&d_zero); goto innerline1000; } } /* *.....device is on */ vgsx = MAX(lvgs,von);if (lvgs >= von) {EqualDeriv(&d_vgsx,&d_p);d_vgsx.value = lvgs;} else {EqualDeriv(&d_vgsx,&d_von);} /* *.....mobility modulation by gate voltage */ onfg = 1.0+model->MOS3theta*(vgsx-vth); TimesDeriv(&d_onfg,&d_vth,-1.0); PlusDeriv(&d_onfg,&d_onfg,&d_vgsx); TimesDeriv(&d_onfg,&d_onfg,model->MOS3theta); d_onfg.value += 1.0; fgate = 1.0/onfg; InvDeriv(&d_fgate,&d_onfg); us = here->MOS3tSurfMob * 1e-4 /*(m**2/cm**2)*/ *fgate; TimesDeriv(&d_us,&d_fgate,here->MOS3tSurfMob * 1e-4); /* *.....saturation voltage */ vdsat = (vgsx-vth)*onfbdy; TimesDeriv(&d_vdsat,&d_vth, -1.0); PlusDeriv(&d_vdsat,&d_vdsat,&d_vgsx); MultDeriv(&d_vdsat,&d_vdsat,&d_onfbdy); if ( model->MOS3maxDriftVel <= 0.0 ) { } else { vdsc = EffectiveLength*model->MOS3maxDriftVel/us; InvDeriv(&d_vdsc,&d_us); TimesDeriv(&d_vdsc,&d_vdsc,EffectiveLength*model->MOS3maxDriftVel); onvdsc = 1.0/vdsc; InvDeriv(&d_onvdsc,&d_vdsc); arga = (vgsx-vth)*onfbdy; /* note arga = vdsat at this point */ EqualDeriv(&d_arga,&d_vdsat); argb = sqrt(arga*arga+vdsc*vdsc); MultDeriv(&d_dummy,&d_arga,&d_arga); MultDeriv(&d_argb,&d_vdsc,&d_vdsc); PlusDeriv(&d_argb,&d_argb,&d_dummy); SqrtDeriv(&d_argb,&d_argb); vdsat = arga+vdsc-argb; TimesDeriv(&d_vdsat,&d_argb,-1.0); PlusDeriv(&d_vdsat,&d_vdsat,&d_vdsc); PlusDeriv(&d_vdsat,&d_vdsat,&d_arga); } /* *.....current factors in linear region */ vdsx = MIN((lvds),vdsat);if (lvds < vdsat) {EqualDeriv(&d_vdsx,&d_r);d_vdsx.value = lvds;} else {EqualDeriv(&d_vdsx,&d_vdsat);} if ( vdsx == 0.0 ) goto line900; cdo = vgsx-vth-0.5*(1.0+fbody)*vdsx; EqualDeriv(&d_cdo,&d_fbody); d_cdo.value += 1.0; MultDeriv(&d_cdo,&d_cdo,&d_vdsx); TimesDeriv(&d_cdo,&d_cdo,0.5); PlusDeriv(&d_cdo,&d_cdo,&d_vth); TimesDeriv(&d_cdo,&d_cdo,-1.0); PlusDeriv(&d_cdo,&d_cdo,&d_vgsx); /* *.....normalized drain current */ cdnorm = cdo*vdsx; MultDeriv(&d_cdnorm,&d_cdo,&d_vdsx); /* *.....drain current without velocity saturation effect *//* Beta is a constant till now */ Beta = Beta*fgate; TimesDeriv(&d_Beta,&d_fgate,Beta); cdrain = Beta*cdnorm; MultDeriv(&d_cdrain,&d_Beta,&d_cdnorm); /* *.....velocity saturation factor */ if ( model->MOS3maxDriftVel != 0.0 ) { fdrain = 1.0/(1.0+vdsx*onvdsc); MultDeriv(&d_fdrain,&d_vdsx,&d_onvdsc); d_fdrain.value += 1.0; InvDeriv(&d_fdrain,&d_fdrain); /* *.....drain current */ cdrain = fdrain*cdrain; MultDeriv(&d_cdrain,&d_cdrain,&d_fdrain); Beta = Beta*fdrain; MultDeriv(&d_Beta,&d_Beta,&d_fdrain); } /* *.....channel length modulation */ if ( (lvds) <= vdsat ) goto line700; if ( model->MOS3maxDriftVel == 0.0 ) goto line510; if (model->MOS3alpha == 0.0) goto line700; cdsat = cdrain; EqualDeriv(&d_cdsat,&d_cdrain); gdsat = cdsat*(1.0-fdrain)*onvdsc; TimesDeriv(&d_dummy,&d_fdrain,-1.0); d_dummy.value += 1.0; MultDeriv(&d_gdsat,&d_cdsat,&d_dummy); MultDeriv(&d_gdsat,&d_gdsat,&d_onvdsc); gdsat = MAX(1.0e-12,gdsat); if (gdsat == 1.0e-12) { EqualDeriv(&d_gdsat,&d_zero); d_gdsat.value = gdsat; } emax = cdsat*oneoverxl/gdsat; DivDeriv(&d_emax,&d_cdsat,&d_gdsat); TimesDeriv(&d_emax,&d_emax,oneoverxl); arga = 0.5*emax*model->MOS3alpha; TimesDeriv(&d_arga,&d_emax,0.5*model->MOS3alpha); argc = model->MOS3kappa*model->MOS3alpha;/*const*/ argb = sqrt(arga*arga+argc*((lvds)-vdsat)); TimesDeriv(&d_dummy,&d_vdsat,-1.0); d_dummy.value += lvds; d_dummy.d1_r += 1.0; TimesDeriv(&d_argb,&d_dummy,argc); MultDeriv(&d_dummy,&d_arga,&d_arga); PlusDeriv(&d_argb,&d_argb,&d_dummy); SqrtDeriv(&d_argb,&d_argb); delxl = argb-arga; TimesDeriv(&d_delxl,&d_arga,-1.0); PlusDeriv(&d_delxl,&d_argb,&d_delxl); goto line520;line510: delxl = sqrt(model->MOS3kappa*((lvds)-vdsat)*model->MOS3alpha); TimesDeriv(&d_delxl,&d_vdsat,-1.0); d_delxl.value += lvds; d_delxl.d1_r += 1.0; TimesDeriv(&d_delxl,&d_delxl,model->MOS3kappa*model->MOS3alpha); SqrtDeriv(&d_delxl,&d_delxl); /* *.....punch through approximation */line520: if ( delxl > (0.5*EffectiveLength) ) { delxl = EffectiveLength - (EffectiveLength*EffectiveLength/ delxl*0.25); InvDeriv(&d_delxl,&d_delxl); TimesDeriv(&d_delxl,&d_delxl,-EffectiveLength*EffectiveLength*0.25); d_delxl.value += EffectiveLength; } /* *.....saturation region */ dlonxl = delxl*oneoverxl; TimesDeriv(&d_dlonxl,&d_delxl,oneoverxl); xlfact = 1.0/(1.0-dlonxl); TimesDeriv(&d_xlfact,&d_dlonxl,-1.0); d_xlfact.value += 1.0; InvDeriv(&d_xlfact,&d_xlfact); cdrain = cdrain*xlfact; MultDeriv(&d_cdrain,&d_cdrain,&d_xlfact); /* *.....finish strong inversion case */line700: if ( lvgs < von ) { /* *.....weak inversion */ onxn = 1.0/xn; InvDeriv(&d_onxn,&d_xn); ondvt = onxn/vt; TimesDeriv(&d_ondvt,&d_onxn,1/vt); wfact = exp( (lvgs-von)*ondvt ); TimesDeriv(&d_wfact,&d_von,-1.0); d_wfact.value += lvgs; d_wfact.d1_p += 1.0; MultDeriv(&d_wfact,&d_wfact,&d_ondvt); ExpDeriv(&d_wfact,&d_wfact); cdrain = cdrain*wfact; MultDeriv(&d_cdrain,&d_cdrain,&d_wfact); } /* *.....charge computation */ goto innerline1000; /* *.....special case of vds = 0.0d0 */line900: Beta = Beta*fgate; /* Beta is still a constant */ TimesDeriv(&d_Beta,&d_fgate,Beta); cdrain = 0.0; EqualDeriv(&d_cdrain,&d_zero); here->MOS3gds = Beta*(vgsx-vth); TimesDeriv(&d_MOS3gds,&d_vth,-1.0); PlusDeriv(&d_MOS3gds,&d_MOS3gds,&d_vgsx); MultDeriv(&d_MOS3gds,&d_MOS3gds,&d_Beta); if ( (model->MOS3fastSurfaceStateDensity != 0.0) && (lvgs < von) ) { here->MOS3gds *=exp((lvgs-von)/(vt*xn));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -