📄 b3soiddcheck.c
字号:
/**********Copyright 1999 Regents of the University of California. All rights reserved.Author: 1998 Samuel Fung, Dennis Sinitsky and Stephen TangFile: b3soiddcheck.c 98/5/01Modified by Paolo Nenzi 2002**********//* * Revision 2.1 99/9/27 Pin Su * BSIMDD2.1 release */#include "ngspice.h"#include "cktdefs.h"#include "b3soidddef.h"#include "trandefs.h"#include "const.h"#include "sperror.h"#include "devdefs.h"#include "suffix.h"intB3SOIDDcheckModel(B3SOIDDmodel *model, B3SOIDDinstance *here, CKTcircuit *ckt){struct b3soiddSizeDependParam *pParam;int Fatal_Flag = 0;FILE *fplog; if ((fplog = fopen("b3soiddv2check.log", "w")) != NULL) { pParam = here->pParam; fprintf(fplog, "B3SOI(DD)V2.1 Parameter Check\n"); fprintf(fplog, "Model = %s\n", model->B3SOIDDmodName); fprintf(fplog, "W = %g, L = %g\n, M = %g\n", here->B3SOIDDw, here->B3SOIDDl, here->B3SOIDDm); if (pParam->B3SOIDDnlx < -pParam->B3SOIDDleff) { fprintf(fplog, "Fatal: Nlx = %g is less than -Leff.\n", pParam->B3SOIDDnlx); printf("Fatal: Nlx = %g is less than -Leff.\n", pParam->B3SOIDDnlx); Fatal_Flag = 1; } if (model->B3SOIDDtox <= 0.0) { fprintf(fplog, "Fatal: Tox = %g is not positive.\n", model->B3SOIDDtox); printf("Fatal: Tox = %g is not positive.\n", model->B3SOIDDtox); Fatal_Flag = 1; } if (model->B3SOIDDtbox <= 0.0) { fprintf(fplog, "Fatal: Tbox = %g is not positive.\n", model->B3SOIDDtbox); printf("Fatal: Tbox = %g is not positive.\n", model->B3SOIDDtbox); Fatal_Flag = 1; } if (pParam->B3SOIDDnpeak <= 0.0) { fprintf(fplog, "Fatal: Nch = %g is not positive.\n", pParam->B3SOIDDnpeak); printf("Fatal: Nch = %g is not positive.\n", pParam->B3SOIDDnpeak); Fatal_Flag = 1; } if (pParam->B3SOIDDngate < 0.0) { fprintf(fplog, "Fatal: Ngate = %g is not positive.\n", pParam->B3SOIDDngate); printf("Fatal: Ngate = %g Ngate is not positive.\n", pParam->B3SOIDDngate); Fatal_Flag = 1; } if (pParam->B3SOIDDngate > 1.e25) { fprintf(fplog, "Fatal: Ngate = %g is too high.\n", pParam->B3SOIDDngate); printf("Fatal: Ngate = %g Ngate is too high\n", pParam->B3SOIDDngate); Fatal_Flag = 1; } if (model->B3SOIDDdvbd1 < 0.0) { fprintf(fplog, "Fatal: Dvbd1 = %g is negative.\n", model->B3SOIDDdvbd1); printf("Fatal: Dvbd1 = %g is negative.\n", model->B3SOIDDdvbd1); Fatal_Flag = 1; } if (pParam->B3SOIDDdvt1 < 0.0) { fprintf(fplog, "Fatal: Dvt1 = %g is negative.\n", pParam->B3SOIDDdvt1); printf("Fatal: Dvt1 = %g is negative.\n", pParam->B3SOIDDdvt1); Fatal_Flag = 1; } if (pParam->B3SOIDDdvt1w < 0.0) { fprintf(fplog, "Fatal: Dvt1w = %g is negative.\n", pParam->B3SOIDDdvt1w); printf("Fatal: Dvt1w = %g is negative.\n", pParam->B3SOIDDdvt1w); Fatal_Flag = 1; } if (pParam->B3SOIDDw0 == -pParam->B3SOIDDweff) { 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->B3SOIDDdsub < 0.0) { fprintf(fplog, "Fatal: Dsub = %g is negative.\n", pParam->B3SOIDDdsub); printf("Fatal: Dsub = %g is negative.\n", pParam->B3SOIDDdsub); Fatal_Flag = 1; } if (pParam->B3SOIDDb1 == -pParam->B3SOIDDweff) { 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->B3SOIDDu0temp <= 0.0) { fprintf(fplog, "Fatal: u0 at current temperature = %g is not positive.\n", pParam->B3SOIDDu0temp); printf("Fatal: u0 at current temperature = %g is not positive.\n", pParam->B3SOIDDu0temp); Fatal_Flag = 1; } /* Check delta parameter */ if (pParam->B3SOIDDdelta < 0.0) { fprintf(fplog, "Fatal: Delta = %g is less than zero.\n", pParam->B3SOIDDdelta); printf("Fatal: Delta = %g is less than zero.\n", pParam->B3SOIDDdelta); Fatal_Flag = 1; } if (pParam->B3SOIDDvsattemp <= 0.0) { fprintf(fplog, "Fatal: Vsat at current temperature = %g is not positive.\n", pParam->B3SOIDDvsattemp); printf("Fatal: Vsat at current temperature = %g is not positive.\n", pParam->B3SOIDDvsattemp); Fatal_Flag = 1; }/* Check Rout parameters */ if (pParam->B3SOIDDpclm <= 0.0) { fprintf(fplog, "Fatal: Pclm = %g is not positive.\n", pParam->B3SOIDDpclm); printf("Fatal: Pclm = %g is not positive.\n", pParam->B3SOIDDpclm); Fatal_Flag = 1; } if (pParam->B3SOIDDdrout < 0.0) { fprintf(fplog, "Fatal: Drout = %g is negative.\n", pParam->B3SOIDDdrout); printf("Fatal: Drout = %g is negative.\n", pParam->B3SOIDDdrout); Fatal_Flag = 1; } if ( model->B3SOIDDunitLengthGateSidewallJctCap > 0.0) { if (here->B3SOIDDdrainPerimeter < pParam->B3SOIDDweff) { fprintf(fplog, "Warning: Pd = %g is less than W.\n", here->B3SOIDDdrainPerimeter); printf("Warning: Pd = %g is less than W.\n", here->B3SOIDDdrainPerimeter); here->B3SOIDDdrainPerimeter =pParam->B3SOIDDweff; } if (here->B3SOIDDsourcePerimeter < pParam->B3SOIDDweff) { fprintf(fplog, "Warning: Ps = %g is less than W.\n", here->B3SOIDDsourcePerimeter); printf("Warning: Ps = %g is less than W.\n", here->B3SOIDDsourcePerimeter); here->B3SOIDDsourcePerimeter =pParam->B3SOIDDweff; } }/* Check capacitance parameters */ if (pParam->B3SOIDDclc < 0.0) { fprintf(fplog, "Fatal: Clc = %g is negative.\n", pParam->B3SOIDDclc); printf("Fatal: Clc = %g is negative.\n", pParam->B3SOIDDclc); Fatal_Flag = 1; } if (model->B3SOIDDparamChk ==1) {/* Check L and W parameters */ if (pParam->B3SOIDDleff <= 5.0e-8) { fprintf(fplog, "Warning: Leff = %g may be too small.\n", pParam->B3SOIDDleff); printf("Warning: Leff = %g may be too small.\n", pParam->B3SOIDDleff); } if (pParam->B3SOIDDleffCV <= 5.0e-8) { fprintf(fplog, "Warning: Leff for CV = %g may be too small.\n", pParam->B3SOIDDleffCV); printf("Warning: Leff for CV = %g may be too small.\n", pParam->B3SOIDDleffCV); } if (pParam->B3SOIDDweff <= 1.0e-7) { fprintf(fplog, "Warning: Weff = %g may be too small.\n", pParam->B3SOIDDweff); printf("Warning: Weff = %g may be too small.\n", pParam->B3SOIDDweff); } if (pParam->B3SOIDDweffCV <= 1.0e-7) { fprintf(fplog, "Warning: Weff for CV = %g may be too small.\n", pParam->B3SOIDDweffCV); printf("Warning: Weff for CV = %g may be too small.\n", pParam->B3SOIDDweffCV); } /* Check threshold voltage parameters */ if (pParam->B3SOIDDnlx < 0.0) { fprintf(fplog, "Warning: Nlx = %g is negative.\n", pParam->B3SOIDDnlx); printf("Warning: Nlx = %g is negative.\n", pParam->B3SOIDDnlx); } if (model->B3SOIDDtox < 1.0e-9) { fprintf(fplog, "Warning: Tox = %g is less than 10A.\n", model->B3SOIDDtox); printf("Warning: Tox = %g is less than 10A.\n", model->B3SOIDDtox); } if (pParam->B3SOIDDnpeak <= 1.0e15) { fprintf(fplog, "Warning: Nch = %g may be too small.\n", pParam->B3SOIDDnpeak); printf("Warning: Nch = %g may be too small.\n", pParam->B3SOIDDnpeak); } else if (pParam->B3SOIDDnpeak >= 1.0e21) { fprintf(fplog, "Warning: Nch = %g may be too large.\n", pParam->B3SOIDDnpeak); printf("Warning: Nch = %g may be too large.\n", pParam->B3SOIDDnpeak); } if (fabs(pParam->B3SOIDDnsub) >= 1.0e21) { fprintf(fplog, "Warning: Nsub = %g may be too large.\n", pParam->B3SOIDDnsub); printf("Warning: Nsub = %g may be too large.\n", pParam->B3SOIDDnsub); } if ((pParam->B3SOIDDngate > 0.0) && (pParam->B3SOIDDngate <= 1.e18)) { fprintf(fplog, "Warning: Ngate = %g is less than 1.E18cm^-3.\n", pParam->B3SOIDDngate); printf("Warning: Ngate = %g is less than 1.E18cm^-3.\n", pParam->B3SOIDDngate); } if (model->B3SOIDDdvbd0 < 0.0) { fprintf(fplog, "Warning: Dvbd0 = %g is negative.\n", model->B3SOIDDdvbd0); printf("Warning: Dvbd0 = %g is negative.\n", model->B3SOIDDdvbd0); } if (pParam->B3SOIDDdvt0 < 0.0) { fprintf(fplog, "Warning: Dvt0 = %g is negative.\n", pParam->B3SOIDDdvt0); printf("Warning: Dvt0 = %g is negative.\n", pParam->B3SOIDDdvt0);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -