📄 b3v1sset.c
字号:
model->BSIM3v1SLint = 0.0; if (!model->BSIM3v1SLlGiven) model->BSIM3v1SLl = 0.0; if (!model->BSIM3v1SLlnGiven) model->BSIM3v1SLln = 1.0; if (!model->BSIM3v1SLwGiven) model->BSIM3v1SLw = 0.0; if (!model->BSIM3v1SLwnGiven) model->BSIM3v1SLwn = 1.0; if (!model->BSIM3v1SLwlGiven) model->BSIM3v1SLwl = 0.0; if (!model->BSIM3v1SLminGiven) model->BSIM3v1SLmin = 0.0; if (!model->BSIM3v1SLmaxGiven) model->BSIM3v1SLmax = 1.0; if (!model->BSIM3v1SWintGiven) model->BSIM3v1SWint = 0.0; if (!model->BSIM3v1SWlGiven) model->BSIM3v1SWl = 0.0; if (!model->BSIM3v1SWlnGiven) model->BSIM3v1SWln = 1.0; if (!model->BSIM3v1SWwGiven) model->BSIM3v1SWw = 0.0; if (!model->BSIM3v1SWwnGiven) model->BSIM3v1SWwn = 1.0; if (!model->BSIM3v1SWwlGiven) model->BSIM3v1SWwl = 0.0; if (!model->BSIM3v1SWminGiven) model->BSIM3v1SWmin = 0.0; if (!model->BSIM3v1SWmaxGiven) model->BSIM3v1SWmax = 1.0; if (!model->BSIM3v1SdwcGiven) model->BSIM3v1Sdwc = model->BSIM3v1SWint; if (!model->BSIM3v1SdlcGiven) model->BSIM3v1Sdlc = model->BSIM3v1SLint; if (!model->BSIM3v1ScfGiven) model->BSIM3v1Scf = 2.0 * EPSOX / PI * log(1.0 + 0.4e-6 / model->BSIM3v1Stox); if (!model->BSIM3v1ScgdoGiven) { if (model->BSIM3v1SdlcGiven && (model->BSIM3v1Sdlc > 0.0)) { model->BSIM3v1Scgdo = model->BSIM3v1Sdlc * model->BSIM3v1Scox - model->BSIM3v1Scgdl ; } else model->BSIM3v1Scgdo = 0.6 * model->BSIM3v1Sxj * model->BSIM3v1Scox; } if (!model->BSIM3v1ScgsoGiven) { if (model->BSIM3v1SdlcGiven && (model->BSIM3v1Sdlc > 0.0)) { model->BSIM3v1Scgso = model->BSIM3v1Sdlc * model->BSIM3v1Scox - model->BSIM3v1Scgsl ; } else model->BSIM3v1Scgso = 0.6 * model->BSIM3v1Sxj * model->BSIM3v1Scox; } if (!model->BSIM3v1ScgboGiven) { model->BSIM3v1Scgbo = 2.0 * model->BSIM3v1Sdwc * model->BSIM3v1Scox; } if (!model->BSIM3v1SxpartGiven) model->BSIM3v1Sxpart = 0.0; if (!model->BSIM3v1SsheetResistanceGiven) model->BSIM3v1SsheetResistance = 0.0; if (!model->BSIM3v1SunitAreaJctCapGiven) model->BSIM3v1SunitAreaJctCap = 5.0E-4; if (!model->BSIM3v1SunitLengthSidewallJctCapGiven) model->BSIM3v1SunitLengthSidewallJctCap = 5.0E-10; if (!model->BSIM3v1SunitLengthGateSidewallJctCapGiven) model->BSIM3v1SunitLengthGateSidewallJctCap = model->BSIM3v1SunitLengthSidewallJctCap ; if (!model->BSIM3v1SjctSatCurDensityGiven) model->BSIM3v1SjctSatCurDensity = 1.0E-4; if (!model->BSIM3v1SjctSidewallSatCurDensityGiven) model->BSIM3v1SjctSidewallSatCurDensity = 0.0; if (!model->BSIM3v1SbulkJctPotentialGiven) model->BSIM3v1SbulkJctPotential = 1.0; if (!model->BSIM3v1SsidewallJctPotentialGiven) model->BSIM3v1SsidewallJctPotential = 1.0; if (!model->BSIM3v1SGatesidewallJctPotentialGiven) model->BSIM3v1SGatesidewallJctPotential = model->BSIM3v1SsidewallJctPotential; if (!model->BSIM3v1SbulkJctBotGradingCoeffGiven) model->BSIM3v1SbulkJctBotGradingCoeff = 0.5; if (!model->BSIM3v1SbulkJctSideGradingCoeffGiven) model->BSIM3v1SbulkJctSideGradingCoeff = 0.33; if (!model->BSIM3v1SbulkJctGateSideGradingCoeffGiven) model->BSIM3v1SbulkJctGateSideGradingCoeff = model->BSIM3v1SbulkJctSideGradingCoeff; if (!model->BSIM3v1SjctEmissionCoeffGiven) model->BSIM3v1SjctEmissionCoeff = 1.0; if (!model->BSIM3v1SjctTempExponentGiven) model->BSIM3v1SjctTempExponent = 3.0; if (!model->BSIM3v1SoxideTrapDensityAGiven) if (!model->BSIM3v1SoxideTrapDensityAGiven) { if (model->BSIM3v1Stype == NMOS) model->BSIM3v1SoxideTrapDensityA = 1e20; else model->BSIM3v1SoxideTrapDensityA=9.9e18; } if (!model->BSIM3v1SoxideTrapDensityBGiven) { if (model->BSIM3v1Stype == NMOS) model->BSIM3v1SoxideTrapDensityB = 5e4; else model->BSIM3v1SoxideTrapDensityB = 2.4e3; } if (!model->BSIM3v1SoxideTrapDensityCGiven) { if (model->BSIM3v1Stype == NMOS) model->BSIM3v1SoxideTrapDensityC = -1.4e-12; else model->BSIM3v1SoxideTrapDensityC = 1.4e-12; } if (!model->BSIM3v1SemGiven) model->BSIM3v1Sem = 4.1e7; /* V/m */ if (!model->BSIM3v1SefGiven) model->BSIM3v1Sef = 1.0; if (!model->BSIM3v1SafGiven) model->BSIM3v1Saf = 1.0; if (!model->BSIM3v1SkfGiven) model->BSIM3v1Skf = 0.0; /* loop through all the instances of the model */ for (here = model->BSIM3v1Sinstances; here != NULL ; here=here->BSIM3v1SnextInstance) { if (here->BSIM3v1Sowner == ARCHme) { /* allocate a chunk of the state vector */ here->BSIM3v1Sstates = *states; *states += BSIM3v1SnumStates; } /* perform the parameter defaulting */ if(here->BSIM3v1Sm == 0.0) here->BSIM3v1Sm = 1.0; fprintf(stderr, "M = %.2f\n", here->BSIM3v1Sm); if (!here->BSIM3v1SwGiven) here->BSIM3v1Sw = 5e-6; here->BSIM3v1Sw *= here->BSIM3v1Sm; if (!here->BSIM3v1SdrainAreaGiven) { if(model->BSIM3v1ShdifGiven) here->BSIM3v1SdrainArea = here->BSIM3v1Sw * 2 * model->BSIM3v1Shdif; else here->BSIM3v1SdrainArea = 0.0; } here->BSIM3v1SdrainArea *= here->BSIM3v1Sm; if (!here->BSIM3v1SdrainPerimeterGiven) { if(model->BSIM3v1ShdifGiven) here->BSIM3v1SdrainPerimeter = 2 * here->BSIM3v1Sw + 4 * model->BSIM3v1Shdif; else here->BSIM3v1SdrainPerimeter = 0.0; } here->BSIM3v1SdrainPerimeter *= here->BSIM3v1Sm; if (!here->BSIM3v1SdrainSquaresGiven) here->BSIM3v1SdrainSquares = 1.0; here->BSIM3v1SdrainSquares /= here->BSIM3v1Sm; if (!here->BSIM3v1SicVBSGiven) here->BSIM3v1SicVBS = 0; if (!here->BSIM3v1SicVDSGiven) here->BSIM3v1SicVDS = 0; if (!here->BSIM3v1SicVGSGiven) here->BSIM3v1SicVGS = 0; if (!here->BSIM3v1SlGiven) here->BSIM3v1Sl = 5e-6; if (!here->BSIM3v1SsourceAreaGiven) { if(model->BSIM3v1ShdifGiven) here->BSIM3v1SsourceArea = here->BSIM3v1Sw * 2 * model->BSIM3v1Shdif; else here->BSIM3v1SsourceArea = 0.0; } here->BSIM3v1SsourceArea *= here->BSIM3v1Sm; if (!here->BSIM3v1SsourcePerimeterGiven) { if(model->BSIM3v1ShdifGiven) here->BSIM3v1SsourcePerimeter = 2 * here->BSIM3v1Sw + 4 * model->BSIM3v1Shdif; else here->BSIM3v1SsourcePerimeter = 0.0; } here->BSIM3v1SsourcePerimeter *= here->BSIM3v1Sm; if (!here->BSIM3v1SsourceSquaresGiven) here->BSIM3v1SsourceSquares = 1.0; here->BSIM3v1SsourceSquares /= here->BSIM3v1Sm; if (!here->BSIM3v1SnqsModGiven) here->BSIM3v1SnqsMod = model->BSIM3v1SnqsMod; /* process drain series resistance */ if ((model->BSIM3v1SsheetResistance > 0.0) && (here->BSIM3v1SdrainSquares > 0.0 ) && (here->BSIM3v1SdNodePrime == 0)) { error = CKTmkVolt(ckt,&tmp,here->BSIM3v1Sname,"drain"); if(error) return(error); here->BSIM3v1SdNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { if (tmpNode->nsGiven) { tmp->nodeset=tmpNode->nodeset; tmp->nsGiven=tmpNode->nsGiven; } } } } else { here->BSIM3v1SdNodePrime = here->BSIM3v1SdNode; } /* process source series resistance */ if ((model->BSIM3v1SsheetResistance > 0.0) && (here->BSIM3v1SsourceSquares > 0.0 ) && (here->BSIM3v1SsNodePrime == 0)) { error = CKTmkVolt(ckt,&tmp,here->BSIM3v1Sname,"source"); if(error) return(error); here->BSIM3v1SsNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { if (tmpNode->nsGiven) { tmp->nodeset=tmpNode->nodeset; tmp->nsGiven=tmpNode->nsGiven; } } } } else { here->BSIM3v1SsNodePrime = here->BSIM3v1SsNode; } /* internal charge node */ if ((here->BSIM3v1SnqsMod) && (here->BSIM3v1SqNode == 0)) { error = CKTmkVolt(ckt,&tmp,here->BSIM3v1Sname,"charge"); if(error) return(error); here->BSIM3v1SqNode = tmp->number; } else { here->BSIM3v1SqNode = 0; } /* set Sparse Matrix Pointers *//* macro to make elements with built in test for out of memory */#define TSTALLOC(ptr,first,second) \if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\ return(E_NOMEM);\} TSTALLOC(BSIM3v1SDdPtr, BSIM3v1SdNode, BSIM3v1SdNode) TSTALLOC(BSIM3v1SGgPtr, BSIM3v1SgNode, BSIM3v1SgNode) TSTALLOC(BSIM3v1SSsPtr, BSIM3v1SsNode, BSIM3v1SsNode) TSTALLOC(BSIM3v1SBbPtr, BSIM3v1SbNode, BSIM3v1SbNode) TSTALLOC(BSIM3v1SDPdpPtr, BSIM3v1SdNodePrime, BSIM3v1SdNodePrime) TSTALLOC(BSIM3v1SSPspPtr, BSIM3v1SsNodePrime, BSIM3v1SsNodePrime) TSTALLOC(BSIM3v1SDdpPtr, BSIM3v1SdNode, BSIM3v1SdNodePrime) TSTALLOC(BSIM3v1SGbPtr, BSIM3v1SgNode, BSIM3v1SbNode) TSTALLOC(BSIM3v1SGdpPtr, BSIM3v1SgNode, BSIM3v1SdNodePrime) TSTALLOC(BSIM3v1SGspPtr, BSIM3v1SgNode, BSIM3v1SsNodePrime) TSTALLOC(BSIM3v1SSspPtr, BSIM3v1SsNode, BSIM3v1SsNodePrime) TSTALLOC(BSIM3v1SBdpPtr, BSIM3v1SbNode, BSIM3v1SdNodePrime) TSTALLOC(BSIM3v1SBspPtr, BSIM3v1SbNode, BSIM3v1SsNodePrime) TSTALLOC(BSIM3v1SDPspPtr, BSIM3v1SdNodePrime, BSIM3v1SsNodePrime) TSTALLOC(BSIM3v1SDPdPtr, BSIM3v1SdNodePrime, BSIM3v1SdNode) TSTALLOC(BSIM3v1SBgPtr, BSIM3v1SbNode, BSIM3v1SgNode) TSTALLOC(BSIM3v1SDPgPtr, BSIM3v1SdNodePrime, BSIM3v1SgNode) TSTALLOC(BSIM3v1SSPgPtr, BSIM3v1SsNodePrime, BSIM3v1SgNode) TSTALLOC(BSIM3v1SSPsPtr, BSIM3v1SsNodePrime, BSIM3v1SsNode) TSTALLOC(BSIM3v1SDPbPtr, BSIM3v1SdNodePrime, BSIM3v1SbNode) TSTALLOC(BSIM3v1SSPbPtr, BSIM3v1SsNodePrime, BSIM3v1SbNode) TSTALLOC(BSIM3v1SSPdpPtr, BSIM3v1SsNodePrime, BSIM3v1SdNodePrime) TSTALLOC(BSIM3v1SQqPtr, BSIM3v1SqNode, BSIM3v1SqNode) TSTALLOC(BSIM3v1SQdpPtr, BSIM3v1SqNode, BSIM3v1SdNodePrime) TSTALLOC(BSIM3v1SQspPtr, BSIM3v1SqNode, BSIM3v1SsNodePrime) TSTALLOC(BSIM3v1SQgPtr, BSIM3v1SqNode, BSIM3v1SgNode) TSTALLOC(BSIM3v1SQbPtr, BSIM3v1SqNode, BSIM3v1SbNode) TSTALLOC(BSIM3v1SDPqPtr, BSIM3v1SdNodePrime, BSIM3v1SqNode) TSTALLOC(BSIM3v1SSPqPtr, BSIM3v1SsNodePrime, BSIM3v1SqNode) TSTALLOC(BSIM3v1SGqPtr, BSIM3v1SgNode, BSIM3v1SqNode) TSTALLOC(BSIM3v1SBqPtr, BSIM3v1SbNode, BSIM3v1SqNode) } } return(OK);} intBSIM3v1Sunsetup(GENmodel *inModel, CKTcircuit *ckt){ BSIM3v1Smodel *model; BSIM3v1Sinstance *here; for (model = (BSIM3v1Smodel *)inModel; model != NULL; model = model->BSIM3v1SnextModel) { for (here = model->BSIM3v1Sinstances; here != NULL; here=here->BSIM3v1SnextInstance) { if (here->BSIM3v1SdNodePrime && here->BSIM3v1SdNodePrime != here->BSIM3v1SdNode) { CKTdltNNum(ckt, here->BSIM3v1SdNodePrime); here->BSIM3v1SdNodePrime = 0; } if (here->BSIM3v1SsNodePrime && here->BSIM3v1SsNodePrime != here->BSIM3v1SsNode) { CKTdltNNum(ckt, here->BSIM3v1SsNodePrime); here->BSIM3v1SsNodePrime = 0; } } } return OK;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -