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

📄 b3soipdcheck.c

📁 ngspice又一个电子CAD仿真软件代码.功能更全
💻 C
📖 第 1 页 / 共 2 页
字号:
/**********Copyright 1990 Regents of the University of California.  All rights reserved.Author: 1998 Samuel Fung, Dennis Sinitsky and Stephen TangFile: b3soipdcheck.c          98/5/01Modified by Pin Su and Jan Feng	99/2/15Modified by Pin Su 99/4/30Modified by Pin Su 00/3/1Modified by Pin Su and Hui Wan 02/3/5Modifies by Paolo Nenzi 2002**********//* * Revision 2.2.3  02/3/5  Pin Su  * BSIMPD2.2.3 release */#include "ngspice.h"#include "cktdefs.h"#include "b3soipddef.h"#include "trandefs.h"#include "const.h"#include "sperror.h"#include "devdefs.h"#include "suffix.h"intB3SOIPDcheckModel(B3SOIPDmodel *model, B3SOIPDinstance *here, CKTcircuit *ckt){struct b3soipdSizeDependParam *pParam;int Fatal_Flag = 0;FILE *fplog;        if ((fplog = fopen("b3soipdv223check.log", "w")) != NULL)    {   pParam = here->pParam;	fprintf(fplog, "B3SOIPDV223 Parameter Check\n");	fprintf(fplog, "Model = %s\n", model->B3SOIPDmodName);	fprintf(fplog, "W = %g, L = %g, M = %g\n", here->B3SOIPDw, 	here->B3SOIPDl, here->B3SOIPDm);   	                if (pParam->B3SOIPDnlx < -pParam->B3SOIPDleff)	    {   fprintf(fplog, "Fatal: Nlx = %g is less than -Leff.\n",			pParam->B3SOIPDnlx);	        printf("Fatal: Nlx = %g is less than -Leff.\n",			pParam->B3SOIPDnlx);		Fatal_Flag = 1;            }	if (model->B3SOIPDtox <= 0.0)	{   fprintf(fplog, "Fatal: Tox = %g is not positive.\n",		    model->B3SOIPDtox);	    printf("Fatal: Tox = %g is not positive.\n", model->B3SOIPDtox);	    Fatal_Flag = 1;	}/* v2.2.3 */        if (model->B3SOIPDtox - model->B3SOIPDdtoxcv <= 0.0)        {   fprintf(fplog, "Fatal: Tox - dtoxcv = %g is not positive.\n",                    model->B3SOIPDtox - model->B3SOIPDdtoxcv);            printf("Fatal: Tox - dtoxcv = %g is not positive.\n", model->B3SOIPDtox - model->B3SOIPDdtoxcv);            Fatal_Flag = 1;        }	if (model->B3SOIPDtbox <= 0.0)	{   fprintf(fplog, "Fatal: Tbox = %g is not positive.\n",		    model->B3SOIPDtbox);	    printf("Fatal: Tbox = %g is not positive.\n", model->B3SOIPDtbox);	    Fatal_Flag = 1;	}	if (pParam->B3SOIPDnpeak <= 0.0)	{   fprintf(fplog, "Fatal: Nch = %g is not positive.\n",		    pParam->B3SOIPDnpeak);	    printf("Fatal: Nch = %g is not positive.\n",		   pParam->B3SOIPDnpeak);	    Fatal_Flag = 1;	}	if (pParam->B3SOIPDngate < 0.0)	{   fprintf(fplog, "Fatal: Ngate = %g is not positive.\n",		    pParam->B3SOIPDngate);	    printf("Fatal: Ngate = %g Ngate is not positive.\n",		   pParam->B3SOIPDngate);	    Fatal_Flag = 1;	}	if (pParam->B3SOIPDngate > 1.e25)	{   fprintf(fplog, "Fatal: Ngate = %g is too high.\n",		    pParam->B3SOIPDngate);	    printf("Fatal: Ngate = %g Ngate is too high\n",		   pParam->B3SOIPDngate);	    Fatal_Flag = 1;	}	if (pParam->B3SOIPDdvt1 < 0.0)	{   fprintf(fplog, "Fatal: Dvt1 = %g is negative.\n",		    pParam->B3SOIPDdvt1);   	    printf("Fatal: Dvt1 = %g is negative.\n", pParam->B3SOIPDdvt1);   	    Fatal_Flag = 1;	}	    	if (pParam->B3SOIPDdvt1w < 0.0)	{   fprintf(fplog, "Fatal: Dvt1w = %g is negative.\n",		    pParam->B3SOIPDdvt1w);	    printf("Fatal: Dvt1w = %g is negative.\n", pParam->B3SOIPDdvt1w);	    Fatal_Flag = 1;	}	    	if (pParam->B3SOIPDw0 == -pParam->B3SOIPDweff)	{   fprintf(fplog, "Fatal: (W0 + Weff) = 0 cauing divided-by-zero.\n");	    printf("Fatal: (W0 + Weff) = 0 cauing divided-by-zero.\n");	    Fatal_Flag = 1;        }   	if (pParam->B3SOIPDdsub < 0.0)	{   fprintf(fplog, "Fatal: Dsub = %g is negative.\n", pParam->B3SOIPDdsub);	    printf("Fatal: Dsub = %g is negative.\n", pParam->B3SOIPDdsub);	    Fatal_Flag = 1;	}	if (pParam->B3SOIPDb1 == -pParam->B3SOIPDweff)	{   fprintf(fplog, "Fatal: (B1 + Weff) = 0 causing divided-by-zero.\n");	    printf("Fatal: (B1 + Weff) = 0 causing divided-by-zero.\n");	    Fatal_Flag = 1;        }          if (pParam->B3SOIPDu0temp <= 0.0)	{   fprintf(fplog, "Fatal: u0 at current temperature = %g is not positive.\n", pParam->B3SOIPDu0temp);	    printf("Fatal: u0 at current temperature = %g is not positive.\n",		   pParam->B3SOIPDu0temp);	    Fatal_Flag = 1;        }    /* Check delta parameter */              if (pParam->B3SOIPDdelta < 0.0)	{   fprintf(fplog, "Fatal: Delta = %g is less than zero.\n",		    pParam->B3SOIPDdelta);	    printf("Fatal: Delta = %g is less than zero.\n", pParam->B3SOIPDdelta);	    Fatal_Flag = 1;        }      	if (pParam->B3SOIPDvsattemp <= 0.0)	{   fprintf(fplog, "Fatal: Vsat at current temperature = %g is not positive.\n", pParam->B3SOIPDvsattemp);	    printf("Fatal: Vsat at current temperature = %g is not positive.\n",		   pParam->B3SOIPDvsattemp);	    Fatal_Flag = 1;	}/* Check Rout parameters */	if (pParam->B3SOIPDpclm <= 0.0)	{   fprintf(fplog, "Fatal: Pclm = %g is not positive.\n", pParam->B3SOIPDpclm);	    printf("Fatal: Pclm = %g is not positive.\n", pParam->B3SOIPDpclm);	    Fatal_Flag = 1;	}	if (pParam->B3SOIPDdrout < 0.0)	{   fprintf(fplog, "Fatal: Drout = %g is negative.\n", pParam->B3SOIPDdrout);	    printf("Fatal: Drout = %g is negative.\n", pParam->B3SOIPDdrout);	    Fatal_Flag = 1;	}      if ( model->B3SOIPDunitLengthGateSidewallJctCap > 0.0)      {	if (here->B3SOIPDdrainPerimeter < pParam->B3SOIPDweff)	{   fprintf(fplog, "Warning: Pd = %g is less than W.\n",		    here->B3SOIPDdrainPerimeter);	   printf("Warning: Pd = %g is less than W.\n",		    here->B3SOIPDdrainPerimeter);            here->B3SOIPDdrainPerimeter =pParam->B3SOIPDweff; 	}	if (here->B3SOIPDsourcePerimeter < pParam->B3SOIPDweff)	{   fprintf(fplog, "Warning: Ps = %g is less than W.\n",		    here->B3SOIPDsourcePerimeter);	   printf("Warning: Ps = %g is less than W.\n",		    here->B3SOIPDsourcePerimeter);            here->B3SOIPDsourcePerimeter =pParam->B3SOIPDweff;	}      }/* Check capacitance parameters */        if (pParam->B3SOIPDclc < 0.0)	{   fprintf(fplog, "Fatal: Clc = %g is negative.\n", pParam->B3SOIPDclc);	    printf("Fatal: Clc = %g is negative.\n", pParam->B3SOIPDclc);	    Fatal_Flag = 1;        } /* v2.2.3 */        if (pParam->B3SOIPDmoin < 5.0)        {   fprintf(fplog, "Warning: Moin = %g is too small.\n",                    pParam->B3SOIPDmoin);            printf("Warning: Moin = %g is too small.\n", pParam->B3SOIPDmoin);        }        if (pParam->B3SOIPDmoin > 25.0)        {   fprintf(fplog, "Warning: Moin = %g is too large.\n",                    pParam->B3SOIPDmoin);            printf("Warning: Moin = %g is too large.\n", pParam->B3SOIPDmoin);        }	if (model->B3SOIPDcapMod == 3) {		if (pParam->B3SOIPDacde < 0.4)		{  fprintf (fplog, "Warning: Acde = %g is too small.\n",		   	    pParam->B3SOIPDacde); 		   printf ("Warning: Acde = %g is too small.\n",                    	    pParam->B3SOIPDacde);		}		if (pParam->B3SOIPDacde > 1.6)		{  fprintf (fplog, "Warning: Acde = %g is too large.\n",		   	    pParam->B3SOIPDacde); 		   printf ("Warning: Acde = %g is too large.\n",                    	    pParam->B3SOIPDacde);		}	}/* v2.2.3 */           if (model->B3SOIPDparamChk ==1)      {/* Check L and W parameters */ 	if (pParam->B3SOIPDleff <= 5.0e-8)	{   fprintf(fplog, "Warning: Leff = %g may be too small.\n",	            pParam->B3SOIPDleff);	    printf("Warning: Leff = %g may be too small.\n",		    pParam->B3SOIPDleff);	}    		if (pParam->B3SOIPDleffCV <= 5.0e-8)	{   fprintf(fplog, "Warning: Leff for CV = %g may be too small.\n",		    pParam->B3SOIPDleffCV);	    printf("Warning: Leff for CV = %g may be too small.\n",		   pParam->B3SOIPDleffCV);	}  	        if (pParam->B3SOIPDweff <= 1.0e-7)	{   fprintf(fplog, "Warning: Weff = %g may be too small.\n",		    pParam->B3SOIPDweff);	    printf("Warning: Weff = %g may be too small.\n",		   pParam->B3SOIPDweff);	}             		if (pParam->B3SOIPDweffCV <= 1.0e-7)	{   fprintf(fplog, "Warning: Weff for CV = %g may be too small.\n",		    pParam->B3SOIPDweffCV);	    printf("Warning: Weff for CV = %g may be too small.\n",		   pParam->B3SOIPDweffCV);	}        	/* Check threshold voltage parameters */	if (pParam->B3SOIPDnlx < 0.0)	{   fprintf(fplog, "Warning: Nlx = %g is negative.\n", pParam->B3SOIPDnlx);	   printf("Warning: Nlx = %g is negative.\n", pParam->B3SOIPDnlx);        }	if (model->B3SOIPDtox < 1.0e-9)	{   fprintf(fplog, "Warning: Tox = %g is less than 10A.\n",	            model->B3SOIPDtox);	    printf("Warning: Tox = %g is less than 10A.\n", model->B3SOIPDtox);        }        if (pParam->B3SOIPDnpeak <= 1.0e15)	{   fprintf(fplog, "Warning: Nch = %g may be too small.\n",	            pParam->B3SOIPDnpeak);	    printf("Warning: Nch = %g may be too small.\n",	           pParam->B3SOIPDnpeak);	}	else if (pParam->B3SOIPDnpeak >= 1.0e21)	{   fprintf(fplog, "Warning: Nch = %g may be too large.\n",	            pParam->B3SOIPDnpeak);	    printf("Warning: Nch = %g may be too large.\n",	           pParam->B3SOIPDnpeak);	}	if (fabs(pParam->B3SOIPDnsub) >= 1.0e21)	{   fprintf(fplog, "Warning: Nsub = %g may be too large.\n",	            pParam->B3SOIPDnsub);	    printf("Warning: Nsub = %g may be too large.\n",	           pParam->B3SOIPDnsub);	}	if ((pParam->B3SOIPDngate > 0.0) &&	    (pParam->B3SOIPDngate <= 1.e18))	{   fprintf(fplog, "Warning: Ngate = %g is less than 1.E18cm^-3.\n",	            pParam->B3SOIPDngate);	    printf("Warning: Ngate = %g is less than 1.E18cm^-3.\n",	           pParam->B3SOIPDngate);	}               if (pParam->B3SOIPDdvt0 < 0.0)	{   fprintf(fplog, "Warning: Dvt0 = %g is negative.\n",		    pParam->B3SOIPDdvt0);   	    printf("Warning: Dvt0 = %g is negative.\n", pParam->B3SOIPDdvt0);   	}	    	if (fabs(1.0e-6 / (pParam->B3SOIPDw0 + pParam->B3SOIPDweff)) > 10.0)	{   fprintf(fplog, "Warning: (W0 + Weff) may be too small.\n");	    printf("Warning: (W0 + Weff) may be too small.\n");        }/* Check subthreshold parameters */	if (pParam->B3SOIPDnfactor < 0.0)	{   fprintf(fplog, "Warning: Nfactor = %g is negative.\n",		    pParam->B3SOIPDnfactor);	    printf("Warning: Nfactor = %g is negative.\n", pParam->B3SOIPDnfactor);	}	if (pParam->B3SOIPDcdsc < 0.0)	{   fprintf(fplog, "Warning: Cdsc = %g is negative.\n",		    pParam->B3SOIPDcdsc);	    printf("Warning: Cdsc = %g is negative.\n", pParam->B3SOIPDcdsc);	}	if (pParam->B3SOIPDcdscd < 0.0)	{   fprintf(fplog, "Warning: Cdscd = %g is negative.\n",		    pParam->B3SOIPDcdscd);	    printf("Warning: Cdscd = %g is negative.\n", pParam->B3SOIPDcdscd);	}/* Check DIBL parameters */	if (pParam->B3SOIPDeta0 < 0.0)	{   fprintf(fplog, "Warning: Eta0 = %g is negative.\n",		    pParam->B3SOIPDeta0); 	    printf("Warning: Eta0 = %g is negative.\n", pParam->B3SOIPDeta0); 	}	      /* Check Abulk parameters */	            if (fabs(1.0e-6 / (pParam->B3SOIPDb1 + pParam->B3SOIPDweff)) > 10.0)       	{   fprintf(fplog, "Warning: (B1 + Weff) may be too small.\n");       	    printf("Warning: (B1 + Weff) may be too small.\n");        }    /* Check Saturation parameters */     	if (pParam->B3SOIPDa2 < 0.01)	{   fprintf(fplog, "Warning: A2 = %g is too small. Set to 0.01.\n", pParam->B3SOIPDa2);	    printf("Warning: A2 = %g is too small. Set to 0.01.\n",		   pParam->B3SOIPDa2);	    pParam->B3SOIPDa2 = 0.01;	}	else if (pParam->B3SOIPDa2 > 1.0)	{   fprintf(fplog, "Warning: A2 = %g is larger than 1. A2 is set to 1 and A1 is set to 0.\n",		    pParam->B3SOIPDa2);	    printf("Warning: A2 = %g is larger than 1. A2 is set to 1 and A1 is set to 0.\n",		   pParam->B3SOIPDa2);	    pParam->B3SOIPDa2 = 1.0;	    pParam->B3SOIPDa1 = 0.0;	}	if (pParam->B3SOIPDrdsw < 0.0)	{   fprintf(fplog, "Warning: Rdsw = %g is negative. Set to zero.\n",		    pParam->B3SOIPDrdsw);	    printf("Warning: Rdsw = %g is negative. Set to zero.\n",		   pParam->B3SOIPDrdsw);	    pParam->B3SOIPDrdsw = 0.0;	    pParam->B3SOIPDrds0 = 0.0;	}	else if ((pParam->B3SOIPDrds0 > 0.0) && (pParam->B3SOIPDrds0 < 0.001))	{   fprintf(fplog, "Warning: Rds at current temperature = %g is less than 0.001 ohm. Set to zero.\n",		    pParam->B3SOIPDrds0);	    printf("Warning: Rds at current temperature = %g is less than 0.001 ohm. Set to zero.\n",		   pParam->B3SOIPDrds0);	    pParam->B3SOIPDrds0 = 0.0;	}	 if (pParam->B3SOIPDvsattemp < 1.0e3)	{   fprintf(fplog, "Warning: Vsat at current temperature = %g may be too small.\n", pParam->B3SOIPDvsattemp);	   printf("Warning: Vsat at current temperature = %g may be too small.\n", pParam->B3SOIPDvsattemp);	}	if (pParam->B3SOIPDpdibl1 < 0.0)	{   fprintf(fplog, "Warning: Pdibl1 = %g is negative.\n",		    pParam->B3SOIPDpdibl1);	    printf("Warning: Pdibl1 = %g is negative.\n", pParam->B3SOIPDpdibl1);	}	if (pParam->B3SOIPDpdibl2 < 0.0)	{   fprintf(fplog, "Warning: Pdibl2 = %g is negative.\n",		    pParam->B3SOIPDpdibl2);	    printf("Warning: Pdibl2 = %g is negative.\n", pParam->B3SOIPDpdibl2);	}/* Check overlap capacitance parameters */        if (model->B3SOIPDcgdo < 0.0)	{   fprintf(fplog, "Warning: cgdo = %g is negative. Set to zero.\n", model->B3SOIPDcgdo);	    printf("Warning: cgdo = %g is negative. Set to zero.\n", model->B3SOIPDcgdo);	    model->B3SOIPDcgdo = 0.0;

⌨️ 快捷键说明

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