repo: gserdyuk/gnucap-a

original_code:
int
B1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt,
        int *states)
{
    B1model *model = (B1model*)inModel;
    B1instance *here;
    int error;
    CKTnode *tmp;
    for( ; model != ((void *)0); model = model->B1nextModel ) {
        if( ! model->B1typeGiven) {
            model->B1type = 1;
        }
        if( ! model->B1vfb0Given) {
            model->B1vfb0 = 0.0;
        }
        if( ! model->B1vfbLGiven) {
            model->B1vfbL = 0.0;
        }
        if( ! model->B1vfbWGiven) {
            model->B1vfbW = 0.0;
        }
        if( ! model->B1phi0Given) {
            model->B1phi0 = 0.0;
        }
        if( ! model->B1phiLGiven) {
            model->B1phiL = 0.0;
        }
        if( ! model->B1phiWGiven) {
            model->B1phiW = 0.0;
        }
        if( ! model->B1K10Given) {
            model->B1K10 = 0.0;
        }
        if( ! model->B1K1LGiven) {
            model->B1K1L = 0.0;
        }
        if( ! model->B1K1WGiven) {
            model->B1K1W = 0.0;
        }
        if( ! model->B1K20Given) {
            model->B1K20 = 0.0;
        }
        if( ! model->B1K2LGiven) {
            model->B1K2L = 0.0;
        }
        if( ! model->B1K2WGiven) {
            model->B1K2W = 0.0;
        }
        if( ! model->B1eta0Given) {
            model->B1eta0 = 0.0;
        }
        if( ! model->B1etaLGiven) {
            model->B1etaL = 0.0;
        }
        if( ! model->B1etaWGiven) {
            model->B1etaW = 0.0;
        }
        if( ! model->B1mobZeroGiven) {
            model->B1mobZero = 0.0;
        }
        if( ! model->B1deltaLGiven) {
            model->B1deltaL = 0.0;
        }
        if( ! model->B1deltaWGiven) {
            model->B1deltaW = 0.0;
        }
        if( ! model->B1ugs0Given) {
            model->B1ugs0 = 0.0;
        }
        if( ! model->B1ugsLGiven) {
            model->B1ugsL = 0.0;
        }
        if( ! model->B1ugsWGiven) {
            model->B1ugsW = 0.0;
        }
        if( ! model->B1uds0Given) {
            model->B1uds0 = 0.0;
        }
        if( ! model->B1udsLGiven) {
            model->B1udsL = 0.0;
        }
        if( ! model->B1udsWGiven) {
            model->B1udsW = 0.0;
        }
        if( ! model->B1mobZeroB0Given) {
            model->B1mobZeroB0 = 0.0;
        }
        if( ! model->B1mobZeroBlGiven) {
            model->B1mobZeroBl = 0.0;
        }
        if( ! model->B1mobZeroBwGiven) {
            model->B1mobZeroBw = 0.0;
        }
        if( ! model->B1etaB0Given) {
            model->B1etaB0 = 0.0;
        }
        if( ! model->B1etaBlGiven) {
            model->B1etaBl = 0.0;
        }
        if( ! model->B1etaBwGiven) {
            model->B1etaBw = 0.0;
        }
        if( ! model->B1etaD0Given) {
            model->B1etaD0 = 0.0;
        }
        if( ! model->B1etaDlGiven) {
            model->B1etaDl = 0.0;
        }
        if( ! model->B1etaDwGiven) {
            model->B1etaDw = 0.0;
        }
        if( ! model->B1ugsB0Given) {
            model->B1ugsB0 = 0.0;
        }
        if( ! model->B1ugsBLGiven) {
            model->B1ugsBL = 0.0;
        }
        if( ! model->B1ugsBWGiven) {
            model->B1ugsBW = 0.0;
        }
        if( ! model->B1udsB0Given) {
            model->B1udsB0 = 0.0;
        }
        if( ! model->B1udsBLGiven) {
            model->B1udsBL = 0.0;
        }
        if( ! model->B1udsBWGiven) {
            model->B1udsBW = 0.0;
        }
        if( ! model->B1mobVdd0Given) {
            model->B1mobVdd0 = 0.0;
        }
        if( ! model->B1mobVddlGiven) {
            model->B1mobVddl = 0.0;
        }
        if( ! model->B1mobVddwGiven) {
            model->B1mobVddw = 0.0;
        }
        if( ! model->B1mobVddB0Given) {
            model->B1mobVddB0 = 0.0;
        }
        if( ! model->B1mobVddBlGiven) {
            model->B1mobVddBl = 0.0;
        }
        if( ! model->B1mobVddBwGiven) {
            model->B1mobVddBw = 0.0;
        }
        if( ! model->B1mobVddD0Given) {
            model->B1mobVddD0 = 0.0;
        }
        if( ! model->B1mobVddDlGiven) {
            model->B1mobVddDl = 0.0;
        }
        if( ! model->B1mobVddDwGiven) {
            model->B1mobVddDw = 0.0;
        }
        if( ! model->B1udsD0Given) {
            model->B1udsD0 = 0.0;
        }
        if( ! model->B1udsDLGiven) {
            model->B1udsDL = 0.0;
        }
        if( ! model->B1udsDWGiven) {
            model->B1udsDW = 0.0;
        }
        if( ! model->B1oxideThicknessGiven) {
            model->B1oxideThickness = 0.0;
        }
        if( ! model->B1tempGiven) {
            model->B1temp = 0.0;
        }
        if( ! model->B1vddGiven) {
            model->B1vdd = 0.0;
        }
        if( ! model->B1gateDrainOverlapCapGiven) {
            model->B1gateDrainOverlapCap = 0.0;
        }
        if( ! model->B1gateSourceOverlapCapGiven) {
            model->B1gateSourceOverlapCap = 0.0;
        }
        if( ! model->B1gateBulkOverlapCapGiven) {
            model->B1gateBulkOverlapCap = 0.0;
        }
        if( ! model->B1channelChargePartitionFlagGiven) {
            model->B1channelChargePartitionFlag = 0;
        }
        if( ! model->B1subthSlope0Given) {
            model->B1subthSlope0 = 0.0;
        }
        if( ! model->B1subthSlopeLGiven) {
            model->B1subthSlopeL = 0.0;
        }
        if( ! model->B1subthSlopeWGiven) {
            model->B1subthSlopeW = 0.0;
        }
        if( ! model->B1subthSlopeB0Given) {
            model->B1subthSlopeB0 = 0.0;
        }
        if( ! model->B1subthSlopeBLGiven) {
            model->B1subthSlopeBL = 0.0;
        }
        if( ! model->B1subthSlopeBWGiven) {
            model->B1subthSlopeBW = 0.0;
        }
        if( ! model->B1subthSlopeD0Given) {
            model->B1subthSlopeD0 = 0.0;
        }
        if( ! model->B1subthSlopeDLGiven) {
            model->B1subthSlopeDL = 0.0;
        }
        if( ! model->B1subthSlopeDWGiven) {
            model->B1subthSlopeDW = 0.0;
        }
        if( ! model->B1sheetResistanceGiven) {
            model->B1sheetResistance = 0.0;
        }
        if( ! model->B1unitAreaJctCapGiven) {
            model->B1unitAreaJctCap = 0.0;
        }
        if( ! model->B1unitLengthSidewallJctCapGiven) {
            model->B1unitLengthSidewallJctCap = 0.0;
        }
        if( ! model->B1jctSatCurDensityGiven) {
            model->B1jctSatCurDensity = 0.0;
        }
        if( ! model->B1bulkJctPotentialGiven) {
            model->B1bulkJctPotential = 0.0;
        }
        if( ! model->B1sidewallJctPotentialGiven) {
            model->B1sidewallJctPotential = 0.0;
        }
        if( ! model->B1bulkJctBotGradingCoeffGiven) {
            model->B1bulkJctBotGradingCoeff = 0.0;
        }
        if( ! model->B1bulkJctSideGradingCoeffGiven) {
            model->B1bulkJctSideGradingCoeff = 0.0;
        }
        if( ! model->B1defaultWidthGiven) {
            model->B1defaultWidth = 0.0;
        }
        if( ! model->B1deltaLengthGiven) {
            model->B1deltaLength = 0.0;
        }
        if( ! model->B1fNcoefGiven) {
            model->B1fNcoef = 0.0;
        }
        if( ! model->B1fNexpGiven) {
            model->B1fNexp = 1.0;
        }
        for (here = model->B1instances; here != ((void *)0) ;
                here=here->B1nextInstance) {
        CKTnode *tmpNode;
        IFuid tmpName;
     if (here->B1owner == ARCHme) {
  here->B1states = *states;
  *states += 35;
     }
            if(!here->B1drainAreaGiven) {
                here->B1drainArea = 0;
            }
            if(!here->B1drainPerimeterGiven) {
                here->B1drainPerimeter = 0;
            }
            if(!here->B1drainSquaresGiven) {
                here->B1drainSquares = 1;
            }
            if(!here->B1icVBSGiven) {
                here->B1icVBS = 0;
            }
            if(!here->B1icVDSGiven) {
                here->B1icVDS = 0;
            }
            if(!here->B1icVGSGiven) {
                here->B1icVGS = 0;
            }
            if(!here->B1lGiven) {
                here->B1l = 5e-6;
            }
            if(!here->B1sourceAreaGiven) {
                here->B1sourceArea = 0;
            }
            if(!here->B1sourcePerimeterGiven) {
                here->B1sourcePerimeter = 0;
            }
            if(!here->B1sourceSquaresGiven) {
                here->B1sourceSquares = 1;
            }
            if(!here->B1vdsatGiven) {
                here->B1vdsat = 0;
            }
            if(!here->B1vonGiven) {
                here->B1von = 0;
            }
            if(!here->B1wGiven) {
                here->B1w = 5e-6;
            }
            if(!here->B1mGiven) {
                here->B1m = 1.0;
            }
            if( (model->B1sheetResistance != 0) &&
                    (here->B1drainSquares != 0.0 ) &&
                    (here->B1dNodePrime == 0) ) {
                error = CKTmkVolt(ckt,&tmp,here->B1name,"drain");
                if(error) return(error);
                here->B1dNodePrime = tmp->number;
                if (ckt->CKTcopyNodesets) {
                  if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==0) {
                     if (tmpNode->nsGiven) {
                       tmp->nodeset=tmpNode->nodeset;
                       tmp->nsGiven=tmpNode->nsGiven;
                     }
                  }
                }
            } else {
                    here->B1dNodePrime = here->B1dNode;
            }
            if( (model->B1sheetResistance != 0) &&
                    (here->B1sourceSquares != 0.0 ) &&
                    (here->B1sNodePrime == 0) ) {
                if(here->B1sNodePrime == 0) {
                    error = CKTmkVolt(ckt,&tmp,here->B1name,"source");
                    if(error) return(error);
                    here->B1sNodePrime = tmp->number;
                    if (ckt->CKTcopyNodesets) {
                     if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==0) {
                     if (tmpNode->nsGiven) {
                       tmp->nodeset=tmpNode->nodeset;
                       tmp->nsGiven=tmpNode->nsGiven;
                     }
                  }
                }
                }
            } else {
                here->B1sNodePrime = here->B1sNode;
            }
            if((here->B1DdPtr = SMPmakeElt(matrix,here->B1dNode,here->B1dNode))==(double *)((void *)0)){ return(8);}
            if((here->B1GgPtr = SMPmakeElt(matrix,here->B1gNode,here->B1gNode))==(double *)((void *)0)){ return(8);}
            if((here->B1SsPtr = SMPmakeElt(matrix,here->B1sNode,here->B1sNode))==(double *)((void *)0)){ return(8);}
            if((here->B1BbPtr = SMPmakeElt(matrix,here->B1bNode,here->B1bNode))==(double *)((void *)0)){ return(8);}
            if((here->B1DPdpPtr = SMPmakeElt(matrix,here->B1dNodePrime,here->B1dNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1SPspPtr = SMPmakeElt(matrix,here->B1sNodePrime,here->B1sNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1DdpPtr = SMPmakeElt(matrix,here->B1dNode,here->B1dNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1GbPtr = SMPmakeElt(matrix,here->B1gNode,here->B1bNode))==(double *)((void *)0)){ return(8);}
            if((here->B1GdpPtr = SMPmakeElt(matrix,here->B1gNode,here->B1dNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1GspPtr = SMPmakeElt(matrix,here->B1gNode,here->B1sNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1SspPtr = SMPmakeElt(matrix,here->B1sNode,here->B1sNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1BdpPtr = SMPmakeElt(matrix,here->B1bNode,here->B1dNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1BspPtr = SMPmakeElt(matrix,here->B1bNode,here->B1sNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1DPspPtr = SMPmakeElt(matrix,here->B1dNodePrime,here->B1sNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1DPdPtr = SMPmakeElt(matrix,here->B1dNodePrime,here->B1dNode))==(double *)((void *)0)){ return(8);}
            if((here->B1BgPtr = SMPmakeElt(matrix,here->B1bNode,here->B1gNode))==(double *)((void *)0)){ return(8);}
            if((here->B1DPgPtr = SMPmakeElt(matrix,here->B1dNodePrime,here->B1gNode))==(double *)((void *)0)){ return(8);}
            if((here->B1SPgPtr = SMPmakeElt(matrix,here->B1sNodePrime,here->B1gNode))==(double *)((void *)0)){ return(8);}
            if((here->B1SPsPtr = SMPmakeElt(matrix,here->B1sNodePrime,here->B1sNode))==(double *)((void *)0)){ return(8);}
            if((here->B1DPbPtr = SMPmakeElt(matrix,here->B1dNodePrime,here->B1bNode))==(double *)((void *)0)){ return(8);}
            if((here->B1SPbPtr = SMPmakeElt(matrix,here->B1sNodePrime,here->B1bNode))==(double *)((void *)0)){ return(8);}
            if((here->B1SPdpPtr = SMPmakeElt(matrix,here->B1sNodePrime,here->B1dNodePrime))==(double *)((void *)0)){ return(8);}
        }
    }
    return(0);
}

canonical_original_code:
int B1setup(void *matrix, struct sGENmodel *inModel, struct CKTcircuit *ckt, int *states)
{
    struct sBSIM1model *model = (B1model*)inModel;
    struct sBSIM1instance *here;
    int error;
    struct sCKTnode *tmp;
    for( ; model != ((void *)0); model = model->B1nextModel ) {
        if( ! model->B1typeGiven) {
            model->B1type = 1;
        }
        if( ! model->B1vfb0Given) {
            model->B1vfb0 = 0.0;
        }
        if( ! model->B1vfbLGiven) {
            model->B1vfbL = 0.0;
        }
        if( ! model->B1vfbWGiven) {
            model->B1vfbW = 0.0;
        }
        if( ! model->B1phi0Given) {
            model->B1phi0 = 0.0;
        }
        if( ! model->B1phiLGiven) {
            model->B1phiL = 0.0;
        }
        if( ! model->B1phiWGiven) {
            model->B1phiW = 0.0;
        }
        if( ! model->B1K10Given) {
            model->B1K10 = 0.0;
        }
        if( ! model->B1K1LGiven) {
            model->B1K1L = 0.0;
        }
        if( ! model->B1K1WGiven) {
            model->B1K1W = 0.0;
        }
        if( ! model->B1K20Given) {
            model->B1K20 = 0.0;
        }
        if( ! model->B1K2LGiven) {
            model->B1K2L = 0.0;
        }
        if( ! model->B1K2WGiven) {
            model->B1K2W = 0.0;
        }
        if( ! model->B1eta0Given) {
            model->B1eta0 = 0.0;
        }
        if( ! model->B1etaLGiven) {
            model->B1etaL = 0.0;
        }
        if( ! model->B1etaWGiven) {
            model->B1etaW = 0.0;
        }
        if( ! model->B1mobZeroGiven) {
            model->B1mobZero = 0.0;
        }
        if( ! model->B1deltaLGiven) {
            model->B1deltaL = 0.0;
        }
        if( ! model->B1deltaWGiven) {
            model->B1deltaW = 0.0;
        }
        if( ! model->B1ugs0Given) {
            model->B1ugs0 = 0.0;
        }
        if( ! model->B1ugsLGiven) {
            model->B1ugsL = 0.0;
        }
        if( ! model->B1ugsWGiven) {
            model->B1ugsW = 0.0;
        }
        if( ! model->B1uds0Given) {
            model->B1uds0 = 0.0;
        }
        if( ! model->B1udsLGiven) {
            model->B1udsL = 0.0;
        }
        if( ! model->B1udsWGiven) {
            model->B1udsW = 0.0;
        }
        if( ! model->B1mobZeroB0Given) {
            model->B1mobZeroB0 = 0.0;
        }
        if( ! model->B1mobZeroBlGiven) {
            model->B1mobZeroBl = 0.0;
        }
        if( ! model->B1mobZeroBwGiven) {
            model->B1mobZeroBw = 0.0;
        }
        if( ! model->B1etaB0Given) {
            model->B1etaB0 = 0.0;
        }
        if( ! model->B1etaBlGiven) {
            model->B1etaBl = 0.0;
        }
        if( ! model->B1etaBwGiven) {
            model->B1etaBw = 0.0;
        }
        if( ! model->B1etaD0Given) {
            model->B1etaD0 = 0.0;
        }
        if( ! model->B1etaDlGiven) {
            model->B1etaDl = 0.0;
        }
        if( ! model->B1etaDwGiven) {
            model->B1etaDw = 0.0;
        }
        if( ! model->B1ugsB0Given) {
            model->B1ugsB0 = 0.0;
        }
        if( ! model->B1ugsBLGiven) {
            model->B1ugsBL = 0.0;
        }
        if( ! model->B1ugsBWGiven) {
            model->B1ugsBW = 0.0;
        }
        if( ! model->B1udsB0Given) {
            model->B1udsB0 = 0.0;
        }
        if( ! model->B1udsBLGiven) {
            model->B1udsBL = 0.0;
        }
        if( ! model->B1udsBWGiven) {
            model->B1udsBW = 0.0;
        }
        if( ! model->B1mobVdd0Given) {
            model->B1mobVdd0 = 0.0;
        }
        if( ! model->B1mobVddlGiven) {
            model->B1mobVddl = 0.0;
        }
        if( ! model->B1mobVddwGiven) {
            model->B1mobVddw = 0.0;
        }
        if( ! model->B1mobVddB0Given) {
            model->B1mobVddB0 = 0.0;
        }
        if( ! model->B1mobVddBlGiven) {
            model->B1mobVddBl = 0.0;
        }
        if( ! model->B1mobVddBwGiven) {
            model->B1mobVddBw = 0.0;
        }
        if( ! model->B1mobVddD0Given) {
            model->B1mobVddD0 = 0.0;
        }
        if( ! model->B1mobVddDlGiven) {
            model->B1mobVddDl = 0.0;
        }
        if( ! model->B1mobVddDwGiven) {
            model->B1mobVddDw = 0.0;
        }
        if( ! model->B1udsD0Given) {
            model->B1udsD0 = 0.0;
        }
        if( ! model->B1udsDLGiven) {
            model->B1udsDL = 0.0;
        }
        if( ! model->B1udsDWGiven) {
            model->B1udsDW = 0.0;
        }
        if( ! model->B1oxideThicknessGiven) {
            model->B1oxideThickness = 0.0;
        }
        if( ! model->B1tempGiven) {
            model->B1temp = 0.0;
        }
        if( ! model->B1vddGiven) {
            model->B1vdd = 0.0;
        }
        if( ! model->B1gateDrainOverlapCapGiven) {
            model->B1gateDrainOverlapCap = 0.0;
        }
        if( ! model->B1gateSourceOverlapCapGiven) {
            model->B1gateSourceOverlapCap = 0.0;
        }
        if( ! model->B1gateBulkOverlapCapGiven) {
            model->B1gateBulkOverlapCap = 0.0;
        }
        if( ! model->B1channelChargePartitionFlagGiven) {
            model->B1channelChargePartitionFlag = 0;
        }
        if( ! model->B1subthSlope0Given) {
            model->B1subthSlope0 = 0.0;
        }
        if( ! model->B1subthSlopeLGiven) {
            model->B1subthSlopeL = 0.0;
        }
        if( ! model->B1subthSlopeWGiven) {
            model->B1subthSlopeW = 0.0;
        }
        if( ! model->B1subthSlopeB0Given) {
            model->B1subthSlopeB0 = 0.0;
        }
        if( ! model->B1subthSlopeBLGiven) {
            model->B1subthSlopeBL = 0.0;
        }
        if( ! model->B1subthSlopeBWGiven) {
            model->B1subthSlopeBW = 0.0;
        }
        if( ! model->B1subthSlopeD0Given) {
            model->B1subthSlopeD0 = 0.0;
        }
        if( ! model->B1subthSlopeDLGiven) {
            model->B1subthSlopeDL = 0.0;
        }
        if( ! model->B1subthSlopeDWGiven) {
            model->B1subthSlopeDW = 0.0;
        }
        if( ! model->B1sheetResistanceGiven) {
            model->B1sheetResistance = 0.0;
        }
        if( ! model->B1unitAreaJctCapGiven) {
            model->B1unitAreaJctCap = 0.0;
        }
        if( ! model->B1unitLengthSidewallJctCapGiven) {
            model->B1unitLengthSidewallJctCap = 0.0;
        }
        if( ! model->B1jctSatCurDensityGiven) {
            model->B1jctSatCurDensity = 0.0;
        }
        if( ! model->B1bulkJctPotentialGiven) {
            model->B1bulkJctPotential = 0.0;
        }
        if( ! model->B1sidewallJctPotentialGiven) {
            model->B1sidewallJctPotential = 0.0;
        }
        if( ! model->B1bulkJctBotGradingCoeffGiven) {
            model->B1bulkJctBotGradingCoeff = 0.0;
        }
        if( ! model->B1bulkJctSideGradingCoeffGiven) {
            model->B1bulkJctSideGradingCoeff = 0.0;
        }
        if( ! model->B1defaultWidthGiven) {
            model->B1defaultWidth = 0.0;
        }
        if( ! model->B1deltaLengthGiven) {
            model->B1deltaLength = 0.0;
        }
        if( ! model->B1fNcoefGiven) {
            model->B1fNcoef = 0.0;
        }
        if( ! model->B1fNexpGiven) {
            model->B1fNexp = 1.0;
        }
        for (here = model->B1instances; here != ((void *)0) ;
                here=here->B1nextInstance) {
        struct sCKTnode *tmpNode;
        char *tmpName;
     if (here->B1owner == ARCHme) {
  here->B1states = *states;
  *states += 35;
     }
            if(!here->B1drainAreaGiven) {
                here->B1drainArea = 0;
            }
            if(!here->B1drainPerimeterGiven) {
                here->B1drainPerimeter = 0;
            }
            if(!here->B1drainSquaresGiven) {
                here->B1drainSquares = 1;
            }
            if(!here->B1icVBSGiven) {
                here->B1icVBS = 0;
            }
            if(!here->B1icVDSGiven) {
                here->B1icVDS = 0;
            }
            if(!here->B1icVGSGiven) {
                here->B1icVGS = 0;
            }
            if(!here->B1lGiven) {
                here->B1l = 5e-6;
            }
            if(!here->B1sourceAreaGiven) {
                here->B1sourceArea = 0;
            }
            if(!here->B1sourcePerimeterGiven) {
                here->B1sourcePerimeter = 0;
            }
            if(!here->B1sourceSquaresGiven) {
                here->B1sourceSquares = 1;
            }
            if(!here->B1vdsatGiven) {
                here->B1vdsat = 0;
            }
            if(!here->B1vonGiven) {
                here->B1von = 0;
            }
            if(!here->B1wGiven) {
                here->B1w = 5e-6;
            }
            if(!here->B1mGiven) {
                here->B1m = 1.0;
            }
            if( (model->B1sheetResistance != 0) &&
                    (here->B1drainSquares != 0.0 ) &&
                    (here->B1dNodePrime == 0) ) {
                error = CKTmkVolt(ckt,&tmp,here->B1name,"drain");
                if(error) return(error);
                here->B1dNodePrime = tmp->number;
                if (ckt->CKTcopyNodesets) {
                  if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==0) {
                     if (tmpNode->nsGiven) {
                       tmp->nodeset=tmpNode->nodeset;
                       tmp->nsGiven=tmpNode->nsGiven;
                     }
                  }
                }
            } else {
                    here->B1dNodePrime = here->B1dNode;
            }
            if( (model->B1sheetResistance != 0) &&
                    (here->B1sourceSquares != 0.0 ) &&
                    (here->B1sNodePrime == 0) ) {
                if(here->B1sNodePrime == 0) {
                    error = CKTmkVolt(ckt,&tmp,here->B1name,"source");
                    if(error) return(error);
                    here->B1sNodePrime = tmp->number;
                    if (ckt->CKTcopyNodesets) {
                     if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==0) {
                     if (tmpNode->nsGiven) {
                       tmp->nodeset=tmpNode->nodeset;
                       tmp->nsGiven=tmpNode->nsGiven;
                     }
                  }
                }
                }
            } else {
                here->B1sNodePrime = here->B1sNode;
            }
            if((here->B1DdPtr = SMPmakeElt(matrix,here->B1dNode,here->B1dNode))==(double *)((void *)0)){ return(8);}
            if((here->B1GgPtr = SMPmakeElt(matrix,here->B1gNode,here->B1gNode))==(double *)((void *)0)){ return(8);}
            if((here->B1SsPtr = SMPmakeElt(matrix,here->B1sNode,here->B1sNode))==(double *)((void *)0)){ return(8);}
            if((here->B1BbPtr = SMPmakeElt(matrix,here->B1bNode,here->B1bNode))==(double *)((void *)0)){ return(8);}
            if((here->B1DPdpPtr = SMPmakeElt(matrix,here->B1dNodePrime,here->B1dNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1SPspPtr = SMPmakeElt(matrix,here->B1sNodePrime,here->B1sNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1DdpPtr = SMPmakeElt(matrix,here->B1dNode,here->B1dNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1GbPtr = SMPmakeElt(matrix,here->B1gNode,here->B1bNode))==(double *)((void *)0)){ return(8);}
            if((here->B1GdpPtr = SMPmakeElt(matrix,here->B1gNode,here->B1dNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1GspPtr = SMPmakeElt(matrix,here->B1gNode,here->B1sNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1SspPtr = SMPmakeElt(matrix,here->B1sNode,here->B1sNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1BdpPtr = SMPmakeElt(matrix,here->B1bNode,here->B1dNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1BspPtr = SMPmakeElt(matrix,here->B1bNode,here->B1sNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1DPspPtr = SMPmakeElt(matrix,here->B1dNodePrime,here->B1sNodePrime))==(double *)((void *)0)){ return(8);}
            if((here->B1DPdPtr = SMPmakeElt(matrix,here->B1dNodePrime,here->B1dNode))==(double *)((void *)0)){ return(8);}
            if((here->B1BgPtr = SMPmakeElt(matrix,here->B1bNode,here->B1gNode))==(double *)((void *)0)){ return(8);}
            if((here->B1DPgPtr = SMPmakeElt(matrix,here->B1dNodePrime,here->B1gNode))==(double *)((void *)0)){ return(8);}
            if((here->B1SPgPtr = SMPmakeElt(matrix,here->B1sNodePrime,here->B1gNode))==(double *)((void *)0)){ return(8);}
            if((here->B1SPsPtr = SMPmakeElt(matrix,here->B1sNodePrime,here->B1sNode))==(double *)((void *)0)){ return(8);}
            if((here->B1DPbPtr = SMPmakeElt(matrix,here->B1dNodePrime,here->B1bNode))==(double *)((void *)0)){ return(8);}
            if((here->B1SPbPtr = SMPmakeElt(matrix,here->B1sNodePrime,here->B1bNode))==(double *)((void *)0)){ return(8);}
            if((here->B1SPdpPtr = SMPmakeElt(matrix,here->B1sNodePrime,here->B1dNodePrime))==(double *)((void *)0)){ return(8);}
        }
    }
    return(0);
}

variable_types:
matrix
void *

variable_types: struct sGENmodel { int GENmodType; struct sGENmodel *GENnextModel; struct sGENinstance { struct sGENmodel *GENmodPtr; struct sGENinstance *GENnextInstance; char *GENname; int GENowner; int GENstate; int GENnode1; int GENnode2; int GENnode3; int GENnode4; int GENnode5; int GENnode6; int GENnode7; } *GENinstances; char *GENmodName; } *

variable_types: struct CKTcircuit { struct sGENmodel **CKThead; struct STATistics { int STATnumIter; int STATtranIter; int STAToldIter; int STATtimePts; int STATaccepted; int STATrejected; double STATtotAnalTime; double STATloadTime; double STATdecompTime; double STATsolveTime; double STATreorderTime; double STATcombineTime; double STATsyncTime; double STATtranTime; double STATtranDecompTime; double STATtranSolveTime; double STATtranLoadTime; double STATtranTruncTime; double STATtranCombTime; double STATtranSyncTime; double STATacTime; double STATacDecompTime; double STATacSolveTime; double STATacLoadTime; double STATacCombTime; double STATacSyncTime; } *CKTstat; double *CKTstates[8]; double CKTtime; double CKTdelta; double CKTdeltaOld[7]; double CKTtemp; double CKTnomTemp; double CKTvt; double CKTag[7]; double CKTagp[7]; int CKTorder; int CKTmaxOrder; int CKTintegrateMethod; void *CKTmatrix; int CKTniState; double *CKTrhs; double *CKTrhsOld; double *CKTrhsSpare; double *CKTirhs; double *CKTirhsOld; double *CKTirhsSpare; double *CKTpred; double *CKTsols[8]; double *CKTrhsOp; double *CKTsenRhs; double *CKTseniRhs; int CKTmaxEqNum; int CKTcurrentAnalysis; struct sCKTnode { char *name; int type; int number; double ic; double nodeset; double *ptr; struct sCKTnode *next; unsigned int icGiven; unsigned int nsGiven; } *CKTnodes; struct sCKTnode *CKTlastNode; int CKTnumStates; long CKTmode; int CKTbypass; int CKTdcMaxIter; int CKTdcTrcvMaxIter; int CKTtranMaxIter; int CKTbreakSize; int CKTbreak; double CKTsaveDelta; double CKTminBreak; double *CKTbreaks; double CKTabstol; double CKTpivotAbsTol; double CKTpivotRelTol; double CKTreltol; double CKTchgtol; double CKTvoltTol; double CKTgmin; double CKTgshunt; double CKTdelmin; double CKTtrtol; double CKTfinalTime; double CKTstep; double CKTmaxStep; double CKTinitTime; double CKTomega; double CKTsrcFact; double CKTdiagGmin; int CKTnumSrcSteps; int CKTnumGminSteps; double CKTgminFactor; int CKTnoncon; double CKTdefaultMosM; double CKTdefaultMosL; double CKTdefaultMosW; double CKTdefaultMosAD; double CKTdefaultMosAS; unsigned int CKThadNodeset; unsigned int CKTfixLimit; unsigned int CKTnoOpIter; unsigned int CKTisSetup; struct sJOB { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; } *CKTcurJob; struct SENstruct { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; int SENnumVal; char **SENdevices; char **SENparmNames; unsigned int SENinitflag; unsigned int SENicflag; unsigned int SENstatus; unsigned int SENacpertflag; int SENmode; int SENparms; double SENpertfac; double **SEN_Sap; double **SEN_RHS; double **SEN_iRHS; int SENsize; void *SEN_Jacmat; double *SEN_parmVal; char **SEN_parmName; } *CKTsenInfo; double *CKTtimePoints; double *CKTdeltaList; int CKTtimeListSize; int CKTtimeIndex; int CKTsizeIncr; unsigned int CKTtryToCompact; unsigned int CKTbadMos3; unsigned int CKTkeepOpInfo; unsigned int CKTcopyNodesets; unsigned int CKTnodeDamping; double CKTabsDv; double CKTrelDv; int CKTtroubleNode; struct sGENinstance *CKTtroubleElt; } *

variable_types:
states
int *

variable_types: struct sBSIM1model { int B1modType; struct sBSIM1model *B1nextModel; struct sBSIM1instance { struct sBSIM1model *B1modPtr; struct sBSIM1instance *B1nextInstance; char *B1name; int B1owner; int B1states; int B1dNode; int B1gNode; int B1sNode; int B1bNode; int B1dNodePrime; int B1sNodePrime; double B1l; double B1w; double B1m; double B1drainArea; double B1sourceArea; double B1drainSquares; double B1sourceSquares; double B1drainPerimeter; double B1sourcePerimeter; double B1sourceConductance; double B1drainConductance; double B1icVBS; double B1icVDS; double B1icVGS; double B1von; double B1vdsat; int B1off; int B1mode; double B1vfb; double B1phi; double B1K1; double B1K2; double B1eta; double B1etaB; double B1etaD; double B1betaZero; double B1betaZeroB; double B1betaVdd; double B1betaVddB; double B1betaVddD; double B1ugs; double B1ugsB; double B1uds; double B1udsB; double B1udsD; double B1subthSlope; double B1subthSlopeB; double B1subthSlopeD; double B1GDoverlapCap; double B1GSoverlapCap; double B1GBoverlapCap; double B1vt0; double B1vdd; double B1temp; double B1oxideThickness; unsigned int B1channelChargePartitionFlag; unsigned int B1lGiven; unsigned int B1wGiven; unsigned int B1mGiven; unsigned int B1drainAreaGiven; unsigned int B1sourceAreaGiven; unsigned int B1drainSquaresGiven; unsigned int B1sourceSquaresGiven; unsigned int B1drainPerimeterGiven; unsigned int B1sourcePerimeterGiven; unsigned int B1dNodePrimeSet; unsigned int B1sNodePrimeSet; unsigned int B1icVBSGiven; unsigned int B1icVDSGiven; unsigned int B1icVGSGiven; unsigned int B1vonGiven; unsigned int B1vdsatGiven; double *B1DdPtr; double *B1GgPtr; double *B1SsPtr; double *B1BbPtr; double *B1DPdpPtr; double *B1SPspPtr; double *B1DdpPtr; double *B1GbPtr; double *B1GdpPtr; double *B1GspPtr; double *B1SspPtr; double *B1BdpPtr; double *B1BspPtr; double *B1DPspPtr; double *B1DPdPtr; double *B1BgPtr; double *B1DPgPtr; double *B1SPgPtr; double *B1SPsPtr; double *B1DPbPtr; double *B1SPbPtr; double *B1SPdpPtr; double B1dCoeffs[82]; double B1nVar[3][5]; } *B1instances; char *B1modName; int B1type; double B1vfb0; double B1vfbL; double B1vfbW; double B1phi0; double B1phiL; double B1phiW; double B1K10; double B1K1L; double B1K1W; double B1K20; double B1K2L; double B1K2W; double B1eta0; double B1etaL; double B1etaW; double B1etaB0; double B1etaBl; double B1etaBw; double B1etaD0; double B1etaDl; double B1etaDw; double B1deltaL; double B1deltaW; double B1mobZero; double B1mobZeroB0; double B1mobZeroBl; double B1mobZeroBw; double B1mobVdd0; double B1mobVddl; double B1mobVddw; double B1mobVddB0; double B1mobVddBl; double B1mobVddBw; double B1mobVddD0; double B1mobVddDl; double B1mobVddDw; double B1ugs0; double B1ugsL; double B1ugsW; double B1ugsB0; double B1ugsBL; double B1ugsBW; double B1uds0; double B1udsL; double B1udsW; double B1udsB0; double B1udsBL; double B1udsBW; double B1udsD0; double B1udsDL; double B1udsDW; double B1subthSlope0; double B1subthSlopeL; double B1subthSlopeW; double B1subthSlopeB0; double B1subthSlopeBL; double B1subthSlopeBW; double B1subthSlopeD0; double B1subthSlopeDL; double B1subthSlopeDW; double B1oxideThickness; double B1Cox; double B1temp; double B1vdd; double B1gateSourceOverlapCap; double B1gateDrainOverlapCap; double B1gateBulkOverlapCap; double B1channelChargePartitionFlag; double B1sheetResistance; double B1jctSatCurDensity; double B1bulkJctPotential; double B1bulkJctBotGradingCoeff; double B1bulkJctSideGradingCoeff; double B1sidewallJctPotential; double B1unitAreaJctCap; double B1unitLengthSidewallJctCap; double B1defaultWidth; double B1deltaLength; double B1fNcoef; double B1fNexp; unsigned int B1vfb0Given; unsigned int B1vfbLGiven; unsigned int B1vfbWGiven; unsigned int B1phi0Given; unsigned int B1phiLGiven; unsigned int B1phiWGiven; unsigned int B1K10Given; unsigned int B1K1LGiven; unsigned int B1K1WGiven; unsigned int B1K20Given; unsigned int B1K2LGiven; unsigned int B1K2WGiven; unsigned int B1eta0Given; unsigned int B1etaLGiven; unsigned int B1etaWGiven; unsigned int B1etaB0Given; unsigned int B1etaBlGiven; unsigned int B1etaBwGiven; unsigned int B1etaD0Given; unsigned int B1etaDlGiven; unsigned int B1etaDwGiven; unsigned int B1deltaLGiven; unsigned int B1deltaWGiven; unsigned int B1mobZeroGiven; unsigned int B1mobZeroB0Given; unsigned int B1mobZeroBlGiven; unsigned int B1mobZeroBwGiven; unsigned int B1mobVdd0Given; unsigned int B1mobVddlGiven; unsigned int B1mobVddwGiven; unsigned int B1mobVddB0Given; unsigned int B1mobVddBlGiven; unsigned int B1mobVddBwGiven; unsigned int B1mobVddD0Given; unsigned int B1mobVddDlGiven; unsigned int B1mobVddDwGiven; unsigned int B1ugs0Given; unsigned int B1ugsLGiven; unsigned int B1ugsWGiven; unsigned int B1ugsB0Given; unsigned int B1ugsBLGiven; unsigned int B1ugsBWGiven; unsigned int B1uds0Given; unsigned int B1udsLGiven; unsigned int B1udsWGiven; unsigned int B1udsB0Given; unsigned int B1udsBLGiven; unsigned int B1udsBWGiven; unsigned int B1udsD0Given; unsigned int B1udsDLGiven; unsigned int B1udsDWGiven; unsigned int B1subthSlope0Given; unsigned int B1subthSlopeLGiven; unsigned int B1subthSlopeWGiven; unsigned int B1subthSlopeB0Given; unsigned int B1subthSlopeBLGiven; unsigned int B1subthSlopeBWGiven; unsigned int B1subthSlopeD0Given; unsigned int B1subthSlopeDLGiven; unsigned int B1subthSlopeDWGiven; unsigned int B1oxideThicknessGiven; unsigned int B1tempGiven; unsigned int B1vddGiven; unsigned int B1gateSourceOverlapCapGiven; unsigned int B1gateDrainOverlapCapGiven; unsigned int B1gateBulkOverlapCapGiven; unsigned int B1channelChargePartitionFlagGiven; unsigned int B1sheetResistanceGiven; unsigned int B1jctSatCurDensityGiven; unsigned int B1bulkJctPotentialGiven; unsigned int B1bulkJctBotGradingCoeffGiven; unsigned int B1sidewallJctPotentialGiven; unsigned int B1bulkJctSideGradingCoeffGiven; unsigned int B1unitAreaJctCapGiven; unsigned int B1unitLengthSidewallJctCapGiven; unsigned int B1defaultWidthGiven; unsigned int B1deltaLengthGiven; unsigned int B1fNcoefGiven; unsigned int B1fNexpGiven; unsigned int B1typeGiven; } *

variable_types: struct sBSIM1instance { struct sBSIM1model { int B1modType; struct sBSIM1model *B1nextModel; struct sBSIM1instance *B1instances; char *B1modName; int B1type; double B1vfb0; double B1vfbL; double B1vfbW; double B1phi0; double B1phiL; double B1phiW; double B1K10; double B1K1L; double B1K1W; double B1K20; double B1K2L; double B1K2W; double B1eta0; double B1etaL; double B1etaW; double B1etaB0; double B1etaBl; double B1etaBw; double B1etaD0; double B1etaDl; double B1etaDw; double B1deltaL; double B1deltaW; double B1mobZero; double B1mobZeroB0; double B1mobZeroBl; double B1mobZeroBw; double B1mobVdd0; double B1mobVddl; double B1mobVddw; double B1mobVddB0; double B1mobVddBl; double B1mobVddBw; double B1mobVddD0; double B1mobVddDl; double B1mobVddDw; double B1ugs0; double B1ugsL; double B1ugsW; double B1ugsB0; double B1ugsBL; double B1ugsBW; double B1uds0; double B1udsL; double B1udsW; double B1udsB0; double B1udsBL; double B1udsBW; double B1udsD0; double B1udsDL; double B1udsDW; double B1subthSlope0; double B1subthSlopeL; double B1subthSlopeW; double B1subthSlopeB0; double B1subthSlopeBL; double B1subthSlopeBW; double B1subthSlopeD0; double B1subthSlopeDL; double B1subthSlopeDW; double B1oxideThickness; double B1Cox; double B1temp; double B1vdd; double B1gateSourceOverlapCap; double B1gateDrainOverlapCap; double B1gateBulkOverlapCap; double B1channelChargePartitionFlag; double B1sheetResistance; double B1jctSatCurDensity; double B1bulkJctPotential; double B1bulkJctBotGradingCoeff; double B1bulkJctSideGradingCoeff; double B1sidewallJctPotential; double B1unitAreaJctCap; double B1unitLengthSidewallJctCap; double B1defaultWidth; double B1deltaLength; double B1fNcoef; double B1fNexp; unsigned int B1vfb0Given; unsigned int B1vfbLGiven; unsigned int B1vfbWGiven; unsigned int B1phi0Given; unsigned int B1phiLGiven; unsigned int B1phiWGiven; unsigned int B1K10Given; unsigned int B1K1LGiven; unsigned int B1K1WGiven; unsigned int B1K20Given; unsigned int B1K2LGiven; unsigned int B1K2WGiven; unsigned int B1eta0Given; unsigned int B1etaLGiven; unsigned int B1etaWGiven; unsigned int B1etaB0Given; unsigned int B1etaBlGiven; unsigned int B1etaBwGiven; unsigned int B1etaD0Given; unsigned int B1etaDlGiven; unsigned int B1etaDwGiven; unsigned int B1deltaLGiven; unsigned int B1deltaWGiven; unsigned int B1mobZeroGiven; unsigned int B1mobZeroB0Given; unsigned int B1mobZeroBlGiven; unsigned int B1mobZeroBwGiven; unsigned int B1mobVdd0Given; unsigned int B1mobVddlGiven; unsigned int B1mobVddwGiven; unsigned int B1mobVddB0Given; unsigned int B1mobVddBlGiven; unsigned int B1mobVddBwGiven; unsigned int B1mobVddD0Given; unsigned int B1mobVddDlGiven; unsigned int B1mobVddDwGiven; unsigned int B1ugs0Given; unsigned int B1ugsLGiven; unsigned int B1ugsWGiven; unsigned int B1ugsB0Given; unsigned int B1ugsBLGiven; unsigned int B1ugsBWGiven; unsigned int B1uds0Given; unsigned int B1udsLGiven; unsigned int B1udsWGiven; unsigned int B1udsB0Given; unsigned int B1udsBLGiven; unsigned int B1udsBWGiven; unsigned int B1udsD0Given; unsigned int B1udsDLGiven; unsigned int B1udsDWGiven; unsigned int B1subthSlope0Given; unsigned int B1subthSlopeLGiven; unsigned int B1subthSlopeWGiven; unsigned int B1subthSlopeB0Given; unsigned int B1subthSlopeBLGiven; unsigned int B1subthSlopeBWGiven; unsigned int B1subthSlopeD0Given; unsigned int B1subthSlopeDLGiven; unsigned int B1subthSlopeDWGiven; unsigned int B1oxideThicknessGiven; unsigned int B1tempGiven; unsigned int B1vddGiven; unsigned int B1gateSourceOverlapCapGiven; unsigned int B1gateDrainOverlapCapGiven; unsigned int B1gateBulkOverlapCapGiven; unsigned int B1channelChargePartitionFlagGiven; unsigned int B1sheetResistanceGiven; unsigned int B1jctSatCurDensityGiven; unsigned int B1bulkJctPotentialGiven; unsigned int B1bulkJctBotGradingCoeffGiven; unsigned int B1sidewallJctPotentialGiven; unsigned int B1bulkJctSideGradingCoeffGiven; unsigned int B1unitAreaJctCapGiven; unsigned int B1unitLengthSidewallJctCapGiven; unsigned int B1defaultWidthGiven; unsigned int B1deltaLengthGiven; unsigned int B1fNcoefGiven; unsigned int B1fNexpGiven; unsigned int B1typeGiven; } *B1modPtr; struct sBSIM1instance *B1nextInstance; char *B1name; int B1owner; int B1states; int B1dNode; int B1gNode; int B1sNode; int B1bNode; int B1dNodePrime; int B1sNodePrime; double B1l; double B1w; double B1m; double B1drainArea; double B1sourceArea; double B1drainSquares; double B1sourceSquares; double B1drainPerimeter; double B1sourcePerimeter; double B1sourceConductance; double B1drainConductance; double B1icVBS; double B1icVDS; double B1icVGS; double B1von; double B1vdsat; int B1off; int B1mode; double B1vfb; double B1phi; double B1K1; double B1K2; double B1eta; double B1etaB; double B1etaD; double B1betaZero; double B1betaZeroB; double B1betaVdd; double B1betaVddB; double B1betaVddD; double B1ugs; double B1ugsB; double B1uds; double B1udsB; double B1udsD; double B1subthSlope; double B1subthSlopeB; double B1subthSlopeD; double B1GDoverlapCap; double B1GSoverlapCap; double B1GBoverlapCap; double B1vt0; double B1vdd; double B1temp; double B1oxideThickness; unsigned int B1channelChargePartitionFlag; unsigned int B1lGiven; unsigned int B1wGiven; unsigned int B1mGiven; unsigned int B1drainAreaGiven; unsigned int B1sourceAreaGiven; unsigned int B1drainSquaresGiven; unsigned int B1sourceSquaresGiven; unsigned int B1drainPerimeterGiven; unsigned int B1sourcePerimeterGiven; unsigned int B1dNodePrimeSet; unsigned int B1sNodePrimeSet; unsigned int B1icVBSGiven; unsigned int B1icVDSGiven; unsigned int B1icVGSGiven; unsigned int B1vonGiven; unsigned int B1vdsatGiven; double *B1DdPtr; double *B1GgPtr; double *B1SsPtr; double *B1BbPtr; double *B1DPdpPtr; double *B1SPspPtr; double *B1DdpPtr; double *B1GbPtr; double *B1GdpPtr; double *B1GspPtr; double *B1SspPtr; double *B1BdpPtr; double *B1BspPtr; double *B1DPspPtr; double *B1DPdPtr; double *B1BgPtr; double *B1DPgPtr; double *B1SPgPtr; double *B1SPsPtr; double *B1DPbPtr; double *B1SPbPtr; double *B1SPdpPtr; double B1dCoeffs[82]; double B1nVar[3][5]; } *

variable_types: error int

variable_types:
tmpName
char *

return_type: int

user_defined_types: struct sGENmodel { int GENmodType; struct sGENmodel *GENnextModel; struct sGENinstance *GENinstances; char *GENmodName; }

user_defined_types: struct CKTcircuit { struct sGENmodel **CKThead; struct STATistics *CKTstat; double *CKTstates[8]; double CKTtime; double CKTdelta; double CKTdeltaOld[7]; double CKTtemp; double CKTnomTemp; double CKTvt; double CKTag[7]; double CKTagp[7]; int CKTorder; int CKTmaxOrder; int CKTintegrateMethod; void *CKTmatrix; int CKTniState; double *CKTrhs; double *CKTrhsOld; double *CKTrhsSpare; double *CKTirhs; double *CKTirhsOld; double *CKTirhsSpare; double *CKTpred; double *CKTsols[8]; double *CKTrhsOp; double *CKTsenRhs; double *CKTseniRhs; int CKTmaxEqNum; int CKTcurrentAnalysis; struct sCKTnode *CKTnodes; struct sCKTnode *CKTlastNode; int CKTnumStates; long CKTmode; int CKTbypass; int CKTdcMaxIter; int CKTdcTrcvMaxIter; int CKTtranMaxIter; int CKTbreakSize; int CKTbreak; double CKTsaveDelta; double CKTminBreak; double *CKTbreaks; double CKTabstol; double CKTpivotAbsTol; double CKTpivotRelTol; double CKTreltol; double CKTchgtol; double CKTvoltTol; double CKTgmin; double CKTgshunt; double CKTdelmin; double CKTtrtol; double CKTfinalTime; double CKTstep; double CKTmaxStep; double CKTinitTime; double CKTomega; double CKTsrcFact; double CKTdiagGmin; int CKTnumSrcSteps; int CKTnumGminSteps; double CKTgminFactor; int CKTnoncon; double CKTdefaultMosM; double CKTdefaultMosL; double CKTdefaultMosW; double CKTdefaultMosAD; double CKTdefaultMosAS; unsigned int CKThadNodeset; unsigned int CKTfixLimit; unsigned int CKTnoOpIter; unsigned int CKTisSetup; struct sJOB *CKTcurJob; struct SENstruct *CKTsenInfo; double *CKTtimePoints; double *CKTdeltaList; int CKTtimeListSize; int CKTtimeIndex; int CKTsizeIncr; unsigned int CKTtryToCompact; unsigned int CKTbadMos3; unsigned int CKTkeepOpInfo; unsigned int CKTcopyNodesets; unsigned int CKTnodeDamping; double CKTabsDv; double CKTrelDv; int CKTtroubleNode; struct sGENinstance *CKTtroubleElt; }


CAPmParam

original_code:
int
CAPmParam(int param, IFvalue *value, GENmodel *inModel)
{
    CAPmodel *mod = (CAPmodel*)inModel;
    switch(param) {
        case 109:
     mod->CAPtnom = value->rValue+(273.15);
     mod->CAPtnomGiven = 1;
     break;
        case 107:
     mod->CAPtempCoeff1 = value->rValue;
     mod->CAPtc1Given = 1;
     break;
        case 108:
     mod->CAPtempCoeff2 = value->rValue;
     mod->CAPtc2Given = 1;
     break;
        case 112:
     mod->CAPmCap = value->rValue;
     mod->CAPmCapGiven = 1;
     break;
        case 101 :
            mod->CAPcj = value->rValue;
            mod->CAPcjGiven = 1;
            break;
        case 102 :
            mod->CAPcjsw = value->rValue;
            mod->CAPcjswGiven = 1;
            break;
        case 103:
            mod->CAPdefWidth = value->rValue;
            mod->CAPdefWidthGiven = 1;
            break;
        case 113:
            mod->CAPdefLength = value->rValue;
            mod->CAPdefLengthGiven = 1;
            break;
        case 105:
            mod->CAPnarrow = value->rValue;
            mod->CAPnarrowGiven = 1;
            break;
        case 106:
            mod->CAPshort = value->rValue;
            mod->CAPshortGiven = 1;
            break;
        case 110:
            mod->CAPdi = value->rValue;
            mod->CAPdiGiven = 1;
            break;
        case 111:
            mod->CAPthick = value->rValue;
            mod->CAPthickGiven = 1;
            break;
        case 104:
            break;
        default:
            return(7);
    }
    return(0);
}

canonical_original_code:
int CAPmParam(int param, union uIFvalue *value, struct sGENmodel *inModel)
{
    struct sCAPmodel *mod = (CAPmodel*)inModel;
    switch(param) {
        case 109:
     mod->CAPtnom = value->rValue+(273.15);
     mod->CAPtnomGiven = 1;
     break;
        case 107:
     mod->CAPtempCoeff1 = value->rValue;
     mod->CAPtc1Given = 1;
     break;
        case 108:
     mod->CAPtempCoeff2 = value->rValue;
     mod->CAPtc2Given = 1;
     break;
        case 112:
     mod->CAPmCap = value->rValue;
     mod->CAPmCapGiven = 1;
     break;
        case 101 :
            mod->CAPcj = value->rValue;
            mod->CAPcjGiven = 1;
            break;
        case 102 :
            mod->CAPcjsw = value->rValue;
            mod->CAPcjswGiven = 1;
            break;
        case 103:
            mod->CAPdefWidth = value->rValue;
            mod->CAPdefWidthGiven = 1;
            break;
        case 113:
            mod->CAPdefLength = value->rValue;
            mod->CAPdefLengthGiven = 1;
            break;
        case 105:
            mod->CAPnarrow = value->rValue;
            mod->CAPnarrowGiven = 1;
            break;
        case 106:
            mod->CAPshort = value->rValue;
            mod->CAPshortGiven = 1;
            break;
        case 110:
            mod->CAPdi = value->rValue;
            mod->CAPdiGiven = 1;
            break;
        case 111:
            mod->CAPthick = value->rValue;
            mod->CAPthickGiven = 1;
            break;
        case 104:
            break;
        default:
            return(7);
    }
    return(0);
}

variable_types: param int

variable_types: union uIFvalue { int iValue; double rValue; struct sIFcomplex { double real; double imag; } cValue; char *sValue; char *uValue; void *nValue; struct sIFparseTree { int numVars; int *varTypes; union uIFvalue *vars; int (*IFeval)(struct sIFparseTree *, double, double *, double *, double *); } *tValue; struct { int numValue; union { int *iVec; double *rVec; struct sIFcomplex *cVec; char **sVec; char **uVec; void **nVec; } vec; } v; } *

variable_types: struct sCAPmodel { int CAPmodType; struct sCAPmodel *CAPnextModel; struct sCAPinstance { struct sCAPmodel *CAPmodPtr; struct sCAPinstance *CAPnextInstance; char *CAPname; int CAPowner; int CAPstate; int CAPposNode; int CAPnegNode; double CAPtemp; double CAPdtemp; double CAPcapac; double CAPinitCond; double CAPwidth; double CAPlength; double CAPscale; double CAPm; double *CAPposPosptr; double *CAPnegNegptr; double *CAPposNegptr; double *CAPnegPosptr; unsigned int CAPcapGiven; unsigned int CAPicGiven; unsigned int CAPwidthGiven; unsigned int CAPlengthGiven; unsigned int CAPtempGiven; unsigned int CAPdtempGiven; unsigned int CAPscaleGiven; unsigned int CAPmGiven; int CAPsenParmNo; } *CAPinstances; char *CAPmodName; double CAPtnom; double CAPtempCoeff1; double CAPtempCoeff2; double CAPmCap; double CAPcj; double CAPcjsw; double CAPdefWidth; double CAPdefLength; double CAPnarrow; double CAPshort; double CAPdi; double CAPthick; unsigned int CAPmCapGiven; unsigned int CAPcjGiven; unsigned int CAPcjswGiven; unsigned int CAPdefWidthGiven; unsigned int CAPdefLengthGiven; unsigned int CAPnarrowGiven; unsigned int CAPshortGiven; unsigned int CAPtnomGiven; unsigned int CAPtc1Given; unsigned int CAPtc2Given; unsigned int CAPdiGiven; unsigned int CAPthickGiven; } *

user_defined_types: union uIFvalue { int iValue; double rValue; struct sIFcomplex cValue; char *sValue; char *uValue; void *nValue; struct sIFparseTree *tValue; struct { int numValue; union { int *iVec; double *rVec; struct sIFcomplex *cVec; char **sVec; char **uVec; void **nVec; } vec; } v; }

user_defined_types: struct sCAPmodel { int CAPmodType; struct sCAPmodel *CAPnextModel; struct sCAPinstance *CAPinstances; char *CAPmodName; double CAPtnom; double CAPtempCoeff1; double CAPtempCoeff2; double CAPmCap; double CAPcj; double CAPcjsw; double CAPdefWidth; double CAPdefLength; double CAPnarrow; double CAPshort; double CAPdi; double CAPthick; unsigned int CAPmCapGiven; unsigned int CAPcjGiven; unsigned int CAPcjswGiven; unsigned int CAPdefWidthGiven; unsigned int CAPdefLengthGiven; unsigned int CAPnarrowGiven; unsigned int CAPshortGiven; unsigned int CAPtnomGiven; unsigned int CAPtc1Given; unsigned int CAPtc2Given; unsigned int CAPdiGiven; unsigned int CAPthickGiven; }

user_defined_types: struct sGENinstance { struct sGENmodel *GENmodPtr; struct sGENinstance *GENnextInstance; char *GENname; int GENowner; int GENstate; int GENnode1; int GENnode2; int GENnode3; int GENnode4; int GENnode5; int GENnode6; int GENnode7; }


JFETask

original_code:
int
JFETask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
        IFvalue *select)
{
    JFETinstance *here = (JFETinstance*)inst;
    static char *msg = "Current and power not available for ac analysis";
    switch(which) {
        case 6:
            value->rValue = here->JFETtemp-(273.15);
            return(0);
        case 7:
            value->rValue = here->JFETdtemp;
            return(0);
        case 1:
            value->rValue = here->JFETarea;
            value->rValue *= here->JFETm;
            return(0);
        case 8:
            value->rValue = here->JFETm;
            return(0);
        case 2:
            value->rValue = here->JFETicVDS;
            return(0);
        case 3:
            value->rValue = here->JFETicVGS;
            return(0);
        case 5:
            value->iValue = here->JFEToff;
            return(0);
        case 301:
            value->iValue = here->JFETdrainNode;
            return(0);
        case 302:
            value->iValue = here->JFETgateNode;
            return(0);
        case 303:
            value->iValue = here->JFETsourceNode;
            return(0);
        case 304:
            value->iValue = here->JFETdrainPrimeNode;
            return(0);
        case 305:
            value->iValue = here->JFETsourcePrimeNode;
            return(0);
        case 306:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate);
            return(0);
        case 307:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+1);
            return(0);
        case 308:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+2);
            value->rValue *= here->JFETm;
            return(0);
        case 309:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+3);
            value->rValue *= here->JFETm;
            return(0);
        case 310:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+4);
            value->rValue *= here->JFETm;
            return(0);
        case 311:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+5);
            value->rValue *= here->JFETm;
            return(0);
        case 312:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+6);
            value->rValue *= here->JFETm;
            return(0);
        case 313:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+7);
            value->rValue *= here->JFETm;
            return(0);
        case 314:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+8);
            value->rValue *= here->JFETm;
            return(0);
        case 315:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+9);
            value->rValue *= here->JFETm;
            return(0);
        case 316:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+10);
            value->rValue *= here->JFETm;
            return(0);
        case 317:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+11);
            value->rValue *= here->JFETm;
            return(0);
        case 318:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+12);
            value->rValue *= here->JFETm;
            return(0);
        case 319 :
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned)(strlen(msg)+1));
                errRtn = "JFETask";
                strcpy(errMsg,msg);
                return((100 +11));
            } else {
                value->rValue = -*(ckt->CKTstates[0] + here->JFETstate+3);
                value->rValue -= *(ckt->CKTstates[0] + here->JFETstate+2);
                value->rValue *= here->JFETm;
            }
            return(0);
        case 320 :
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned)(strlen(msg)+1));
                errRtn = "JFETask";
                strcpy(errMsg,msg);
                return((100 +12));
            } else {
                value->rValue = *(ckt->CKTstates[0] + here->JFETstate+3) *
                        *(ckt->CKTrhsOld + here->JFETdrainNode);
                value->rValue += *(ckt->CKTstates[0] + here->JFETstate+2) *
                        *(ckt->CKTrhsOld + here->JFETgateNode);
                value->rValue -= (*(ckt->CKTstates[0] + here->JFETstate+3) +
                        *(ckt->CKTstates[0] + here->JFETstate+2)) *
                *(ckt->CKTrhsOld + here->JFETsourceNode);
                value->rValue *= here->JFETm;
            }
            return(0);
        default:
            return(7);
    }
}

canonical_original_code:
int JFETask(struct CKTcircuit *ckt, struct sGENinstance *inst, int which, union uIFvalue *value, union uIFvalue *select)
{
    struct sJFETinstance *here = (JFETinstance*)inst;
    static char *msg = "Current and power not available for ac analysis";
    switch(which) {
        case 6:
            value->rValue = here->JFETtemp-(273.15);
            return(0);
        case 7:
            value->rValue = here->JFETdtemp;
            return(0);
        case 1:
            value->rValue = here->JFETarea;
            value->rValue *= here->JFETm;
            return(0);
        case 8:
            value->rValue = here->JFETm;
            return(0);
        case 2:
            value->rValue = here->JFETicVDS;
            return(0);
        case 3:
            value->rValue = here->JFETicVGS;
            return(0);
        case 5:
            value->iValue = here->JFEToff;
            return(0);
        case 301:
            value->iValue = here->JFETdrainNode;
            return(0);
        case 302:
            value->iValue = here->JFETgateNode;
            return(0);
        case 303:
            value->iValue = here->JFETsourceNode;
            return(0);
        case 304:
            value->iValue = here->JFETdrainPrimeNode;
            return(0);
        case 305:
            value->iValue = here->JFETsourcePrimeNode;
            return(0);
        case 306:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate);
            return(0);
        case 307:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+1);
            return(0);
        case 308:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+2);
            value->rValue *= here->JFETm;
            return(0);
        case 309:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+3);
            value->rValue *= here->JFETm;
            return(0);
        case 310:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+4);
            value->rValue *= here->JFETm;
            return(0);
        case 311:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+5);
            value->rValue *= here->JFETm;
            return(0);
        case 312:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+6);
            value->rValue *= here->JFETm;
            return(0);
        case 313:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+7);
            value->rValue *= here->JFETm;
            return(0);
        case 314:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+8);
            value->rValue *= here->JFETm;
            return(0);
        case 315:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+9);
            value->rValue *= here->JFETm;
            return(0);
        case 316:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+10);
            value->rValue *= here->JFETm;
            return(0);
        case 317:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+11);
            value->rValue *= here->JFETm;
            return(0);
        case 318:
            value->rValue = *(ckt->CKTstates[0] + here->JFETstate+12);
            value->rValue *= here->JFETm;
            return(0);
        case 319 :
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned int)(strlen(msg)+1));
                errRtn = "JFETask";
                strcpy(errMsg,msg);
                return((100 +11));
            } else {
                value->rValue = -*(ckt->CKTstates[0] + here->JFETstate+3);
                value->rValue -= *(ckt->CKTstates[0] + here->JFETstate+2);
                value->rValue *= here->JFETm;
            }
            return(0);
        case 320 :
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned int)(strlen(msg)+1));
                errRtn = "JFETask";
                strcpy(errMsg,msg);
                return((100 +12));
            } else {
                value->rValue = *(ckt->CKTstates[0] + here->JFETstate+3) *
                        *(ckt->CKTrhsOld + here->JFETdrainNode);
                value->rValue += *(ckt->CKTstates[0] + here->JFETstate+2) *
                        *(ckt->CKTrhsOld + here->JFETgateNode);
                value->rValue -= (*(ckt->CKTstates[0] + here->JFETstate+3) +
                        *(ckt->CKTstates[0] + here->JFETstate+2)) *
                *(ckt->CKTrhsOld + here->JFETsourceNode);
                value->rValue *= here->JFETm;
            }
            return(0);
        default:
            return(7);
    }
}

variable_types: struct CKTcircuit { struct sGENmodel { int GENmodType; struct sGENmodel *GENnextModel; struct sGENinstance { struct sGENmodel *GENmodPtr; struct sGENinstance *GENnextInstance; char *GENname; int GENowner; int GENstate; int GENnode1; int GENnode2; int GENnode3; int GENnode4; int GENnode5; int GENnode6; int GENnode7; } *GENinstances; char *GENmodName; } **CKThead; struct STATistics { int STATnumIter; int STATtranIter; int STAToldIter; int STATtimePts; int STATaccepted; int STATrejected; double STATtotAnalTime; double STATloadTime; double STATdecompTime; double STATsolveTime; double STATreorderTime; double STATcombineTime; double STATsyncTime; double STATtranTime; double STATtranDecompTime; double STATtranSolveTime; double STATtranLoadTime; double STATtranTruncTime; double STATtranCombTime; double STATtranSyncTime; double STATacTime; double STATacDecompTime; double STATacSolveTime; double STATacLoadTime; double STATacCombTime; double STATacSyncTime; } *CKTstat; double *CKTstates[8]; double CKTtime; double CKTdelta; double CKTdeltaOld[7]; double CKTtemp; double CKTnomTemp; double CKTvt; double CKTag[7]; double CKTagp[7]; int CKTorder; int CKTmaxOrder; int CKTintegrateMethod; void *CKTmatrix; int CKTniState; double *CKTrhs; double *CKTrhsOld; double *CKTrhsSpare; double *CKTirhs; double *CKTirhsOld; double *CKTirhsSpare; double *CKTpred; double *CKTsols[8]; double *CKTrhsOp; double *CKTsenRhs; double *CKTseniRhs; int CKTmaxEqNum; int CKTcurrentAnalysis; struct sCKTnode { char *name; int type; int number; double ic; double nodeset; double *ptr; struct sCKTnode *next; unsigned int icGiven; unsigned int nsGiven; } *CKTnodes; struct sCKTnode *CKTlastNode; int CKTnumStates; long CKTmode; int CKTbypass; int CKTdcMaxIter; int CKTdcTrcvMaxIter; int CKTtranMaxIter; int CKTbreakSize; int CKTbreak; double CKTsaveDelta; double CKTminBreak; double *CKTbreaks; double CKTabstol; double CKTpivotAbsTol; double CKTpivotRelTol; double CKTreltol; double CKTchgtol; double CKTvoltTol; double CKTgmin; double CKTgshunt; double CKTdelmin; double CKTtrtol; double CKTfinalTime; double CKTstep; double CKTmaxStep; double CKTinitTime; double CKTomega; double CKTsrcFact; double CKTdiagGmin; int CKTnumSrcSteps; int CKTnumGminSteps; double CKTgminFactor; int CKTnoncon; double CKTdefaultMosM; double CKTdefaultMosL; double CKTdefaultMosW; double CKTdefaultMosAD; double CKTdefaultMosAS; unsigned int CKThadNodeset; unsigned int CKTfixLimit; unsigned int CKTnoOpIter; unsigned int CKTisSetup; struct sJOB { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; } *CKTcurJob; struct SENstruct { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; int SENnumVal; char **SENdevices; char **SENparmNames; unsigned int SENinitflag; unsigned int SENicflag; unsigned int SENstatus; unsigned int SENacpertflag; int SENmode; int SENparms; double SENpertfac; double **SEN_Sap; double **SEN_RHS; double **SEN_iRHS; int SENsize; void *SEN_Jacmat; double *SEN_parmVal; char **SEN_parmName; } *CKTsenInfo; double *CKTtimePoints; double *CKTdeltaList; int CKTtimeListSize; int CKTtimeIndex; int CKTsizeIncr; unsigned int CKTtryToCompact; unsigned int CKTbadMos3; unsigned int CKTkeepOpInfo; unsigned int CKTcopyNodesets; unsigned int CKTnodeDamping; double CKTabsDv; double CKTrelDv; int CKTtroubleNode; struct sGENinstance *CKTtroubleElt; } *

variable_types:
inst
struct sGENinstance *

variable_types: which int

variable_types:
select
union uIFvalue *

variable_types: struct sJFETinstance { struct sJFETmodel { int JFETmodType; struct sJFETmodel *JFETnextModel; struct sJFETinstance *JFETinstances; char *JFETmodName; int JFETtype; double JFETthreshold; double JFETbeta; double JFETlModulation; double JFETdrainResist; double JFETsourceResist; double JFETcapGS; double JFETcapGD; double JFETgatePotential; double JFETgateSatCurrent; double JFETdepletionCapCoeff; double JFETfNcoef; double JFETfNexp; double JFETdrainConduct; double JFETsourceConduct; double JFETf2; double JFETf3; double JFETb; double JFETbFac; double JFETtnom; unsigned int JFETthresholdGiven; unsigned int JFETbetaGiven; unsigned int JFETlModulationGiven; unsigned int JFETdrainResistGiven; unsigned int JFETsourceResistGiven; unsigned int JFETcapGSGiven; unsigned int JFETcapGDGiven; unsigned int JFETgatePotentialGiven; unsigned int JFETgateSatCurrentGiven; unsigned int JFETdepletionCapCoeffGiven; unsigned int JFETbGiven; unsigned int JFETtnomGiven; unsigned int JFETfNcoefGiven; unsigned int JFETfNexpGiven; } *JFETmodPtr; struct sJFETinstance *JFETnextInstance; char *JFETname; int JFETowner; int JFETstate; int JFETdrainNode; int JFETgateNode; int JFETsourceNode; int JFETdrainPrimeNode; int JFETsourcePrimeNode; double *JFETdrainDrainPrimePtr; double *JFETgateDrainPrimePtr; double *JFETgateSourcePrimePtr; double *JFETsourceSourcePrimePtr; double *JFETdrainPrimeDrainPtr; double *JFETdrainPrimeGatePtr; double *JFETdrainPrimeSourcePrimePtr; double *JFETsourcePrimeGatePtr; double *JFETsourcePrimeSourcePtr; double *JFETsourcePrimeDrainPrimePtr; double *JFETdrainDrainPtr; double *JFETgateGatePtr; double *JFETsourceSourcePtr; double *JFETdrainPrimeDrainPrimePtr; double *JFETsourcePrimeSourcePrimePtr; int JFETmode; double JFETdCoeffs[21]; double JFETnVar[3][5]; unsigned int JFEToff; unsigned int JFETareaGiven; unsigned int JFETmGiven; unsigned int JFETicVDSGiven; unsigned int JFETicVGSGiven; unsigned int JFETtempGiven; unsigned int JFETdtempGiven; double JFETarea; double JFETm; double JFETicVDS; double JFETicVGS; double JFETtemp; double JFETdtemp; double JFETtSatCur; double JFETtGatePot; double JFETtCGS; double JFETtCGD; double JFETcorDepCap; double JFETvcrit; double JFETf1; } *

variable_types:
msg
char *

user_defined_types: struct sJFETinstance { struct sJFETmodel *JFETmodPtr; struct sJFETinstance *JFETnextInstance; char *JFETname; int JFETowner; int JFETstate; int JFETdrainNode; int JFETgateNode; int JFETsourceNode; int JFETdrainPrimeNode; int JFETsourcePrimeNode; double *JFETdrainDrainPrimePtr; double *JFETgateDrainPrimePtr; double *JFETgateSourcePrimePtr; double *JFETsourceSourcePrimePtr; double *JFETdrainPrimeDrainPtr; double *JFETdrainPrimeGatePtr; double *JFETdrainPrimeSourcePrimePtr; double *JFETsourcePrimeGatePtr; double *JFETsourcePrimeSourcePtr; double *JFETsourcePrimeDrainPrimePtr; double *JFETdrainDrainPtr; double *JFETgateGatePtr; double *JFETsourceSourcePtr; double *JFETdrainPrimeDrainPrimePtr; double *JFETsourcePrimeSourcePrimePtr; int JFETmode; double JFETdCoeffs[21]; double JFETnVar[3][5]; unsigned int JFEToff; unsigned int JFETareaGiven; unsigned int JFETmGiven; unsigned int JFETicVDSGiven; unsigned int JFETicVGSGiven; unsigned int JFETtempGiven; unsigned int JFETdtempGiven; double JFETarea; double JFETm; double JFETicVDS; double JFETicVGS; double JFETtemp; double JFETdtemp; double JFETtSatCur; double JFETtGatePot; double JFETtCGS; double JFETtCGD; double JFETcorDepCap; double JFETvcrit; double JFETf1; }

user_defined_types: struct sIFcomplex { double real; double imag; }

user_defined_types: struct sIFparseTree { int numVars; int *varTypes; union uIFvalue *vars; int (*IFeval)(struct sIFparseTree *, double, double *, double *, double *); }


INDparam

original_code:
int
INDparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
{
    INDinstance *here = (INDinstance*)inst;
    switch(param) {
        case 1:
            here->INDinduct = value->rValue;
     if (!here->INDmGiven)
         here->INDm =1.0;
            here->INDindGiven = 1;
            break;
        case 9:
            here->INDtemp = value->rValue + (273.15);
            here->INDtempGiven = 1;
            break;
        case 10:
            here->INDdtemp = value->rValue;
            here->INDdtempGiven = 1;
            break;
        case 8:
            here->INDm = value->rValue;
            here->INDmGiven = 1;
            break;
        case 11:
            here->INDscale = value->rValue;
            here->INDscaleGiven = 1;
            break;
 case 12:
            here->INDnt = value->rValue;
            here->INDntGiven = 1;
            break;
        case 2:
            here->INDinitCond = value->rValue;
            here->INDicGiven = 1;
            break;
        case 5:
            here->INDsenParmNo = value->iValue;
            break;
        default:
            return(7);
    }
    return(0);
}

canonical_original_code:
int INDparam(int param, union uIFvalue *value, struct sGENinstance *inst, union uIFvalue *select)
{
    struct sINDinstance *here = (INDinstance*)inst;
    switch(param) {
        case 1:
            here->INDinduct = value->rValue;
     if (!here->INDmGiven)
         here->INDm =1.0;
            here->INDindGiven = 1;
            break;
        case 9:
            here->INDtemp = value->rValue + (273.15);
            here->INDtempGiven = 1;
            break;
        case 10:
            here->INDdtemp = value->rValue;
            here->INDdtempGiven = 1;
            break;
        case 8:
            here->INDm = value->rValue;
            here->INDmGiven = 1;
            break;
        case 11:
            here->INDscale = value->rValue;
            here->INDscaleGiven = 1;
            break;
 case 12:
            here->INDnt = value->rValue;
            here->INDntGiven = 1;
            break;
        case 2:
            here->INDinitCond = value->rValue;
            here->INDicGiven = 1;
            break;
        case 5:
            here->INDsenParmNo = value->iValue;
            break;
        default:
            return(7);
    }
    return(0);
}

variable_types: struct sGENinstance { struct sGENmodel { int GENmodType; struct sGENmodel *GENnextModel; struct sGENinstance *GENinstances; char *GENmodName; } *GENmodPtr; struct sGENinstance *GENnextInstance; char *GENname; int GENowner; int GENstate; int GENnode1; int GENnode2; int GENnode3; int GENnode4; int GENnode5; int GENnode6; int GENnode7; } *

variable_types: struct sINDinstance { struct sINDmodel { int INDmodType; struct sINDmodel *INDnextModel; struct sINDinstance *INDinstances; char *INDmodName; double INDmInd; double INDtnom; double INDtempCoeff1; double INDtempCoeff2; double INDcsect; double INDlength; double INDmodNt; double INDmu; unsigned int INDtnomGiven; unsigned int INDtc1Given; unsigned int INDtc2Given; unsigned int INDcsectGiven; unsigned int INDlengthGiven; unsigned int INDmodNtGiven; unsigned int INDmuGiven; unsigned int INDmIndGiven; double INDspecInd; } *INDmodPtr; struct sINDinstance *INDnextInstance; char *INDname; int INDowner; int INDstate; int INDposNode; int INDnegNode; int INDbrEq; double INDinduct; double INDm; double INDtemp; double INDdtemp; double INDscale; double INDnt; double INDinitCond; double *INDposIbrptr; double *INDnegIbrptr; double *INDibrNegptr; double *INDibrPosptr; double *INDibrIbrptr; unsigned int INDindGiven; unsigned int INDicGiven; unsigned int INDmGiven; unsigned int INDtempGiven; unsigned int INDdtempGiven; unsigned int INDscaleGiven; unsigned int INDntGiven; int INDsenParmNo; } *

user_defined_types: struct sINDinstance { struct sINDmodel *INDmodPtr; struct sINDinstance *INDnextInstance; char *INDname; int INDowner; int INDstate; int INDposNode; int INDnegNode; int INDbrEq; double INDinduct; double INDm; double INDtemp; double INDdtemp; double INDscale; double INDnt; double INDinitCond; double *INDposIbrptr; double *INDnegIbrptr; double *INDibrNegptr; double *INDibrPosptr; double *INDibrIbrptr; unsigned int INDindGiven; unsigned int INDicGiven; unsigned int INDmGiven; unsigned int INDtempGiven; unsigned int INDdtempGiven; unsigned int INDscaleGiven; unsigned int INDntGiven; int INDsenParmNo; }


INDask

original_code:
int
INDask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
       IFvalue *select)
{
    INDinstance *here = (INDinstance*)inst;
    double vr;
    double vi;
    double sr;
    double si;
    double vm;
    static char *msg = "Current and power not available for ac analysis";
    switch(which) {
        case 3:
            value->rValue = *(ckt->CKTstates[0]+here->INDstate);
            return(0);
        case 4:
            value->rValue = *(ckt->CKTstates[0]+here->INDstate+1);
            return(0);
        case 1:
            value->rValue = here->INDinduct;
            return(0);
        case 2:
            value->rValue = here->INDinitCond;
            return(0);
        case 9:
            value->rValue = here->INDtemp - (273.15);
            return(0);
        case 10:
            value->rValue = here->INDdtemp;
            return(0);
        case 8:
            value->rValue = here->INDm;
            return(0);
        case 11:
            value->rValue = here->INDscale;
            return(0);
 case 12:
            value->rValue = here->INDnt;
            return(0);
        case 6 :
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned)(strlen(msg)+1));
                errRtn = "INDask";
                strcpy(errMsg,msg);
                return((100 +11));
            } else {
                value->rValue = *(ckt->CKTrhsOld + here->INDbrEq);
            }
            return(0);
        case 7 :
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned)(strlen(msg)+1));
                errRtn = "INDask";
                strcpy(errMsg,msg);
                return((100 +12));
            } else {
                value->rValue = *(ckt->CKTrhsOld + here->INDbrEq) *
                        *(ckt->CKTstates[0]+here->INDstate+1);
            }
            return(0);
        case 206:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
                        here->INDsenParmNo);
            }
            return(0);
        case 201:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                    here->INDsenParmNo);
            }
            return(0);
        case 202:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->INDsenParmNo);
            }
            return(0);
        case 203:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = sqrt(vr*vr + vi*vi);
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->INDsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->INDsenParmNo);
                value->rValue = (vr * sr + vi * si)/vm;
            }
            return(0);
        case 204:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = vr*vr + vi*vi;
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->INDsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->INDsenParmNo);
                value->rValue = (vr * si - vi * sr)/vm;
            }
            return(0);
        case 205:
            if(ckt->CKTsenInfo){
                value->cValue.real=
                        *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->INDsenParmNo);
                value->cValue.imag=
                        *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->INDsenParmNo);
            }
            return(0);
        default:
            return(7);
    }
}

canonical_original_code:
int INDask(struct CKTcircuit *ckt, struct sGENinstance *inst, int which, union uIFvalue *value, union uIFvalue *select)
{
    struct sINDinstance *here = (INDinstance*)inst;
    double vr;
    double vi;
    double sr;
    double si;
    double vm;
    static char *msg = "Current and power not available for ac analysis";
    switch(which) {
        case 3:
            value->rValue = *(ckt->CKTstates[0]+here->INDstate);
            return(0);
        case 4:
            value->rValue = *(ckt->CKTstates[0]+here->INDstate+1);
            return(0);
        case 1:
            value->rValue = here->INDinduct;
            return(0);
        case 2:
            value->rValue = here->INDinitCond;
            return(0);
        case 9:
            value->rValue = here->INDtemp - (273.15);
            return(0);
        case 10:
            value->rValue = here->INDdtemp;
            return(0);
        case 8:
            value->rValue = here->INDm;
            return(0);
        case 11:
            value->rValue = here->INDscale;
            return(0);
 case 12:
            value->rValue = here->INDnt;
            return(0);
        case 6 :
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned int)(strlen(msg)+1));
                errRtn = "INDask";
                strcpy(errMsg,msg);
                return((100 +11));
            } else {
                value->rValue = *(ckt->CKTrhsOld + here->INDbrEq);
            }
            return(0);
        case 7 :
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned int)(strlen(msg)+1));
                errRtn = "INDask";
                strcpy(errMsg,msg);
                return((100 +12));
            } else {
                value->rValue = *(ckt->CKTrhsOld + here->INDbrEq) *
                        *(ckt->CKTstates[0]+here->INDstate+1);
            }
            return(0);
        case 206:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
                        here->INDsenParmNo);
            }
            return(0);
        case 201:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                    here->INDsenParmNo);
            }
            return(0);
        case 202:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->INDsenParmNo);
            }
            return(0);
        case 203:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = sqrt(vr*vr + vi*vi);
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->INDsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->INDsenParmNo);
                value->rValue = (vr * sr + vi * si)/vm;
            }
            return(0);
        case 204:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = vr*vr + vi*vi;
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->INDsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->INDsenParmNo);
                value->rValue = (vr * si - vi * sr)/vm;
            }
            return(0);
        case 205:
            if(ckt->CKTsenInfo){
                value->cValue.real=
                        *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->INDsenParmNo);
                value->cValue.imag=
                        *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->INDsenParmNo);
            }
            return(0);
        default:
            return(7);
    }
}

variable_types: vr double

variable_types: vi double

variable_types: sr double

variable_types: si double

variable_types: vm double

user_defined_types: struct STATistics { int STATnumIter; int STATtranIter; int STAToldIter; int STATtimePts; int STATaccepted; int STATrejected; double STATtotAnalTime; double STATloadTime; double STATdecompTime; double STATsolveTime; double STATreorderTime; double STATcombineTime; double STATsyncTime; double STATtranTime; double STATtranDecompTime; double STATtranSolveTime; double STATtranLoadTime; double STATtranTruncTime; double STATtranCombTime; double STATtranSyncTime; double STATacTime; double STATacDecompTime; double STATacSolveTime; double STATacLoadTime; double STATacCombTime; double STATacSyncTime; }

user_defined_types: struct sCKTnode { char *name; int type; int number; double ic; double nodeset; double *ptr; struct sCKTnode *next; unsigned int icGiven; unsigned int nsGiven; }

user_defined_types: struct sJOB { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; }

user_defined_types: struct SENstruct { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; int SENnumVal; char **SENdevices; char **SENparmNames; unsigned int SENinitflag; unsigned int SENicflag; unsigned int SENstatus; unsigned int SENacpertflag; int SENmode; int SENparms; double SENpertfac; double **SEN_Sap; double **SEN_RHS; double **SEN_iRHS; int SENsize; void *SEN_Jacmat; double *SEN_parmVal; char **SEN_parmName; }

user_defined_types: struct sINDmodel { int INDmodType; struct sINDmodel *INDnextModel; struct sINDinstance *INDinstances; char *INDmodName; double INDmInd; double INDtnom; double INDtempCoeff1; double INDtempCoeff2; double INDcsect; double INDlength; double INDmodNt; double INDmu; unsigned int INDtnomGiven; unsigned int INDtc1Given; unsigned int INDtc2Given; unsigned int INDcsectGiven; unsigned int INDlengthGiven; unsigned int INDmodNtGiven; unsigned int INDmuGiven; unsigned int INDmIndGiven; double INDspecInd; }