diff --git a/src/spicelib/devices/hisim2/hsm2bindCSC.c b/src/spicelib/devices/hisim2/hsm2bindCSC.c index 7f0afd5d0..7466116a7 100644 --- a/src/spicelib/devices/hisim2/hsm2bindCSC.c +++ b/src/spicelib/devices/hisim2/hsm2bindCSC.c @@ -1,5 +1,5 @@ /********** -Author: 2012 Francesco Lannutti +Author: 2013 Francesco Lannutti **********/ #include "ngspice/ngspice.h" @@ -7,592 +7,568 @@ Author: 2012 Francesco Lannutti #include "hsm2def.h" #include "ngspice/sperror.h" +#include + +static int -HSM2bindCSC(GENmodel *inModel, CKTcircuit *ckt) +BindCompare (const void *a, const void *b) { - HSM2model *model = (HSM2model *)inModel; - int i ; + BindElement *A, *B ; + A = (BindElement *)a ; + B = (BindElement *)b ; - /* loop through all the hsm2 models */ - for( ; model != NULL; model = model->HSM2nextModel ) { - HSM2instance *here; - - /* loop through all the instances of the model */ - for (here = model->HSM2instances; here != NULL ; - here = here->HSM2nextInstance) { - - i = 0 ; - if ((here-> HSM2dNodePrime != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2DPbpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2DPbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2sNodePrime != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2SPbpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2SPbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2gNodePrime != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2GPbpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2GPbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2BPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2BPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2BPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2BPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2gNodePrime != 0)) { - while (here->HSM2BPgpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2BPgpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2BPbpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2BPbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2dNode != 0) && (here-> HSM2dNode != 0)) { - while (here->HSM2DdPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2DdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2gNodePrime != 0) && (here-> HSM2gNodePrime != 0)) { - while (here->HSM2GPgpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2GPgpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2sNode != 0) && (here-> HSM2sNode != 0)) { - while (here->HSM2SsPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2SsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2DPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2DPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2SPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2SPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2dNode != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2DdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2DdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2gNodePrime != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2GPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2GPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2gNodePrime != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2GPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2GPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2sNode != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2SspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2SspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2dNodePrime != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2DPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2DPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dNode != 0)) { - while (here->HSM2DPdPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2DPdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2dNodePrime != 0) && (here-> HSM2gNodePrime != 0)) { - while (here->HSM2DPgpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2DPgpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2sNodePrime != 0) && (here-> HSM2gNodePrime != 0)) { - while (here->HSM2SPgpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2SPgpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sNode != 0)) { - while (here->HSM2SPsPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2SPsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2sNodePrime != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2SPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2SPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - if ( here->HSM2_corg == 1 ) { - - i = 0 ; - if ((here-> HSM2gNode != 0) && (here-> HSM2gNode != 0)) { - while (here->HSM2GgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2GgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2gNode != 0) && (here-> HSM2gNodePrime != 0)) { - while (here->HSM2GgpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2GgpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2gNodePrime != 0) && (here-> HSM2gNode != 0)) { - while (here->HSM2GPgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2GPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2gNode != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2GdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2GdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2gNode != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2GspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2GspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2gNode != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2GbpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2GbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - } /* IF */ - - if ( here->HSM2_corbnet == 1 ) { /* consider body resistance net */ - - i = 0 ; - if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dbNode != 0)) { - while (here->HSM2DPdbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2DPdbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sbNode != 0)) { - while (here->HSM2SPsbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2SPsbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2dbNode != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2DBdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2DBdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2dbNode != 0) && (here-> HSM2dbNode != 0)) { - while (here->HSM2DBdbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2DBdbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2dbNode != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2DBbpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2DBbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2dbNode != 0) && (here-> HSM2bNode != 0)) { - while (here->HSM2DBbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2DBbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2dbNode != 0)) { - while (here->HSM2BPdbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2BPdbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2bNode != 0)) { - while (here->HSM2BPbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2BPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2sbNode != 0)) { - while (here->HSM2BPsbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2BPsbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2sbNode != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2SBspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2SBspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2sbNode != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2SBbpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2SBbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2sbNode != 0) && (here-> HSM2bNode != 0)) { - while (here->HSM2SBbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2SBbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2sbNode != 0) && (here-> HSM2sbNode != 0)) { - while (here->HSM2SBsbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2SBsbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2bNode != 0) && (here-> HSM2dbNode != 0)) { - while (here->HSM2BdbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2BdbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2bNode != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2BbpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2BbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2bNode != 0) && (here-> HSM2sbNode != 0)) { - while (here->HSM2BsbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2BsbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> HSM2bNode != 0) && (here-> HSM2bNode != 0)) { - while (here->HSM2BbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->HSM2BbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - } /* IF */ - } - } - return(OK); + return ((int)(A->Sparse - B->Sparse)) ; } int -HSM2bindCSCComplex(GENmodel *inModel, CKTcircuit *ckt) +HSM2bindCSC (GENmodel *inModel, CKTcircuit *ckt) { - HSM2model *model = (HSM2model *)inModel; - int i ; + HSM2model *model = (HSM2model *)inModel ; + HSM2instance *here ; + double *i ; + BindElement *matched, *BindStruct ; + size_t nz ; - /* loop through all the hsm2 models */ - for( ; model != NULL; model = model->HSM2nextModel ) { - HSM2instance *here; + BindStruct = ckt->CKTmatrix->CKTbindStruct ; + nz = (size_t)ckt->CKTmatrix->CKTklunz ; + /* loop through all the HSM2 models */ + for ( ; model != NULL ; model = model->HSM2nextModel) + { /* loop through all the instances of the model */ - for (here = model->HSM2instances; here != NULL ; - here = here->HSM2nextInstance) { + for (here = model->HSM2instances ; here != NULL ; here = here->HSM2nextInstance) + { + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2bNodePrime != 0)) + { + i = here->HSM2DPbpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2DPbpStructPtr = matched ; + here->HSM2DPbpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2dNodePrime != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2DPbpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2DPbpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2bNodePrime != 0)) + { + i = here->HSM2SPbpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2SPbpStructPtr = matched ; + here->HSM2SPbpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2sNodePrime != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2SPbpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2SPbpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2bNodePrime != 0)) + { + i = here->HSM2GPbpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2GPbpStructPtr = matched ; + here->HSM2GPbpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2gNodePrime != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2GPbpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2GPbpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2dNodePrime != 0)) + { + i = here->HSM2BPdpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2BPdpStructPtr = matched ; + here->HSM2BPdpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2BPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2BPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2sNodePrime != 0)) + { + i = here->HSM2BPspPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2BPspStructPtr = matched ; + here->HSM2BPspPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2BPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2BPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2gNodePrime != 0)) + { + i = here->HSM2BPgpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2BPgpStructPtr = matched ; + here->HSM2BPgpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2gNodePrime != 0)) { - while (here->HSM2BPgpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2BPgpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2bNodePrime != 0)) + { + i = here->HSM2BPbpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2BPbpStructPtr = matched ; + here->HSM2BPbpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2BPbpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2BPbpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2dNode != 0) && (here-> HSM2dNode != 0)) + { + i = here->HSM2DdPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2DdStructPtr = matched ; + here->HSM2DdPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2dNode != 0) && (here-> HSM2dNode != 0)) { - while (here->HSM2DdPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2DdPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2gNodePrime != 0)) + { + i = here->HSM2GPgpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2GPgpStructPtr = matched ; + here->HSM2GPgpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2gNodePrime != 0) && (here-> HSM2gNodePrime != 0)) { - while (here->HSM2GPgpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2GPgpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2sNode != 0) && (here-> HSM2sNode != 0)) + { + i = here->HSM2SsPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2SsStructPtr = matched ; + here->HSM2SsPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2sNode != 0) && (here-> HSM2sNode != 0)) { - while (here->HSM2SsPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2SsPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dNodePrime != 0)) + { + i = here->HSM2DPdpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2DPdpStructPtr = matched ; + here->HSM2DPdpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2DPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2DPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sNodePrime != 0)) + { + i = here->HSM2SPspPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2SPspStructPtr = matched ; + here->HSM2SPspPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2SPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2SPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2dNode != 0) && (here-> HSM2dNodePrime != 0)) + { + i = here->HSM2DdpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2DdpStructPtr = matched ; + here->HSM2DdpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2dNode != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2DdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2DdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2dNodePrime != 0)) + { + i = here->HSM2GPdpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2GPdpStructPtr = matched ; + here->HSM2GPdpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2gNodePrime != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2GPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2GPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2sNodePrime != 0)) + { + i = here->HSM2GPspPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2GPspStructPtr = matched ; + here->HSM2GPspPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2gNodePrime != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2GPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2GPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2sNode != 0) && (here-> HSM2sNodePrime != 0)) + { + i = here->HSM2SspPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2SspStructPtr = matched ; + here->HSM2SspPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2sNode != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2SspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2SspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2sNodePrime != 0)) + { + i = here->HSM2DPspPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2DPspStructPtr = matched ; + here->HSM2DPspPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2dNodePrime != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2DPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2DPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dNode != 0)) + { + i = here->HSM2DPdPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2DPdStructPtr = matched ; + here->HSM2DPdPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dNode != 0)) { - while (here->HSM2DPdPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2DPdPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2gNodePrime != 0)) + { + i = here->HSM2DPgpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2DPgpStructPtr = matched ; + here->HSM2DPgpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2dNodePrime != 0) && (here-> HSM2gNodePrime != 0)) { - while (here->HSM2DPgpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2DPgpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2gNodePrime != 0)) + { + i = here->HSM2SPgpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2SPgpStructPtr = matched ; + here->HSM2SPgpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2sNodePrime != 0) && (here-> HSM2gNodePrime != 0)) { - while (here->HSM2SPgpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2SPgpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sNode != 0)) + { + i = here->HSM2SPsPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2SPsStructPtr = matched ; + here->HSM2SPsPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sNode != 0)) { - while (here->HSM2SPsPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2SPsPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2dNodePrime != 0)) + { + i = here->HSM2SPdpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2SPdpStructPtr = matched ; + here->HSM2SPdpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2sNodePrime != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2SPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2SPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ( here->HSM2_corg == 1 ) + { + if ((here-> HSM2gNode != 0) && (here-> HSM2gNode != 0)) + { + i = here->HSM2GgPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2GgStructPtr = matched ; + here->HSM2GgPtr = matched->CSC ; + } - if ( here->HSM2_corg == 1 ) { + if ((here-> HSM2gNode != 0) && (here-> HSM2gNodePrime != 0)) + { + i = here->HSM2GgpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2GgpStructPtr = matched ; + here->HSM2GgpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2gNode != 0) && (here-> HSM2gNode != 0)) { - while (here->HSM2GgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2GgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2gNode != 0)) + { + i = here->HSM2GPgPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2GPgStructPtr = matched ; + here->HSM2GPgPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2gNode != 0) && (here-> HSM2gNodePrime != 0)) { - while (here->HSM2GgpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2GgpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2gNode != 0) && (here-> HSM2dNodePrime != 0)) + { + i = here->HSM2GdpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2GdpStructPtr = matched ; + here->HSM2GdpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2gNodePrime != 0) && (here-> HSM2gNode != 0)) { - while (here->HSM2GPgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2GPgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2gNode != 0) && (here-> HSM2sNodePrime != 0)) + { + i = here->HSM2GspPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2GspStructPtr = matched ; + here->HSM2GspPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2gNode != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2GdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2GdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2gNode != 0) && (here-> HSM2bNodePrime != 0)) + { + i = here->HSM2GbpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2GbpStructPtr = matched ; + here->HSM2GbpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2gNode != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2GspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2GspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + } + if ( here->HSM2_corbnet == 1 ) + { + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dbNode != 0)) + { + i = here->HSM2DPdbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2DPdbStructPtr = matched ; + here->HSM2DPdbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2gNode != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2GbpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2GbpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } - } /* IF */ + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sbNode != 0)) + { + i = here->HSM2SPsbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2SPsbStructPtr = matched ; + here->HSM2SPsbPtr = matched->CSC ; + } - if ( here->HSM2_corbnet == 1 ) { /* consider body resistance net */ + if ((here-> HSM2dbNode != 0) && (here-> HSM2dNodePrime != 0)) + { + i = here->HSM2DBdpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2DBdpStructPtr = matched ; + here->HSM2DBdpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dbNode != 0)) { - while (here->HSM2DPdbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2DPdbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2dbNode != 0) && (here-> HSM2dbNode != 0)) + { + i = here->HSM2DBdbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2DBdbStructPtr = matched ; + here->HSM2DBdbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sbNode != 0)) { - while (here->HSM2SPsbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2SPsbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2dbNode != 0) && (here-> HSM2bNodePrime != 0)) + { + i = here->HSM2DBbpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2DBbpStructPtr = matched ; + here->HSM2DBbpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2dbNode != 0) && (here-> HSM2dNodePrime != 0)) { - while (here->HSM2DBdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2DBdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2dbNode != 0) && (here-> HSM2bNode != 0)) + { + i = here->HSM2DBbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2DBbStructPtr = matched ; + here->HSM2DBbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2dbNode != 0) && (here-> HSM2dbNode != 0)) { - while (here->HSM2DBdbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2DBdbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2dbNode != 0)) + { + i = here->HSM2BPdbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2BPdbStructPtr = matched ; + here->HSM2BPdbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2dbNode != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2DBbpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2DBbpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2bNode != 0)) + { + i = here->HSM2BPbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2BPbStructPtr = matched ; + here->HSM2BPbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2dbNode != 0) && (here-> HSM2bNode != 0)) { - while (here->HSM2DBbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2DBbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2sbNode != 0)) + { + i = here->HSM2BPsbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2BPsbStructPtr = matched ; + here->HSM2BPsbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2dbNode != 0)) { - while (here->HSM2BPdbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2BPdbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2sbNode != 0) && (here-> HSM2sNodePrime != 0)) + { + i = here->HSM2SBspPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2SBspStructPtr = matched ; + here->HSM2SBspPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2bNode != 0)) { - while (here->HSM2BPbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2BPbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2sbNode != 0) && (here-> HSM2bNodePrime != 0)) + { + i = here->HSM2SBbpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2SBbpStructPtr = matched ; + here->HSM2SBbpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2bNodePrime != 0) && (here-> HSM2sbNode != 0)) { - while (here->HSM2BPsbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2BPsbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2sbNode != 0) && (here-> HSM2bNode != 0)) + { + i = here->HSM2SBbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2SBbStructPtr = matched ; + here->HSM2SBbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2sbNode != 0) && (here-> HSM2sNodePrime != 0)) { - while (here->HSM2SBspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2SBspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2sbNode != 0) && (here-> HSM2sbNode != 0)) + { + i = here->HSM2SBsbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2SBsbStructPtr = matched ; + here->HSM2SBsbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2sbNode != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2SBbpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2SBbpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2bNode != 0) && (here-> HSM2dbNode != 0)) + { + i = here->HSM2BdbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2BdbStructPtr = matched ; + here->HSM2BdbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2sbNode != 0) && (here-> HSM2bNode != 0)) { - while (here->HSM2SBbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2SBbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2bNode != 0) && (here-> HSM2bNodePrime != 0)) + { + i = here->HSM2BbpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2BbpStructPtr = matched ; + here->HSM2BbpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2sbNode != 0) && (here-> HSM2sbNode != 0)) { - while (here->HSM2SBsbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2SBsbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2bNode != 0) && (here-> HSM2sbNode != 0)) + { + i = here->HSM2BsbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2BsbStructPtr = matched ; + here->HSM2BsbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2bNode != 0) && (here-> HSM2dbNode != 0)) { - while (here->HSM2BdbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2BdbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> HSM2bNode != 0) && (here-> HSM2bNode != 0)) + { + i = here->HSM2BbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->HSM2BbStructPtr = matched ; + here->HSM2BbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> HSM2bNode != 0) && (here-> HSM2bNodePrime != 0)) { - while (here->HSM2BbpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2BbpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } - - i = 0 ; - if ((here-> HSM2bNode != 0) && (here-> HSM2sbNode != 0)) { - while (here->HSM2BsbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2BsbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } - - i = 0 ; - if ((here-> HSM2bNode != 0) && (here-> HSM2bNode != 0)) { - while (here->HSM2BbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->HSM2BbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } - } /* IF */ - } + } + } } - return(OK); + + return (OK) ; +} + +int +HSM2bindCSCComplex (GENmodel *inModel, CKTcircuit *ckt) +{ + HSM2model *model = (HSM2model *)inModel ; + HSM2instance *here ; + + NG_IGNORE (ckt) ; + + /* loop through all the HSM2 models */ + for ( ; model != NULL ; model = model->HSM2nextModel) + { + /* loop through all the instances of the model */ + for (here = model->HSM2instances ; here != NULL ; here = here->HSM2nextInstance) + { + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2DPbpPtr = here->HSM2DPbpStructPtr->CSC_Complex ; + + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2SPbpPtr = here->HSM2SPbpStructPtr->CSC_Complex ; + + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2GPbpPtr = here->HSM2GPbpStructPtr->CSC_Complex ; + + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2BPdpPtr = here->HSM2BPdpStructPtr->CSC_Complex ; + + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2BPspPtr = here->HSM2BPspStructPtr->CSC_Complex ; + + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2gNodePrime != 0)) + here->HSM2BPgpPtr = here->HSM2BPgpStructPtr->CSC_Complex ; + + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2BPbpPtr = here->HSM2BPbpStructPtr->CSC_Complex ; + + if ((here-> HSM2dNode != 0) && (here-> HSM2dNode != 0)) + here->HSM2DdPtr = here->HSM2DdStructPtr->CSC_Complex ; + + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2gNodePrime != 0)) + here->HSM2GPgpPtr = here->HSM2GPgpStructPtr->CSC_Complex ; + + if ((here-> HSM2sNode != 0) && (here-> HSM2sNode != 0)) + here->HSM2SsPtr = here->HSM2SsStructPtr->CSC_Complex ; + + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2DPdpPtr = here->HSM2DPdpStructPtr->CSC_Complex ; + + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2SPspPtr = here->HSM2SPspStructPtr->CSC_Complex ; + + if ((here-> HSM2dNode != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2DdpPtr = here->HSM2DdpStructPtr->CSC_Complex ; + + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2GPdpPtr = here->HSM2GPdpStructPtr->CSC_Complex ; + + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2GPspPtr = here->HSM2GPspStructPtr->CSC_Complex ; + + if ((here-> HSM2sNode != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2SspPtr = here->HSM2SspStructPtr->CSC_Complex ; + + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2DPspPtr = here->HSM2DPspStructPtr->CSC_Complex ; + + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dNode != 0)) + here->HSM2DPdPtr = here->HSM2DPdStructPtr->CSC_Complex ; + + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2gNodePrime != 0)) + here->HSM2DPgpPtr = here->HSM2DPgpStructPtr->CSC_Complex ; + + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2gNodePrime != 0)) + here->HSM2SPgpPtr = here->HSM2SPgpStructPtr->CSC_Complex ; + + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sNode != 0)) + here->HSM2SPsPtr = here->HSM2SPsStructPtr->CSC_Complex ; + + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2SPdpPtr = here->HSM2SPdpStructPtr->CSC_Complex ; + + if ( here->HSM2_corg == 1 ) + { + if ((here-> HSM2gNode != 0) && (here-> HSM2gNode != 0)) + here->HSM2GgPtr = here->HSM2GgStructPtr->CSC_Complex ; + + if ((here-> HSM2gNode != 0) && (here-> HSM2gNodePrime != 0)) + here->HSM2GgpPtr = here->HSM2GgpStructPtr->CSC_Complex ; + + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2gNode != 0)) + here->HSM2GPgPtr = here->HSM2GPgStructPtr->CSC_Complex ; + + if ((here-> HSM2gNode != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2GdpPtr = here->HSM2GdpStructPtr->CSC_Complex ; + + if ((here-> HSM2gNode != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2GspPtr = here->HSM2GspStructPtr->CSC_Complex ; + + if ((here-> HSM2gNode != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2GbpPtr = here->HSM2GbpStructPtr->CSC_Complex ; + + } + if ( here->HSM2_corbnet == 1 ) + { + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dbNode != 0)) + here->HSM2DPdbPtr = here->HSM2DPdbStructPtr->CSC_Complex ; + + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sbNode != 0)) + here->HSM2SPsbPtr = here->HSM2SPsbStructPtr->CSC_Complex ; + + if ((here-> HSM2dbNode != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2DBdpPtr = here->HSM2DBdpStructPtr->CSC_Complex ; + + if ((here-> HSM2dbNode != 0) && (here-> HSM2dbNode != 0)) + here->HSM2DBdbPtr = here->HSM2DBdbStructPtr->CSC_Complex ; + + if ((here-> HSM2dbNode != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2DBbpPtr = here->HSM2DBbpStructPtr->CSC_Complex ; + + if ((here-> HSM2dbNode != 0) && (here-> HSM2bNode != 0)) + here->HSM2DBbPtr = here->HSM2DBbStructPtr->CSC_Complex ; + + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2dbNode != 0)) + here->HSM2BPdbPtr = here->HSM2BPdbStructPtr->CSC_Complex ; + + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2bNode != 0)) + here->HSM2BPbPtr = here->HSM2BPbStructPtr->CSC_Complex ; + + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2sbNode != 0)) + here->HSM2BPsbPtr = here->HSM2BPsbStructPtr->CSC_Complex ; + + if ((here-> HSM2sbNode != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2SBspPtr = here->HSM2SBspStructPtr->CSC_Complex ; + + if ((here-> HSM2sbNode != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2SBbpPtr = here->HSM2SBbpStructPtr->CSC_Complex ; + + if ((here-> HSM2sbNode != 0) && (here-> HSM2bNode != 0)) + here->HSM2SBbPtr = here->HSM2SBbStructPtr->CSC_Complex ; + + if ((here-> HSM2sbNode != 0) && (here-> HSM2sbNode != 0)) + here->HSM2SBsbPtr = here->HSM2SBsbStructPtr->CSC_Complex ; + + if ((here-> HSM2bNode != 0) && (here-> HSM2dbNode != 0)) + here->HSM2BdbPtr = here->HSM2BdbStructPtr->CSC_Complex ; + + if ((here-> HSM2bNode != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2BbpPtr = here->HSM2BbpStructPtr->CSC_Complex ; + + if ((here-> HSM2bNode != 0) && (here-> HSM2sbNode != 0)) + here->HSM2BsbPtr = here->HSM2BsbStructPtr->CSC_Complex ; + + if ((here-> HSM2bNode != 0) && (here-> HSM2bNode != 0)) + here->HSM2BbPtr = here->HSM2BbStructPtr->CSC_Complex ; + + } + } + } + + return (OK) ; } int @@ -600,330 +576,158 @@ HSM2bindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt) { HSM2model *model = (HSM2model *)inModel ; HSM2instance *here ; - int i ; - /* loop through all the hsm2 models */ + NG_IGNORE (ckt) ; + + /* loop through all the HSM2 models */ for ( ; model != NULL ; model = model->HSM2nextModel) { /* loop through all the instances of the model */ for (here = model->HSM2instances ; here != NULL ; here = here->HSM2nextInstance) { - i = 0 ; - if ((here->HSM2dNodePrime != 0) && (here->HSM2bNodePrime != 0)) - { - while (here->HSM2DPbpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2DPbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2DPbpPtr = here->HSM2DPbpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2sNodePrime != 0) && (here->HSM2bNodePrime != 0)) - { - while (here->HSM2SPbpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2SPbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2SPbpPtr = here->HSM2SPbpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2gNodePrime != 0) && (here->HSM2bNodePrime != 0)) - { - while (here->HSM2GPbpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2GPbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2GPbpPtr = here->HSM2GPbpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2bNodePrime != 0) && (here->HSM2dNodePrime != 0)) - { - while (here->HSM2BPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2BPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2BPdpPtr = here->HSM2BPdpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2bNodePrime != 0) && (here->HSM2sNodePrime != 0)) - { - while (here->HSM2BPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2BPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2BPspPtr = here->HSM2BPspStructPtr->CSC ; - i = 0 ; - if ((here->HSM2bNodePrime != 0) && (here->HSM2gNodePrime != 0)) - { - while (here->HSM2BPgpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2BPgpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2gNodePrime != 0)) + here->HSM2BPgpPtr = here->HSM2BPgpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2bNodePrime != 0) && (here->HSM2bNodePrime != 0)) - { - while (here->HSM2BPbpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2BPbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2BPbpPtr = here->HSM2BPbpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2dNode != 0) && (here->HSM2dNode != 0)) - { - while (here->HSM2DdPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2DdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2dNode != 0) && (here-> HSM2dNode != 0)) + here->HSM2DdPtr = here->HSM2DdStructPtr->CSC ; - i = 0 ; - if ((here->HSM2gNodePrime != 0) && (here->HSM2gNodePrime != 0)) - { - while (here->HSM2GPgpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2GPgpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2gNodePrime != 0)) + here->HSM2GPgpPtr = here->HSM2GPgpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2sNode != 0) && (here->HSM2sNode != 0)) - { - while (here->HSM2SsPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2SsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2sNode != 0) && (here-> HSM2sNode != 0)) + here->HSM2SsPtr = here->HSM2SsStructPtr->CSC ; - i = 0 ; - if ((here->HSM2dNodePrime != 0) && (here->HSM2dNodePrime != 0)) - { - while (here->HSM2DPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2DPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2DPdpPtr = here->HSM2DPdpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2sNodePrime != 0) && (here->HSM2sNodePrime != 0)) - { - while (here->HSM2SPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2SPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2SPspPtr = here->HSM2SPspStructPtr->CSC ; - i = 0 ; - if ((here->HSM2dNode != 0) && (here->HSM2dNodePrime != 0)) - { - while (here->HSM2DdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2DdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2dNode != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2DdpPtr = here->HSM2DdpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2gNodePrime != 0) && (here->HSM2dNodePrime != 0)) - { - while (here->HSM2GPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2GPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2GPdpPtr = here->HSM2GPdpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2gNodePrime != 0) && (here->HSM2sNodePrime != 0)) - { - while (here->HSM2GPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2GPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2GPspPtr = here->HSM2GPspStructPtr->CSC ; - i = 0 ; - if ((here->HSM2sNode != 0) && (here->HSM2sNodePrime != 0)) - { - while (here->HSM2SspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2SspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2sNode != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2SspPtr = here->HSM2SspStructPtr->CSC ; - i = 0 ; - if ((here->HSM2dNodePrime != 0) && (here->HSM2sNodePrime != 0)) - { - while (here->HSM2DPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2DPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2DPspPtr = here->HSM2DPspStructPtr->CSC ; - i = 0 ; - if ((here->HSM2dNodePrime != 0) && (here->HSM2dNode != 0)) - { - while (here->HSM2DPdPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2DPdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dNode != 0)) + here->HSM2DPdPtr = here->HSM2DPdStructPtr->CSC ; - i = 0 ; - if ((here->HSM2dNodePrime != 0) && (here->HSM2gNodePrime != 0)) - { - while (here->HSM2DPgpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2DPgpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2gNodePrime != 0)) + here->HSM2DPgpPtr = here->HSM2DPgpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2sNodePrime != 0) && (here->HSM2gNodePrime != 0)) - { - while (here->HSM2SPgpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2SPgpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2gNodePrime != 0)) + here->HSM2SPgpPtr = here->HSM2SPgpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2sNodePrime != 0) && (here->HSM2sNode != 0)) - { - while (here->HSM2SPsPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2SPsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sNode != 0)) + here->HSM2SPsPtr = here->HSM2SPsStructPtr->CSC ; - i = 0 ; - if ((here->HSM2sNodePrime != 0) && (here->HSM2dNodePrime != 0)) - { - while (here->HSM2SPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2SPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2SPdpPtr = here->HSM2SPdpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2gNode != 0) && (here->HSM2gNode != 0)) + if ( here->HSM2_corg == 1 ) { - while (here->HSM2GgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2GgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2gNode != 0) && (here-> HSM2gNode != 0)) + here->HSM2GgPtr = here->HSM2GgStructPtr->CSC ; - i = 0 ; - if ((here->HSM2gNode != 0) && (here->HSM2gNodePrime != 0)) - { - while (here->HSM2GgpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2GgpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2gNode != 0) && (here-> HSM2gNodePrime != 0)) + here->HSM2GgpPtr = here->HSM2GgpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2gNodePrime != 0) && (here->HSM2gNode != 0)) - { - while (here->HSM2GPgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2GPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2gNodePrime != 0) && (here-> HSM2gNode != 0)) + here->HSM2GPgPtr = here->HSM2GPgStructPtr->CSC ; - i = 0 ; - if ((here->HSM2gNode != 0) && (here->HSM2dNodePrime != 0)) - { - while (here->HSM2GdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2GdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2gNode != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2GdpPtr = here->HSM2GdpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2gNode != 0) && (here->HSM2sNodePrime != 0)) - { - while (here->HSM2GspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2GspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2gNode != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2GspPtr = here->HSM2GspStructPtr->CSC ; - i = 0 ; - if ((here->HSM2gNode != 0) && (here->HSM2bNodePrime != 0)) - { - while (here->HSM2GbpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2GbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2gNode != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2GbpPtr = here->HSM2GbpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2dNodePrime != 0) && (here->HSM2dbNode != 0)) - { - while (here->HSM2DPdbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2DPdbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; } - - i = 0 ; - if ((here->HSM2sNodePrime != 0) && (here->HSM2sbNode != 0)) + if ( here->HSM2_corbnet == 1 ) { - while (here->HSM2SPsbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2SPsbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2dNodePrime != 0) && (here-> HSM2dbNode != 0)) + here->HSM2DPdbPtr = here->HSM2DPdbStructPtr->CSC ; - i = 0 ; - if ((here->HSM2dbNode != 0) && (here->HSM2dNodePrime != 0)) - { - while (here->HSM2DBdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2DBdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2sNodePrime != 0) && (here-> HSM2sbNode != 0)) + here->HSM2SPsbPtr = here->HSM2SPsbStructPtr->CSC ; - i = 0 ; - if ((here->HSM2dbNode != 0) && (here->HSM2dbNode != 0)) - { - while (here->HSM2DBdbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2DBdbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2dbNode != 0) && (here-> HSM2dNodePrime != 0)) + here->HSM2DBdpPtr = here->HSM2DBdpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2dbNode != 0) && (here->HSM2bNodePrime != 0)) - { - while (here->HSM2DBbpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2DBbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2dbNode != 0) && (here-> HSM2dbNode != 0)) + here->HSM2DBdbPtr = here->HSM2DBdbStructPtr->CSC ; - i = 0 ; - if ((here->HSM2dbNode != 0) && (here->HSM2bNode != 0)) - { - while (here->HSM2DBbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2DBbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2dbNode != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2DBbpPtr = here->HSM2DBbpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2bNodePrime != 0) && (here->HSM2dbNode != 0)) - { - while (here->HSM2BPdbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2BPdbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2dbNode != 0) && (here-> HSM2bNode != 0)) + here->HSM2DBbPtr = here->HSM2DBbStructPtr->CSC ; - i = 0 ; - if ((here->HSM2bNodePrime != 0) && (here->HSM2bNode != 0)) - { - while (here->HSM2BPbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2BPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2dbNode != 0)) + here->HSM2BPdbPtr = here->HSM2BPdbStructPtr->CSC ; - i = 0 ; - if ((here->HSM2bNodePrime != 0) && (here->HSM2sbNode != 0)) - { - while (here->HSM2BPsbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2BPsbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2bNode != 0)) + here->HSM2BPbPtr = here->HSM2BPbStructPtr->CSC ; - i = 0 ; - if ((here->HSM2sbNode != 0) && (here->HSM2sNodePrime != 0)) - { - while (here->HSM2SBspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2SBspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2bNodePrime != 0) && (here-> HSM2sbNode != 0)) + here->HSM2BPsbPtr = here->HSM2BPsbStructPtr->CSC ; - i = 0 ; - if ((here->HSM2sbNode != 0) && (here->HSM2bNodePrime != 0)) - { - while (here->HSM2SBbpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2SBbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2sbNode != 0) && (here-> HSM2sNodePrime != 0)) + here->HSM2SBspPtr = here->HSM2SBspStructPtr->CSC ; - i = 0 ; - if ((here->HSM2sbNode != 0) && (here->HSM2bNode != 0)) - { - while (here->HSM2SBbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2SBbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2sbNode != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2SBbpPtr = here->HSM2SBbpStructPtr->CSC ; - i = 0 ; - if ((here->HSM2sbNode != 0) && (here->HSM2sbNode != 0)) - { - while (here->HSM2SBsbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2SBsbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2sbNode != 0) && (here-> HSM2bNode != 0)) + here->HSM2SBbPtr = here->HSM2SBbStructPtr->CSC ; - i = 0 ; - if ((here->HSM2bNode != 0) && (here->HSM2dbNode != 0)) - { - while (here->HSM2BdbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2BdbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2sbNode != 0) && (here-> HSM2sbNode != 0)) + here->HSM2SBsbPtr = here->HSM2SBsbStructPtr->CSC ; - i = 0 ; - if ((here->HSM2bNode != 0) && (here->HSM2bNodePrime != 0)) - { - while (here->HSM2BbpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2BbpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2bNode != 0) && (here-> HSM2dbNode != 0)) + here->HSM2BdbPtr = here->HSM2BdbStructPtr->CSC ; - i = 0 ; - if ((here->HSM2bNode != 0) && (here->HSM2sbNode != 0)) - { - while (here->HSM2BsbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2BsbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> HSM2bNode != 0) && (here-> HSM2bNodePrime != 0)) + here->HSM2BbpPtr = here->HSM2BbpStructPtr->CSC ; + + if ((here-> HSM2bNode != 0) && (here-> HSM2sbNode != 0)) + here->HSM2BsbPtr = here->HSM2BsbStructPtr->CSC ; + + if ((here-> HSM2bNode != 0) && (here-> HSM2bNode != 0)) + here->HSM2BbPtr = here->HSM2BbStructPtr->CSC ; - i = 0 ; - if ((here->HSM2bNode != 0) && (here->HSM2bNode != 0)) - { - while (here->HSM2BbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->HSM2BbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; } } } return (OK) ; -} \ No newline at end of file +} diff --git a/src/spicelib/devices/hisim2/hsm2def.h b/src/spicelib/devices/hisim2/hsm2def.h index d24ae6faf..b6700f19d 100644 --- a/src/spicelib/devices/hisim2/hsm2def.h +++ b/src/spicelib/devices/hisim2/hsm2def.h @@ -584,6 +584,54 @@ typedef struct sHSM2instance { double **HSM2nVar; #endif /* NONOISE */ +#ifdef KLU + BindElement *HSM2DPbpStructPtr ; + BindElement *HSM2SPbpStructPtr ; + BindElement *HSM2GPbpStructPtr ; + BindElement *HSM2BPdpStructPtr ; + BindElement *HSM2BPspStructPtr ; + BindElement *HSM2BPgpStructPtr ; + BindElement *HSM2BPbpStructPtr ; + BindElement *HSM2DdStructPtr ; + BindElement *HSM2GPgpStructPtr ; + BindElement *HSM2SsStructPtr ; + BindElement *HSM2DPdpStructPtr ; + BindElement *HSM2SPspStructPtr ; + BindElement *HSM2DdpStructPtr ; + BindElement *HSM2GPdpStructPtr ; + BindElement *HSM2GPspStructPtr ; + BindElement *HSM2SspStructPtr ; + BindElement *HSM2DPspStructPtr ; + BindElement *HSM2DPdStructPtr ; + BindElement *HSM2DPgpStructPtr ; + BindElement *HSM2SPgpStructPtr ; + BindElement *HSM2SPsStructPtr ; + BindElement *HSM2SPdpStructPtr ; + BindElement *HSM2GgStructPtr ; + BindElement *HSM2GgpStructPtr ; + BindElement *HSM2GPgStructPtr ; + BindElement *HSM2GdpStructPtr ; + BindElement *HSM2GspStructPtr ; + BindElement *HSM2GbpStructPtr ; + BindElement *HSM2DPdbStructPtr ; + BindElement *HSM2SPsbStructPtr ; + BindElement *HSM2DBdpStructPtr ; + BindElement *HSM2DBdbStructPtr ; + BindElement *HSM2DBbpStructPtr ; + BindElement *HSM2DBbStructPtr ; + BindElement *HSM2BPdbStructPtr ; + BindElement *HSM2BPbStructPtr ; + BindElement *HSM2BPsbStructPtr ; + BindElement *HSM2SBspStructPtr ; + BindElement *HSM2SBbpStructPtr ; + BindElement *HSM2SBbStructPtr ; + BindElement *HSM2SBsbStructPtr ; + BindElement *HSM2BdbStructPtr ; + BindElement *HSM2BbpStructPtr ; + BindElement *HSM2BsbStructPtr ; + BindElement *HSM2BbStructPtr ; +#endif + } HSM2instance ;