📄 soi3set.c
字号:
/**********STAG version 2.7Copyright 2000 owned by the United Kingdom Secretary of State for Defenceacting through the Defence Evaluation and Research Agency.Developed by : Jim Benson, Department of Electronics and Computer Science, University of Southampton, United Kingdom.With help from : Nele D'Halleweyn, Ketan Mistry, Bill Redman-White, and Craig Easson.Based on STAG version 2.1Developed by : Mike Lee,With help from : Bernard Tenbroek, Bill Redman-White, Mike Uren, Chris Edwards and John Bunyan.Acknowledgements : Rupert Howes and Pete Mole.**********//********** Modified by Paolo Nenzi 2002ngspice integration**********/#include "ngspice.h"#include "smpdefs.h"#include "cktdefs.h"#include "soi3defs.h"#include "sperror.h"#include "suffix.h"intSOI3setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states){ SOI3model *model = (SOI3model *)inModel; SOI3instance *here; int error; CKTnode *tmp; /* JimB - new variable for RT and CT scaling */ double thermal_area; double rtargs[5]; double * rtptr; int node_count; CKTnode *tmpNode; IFuid tmpName; /****** Part 1 - set any model parameters that are not present in ******/ /****** the netlist to default values. ******/ /* loop through all the SOI3 device models */ for( ; model != NULL; model = model->SOI3nextModel ) { if(!model->SOI3typeGiven) { model->SOI3type = NSOI3; } if(!model->SOI3latDiffGiven) { model->SOI3latDiff = 0; } if(!model->SOI3jctSatCurDensityGiven) { model->SOI3jctSatCurDensity = 1.0e-10; } if(!model->SOI3jctSatCurDensity1Given) { model->SOI3jctSatCurDensity1 = 0.0; } if(!model->SOI3jctSatCurGiven) { model->SOI3jctSatCur = 0.0; } if(!model->SOI3jctSatCur1Given) { model->SOI3jctSatCur1 = 0.0; } if(!model->SOI3transconductanceGiven) { model->SOI3transconductance = 2e-5; } if(!model->SOI3frontGateSourceOverlapCapFactorGiven) { model->SOI3frontGateSourceOverlapCapFactor = 0; } if(!model->SOI3frontGateDrainOverlapCapFactorGiven) { model->SOI3frontGateDrainOverlapCapFactor = 0; } if(!model->SOI3frontGateBulkOverlapCapFactorGiven) { model->SOI3frontGateBulkOverlapCapFactor = 0; } if(!model->SOI3backGateSourceOverlapCapAreaFactorGiven) { model->SOI3backGateSourceOverlapCapAreaFactor = 0; } if(!model->SOI3backGateDrainOverlapCapAreaFactorGiven) { model->SOI3backGateDrainOverlapCapAreaFactor = 0; } if(!model->SOI3backGateBulkOverlapCapAreaFactorGiven) { model->SOI3backGateBulkOverlapCapAreaFactor = 0; } if(!model->SOI3sideWallCapFactorGiven) { model->SOI3sideWallCapFactor = 0; } if(!model->SOI3bulkJctPotentialGiven) { model->SOI3bulkJctPotential = 0.8; } if(!model->SOI3bulkJctSideGradingCoeffGiven) { model->SOI3bulkJctSideGradingCoeff = 0.5; } if(!model->SOI3fwdCapDepCoeffGiven) { model->SOI3fwdCapDepCoeff = 0.5; } if(!model->SOI3lambdaGiven) { model->SOI3lambda = 0; } if(!model->SOI3thetaGiven) { model->SOI3theta = 0; } /* JimB - If SiO2 thermal conductivity given in netlist then use */ /* that value, otherwise use literature value. (Units W/K*m). */ if(!model->SOI3oxideThermalConductivityGiven) { model->SOI3oxideThermalConductivity = 1.4; } /* JimB - If Si specific heat given in netlist then use that value, */ /* otherwise use literature value. (Units J/kg*K). */ if(!model->SOI3siliconSpecificHeatGiven) { model->SOI3siliconSpecificHeat = 700; } /* JimB - If density of Si given in netlist then use that value, */ /* otherwise use literature value. (kg/m^3). */ if(!model->SOI3siliconDensityGiven) { model->SOI3siliconDensity = 2330; } if(!model->SOI3frontFixedChargeDensityGiven) { model->SOI3frontFixedChargeDensity = 0; } if(!model->SOI3backFixedChargeDensityGiven) { model->SOI3backFixedChargeDensity = 0; } if(!model->SOI3frontSurfaceStateDensityGiven) { model->SOI3frontSurfaceStateDensity = 0; } if(!model->SOI3backSurfaceStateDensityGiven) { model->SOI3backSurfaceStateDensity = 0; } if(!model->SOI3gammaGiven) { model->SOI3gamma = 0; } if(!model->SOI3fNcoefGiven) { model->SOI3fNcoef = 0; } if(!model->SOI3fNexpGiven) { model->SOI3fNexp = 1; }/* extra stuff for newer model - msll Jan96 */ if(!model->SOI3sigmaGiven) { model->SOI3sigma = 0; } if(!model->SOI3chiFBGiven) { model->SOI3chiFB = 0; } if(!model->SOI3chiPHIGiven) { model->SOI3chiPHI = 0; } if(!model->SOI3deltaWGiven) { model->SOI3deltaW = 0; } if(!model->SOI3deltaLGiven) { model->SOI3deltaL = 0; } if(!model->SOI3vsatGiven) { model->SOI3vsat = 0; /* special case - must check for it */ } if(!model->SOI3kGiven) { model->SOI3k = 1.5; /* defaults to old SPICE value */ } if(!model->SOI3lxGiven) { model->SOI3lx = 0; } if(!model->SOI3vpGiven) { model->SOI3vp = 0; } if(!model->SOI3gammaBGiven) { model->SOI3gammaB = 0; } if(!model->SOI3etaGiven) { model->SOI3eta = 1.0; /* normal field for imp. ion. */ } if(!model->SOI3alpha0Given) { model->SOI3alpha0=0; } if(!model->SOI3beta0Given) { model->SOI3beta0=1.92e6; } if(!model->SOI3lmGiven) { model->SOI3lm = 0; } if(!model->SOI3lm1Given) { model->SOI3lm1 = 0; } if(!model->SOI3lm2Given) { model->SOI3lm2 = 0; } if((!model->SOI3etadGiven) || (model->SOI3etad == 0 )) { model->SOI3etad = 1.0; } if((!model->SOI3etad1Given) || (model->SOI3etad1 == 0 )) { model->SOI3etad1 = 1.0; } if(!model->SOI3chibetaGiven) { model->SOI3chibeta = 0.0; } if(!model->SOI3dvtGiven) { model->SOI3dvt = 1; } if(!model->SOI3nLevGiven) { model->SOI3nLev = 0; } if(!model->SOI3betaBJTGiven) { model->SOI3betaBJT = 0.0; } if(!model->SOI3tauFBJTGiven) { model->SOI3tauFBJT = 0.0; } if(!model->SOI3tauRBJTGiven) { model->SOI3tauRBJT = 0.0; } if(!model->SOI3betaEXPGiven) { model->SOI3betaEXP = 2.0; } if(!model->SOI3tauEXPGiven) { model->SOI3tauEXP = 0.0; } if(!model->SOI3rswGiven) { model->SOI3rsw = 0.0; } if(!model->SOI3rdwGiven) { model->SOI3rdw = 0.0; } if(!model->SOI3minimumFeatureSizeGiven) { model->SOI3minimumFeatureSize = 0.0; } if(!model->SOI3vtexGiven) { model->SOI3vtex = 0.0; } if(!model->SOI3vdexGiven) { model->SOI3vdex = 0.0; } if(!model->SOI3delta0Given) { model->SOI3delta0 = 0.0; } if(!model->SOI3satChargeShareFactorGiven) { model->SOI3satChargeShareFactor = 0.5; } if(!model->SOI3nplusDopingGiven) { model->SOI3nplusDoping = 1e20; } if(!model->SOI3rtaGiven) { model->SOI3rta = 0; } if(!model->SOI3ctaGiven) { model->SOI3cta = 0; } if(!model->SOI3mexpGiven) { model->SOI3mexp = 0; } /* now check to determine which CLM model to use */ if((model->SOI3lx != 0) && (model->SOI3lambda != 0)) { (*(SPfrontEnd->IFerror))(ERR_WARNING, "%s: Non-zero values for BOTH LAMBDA and LX. \nDefaulting to simple LAMBDA model", &model->SOI3modName); model->SOI3useLAMBDA = TRUE; } /* if only lx given, AND vp!=0, AND mexp (integer) is at least 1, use lx/vp, else basic lambda model*/ if ((model->SOI3lxGiven) && (model->SOI3lx != 0) && (!model->SOI3lambdaGiven) && (model->SOI3vp != 0) && (model->SOI3mexp > 0)) { model->SOI3useLAMBDA = FALSE; } else { model->SOI3useLAMBDA = TRUE; } /****** Part 2 - set any instance parameters that are not present ******/ /****** in the netlist to default values. ******/ /* loop through all the instances of the model */ for (here = model->SOI3instances; here != NULL ; here=here->SOI3nextInstance) { if(!here->SOI3icVBSGiven) { here->SOI3icVBS = 0; } if(!here->SOI3icVDSGiven) { here->SOI3icVDS = 0; } if(!here->SOI3icVGFSGiven) { here->SOI3icVGFS = 0; } if(!here->SOI3icVGBSGiven) { here->SOI3icVGBS = 0; } if(!here->SOI3drainSquaresGiven || here->SOI3drainSquares==0) { here->SOI3drainSquares=1; } if(!here->SOI3sourceSquaresGiven || here->SOI3sourceSquares==0) { here->SOI3sourceSquares=1; } if (!here->SOI3mGiven) here->SOI3m = 1; /****** Part 3 - Initialise transconductances. ******/ /* initialise gM's */ here->SOI3iMdb= 0.0; here->SOI3iMsb= 0.0; here->SOI3gMmbs = 0.0; here->SOI3gMmf = 0.0; here->SOI3gMmb = 0.0; here->SOI3gMd = 0.0; here->SOI3gMdeltaT = 0.0; if (here->SOI3owner == ARCHme) { /* allocate a chunk of the state vector */ here->SOI3states = *states; *states += SOI3numStates;/* if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & TRANSEN) ){ *states += 10 * (ckt->CKTsenInfo->SENparms); }*/ } /****** Part 4 - check resistance values for internal nodes, ******/ /****** to see which internal nodes need to be created. ******/ /* Start with internal source and drain nodes */ if((model->SOI3drainResistance != 0 || (model->SOI3sheetResistance != 0 && here->SOI3drainSquares != 0) || model->SOI3rdw != 0) && here->SOI3dNodePrime == 0) { error = CKTmkVolt(ckt,&tmp,here->SOI3name,"drain"); if(error) { return(error); } here->SOI3dNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { if (tmpNode->nsGiven) { tmp->nodeset=tmpNode->nodeset;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -