From 913490b20cfb2d9e12c26a4354e04c045d26fe39 Mon Sep 17 00:00:00 2001 From: Francesco Lannutti Date: Mon, 1 Apr 2013 22:22:29 +0200 Subject: [PATCH] New Binding Method extended to BSIM3v32 device --- src/spicelib/devices/bsim3v32/b3v32bindCSC.c | 976 ++++++++----------- src/spicelib/devices/bsim3v32/bsim3v32def.h | 34 + 2 files changed, 456 insertions(+), 554 deletions(-) diff --git a/src/spicelib/devices/bsim3v32/b3v32bindCSC.c b/src/spicelib/devices/bsim3v32/b3v32bindCSC.c index 933d3968f..02513e0ef 100644 --- a/src/spicelib/devices/bsim3v32/b3v32bindCSC.c +++ b/src/spicelib/devices/bsim3v32/b3v32bindCSC.c @@ -1,5 +1,5 @@ /********** -Author: 2012 Francesco Lannutti +Author: 2013 Francesco Lannutti **********/ #include "ngspice/ngspice.h" @@ -7,412 +7,402 @@ Author: 2012 Francesco Lannutti #include "bsim3v32def.h" #include "ngspice/sperror.h" +#include + +static int -BSIM3v32bindCSC(GENmodel *inModel, CKTcircuit *ckt) +BindCompare (const void *a, const void *b) { - BSIM3v32model *model = (BSIM3v32model *)inModel; - int i ; + BindElement *A, *B ; + A = (BindElement *)a ; + B = (BindElement *)b ; - /* loop through all the b3v32 models */ - for( ; model != NULL; model = model->BSIM3v32nextModel ) { - BSIM3v32instance *here; - - /* loop through all the instances of the model */ - for (here = model->BSIM3v32instances; here != NULL ; - here = here->BSIM3v32nextInstance) { - - i = 0 ; - if ((here-> BSIM3v32dNode != 0) && (here-> BSIM3v32dNode != 0)) { - while (here->BSIM3v32DdPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32DdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32gNode != 0)) { - while (here->BSIM3v32GgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32GgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32sNode != 0) && (here-> BSIM3v32sNode != 0)) { - while (here->BSIM3v32SsPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32SsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32bNode != 0)) { - while (here->BSIM3v32BbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32BbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32dNodePrime != 0)) { - while (here->BSIM3v32DPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32DPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32sNodePrime != 0)) { - while (here->BSIM3v32SPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32SPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32dNode != 0) && (here-> BSIM3v32dNodePrime != 0)) { - while (here->BSIM3v32DdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32DdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32bNode != 0)) { - while (here->BSIM3v32GbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32GbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32dNodePrime != 0)) { - while (here->BSIM3v32GdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32GdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32sNodePrime != 0)) { - while (here->BSIM3v32GspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32GspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32sNode != 0) && (here-> BSIM3v32sNodePrime != 0)) { - while (here->BSIM3v32SspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32SspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32dNodePrime != 0)) { - while (here->BSIM3v32BdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32BdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32sNodePrime != 0)) { - while (here->BSIM3v32BspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32BspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32sNodePrime != 0)) { - while (here->BSIM3v32DPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32DPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32dNode != 0)) { - while (here->BSIM3v32DPdPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32DPdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32gNode != 0)) { - while (here->BSIM3v32BgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32BgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32gNode != 0)) { - while (here->BSIM3v32DPgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32DPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32gNode != 0)) { - while (here->BSIM3v32SPgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32SPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32sNode != 0)) { - while (here->BSIM3v32SPsPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32SPsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32bNode != 0)) { - while (here->BSIM3v32DPbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32DPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32bNode != 0)) { - while (here->BSIM3v32SPbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32SPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32dNodePrime != 0)) { - while (here->BSIM3v32SPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32SPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32qNode != 0)) { - while (here->BSIM3v32QqPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32QqPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32dNodePrime != 0)) { - while (here->BSIM3v32QdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32QdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32sNodePrime != 0)) { - while (here->BSIM3v32QspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32QspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32gNode != 0)) { - while (here->BSIM3v32QgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32QgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32bNode != 0)) { - while (here->BSIM3v32QbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32QbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32qNode != 0)) { - while (here->BSIM3v32DPqPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32DPqPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32qNode != 0)) { - while (here->BSIM3v32SPqPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32SPqPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32qNode != 0)) { - while (here->BSIM3v32GqPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32GqPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - - i = 0 ; - if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32qNode != 0)) { - while (here->BSIM3v32BqPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ; - here->BSIM3v32BqPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } - } - } - return(OK); + return ((int)(A->Sparse - B->Sparse)) ; } int -BSIM3v32bindCSCComplex(GENmodel *inModel, CKTcircuit *ckt) +BSIM3v32bindCSC (GENmodel *inModel, CKTcircuit *ckt) { - BSIM3v32model *model = (BSIM3v32model *)inModel; - int i ; + BSIM3v32model *model = (BSIM3v32model *)inModel ; + BSIM3v32instance *here ; + double *i ; + BindElement *matched, *BindStruct ; + size_t nz ; - /* loop through all the b3v32 models */ - for( ; model != NULL; model = model->BSIM3v32nextModel ) { - BSIM3v32instance *here; + BindStruct = ckt->CKTmatrix->CKTbindStruct ; + nz = (size_t)ckt->CKTmatrix->CKTklunz ; + /* loop through all the BSIM3v32 models */ + for ( ; model != NULL ; model = model->BSIM3v32nextModel) + { /* loop through all the instances of the model */ - for (here = model->BSIM3v32instances; here != NULL ; - here = here->BSIM3v32nextInstance) { + for (here = model->BSIM3v32instances ; here != NULL ; here = here->BSIM3v32nextInstance) + { + if ((here-> BSIM3v32dNode != 0) && (here-> BSIM3v32dNode != 0)) + { + i = here->BSIM3v32DdPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32DdStructPtr = matched ; + here->BSIM3v32DdPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32dNode != 0) && (here-> BSIM3v32dNode != 0)) { - while (here->BSIM3v32DdPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32DdPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32gNode != 0)) + { + i = here->BSIM3v32GgPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32GgStructPtr = matched ; + here->BSIM3v32GgPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32gNode != 0)) { - while (here->BSIM3v32GgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32GgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32sNode != 0) && (here-> BSIM3v32sNode != 0)) + { + i = here->BSIM3v32SsPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32SsStructPtr = matched ; + here->BSIM3v32SsPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32sNode != 0) && (here-> BSIM3v32sNode != 0)) { - while (here->BSIM3v32SsPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32SsPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32bNode != 0)) + { + i = here->BSIM3v32BbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32BbStructPtr = matched ; + here->BSIM3v32BbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32bNode != 0)) { - while (here->BSIM3v32BbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32BbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32dNodePrime != 0)) + { + i = here->BSIM3v32DPdpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32DPdpStructPtr = matched ; + here->BSIM3v32DPdpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32dNodePrime != 0)) { - while (here->BSIM3v32DPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32DPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32sNodePrime != 0)) + { + i = here->BSIM3v32SPspPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32SPspStructPtr = matched ; + here->BSIM3v32SPspPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32sNodePrime != 0)) { - while (here->BSIM3v32SPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32SPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32dNode != 0) && (here-> BSIM3v32dNodePrime != 0)) + { + i = here->BSIM3v32DdpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32DdpStructPtr = matched ; + here->BSIM3v32DdpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32dNode != 0) && (here-> BSIM3v32dNodePrime != 0)) { - while (here->BSIM3v32DdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32DdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32bNode != 0)) + { + i = here->BSIM3v32GbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32GbStructPtr = matched ; + here->BSIM3v32GbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32bNode != 0)) { - while (here->BSIM3v32GbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32GbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32dNodePrime != 0)) + { + i = here->BSIM3v32GdpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32GdpStructPtr = matched ; + here->BSIM3v32GdpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32dNodePrime != 0)) { - while (here->BSIM3v32GdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32GdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32sNodePrime != 0)) + { + i = here->BSIM3v32GspPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32GspStructPtr = matched ; + here->BSIM3v32GspPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32sNodePrime != 0)) { - while (here->BSIM3v32GspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32GspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32sNode != 0) && (here-> BSIM3v32sNodePrime != 0)) + { + i = here->BSIM3v32SspPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32SspStructPtr = matched ; + here->BSIM3v32SspPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32sNode != 0) && (here-> BSIM3v32sNodePrime != 0)) { - while (here->BSIM3v32SspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32SspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32dNodePrime != 0)) + { + i = here->BSIM3v32BdpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32BdpStructPtr = matched ; + here->BSIM3v32BdpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32dNodePrime != 0)) { - while (here->BSIM3v32BdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32BdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32sNodePrime != 0)) + { + i = here->BSIM3v32BspPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32BspStructPtr = matched ; + here->BSIM3v32BspPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32sNodePrime != 0)) { - while (here->BSIM3v32BspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32BspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32sNodePrime != 0)) + { + i = here->BSIM3v32DPspPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32DPspStructPtr = matched ; + here->BSIM3v32DPspPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32sNodePrime != 0)) { - while (here->BSIM3v32DPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32DPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32dNode != 0)) + { + i = here->BSIM3v32DPdPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32DPdStructPtr = matched ; + here->BSIM3v32DPdPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32dNode != 0)) { - while (here->BSIM3v32DPdPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32DPdPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32gNode != 0)) + { + i = here->BSIM3v32BgPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32BgStructPtr = matched ; + here->BSIM3v32BgPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32gNode != 0)) { - while (here->BSIM3v32BgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32BgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32gNode != 0)) + { + i = here->BSIM3v32DPgPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32DPgStructPtr = matched ; + here->BSIM3v32DPgPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32gNode != 0)) { - while (here->BSIM3v32DPgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32DPgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32gNode != 0)) + { + i = here->BSIM3v32SPgPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32SPgStructPtr = matched ; + here->BSIM3v32SPgPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32gNode != 0)) { - while (here->BSIM3v32SPgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32SPgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32sNode != 0)) + { + i = here->BSIM3v32SPsPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32SPsStructPtr = matched ; + here->BSIM3v32SPsPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32sNode != 0)) { - while (here->BSIM3v32SPsPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32SPsPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32bNode != 0)) + { + i = here->BSIM3v32DPbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32DPbStructPtr = matched ; + here->BSIM3v32DPbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32bNode != 0)) { - while (here->BSIM3v32DPbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32DPbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32bNode != 0)) + { + i = here->BSIM3v32SPbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32SPbStructPtr = matched ; + here->BSIM3v32SPbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32bNode != 0)) { - while (here->BSIM3v32SPbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32SPbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32dNodePrime != 0)) + { + i = here->BSIM3v32SPdpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32SPdpStructPtr = matched ; + here->BSIM3v32SPdpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32dNodePrime != 0)) { - while (here->BSIM3v32SPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32SPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32qNode != 0)) + { + i = here->BSIM3v32QqPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32QqStructPtr = matched ; + here->BSIM3v32QqPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32qNode != 0)) { - while (here->BSIM3v32QqPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32QqPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32dNodePrime != 0)) + { + i = here->BSIM3v32QdpPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32QdpStructPtr = matched ; + here->BSIM3v32QdpPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32dNodePrime != 0)) { - while (here->BSIM3v32QdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32QdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32sNodePrime != 0)) + { + i = here->BSIM3v32QspPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32QspStructPtr = matched ; + here->BSIM3v32QspPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32sNodePrime != 0)) { - while (here->BSIM3v32QspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32QspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32gNode != 0)) + { + i = here->BSIM3v32QgPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32QgStructPtr = matched ; + here->BSIM3v32QgPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32gNode != 0)) { - while (here->BSIM3v32QgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32QgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32bNode != 0)) + { + i = here->BSIM3v32QbPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32QbStructPtr = matched ; + here->BSIM3v32QbPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32bNode != 0)) { - while (here->BSIM3v32QbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32QbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32qNode != 0)) + { + i = here->BSIM3v32DPqPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32DPqStructPtr = matched ; + here->BSIM3v32DPqPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32qNode != 0)) { - while (here->BSIM3v32DPqPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32DPqPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32qNode != 0)) + { + i = here->BSIM3v32SPqPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32SPqStructPtr = matched ; + here->BSIM3v32SPqPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32qNode != 0)) { - while (here->BSIM3v32SPqPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32SPqPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32qNode != 0)) + { + i = here->BSIM3v32GqPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32GqStructPtr = matched ; + here->BSIM3v32GqPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32qNode != 0)) { - while (here->BSIM3v32GqPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32GqPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32qNode != 0)) + { + i = here->BSIM3v32BqPtr ; + matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; + here->BSIM3v32BqStructPtr = matched ; + here->BSIM3v32BqPtr = matched->CSC ; + } - i = 0 ; - if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32qNode != 0)) { - while (here->BSIM3v32BqPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ; - here->BSIM3v32BqPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ; - } - } + } } - return(OK); + + return (OK) ; +} + +int +BSIM3v32bindCSCComplex (GENmodel *inModel, CKTcircuit *ckt) +{ + BSIM3v32model *model = (BSIM3v32model *)inModel ; + BSIM3v32instance *here ; + + NG_IGNORE (ckt) ; + + /* loop through all the BSIM3v32 models */ + for ( ; model != NULL ; model = model->BSIM3v32nextModel) + { + /* loop through all the instances of the model */ + for (here = model->BSIM3v32instances ; here != NULL ; here = here->BSIM3v32nextInstance) + { + if ((here-> BSIM3v32dNode != 0) && (here-> BSIM3v32dNode != 0)) + here->BSIM3v32DdPtr = here->BSIM3v32DdStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32gNode != 0)) + here->BSIM3v32GgPtr = here->BSIM3v32GgStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32sNode != 0) && (here-> BSIM3v32sNode != 0)) + here->BSIM3v32SsPtr = here->BSIM3v32SsStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32bNode != 0)) + here->BSIM3v32BbPtr = here->BSIM3v32BbStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32dNodePrime != 0)) + here->BSIM3v32DPdpPtr = here->BSIM3v32DPdpStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32sNodePrime != 0)) + here->BSIM3v32SPspPtr = here->BSIM3v32SPspStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32dNode != 0) && (here-> BSIM3v32dNodePrime != 0)) + here->BSIM3v32DdpPtr = here->BSIM3v32DdpStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32bNode != 0)) + here->BSIM3v32GbPtr = here->BSIM3v32GbStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32dNodePrime != 0)) + here->BSIM3v32GdpPtr = here->BSIM3v32GdpStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32sNodePrime != 0)) + here->BSIM3v32GspPtr = here->BSIM3v32GspStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32sNode != 0) && (here-> BSIM3v32sNodePrime != 0)) + here->BSIM3v32SspPtr = here->BSIM3v32SspStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32dNodePrime != 0)) + here->BSIM3v32BdpPtr = here->BSIM3v32BdpStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32sNodePrime != 0)) + here->BSIM3v32BspPtr = here->BSIM3v32BspStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32sNodePrime != 0)) + here->BSIM3v32DPspPtr = here->BSIM3v32DPspStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32dNode != 0)) + here->BSIM3v32DPdPtr = here->BSIM3v32DPdStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32gNode != 0)) + here->BSIM3v32BgPtr = here->BSIM3v32BgStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32gNode != 0)) + here->BSIM3v32DPgPtr = here->BSIM3v32DPgStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32gNode != 0)) + here->BSIM3v32SPgPtr = here->BSIM3v32SPgStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32sNode != 0)) + here->BSIM3v32SPsPtr = here->BSIM3v32SPsStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32bNode != 0)) + here->BSIM3v32DPbPtr = here->BSIM3v32DPbStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32bNode != 0)) + here->BSIM3v32SPbPtr = here->BSIM3v32SPbStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32dNodePrime != 0)) + here->BSIM3v32SPdpPtr = here->BSIM3v32SPdpStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32qNode != 0)) + here->BSIM3v32QqPtr = here->BSIM3v32QqStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32dNodePrime != 0)) + here->BSIM3v32QdpPtr = here->BSIM3v32QdpStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32sNodePrime != 0)) + here->BSIM3v32QspPtr = here->BSIM3v32QspStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32gNode != 0)) + here->BSIM3v32QgPtr = here->BSIM3v32QgStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32bNode != 0)) + here->BSIM3v32QbPtr = here->BSIM3v32QbStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32qNode != 0)) + here->BSIM3v32DPqPtr = here->BSIM3v32DPqStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32qNode != 0)) + here->BSIM3v32SPqPtr = here->BSIM3v32SPqStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32qNode != 0)) + here->BSIM3v32GqPtr = here->BSIM3v32GqStructPtr->CSC_Complex ; + + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32qNode != 0)) + here->BSIM3v32BqPtr = here->BSIM3v32BqStructPtr->CSC_Complex ; + + } + } + + return (OK) ; } int @@ -420,232 +410,110 @@ BSIM3v32bindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt) { BSIM3v32model *model = (BSIM3v32model *)inModel ; BSIM3v32instance *here ; - int i ; - /* loop through all the bsim3v32 models */ + NG_IGNORE (ckt) ; + + /* loop through all the BSIM3v32 models */ for ( ; model != NULL ; model = model->BSIM3v32nextModel) { /* loop through all the instances of the model */ for (here = model->BSIM3v32instances ; here != NULL ; here = here->BSIM3v32nextInstance) { - i = 0 ; - if ((here->BSIM3v32dNode != 0) && (here->BSIM3v32dNode != 0)) - { - while (here->BSIM3v32DdPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32DdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32dNode != 0) && (here-> BSIM3v32dNode != 0)) + here->BSIM3v32DdPtr = here->BSIM3v32DdStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32gNode != 0) && (here->BSIM3v32gNode != 0)) - { - while (here->BSIM3v32GgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32GgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32gNode != 0)) + here->BSIM3v32GgPtr = here->BSIM3v32GgStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32sNode != 0) && (here->BSIM3v32sNode != 0)) - { - while (here->BSIM3v32SsPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32SsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32sNode != 0) && (here-> BSIM3v32sNode != 0)) + here->BSIM3v32SsPtr = here->BSIM3v32SsStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32bNode != 0) && (here->BSIM3v32bNode != 0)) - { - while (here->BSIM3v32BbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32BbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32bNode != 0)) + here->BSIM3v32BbPtr = here->BSIM3v32BbStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32dNodePrime != 0) && (here->BSIM3v32dNodePrime != 0)) - { - while (here->BSIM3v32DPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32DPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32dNodePrime != 0)) + here->BSIM3v32DPdpPtr = here->BSIM3v32DPdpStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32sNodePrime != 0) && (here->BSIM3v32sNodePrime != 0)) - { - while (here->BSIM3v32SPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32SPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32sNodePrime != 0)) + here->BSIM3v32SPspPtr = here->BSIM3v32SPspStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32dNode != 0) && (here->BSIM3v32dNodePrime != 0)) - { - while (here->BSIM3v32DdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32DdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32dNode != 0) && (here-> BSIM3v32dNodePrime != 0)) + here->BSIM3v32DdpPtr = here->BSIM3v32DdpStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32gNode != 0) && (here->BSIM3v32bNode != 0)) - { - while (here->BSIM3v32GbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32GbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32bNode != 0)) + here->BSIM3v32GbPtr = here->BSIM3v32GbStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32gNode != 0) && (here->BSIM3v32dNodePrime != 0)) - { - while (here->BSIM3v32GdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32GdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32dNodePrime != 0)) + here->BSIM3v32GdpPtr = here->BSIM3v32GdpStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32gNode != 0) && (here->BSIM3v32sNodePrime != 0)) - { - while (here->BSIM3v32GspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32GspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32sNodePrime != 0)) + here->BSIM3v32GspPtr = here->BSIM3v32GspStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32sNode != 0) && (here->BSIM3v32sNodePrime != 0)) - { - while (here->BSIM3v32SspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32SspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32sNode != 0) && (here-> BSIM3v32sNodePrime != 0)) + here->BSIM3v32SspPtr = here->BSIM3v32SspStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32bNode != 0) && (here->BSIM3v32dNodePrime != 0)) - { - while (here->BSIM3v32BdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32BdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32dNodePrime != 0)) + here->BSIM3v32BdpPtr = here->BSIM3v32BdpStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32bNode != 0) && (here->BSIM3v32sNodePrime != 0)) - { - while (here->BSIM3v32BspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32BspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32sNodePrime != 0)) + here->BSIM3v32BspPtr = here->BSIM3v32BspStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32dNodePrime != 0) && (here->BSIM3v32sNodePrime != 0)) - { - while (here->BSIM3v32DPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32DPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32sNodePrime != 0)) + here->BSIM3v32DPspPtr = here->BSIM3v32DPspStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32dNodePrime != 0) && (here->BSIM3v32dNode != 0)) - { - while (here->BSIM3v32DPdPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32DPdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32dNode != 0)) + here->BSIM3v32DPdPtr = here->BSIM3v32DPdStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32bNode != 0) && (here->BSIM3v32gNode != 0)) - { - while (here->BSIM3v32BgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32BgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32gNode != 0)) + here->BSIM3v32BgPtr = here->BSIM3v32BgStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32dNodePrime != 0) && (here->BSIM3v32gNode != 0)) - { - while (here->BSIM3v32DPgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32DPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32gNode != 0)) + here->BSIM3v32DPgPtr = here->BSIM3v32DPgStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32sNodePrime != 0) && (here->BSIM3v32gNode != 0)) - { - while (here->BSIM3v32SPgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32SPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32gNode != 0)) + here->BSIM3v32SPgPtr = here->BSIM3v32SPgStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32sNodePrime != 0) && (here->BSIM3v32sNode != 0)) - { - while (here->BSIM3v32SPsPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32SPsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32sNode != 0)) + here->BSIM3v32SPsPtr = here->BSIM3v32SPsStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32dNodePrime != 0) && (here->BSIM3v32bNode != 0)) - { - while (here->BSIM3v32DPbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32DPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32bNode != 0)) + here->BSIM3v32DPbPtr = here->BSIM3v32DPbStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32sNodePrime != 0) && (here->BSIM3v32bNode != 0)) - { - while (here->BSIM3v32SPbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32SPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32bNode != 0)) + here->BSIM3v32SPbPtr = here->BSIM3v32SPbStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32sNodePrime != 0) && (here->BSIM3v32dNodePrime != 0)) - { - while (here->BSIM3v32SPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32SPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32dNodePrime != 0)) + here->BSIM3v32SPdpPtr = here->BSIM3v32SPdpStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32qNode != 0) && (here->BSIM3v32qNode != 0)) - { - while (here->BSIM3v32QqPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32QqPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32qNode != 0)) + here->BSIM3v32QqPtr = here->BSIM3v32QqStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32qNode != 0) && (here->BSIM3v32dNodePrime != 0)) - { - while (here->BSIM3v32QdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32QdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32dNodePrime != 0)) + here->BSIM3v32QdpPtr = here->BSIM3v32QdpStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32qNode != 0) && (here->BSIM3v32sNodePrime != 0)) - { - while (here->BSIM3v32QspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32QspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32sNodePrime != 0)) + here->BSIM3v32QspPtr = here->BSIM3v32QspStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32qNode != 0) && (here->BSIM3v32gNode != 0)) - { - while (here->BSIM3v32QgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32QgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32gNode != 0)) + here->BSIM3v32QgPtr = here->BSIM3v32QgStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32qNode != 0) && (here->BSIM3v32bNode != 0)) - { - while (here->BSIM3v32QbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32QbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32bNode != 0)) + here->BSIM3v32QbPtr = here->BSIM3v32QbStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32dNodePrime != 0) && (here->BSIM3v32qNode != 0)) - { - while (here->BSIM3v32DPqPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32DPqPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32qNode != 0)) + here->BSIM3v32DPqPtr = here->BSIM3v32DPqStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32sNodePrime != 0) && (here->BSIM3v32qNode != 0)) - { - while (here->BSIM3v32SPqPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32SPqPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32qNode != 0)) + here->BSIM3v32SPqPtr = here->BSIM3v32SPqStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32gNode != 0) && (here->BSIM3v32qNode != 0)) - { - while (here->BSIM3v32GqPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32GqPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } + if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32qNode != 0)) + here->BSIM3v32GqPtr = here->BSIM3v32GqStructPtr->CSC ; + + if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32qNode != 0)) + here->BSIM3v32BqPtr = here->BSIM3v32BqStructPtr->CSC ; - i = 0 ; - if ((here->BSIM3v32bNode != 0) && (here->BSIM3v32qNode != 0)) - { - while (here->BSIM3v32BqPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ; - here->BSIM3v32BqPtr = ckt->CKTmatrix->CKTbind_CSC [i] ; - } } } return (OK) ; -} \ No newline at end of file +} diff --git a/src/spicelib/devices/bsim3v32/bsim3v32def.h b/src/spicelib/devices/bsim3v32/bsim3v32def.h index 5c7e47919..10f1325d5 100644 --- a/src/spicelib/devices/bsim3v32/bsim3v32def.h +++ b/src/spicelib/devices/bsim3v32/bsim3v32def.h @@ -210,6 +210,40 @@ typedef struct sBSIM3v32instance double **BSIM3v32nVar; #endif /* NONOISE */ +#ifdef KLU + BindElement *BSIM3v32DdStructPtr ; + BindElement *BSIM3v32GgStructPtr ; + BindElement *BSIM3v32SsStructPtr ; + BindElement *BSIM3v32BbStructPtr ; + BindElement *BSIM3v32DPdpStructPtr ; + BindElement *BSIM3v32SPspStructPtr ; + BindElement *BSIM3v32DdpStructPtr ; + BindElement *BSIM3v32GbStructPtr ; + BindElement *BSIM3v32GdpStructPtr ; + BindElement *BSIM3v32GspStructPtr ; + BindElement *BSIM3v32SspStructPtr ; + BindElement *BSIM3v32BdpStructPtr ; + BindElement *BSIM3v32BspStructPtr ; + BindElement *BSIM3v32DPspStructPtr ; + BindElement *BSIM3v32DPdStructPtr ; + BindElement *BSIM3v32BgStructPtr ; + BindElement *BSIM3v32DPgStructPtr ; + BindElement *BSIM3v32SPgStructPtr ; + BindElement *BSIM3v32SPsStructPtr ; + BindElement *BSIM3v32DPbStructPtr ; + BindElement *BSIM3v32SPbStructPtr ; + BindElement *BSIM3v32SPdpStructPtr ; + BindElement *BSIM3v32QqStructPtr ; + BindElement *BSIM3v32QdpStructPtr ; + BindElement *BSIM3v32QspStructPtr ; + BindElement *BSIM3v32QgStructPtr ; + BindElement *BSIM3v32QbStructPtr ; + BindElement *BSIM3v32DPqStructPtr ; + BindElement *BSIM3v32SPqStructPtr ; + BindElement *BSIM3v32GqStructPtr ; + BindElement *BSIM3v32BqStructPtr ; +#endif + } BSIM3v32instance ; struct bsim3v32SizeDependParam