⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 b4temp.c

📁 ngspice又一个电子CAD仿真软件代码.功能更全
💻 C
📖 第 1 页 / 共 5 页
字号:
                      if (!model->BSIM4gamma1Given)                          pParam->BSIM4gamma1 = 5.753e-12					      * sqrt(pParam->BSIM4ndep)                                              / model->BSIM4coxe;                      if (!model->BSIM4gamma2Given)                          pParam->BSIM4gamma2 = 5.753e-12					      * sqrt(pParam->BSIM4nsub)                                              / model->BSIM4coxe;                      T0 = pParam->BSIM4gamma1 - pParam->BSIM4gamma2;                      T1 = sqrt(pParam->BSIM4phi - pParam->BSIM4vbx)			 - pParam->BSIM4sqrtPhi;                      T2 = sqrt(pParam->BSIM4phi * (pParam->BSIM4phi			 - pParam->BSIM4vbm)) - pParam->BSIM4phi;                      pParam->BSIM4k2 = T0 * T1 / (2.0 * T2 + pParam->BSIM4vbm);                      pParam->BSIM4k1 = pParam->BSIM4gamma2 - 2.0				      * pParam->BSIM4k2 * sqrt(pParam->BSIM4phi				      - pParam->BSIM4vbm);                  } 		  if (pParam->BSIM4k2 < 0.0)		  {   T0 = 0.5 * pParam->BSIM4k1 / pParam->BSIM4k2;                      pParam->BSIM4vbsc = 0.9 * (pParam->BSIM4phi - T0 * T0);		      if (pParam->BSIM4vbsc > -3.0)		          pParam->BSIM4vbsc = -3.0;		      else if (pParam->BSIM4vbsc < -30.0)		          pParam->BSIM4vbsc = -30.0;		  }		  else		  {   pParam->BSIM4vbsc = -30.0;		  }		  if (pParam->BSIM4vbsc > pParam->BSIM4vbm)		      pParam->BSIM4vbsc = pParam->BSIM4vbm;                  if (!model->BSIM4vfbGiven)                  {   if (model->BSIM4vth0Given)                      {   pParam->BSIM4vfb = model->BSIM4type * pParam->BSIM4vth0                                           - pParam->BSIM4phi - pParam->BSIM4k1                                           * pParam->BSIM4sqrtPhi;                      }                      else                      {   pParam->BSIM4vfb = -1.0;                      }                  }                   if (!model->BSIM4vth0Given)                  {   pParam->BSIM4vth0 = model->BSIM4type * (pParam->BSIM4vfb                                        + pParam->BSIM4phi + pParam->BSIM4k1                                        * pParam->BSIM4sqrtPhi);                  }                  pParam->BSIM4k1ox = pParam->BSIM4k1 * model->BSIM4toxe                                    / model->BSIM4toxm;                  pParam->BSIM4k2ox = pParam->BSIM4k2 * model->BSIM4toxe                                    / model->BSIM4toxm;		  T3 = model->BSIM4type * pParam->BSIM4vth0		     - pParam->BSIM4vfb - pParam->BSIM4phi;		  T4 = T3 + T3;		  T5 = 2.5 * T3;                  pParam->BSIM4vtfbphi1 = (model->BSIM4type == NMOS) ? T4 : T5; 		  if (pParam->BSIM4vtfbphi1 < 0.0)		      pParam->BSIM4vtfbphi1 = 0.0;                  pParam->BSIM4vtfbphi2 = 4.0 * T3;                  if (pParam->BSIM4vtfbphi2 < 0.0)                      pParam->BSIM4vtfbphi2 = 0.0;                  tmp = sqrt(EPSSI / (model->BSIM4epsrox * EPS0)                      * model->BSIM4toxe * pParam->BSIM4Xdep0);          	  T0 = pParam->BSIM4dsub * pParam->BSIM4leff / tmp;                  if (T0 < EXP_THRESHOLD)          	  {   T1 = exp(T0);              	      T2 = T1 - 1.0;              	      T3 = T2 * T2;                      T4 = T3 + 2.0 * T1 * MIN_EXP;                      pParam->BSIM4theta0vb0 = T1 / T4;                  }                  else                      pParam->BSIM4theta0vb0 = 1.0 / (MAX_EXP - 2.0); 	          T0 = pParam->BSIM4drout * pParam->BSIM4leff / tmp;        	  if (T0 < EXP_THRESHOLD)       	          {   T1 = exp(T0);              	      T2 = T1 - 1.0;                      T3 = T2 * T2;                      T4 = T3 + 2.0 * T1 * MIN_EXP;                      T5 = T1 / T4;                  }                  else                      T5 = 1.0 / (MAX_EXP - 2.0); /* 3.0 * MIN_EXP omitted */                  pParam->BSIM4thetaRout = pParam->BSIM4pdibl1 * T5                                         + pParam->BSIM4pdibl2;                  tmp = sqrt(pParam->BSIM4Xdep0);                  tmp1 = pParam->BSIM4vbi - pParam->BSIM4phi;                  tmp2 = model->BSIM4factor1 * tmp;                  T0 = pParam->BSIM4dvt1w * pParam->BSIM4weff                     * pParam->BSIM4leff / tmp2;                  if (T0 < EXP_THRESHOLD)                  {   T1 = exp(T0);                      T2 = T1 - 1.0;                      T3 = T2 * T2;                      T4 = T3 + 2.0 * T1 * MIN_EXP;                      T8 = T1 / T4;                  }                  else                      T8 = 1.0 / (MAX_EXP - 2.0);                  T0 = pParam->BSIM4dvt0w * T8;                  T8 = T0 * tmp1;                  T0 = pParam->BSIM4dvt1 * pParam->BSIM4leff / tmp2;                  if (T0 < EXP_THRESHOLD)                  {   T1 = exp(T0);                      T2 = T1 - 1.0;                      T3 = T2 * T2;                      T4 = T3 + 2.0 * T1 * MIN_EXP;                      T9 = T1 / T4;                  }                   else                      T9 = 1.0 / (MAX_EXP - 2.0);                  T9 = pParam->BSIM4dvt0 * T9 * tmp1;                  T4 = model->BSIM4toxe * pParam->BSIM4phi                     / (pParam->BSIM4weff + pParam->BSIM4w0);                  T0 = sqrt(1.0 + pParam->BSIM4lpe0 / pParam->BSIM4leff);                  T5 = pParam->BSIM4k1ox * (T0 - 1.0) * pParam->BSIM4sqrtPhi                     + (pParam->BSIM4kt1 + pParam->BSIM4kt1l / pParam->BSIM4leff)                     * (TRatio - 1.0);                  tmp3 = model->BSIM4type * pParam->BSIM4vth0                       - T8 - T9 + pParam->BSIM4k3 * T4 + T5;                  pParam->BSIM4vfbzb = tmp3 - pParam->BSIM4phi - pParam->BSIM4k1                                     * pParam->BSIM4sqrtPhi; /* End of vfbzb */		  /* stress effect */                  T0 = pow(Lnew, model->BSIM4llodku0);		  W_tmp = Wnew + model->BSIM4wlod;                  T1 = pow(W_tmp, model->BSIM4wlodku0);                  tmp1 = model->BSIM4lku0 / T0 + model->BSIM4wku0 / T1                         + model->BSIM4pku0 / (T0 * T1);                  pParam->BSIM4ku0 = 1.0 + tmp1;                  T0 = pow(Lnew, model->BSIM4llodvth);                  T1 = pow(W_tmp, model->BSIM4wlodvth);                  tmp1 = model->BSIM4lkvth0 / T0 + model->BSIM4wkvth0 / T1                       + model->BSIM4pkvth0 / (T0 * T1);                  pParam->BSIM4kvth0 = 1.0 + tmp1;		  pParam->BSIM4kvth0 = sqrt(pParam->BSIM4kvth0*pParam->BSIM4kvth0 + DELTA);                  T0 = (TRatio - 1.0);                  pParam->BSIM4ku0temp = pParam->BSIM4ku0 * (1.0 + model->BSIM4tku0 *T0) + DELTA;                  Inv_saref = 1.0/(model->BSIM4saref + 0.5*Ldrn);                  Inv_sbref = 1.0/(model->BSIM4sbref + 0.5*Ldrn);		  pParam->BSIM4inv_od_ref = Inv_saref + Inv_sbref;		  pParam->BSIM4rho_ref = model->BSIM4ku0 / pParam->BSIM4ku0temp * pParam->BSIM4inv_od_ref;              } /* End of SizeNotFound */              /*  stress effect */              if( (here->BSIM4sa > 0.0) && (here->BSIM4sb > 0.0) &&                	 ((here->BSIM4nf == 1.0) || ((here->BSIM4nf > 1.0) && (here->BSIM4sd > 0.0))) )	      {	  Inv_sa = 0;              	  Inv_sb = 0;	    	  	    	  if (model->BSIM4wlod < 0.0)	          {   fprintf(stderr, "Warning: WLOD = %g is less than 0. Set to 0.0\n",model->BSIM4wlod);               	      model->BSIM4wlod = 0.0;	          }	          if (model->BSIM4kvsat < -1.0 )	          {   fprintf(stderr, "Warning: KVSAT = %g is too small; Reset to -1.0.\n",model->BSIM4kvsat);	       	      model->BSIM4kvsat = -1.0;            	  }            	  if (model->BSIM4kvsat > 1.0)            	  {   fprintf(stderr, "Warning: KVSAT = %g is too big; Reset to 1.0.\n",model->BSIM4kvsat);           	      model->BSIM4kvsat = 1.0;            	  }              	  	      	  for(i = 0; i < here->BSIM4nf; i++){                   	T0 = 1.0 / here->BSIM4nf / (here->BSIM4sa + 0.5*Ldrn + i * (here->BSIM4sd +Ldrn));                    	T1 = 1.0 / here->BSIM4nf / (here->BSIM4sb + 0.5*Ldrn + i * (here->BSIM4sd +Ldrn));                   	Inv_sa += T0;                    	Inv_sb += T1;                  }                  Inv_ODeff = Inv_sa + Inv_sb;                   rho = model->BSIM4ku0 / pParam->BSIM4ku0temp * Inv_ODeff;                  T0 = (1.0 + rho)/(1.0 + pParam->BSIM4rho_ref);                  here->BSIM4u0temp = pParam->BSIM4u0temp * T0;                  T1 = (1.0 + model->BSIM4kvsat * rho)/(1.0 + model->BSIM4kvsat * pParam->BSIM4rho_ref);                  here->BSIM4vsattemp = pParam->BSIM4vsattemp * T1;		  OD_offset = Inv_ODeff - pParam->BSIM4inv_od_ref;		  dvth0_lod = model->BSIM4kvth0 / pParam->BSIM4kvth0 * OD_offset;                  dk2_lod = model->BSIM4stk2 / pow(pParam->BSIM4kvth0, model->BSIM4lodk2) *                                   OD_offset;                  deta0_lod = model->BSIM4steta0 / pow(pParam->BSIM4kvth0, model->BSIM4lodeta0) *                                     OD_offset;		  here->BSIM4vth0 = pParam->BSIM4vth0 + dvth0_lod;	          if (!model->BSIM4vfbGiven && !model->BSIM4vth0Given)                       here->BSIM4vfb = -1.0;                  else                         here->BSIM4vfb = pParam->BSIM4vfb + model->BSIM4type * dvth0_lod;                  here->BSIM4vfbzb = pParam->BSIM4vfbzb + model->BSIM4type * dvth0_lod;                  T3 = model->BSIM4type * here->BSIM4vth0                     - here->BSIM4vfb - pParam->BSIM4phi;                  T4 = T3 + T3;                  T5 = 2.5 * T3;                  here->BSIM4vtfbphi1 = (model->BSIM4type == NMOS) ? T4 : T5;                  if (here->BSIM4vtfbphi1 < 0.0)                      here->BSIM4vtfbphi1 = 0.0;                  here->BSIM4vtfbphi2 = 4.0 * T3;                  if (here->BSIM4vtfbphi2 < 0.0)                      here->BSIM4vtfbphi2 = 0.0;		  		  here->BSIM4k2 = pParam->BSIM4k2 + dk2_lod;                  if (here->BSIM4k2 < 0.0)                  {   T0 = 0.5 * pParam->BSIM4k1 / here->BSIM4k2;                      here->BSIM4vbsc = 0.9 * (pParam->BSIM4phi - T0 * T0);                      if (here->BSIM4vbsc > -3.0)                          here->BSIM4vbsc = -3.0;                      else if (here->BSIM4vbsc < -30.0)                          here->BSIM4vbsc = -30.0;                  }                  else                      here->BSIM4vbsc = -30.0;                  if (here->BSIM4vbsc > pParam->BSIM4vbm)                      here->BSIM4vbsc = pParam->BSIM4vbm;		  here->BSIM4k2ox = here->BSIM4k2 * model->BSIM4toxe                                    / model->BSIM4toxm;                  here->BSIM4eta0 = pParam->BSIM4eta0 + deta0_lod;	       } else {		      here->BSIM4u0temp = pParam->BSIM4u0temp;                      here->BSIM4vth0 = pParam->BSIM4vth0;                      here->BSIM4vsattemp = pParam->BSIM4vsattemp;                      here->BSIM4vfb = pParam->BSIM4vfb;                      here->BSIM4vfbzb = pParam->BSIM4vfbzb;		      here->BSIM4vtfbphi1 = pParam->BSIM4vtfbphi1;		      here->BSIM4vtfbphi2 = pParam->BSIM4vtfbphi2;                      here->BSIM4k2 = pParam->BSIM4k2;                      here->BSIM4vbsc = pParam->BSIM4vbsc;                      here->BSIM4k2ox = pParam->BSIM4k2ox;                      here->BSIM4eta0 = pParam->BSIM4eta0;              }                                 here->BSIM4cgso = pParam->BSIM4cgso;              here->BSIM4cgdo = pParam->BSIM4cgdo;                            if (here->BSIM4rbodyMod)              {   if (here->BSIM4rbdb < 1.0e-3)                      here->BSIM4grbdb = 1.0e3; /* in mho */                  else                      here->BSIM4grbdb = model->BSIM4gbmin + 1.0 / here->BSIM4rbdb;                  if (here->BSIM4rbpb < 1.0e-3)                      here->BSIM4grbpb = 1.0e3;                  else                      here->BSIM4grbpb = model->BSIM4gbmin + 1.0 / here->BSIM4rbpb;                  if (here->BSIM4rbps < 1.0e-3)                      here->BSIM4grbps = 1.0e3;                  else                      here->BSIM4grbps = model->BSIM4gbmin + 1.0 / here->BSIM4rbps;                  if (here->BSIM4rbsb < 1.0e-3)                      here->BSIM4grbsb = 1.0e3;                  else                      here->BSIM4grbsb = model->BSIM4gbmin + 1.0 / here->BSIM4rbsb;                  if (here->BSIM4rbpd < 1.0e-3)                      here->BSIM4grbpd = 1.0e3;                  else                      here->BSIM4grbpd = model->BSIM4gbmin + 1.0 / here->BSIM4rbpd;              }              /*                * Process geomertry dependent parasitics	       */              here->BSIM4grgeltd = model->BSIM4rshg * (model->BSIM4xgw                      + pParam->BSIM4weffCJ / 3.0 / model->BSIM4ngcon) /                      (model->BSIM4ngcon * here->BSIM4nf *                      (Lnew - model->B

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -