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

📄 soi3set.c

📁 ngspice又一个电子CAD仿真软件代码.功能更全
💻 C
📖 第 1 页 / 共 2 页
字号:
                       tmp->nsGiven=tmpNode->nsGiven;                      }                  }                }            }            else            {                here->SOI3dNodePrime = here->SOI3dNode;            }            if((model->SOI3sourceResistance != 0 ||                    (model->SOI3sheetResistance != 0 &&                     here->SOI3sourceSquares != 0) ||                    model->SOI3rsw != 0) &&                    here->SOI3sNodePrime==0)            {                error = CKTmkVolt(ckt,&tmp,here->SOI3name,"source");                if(error)					 {                    return(error);                }                here->SOI3sNodePrime = 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->SOI3sNodePrime = here->SOI3sNode;            }            /* Now for thermal node */            /* JimB - If minimum feature size has non-zero value, then this */            /* will be used to calculate thermal area of SiO2 - this gives  */            /* more accurate values of RT for short-channel devices.  Assume*/            /* 4*fmin added to L, and 2*fmin added to W (fmin in microns).  */				thermal_area = (here->SOI3w + 2*1e-6*model->SOI3minimumFeatureSize)                  					* (here->SOI3l + 4*1e-6*model->SOI3minimumFeatureSize);            /* Now calculate RT and CT. */            /* If RT is given on instance line, use it, otherwise calculate from */            /* above variables. */            if (!here->SOI3rtGiven)            {               if (model->SOI3rtaGiven)               {            	   here->SOI3rt = model->SOI3rta/thermal_area;               }               else               {                  if (model->SOI3oxideThermalConductivity != 0)					   {						   here->SOI3rt = model->SOI3backOxideThickness /                  	   			   (model->SOI3oxideThermalConductivity * thermal_area);                  }                  else                  /* If conductivity set to zero in netlist, switch off self-heating. */                  {                     here->SOI3rt = 0;                  }               }            }            if (!here->SOI3rt1Given)            {              here->SOI3rt1=0;            }            if (!here->SOI3rt2Given)            {              here->SOI3rt2=0;            }            if (!here->SOI3rt3Given)            {              here->SOI3rt3=0;            }            if (!here->SOI3rt4Given)            {              here->SOI3rt4=0;            }				/* Now same thing for CT, but less complex as CT=0 does not cause problems */            if (!here->SOI3ctGiven)            {               if (model->SOI3ctaGiven)               {            	   here->SOI3ct = model->SOI3cta*thermal_area;               }               else               {                  here->SOI3ct = model->SOI3siliconDensity * model->SOI3siliconSpecificHeat *               					   thermal_area * model->SOI3bodyThickness;               }            }            if (!here->SOI3ct1Given)            {              here->SOI3ct1=0;            }            if (!here->SOI3ct2Given)            {              here->SOI3ct2=0;            }            if (!here->SOI3ct3Given)            {              here->SOI3ct3=0;            }            if (!here->SOI3ct4Given)            {              here->SOI3ct4=0;            }                        /* JimB - 15/9/99 */            rtargs[0]=here->SOI3rt;            rtargs[1]=here->SOI3rt1;            rtargs[2]=here->SOI3rt2;            rtargs[3]=here->SOI3rt3;            rtargs[4]=here->SOI3rt4;	 			rtptr = rtargs; /* Set pointer to start address of rtargs array. */            node_count=0;            while ( (*rtptr) && (node_count<5) )				{               node_count++;               if (node_count<5)               {               	rtptr++; /* Increment pointer to next array element. */               }            }            here->SOI3numThermalNodes=node_count;				/* Thermal node is now external and so is automatically created by CKTcreate in INP2A.   			It is also bound to the created node's number.  However, if rt=0 then no thermal so   			make tout be the thermal ground.  Can't simply use CKTbindNode 'cos the row and column   			associated with the original node has already been created.  Thus problems will occur   			during pivoting.  Instead put zero voltage source here.  First create branch for it.*/            if ((here->SOI3rt == 0) && (here->SOI3branch == 0))            {               error = CKTmkCur(ckt,&tmp,here->SOI3name,"branch");					if(error)					{               	return(error);					}               here->SOI3branch = tmp->number;            }            else            { /* have thermal - now how many time constants ? */              if ((here->SOI3numThermalNodes > 1) &&                  (here->SOI3tout1Node == 0))              {                error = CKTmkVolt(ckt,&tmp,here->SOI3name,"tout1");                if (error) return (error);                here->SOI3tout1Node = tmp->number;              }              else              {                here->SOI3tout1Node = 0;              }              if ((here->SOI3numThermalNodes > 2) &&                  (here->SOI3tout2Node == 0))              {                error = CKTmkVolt(ckt,&tmp,here->SOI3name,"tout2");                if (error) return (error);                here->SOI3tout2Node = tmp->number;              }              else              {                here->SOI3tout2Node = 0;              }              if ((here->SOI3numThermalNodes > 3) &&                  (here->SOI3tout3Node == 0))              {                error = CKTmkVolt(ckt,&tmp,here->SOI3name,"tout3");                if (error) return (error);                here->SOI3tout3Node = tmp->number;              }              else              {                here->SOI3tout3Node = 0;              }              if ((here->SOI3numThermalNodes > 4) &&                  (here->SOI3tout4Node == 0))              {                error = CKTmkVolt(ckt,&tmp,here->SOI3name,"tout4");                if (error) return (error);                here->SOI3tout4Node = tmp->number;              }              else              {                here->SOI3tout4Node = 0;              }            }/****** Part 5 - allocate memory to matrix elements corresponding to ******//****** pairs of nodes.                                              ******//* 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(SOI3D_dPtr,SOI3dNode,SOI3dNode)            TSTALLOC(SOI3D_dpPtr,SOI3dNode,SOI3dNodePrime)            TSTALLOC(SOI3DP_dPtr,SOI3dNodePrime,SOI3dNode)            TSTALLOC(SOI3S_sPtr,SOI3sNode,SOI3sNode)            TSTALLOC(SOI3S_spPtr,SOI3sNode,SOI3sNodePrime)            TSTALLOC(SOI3SP_sPtr,SOI3sNodePrime,SOI3sNode)            TSTALLOC(SOI3GF_gfPtr,SOI3gfNode,SOI3gfNode)            TSTALLOC(SOI3GF_gbPtr,SOI3gfNode,SOI3gbNode)            TSTALLOC(SOI3GF_dpPtr,SOI3gfNode,SOI3dNodePrime)            TSTALLOC(SOI3GF_spPtr,SOI3gfNode,SOI3sNodePrime)            TSTALLOC(SOI3GF_bPtr,SOI3gfNode,SOI3bNode)            TSTALLOC(SOI3GB_gfPtr,SOI3gbNode,SOI3gfNode)            TSTALLOC(SOI3GB_gbPtr,SOI3gbNode,SOI3gbNode)            TSTALLOC(SOI3GB_dpPtr,SOI3gbNode,SOI3dNodePrime)            TSTALLOC(SOI3GB_spPtr,SOI3gbNode,SOI3sNodePrime)            TSTALLOC(SOI3GB_bPtr,SOI3gbNode,SOI3bNode)                        TSTALLOC(SOI3B_gfPtr,SOI3bNode,SOI3gfNode)            TSTALLOC(SOI3B_gbPtr,SOI3bNode,SOI3gbNode)            TSTALLOC(SOI3B_dpPtr,SOI3bNode,SOI3dNodePrime)            TSTALLOC(SOI3B_spPtr,SOI3bNode,SOI3sNodePrime)            TSTALLOC(SOI3B_bPtr,SOI3bNode,SOI3bNode)            TSTALLOC(SOI3DP_gfPtr,SOI3dNodePrime,SOI3gfNode)            TSTALLOC(SOI3DP_gbPtr,SOI3dNodePrime,SOI3gbNode)            TSTALLOC(SOI3DP_dpPtr,SOI3dNodePrime,SOI3dNodePrime)            TSTALLOC(SOI3DP_spPtr,SOI3dNodePrime,SOI3sNodePrime)            TSTALLOC(SOI3DP_bPtr,SOI3dNodePrime,SOI3bNode)            TSTALLOC(SOI3SP_gfPtr,SOI3sNodePrime,SOI3gfNode)            TSTALLOC(SOI3SP_gbPtr,SOI3sNodePrime,SOI3gbNode)            TSTALLOC(SOI3SP_dpPtr,SOI3sNodePrime,SOI3dNodePrime)            TSTALLOC(SOI3SP_spPtr,SOI3sNodePrime,SOI3sNodePrime)            TSTALLOC(SOI3SP_bPtr,SOI3sNodePrime,SOI3bNode)            if (here->SOI3rt == 0)            {              TSTALLOC(SOI3TOUT_ibrPtr,SOI3toutNode,SOI3branch)              TSTALLOC(SOI3IBR_toutPtr,SOI3branch,SOI3toutNode)            }            else            {              TSTALLOC(SOI3TOUT_toutPtr,SOI3toutNode,SOI3toutNode)              if (here->SOI3numThermalNodes > 1)              {                TSTALLOC(SOI3TOUT_tout1Ptr,SOI3toutNode,SOI3tout1Node)                TSTALLOC(SOI3TOUT1_toutPtr,SOI3tout1Node,SOI3toutNode)                TSTALLOC(SOI3TOUT1_tout1Ptr,SOI3tout1Node,SOI3tout1Node)              }              if (here->SOI3numThermalNodes > 2)              {                TSTALLOC(SOI3TOUT1_tout2Ptr,SOI3tout1Node,SOI3tout2Node)                TSTALLOC(SOI3TOUT2_tout1Ptr,SOI3tout2Node,SOI3tout1Node)                TSTALLOC(SOI3TOUT2_tout2Ptr,SOI3tout2Node,SOI3tout2Node)              }              if (here->SOI3numThermalNodes > 3)              {                TSTALLOC(SOI3TOUT2_tout3Ptr,SOI3tout2Node,SOI3tout3Node)                TSTALLOC(SOI3TOUT3_tout2Ptr,SOI3tout3Node,SOI3tout2Node)                TSTALLOC(SOI3TOUT3_tout3Ptr,SOI3tout3Node,SOI3tout3Node)              }              if (here->SOI3numThermalNodes > 4)              {                TSTALLOC(SOI3TOUT3_tout4Ptr,SOI3tout3Node,SOI3tout4Node)                TSTALLOC(SOI3TOUT4_tout3Ptr,SOI3tout4Node,SOI3tout3Node)                TSTALLOC(SOI3TOUT4_tout4Ptr,SOI3tout4Node,SOI3tout4Node)              }              TSTALLOC(SOI3TOUT_toutPtr,SOI3toutNode,SOI3toutNode)              TSTALLOC(SOI3TOUT_gfPtr,SOI3toutNode,SOI3gfNode)              TSTALLOC(SOI3TOUT_gbPtr,SOI3toutNode,SOI3gbNode)              TSTALLOC(SOI3TOUT_dpPtr,SOI3toutNode,SOI3dNodePrime)              TSTALLOC(SOI3TOUT_spPtr,SOI3toutNode,SOI3sNodePrime)              TSTALLOC(SOI3TOUT_bPtr,SOI3toutNode,SOI3bNode)              TSTALLOC(SOI3GF_toutPtr,SOI3gfNode,SOI3toutNode)              TSTALLOC(SOI3GB_toutPtr,SOI3gbNode,SOI3toutNode)              TSTALLOC(SOI3DP_toutPtr,SOI3dNodePrime,SOI3toutNode)              TSTALLOC(SOI3SP_toutPtr,SOI3sNodePrime,SOI3toutNode)              TSTALLOC(SOI3B_toutPtr,SOI3bNode,SOI3toutNode)            }        }    }    return(OK);}intSOI3unsetup(GENmodel *inModel, CKTcircuit *ckt){    SOI3model *model;    SOI3instance *here;    for (model = (SOI3model *)inModel; model != NULL;	    model = model->SOI3nextModel)    {       for (here = model->SOI3instances; here != NULL;                here=here->SOI3nextInstance)		 {	       if (here->SOI3dNodePrime             && here->SOI3dNodePrime != here->SOI3dNode)          {             CKTdltNNum(ckt, here->SOI3dNodePrime);		       here->SOI3dNodePrime= 0;	       }	       if (here->SOI3sNodePrime		       && here->SOI3sNodePrime != here->SOI3sNode)	       {		       CKTdltNNum(ckt, here->SOI3sNodePrime);		       here->SOI3sNodePrime= 0;	       }	       if (here->SOI3branch)	       {		       CKTdltNNum(ckt, here->SOI3branch);		       here->SOI3branch=0;	       }	       if (here->SOI3tout1Node)	       {             CKTdltNNum(ckt, here->SOI3tout1Node);		       here->SOI3tout1Node = 0;	       }	       if (here->SOI3tout2Node)	       {		       CKTdltNNum(ckt, here->SOI3tout2Node);		       here->SOI3tout2Node = 0;	       }	       if (here->SOI3tout3Node)	       {             CKTdltNNum(ckt, here->SOI3tout3Node);		       here->SOI3tout3Node = 0;	       }	       if (here->SOI3tout4Node)	       {		       CKTdltNNum(ckt, here->SOI3tout4Node);		       here->SOI3tout4Node = 0;	       }	    }    }    return OK;}

⌨️ 快捷键说明

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