KLU Integration from scratch #5, devices
This commit is contained in:
parent
4ccf8ed726
commit
b38091b25b
|
|
@ -74,7 +74,14 @@ SPICEdev ASRCinfo = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &ASRCiSize,
|
||||
/* DEVmodSize */ &ASRCmSize
|
||||
/* DEVmodSize */ &ASRCmSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ NULL,
|
||||
/* DEVbindCSCComplex */ NULL,
|
||||
/* DEVbindCSCComplexToReal */ NULL,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,9 @@ libbjt_la_SOURCES = \
|
|||
bjttrunc.c
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libbjt_la_SOURCES += bjtbindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,407 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "bjtdefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
BJTbindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BJTmodel *model = (BJTmodel *)inModel ;
|
||||
BJTinstance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the BJT models */
|
||||
for ( ; model != NULL ; model = model->BJTnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BJTinstances ; here != NULL ; here = here->BJTnextInstance)
|
||||
{
|
||||
if ((here->BJTcolNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
{
|
||||
i = here->BJTcolColPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTcolColPrimeStructPtr = matched ;
|
||||
here->BJTcolColPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTbaseNode != 0) && (here->BJTbasePrimeNode != 0))
|
||||
{
|
||||
i = here->BJTbaseBasePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTbaseBasePrimeStructPtr = matched ;
|
||||
here->BJTbaseBasePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTemitNode != 0) && (here->BJTemitPrimeNode != 0))
|
||||
{
|
||||
i = here->BJTemitEmitPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTemitEmitPrimeStructPtr = matched ;
|
||||
here->BJTemitEmitPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTcolNode != 0))
|
||||
{
|
||||
i = here->BJTcolPrimeColPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTcolPrimeColStructPtr = matched ;
|
||||
here->BJTcolPrimeColPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTbasePrimeNode != 0))
|
||||
{
|
||||
i = here->BJTcolPrimeBasePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTcolPrimeBasePrimeStructPtr = matched ;
|
||||
here->BJTcolPrimeBasePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTemitPrimeNode != 0))
|
||||
{
|
||||
i = here->BJTcolPrimeEmitPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTcolPrimeEmitPrimeStructPtr = matched ;
|
||||
here->BJTcolPrimeEmitPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTbasePrimeNode != 0) && (here->BJTbaseNode != 0))
|
||||
{
|
||||
i = here->BJTbasePrimeBasePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTbasePrimeBaseStructPtr = matched ;
|
||||
here->BJTbasePrimeBasePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTbasePrimeNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
{
|
||||
i = here->BJTbasePrimeColPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTbasePrimeColPrimeStructPtr = matched ;
|
||||
here->BJTbasePrimeColPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTbasePrimeNode != 0) && (here->BJTemitPrimeNode != 0))
|
||||
{
|
||||
i = here->BJTbasePrimeEmitPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTbasePrimeEmitPrimeStructPtr = matched ;
|
||||
here->BJTbasePrimeEmitPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTemitPrimeNode != 0) && (here->BJTemitNode != 0))
|
||||
{
|
||||
i = here->BJTemitPrimeEmitPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTemitPrimeEmitStructPtr = matched ;
|
||||
here->BJTemitPrimeEmitPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTemitPrimeNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
{
|
||||
i = here->BJTemitPrimeColPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTemitPrimeColPrimeStructPtr = matched ;
|
||||
here->BJTemitPrimeColPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTemitPrimeNode != 0) && (here->BJTbasePrimeNode != 0))
|
||||
{
|
||||
i = here->BJTemitPrimeBasePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTemitPrimeBasePrimeStructPtr = matched ;
|
||||
here->BJTemitPrimeBasePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTcolNode != 0) && (here->BJTcolNode != 0))
|
||||
{
|
||||
i = here->BJTcolColPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTcolColStructPtr = matched ;
|
||||
here->BJTcolColPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTbaseNode != 0) && (here->BJTbaseNode != 0))
|
||||
{
|
||||
i = here->BJTbaseBasePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTbaseBaseStructPtr = matched ;
|
||||
here->BJTbaseBasePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTemitNode != 0) && (here->BJTemitNode != 0))
|
||||
{
|
||||
i = here->BJTemitEmitPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTemitEmitStructPtr = matched ;
|
||||
here->BJTemitEmitPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
{
|
||||
i = here->BJTcolPrimeColPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTcolPrimeColPrimeStructPtr = matched ;
|
||||
here->BJTcolPrimeColPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTbasePrimeNode != 0) && (here->BJTbasePrimeNode != 0))
|
||||
{
|
||||
i = here->BJTbasePrimeBasePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTbasePrimeBasePrimeStructPtr = matched ;
|
||||
here->BJTbasePrimeBasePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTemitPrimeNode != 0) && (here->BJTemitPrimeNode != 0))
|
||||
{
|
||||
i = here->BJTemitPrimeEmitPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTemitPrimeEmitPrimeStructPtr = matched ;
|
||||
here->BJTemitPrimeEmitPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTsubstNode != 0) && (here->BJTsubstNode != 0))
|
||||
{
|
||||
i = here->BJTsubstSubstPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTsubstSubstStructPtr = matched ;
|
||||
here->BJTsubstSubstPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTsubstConNode != 0) && (here->BJTsubstNode != 0))
|
||||
{
|
||||
i = here->BJTsubstConSubstPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTsubstConSubstStructPtr = matched ;
|
||||
here->BJTsubstConSubstPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTsubstNode != 0) && (here->BJTsubstConNode != 0))
|
||||
{
|
||||
i = here->BJTsubstSubstConPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTsubstSubstConStructPtr = matched ;
|
||||
here->BJTsubstSubstConPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTbaseNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
{
|
||||
i = here->BJTbaseColPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTbaseColPrimeStructPtr = matched ;
|
||||
here->BJTbaseColPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTbaseNode != 0))
|
||||
{
|
||||
i = here->BJTcolPrimeBasePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BJTcolPrimeBaseStructPtr = matched ;
|
||||
here->BJTcolPrimeBasePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
BJTbindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BJTmodel *model = (BJTmodel *)inModel ;
|
||||
BJTinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the BJT models */
|
||||
for ( ; model != NULL ; model = model->BJTnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BJTinstances ; here != NULL ; here = here->BJTnextInstance)
|
||||
{
|
||||
if ((here->BJTcolNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
here->BJTcolColPrimePtr = here->BJTcolColPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTbaseNode != 0) && (here->BJTbasePrimeNode != 0))
|
||||
here->BJTbaseBasePrimePtr = here->BJTbaseBasePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTemitNode != 0) && (here->BJTemitPrimeNode != 0))
|
||||
here->BJTemitEmitPrimePtr = here->BJTemitEmitPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTcolNode != 0))
|
||||
here->BJTcolPrimeColPtr = here->BJTcolPrimeColStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTbasePrimeNode != 0))
|
||||
here->BJTcolPrimeBasePrimePtr = here->BJTcolPrimeBasePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTemitPrimeNode != 0))
|
||||
here->BJTcolPrimeEmitPrimePtr = here->BJTcolPrimeEmitPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTbasePrimeNode != 0) && (here->BJTbaseNode != 0))
|
||||
here->BJTbasePrimeBasePtr = here->BJTbasePrimeBaseStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTbasePrimeNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
here->BJTbasePrimeColPrimePtr = here->BJTbasePrimeColPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTbasePrimeNode != 0) && (here->BJTemitPrimeNode != 0))
|
||||
here->BJTbasePrimeEmitPrimePtr = here->BJTbasePrimeEmitPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTemitPrimeNode != 0) && (here->BJTemitNode != 0))
|
||||
here->BJTemitPrimeEmitPtr = here->BJTemitPrimeEmitStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTemitPrimeNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
here->BJTemitPrimeColPrimePtr = here->BJTemitPrimeColPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTemitPrimeNode != 0) && (here->BJTbasePrimeNode != 0))
|
||||
here->BJTemitPrimeBasePrimePtr = here->BJTemitPrimeBasePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTcolNode != 0) && (here->BJTcolNode != 0))
|
||||
here->BJTcolColPtr = here->BJTcolColStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTbaseNode != 0) && (here->BJTbaseNode != 0))
|
||||
here->BJTbaseBasePtr = here->BJTbaseBaseStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTemitNode != 0) && (here->BJTemitNode != 0))
|
||||
here->BJTemitEmitPtr = here->BJTemitEmitStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
here->BJTcolPrimeColPrimePtr = here->BJTcolPrimeColPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTbasePrimeNode != 0) && (here->BJTbasePrimeNode != 0))
|
||||
here->BJTbasePrimeBasePrimePtr = here->BJTbasePrimeBasePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTemitPrimeNode != 0) && (here->BJTemitPrimeNode != 0))
|
||||
here->BJTemitPrimeEmitPrimePtr = here->BJTemitPrimeEmitPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTsubstNode != 0) && (here->BJTsubstNode != 0))
|
||||
here->BJTsubstSubstPtr = here->BJTsubstSubstStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTsubstConNode != 0) && (here->BJTsubstNode != 0))
|
||||
here->BJTsubstConSubstPtr = here->BJTsubstConSubstStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTsubstNode != 0) && (here->BJTsubstConNode != 0))
|
||||
here->BJTsubstSubstConPtr = here->BJTsubstSubstConStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTbaseNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
here->BJTbaseColPrimePtr = here->BJTbaseColPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTbaseNode != 0))
|
||||
here->BJTcolPrimeBasePtr = here->BJTcolPrimeBaseStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
BJTbindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BJTmodel *model = (BJTmodel *)inModel ;
|
||||
BJTinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the BJT models */
|
||||
for ( ; model != NULL ; model = model->BJTnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BJTinstances ; here != NULL ; here = here->BJTnextInstance)
|
||||
{
|
||||
if ((here->BJTcolNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
here->BJTcolColPrimePtr = here->BJTcolColPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTbaseNode != 0) && (here->BJTbasePrimeNode != 0))
|
||||
here->BJTbaseBasePrimePtr = here->BJTbaseBasePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTemitNode != 0) && (here->BJTemitPrimeNode != 0))
|
||||
here->BJTemitEmitPrimePtr = here->BJTemitEmitPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTcolNode != 0))
|
||||
here->BJTcolPrimeColPtr = here->BJTcolPrimeColStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTbasePrimeNode != 0))
|
||||
here->BJTcolPrimeBasePrimePtr = here->BJTcolPrimeBasePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTemitPrimeNode != 0))
|
||||
here->BJTcolPrimeEmitPrimePtr = here->BJTcolPrimeEmitPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTbasePrimeNode != 0) && (here->BJTbaseNode != 0))
|
||||
here->BJTbasePrimeBasePtr = here->BJTbasePrimeBaseStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTbasePrimeNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
here->BJTbasePrimeColPrimePtr = here->BJTbasePrimeColPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTbasePrimeNode != 0) && (here->BJTemitPrimeNode != 0))
|
||||
here->BJTbasePrimeEmitPrimePtr = here->BJTbasePrimeEmitPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTemitPrimeNode != 0) && (here->BJTemitNode != 0))
|
||||
here->BJTemitPrimeEmitPtr = here->BJTemitPrimeEmitStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTemitPrimeNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
here->BJTemitPrimeColPrimePtr = here->BJTemitPrimeColPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTemitPrimeNode != 0) && (here->BJTbasePrimeNode != 0))
|
||||
here->BJTemitPrimeBasePrimePtr = here->BJTemitPrimeBasePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTcolNode != 0) && (here->BJTcolNode != 0))
|
||||
here->BJTcolColPtr = here->BJTcolColStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTbaseNode != 0) && (here->BJTbaseNode != 0))
|
||||
here->BJTbaseBasePtr = here->BJTbaseBaseStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTemitNode != 0) && (here->BJTemitNode != 0))
|
||||
here->BJTemitEmitPtr = here->BJTemitEmitStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
here->BJTcolPrimeColPrimePtr = here->BJTcolPrimeColPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTbasePrimeNode != 0) && (here->BJTbasePrimeNode != 0))
|
||||
here->BJTbasePrimeBasePrimePtr = here->BJTbasePrimeBasePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTemitPrimeNode != 0) && (here->BJTemitPrimeNode != 0))
|
||||
here->BJTemitPrimeEmitPrimePtr = here->BJTemitPrimeEmitPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTsubstNode != 0) && (here->BJTsubstNode != 0))
|
||||
here->BJTsubstSubstPtr = here->BJTsubstSubstStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTsubstConNode != 0) && (here->BJTsubstNode != 0))
|
||||
here->BJTsubstConSubstPtr = here->BJTsubstConSubstStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTsubstNode != 0) && (here->BJTsubstConNode != 0))
|
||||
here->BJTsubstSubstConPtr = here->BJTsubstSubstConStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTbaseNode != 0) && (here->BJTcolPrimeNode != 0))
|
||||
here->BJTbaseColPrimePtr = here->BJTbaseColPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->BJTcolPrimeNode != 0) && (here->BJTbaseNode != 0))
|
||||
here->BJTcolPrimeBasePtr = here->BJTcolPrimeBaseStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -283,6 +283,33 @@ typedef struct sBJTinstance {
|
|||
#endif /*NONOISE*/
|
||||
/* the above to avoid allocating memory when it is not needed */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *BJTcolColPrimeStructPtr ;
|
||||
BindElement *BJTbaseBasePrimeStructPtr ;
|
||||
BindElement *BJTemitEmitPrimeStructPtr ;
|
||||
BindElement *BJTcolPrimeColStructPtr ;
|
||||
BindElement *BJTcolPrimeBasePrimeStructPtr ;
|
||||
BindElement *BJTcolPrimeEmitPrimeStructPtr ;
|
||||
BindElement *BJTbasePrimeBaseStructPtr ;
|
||||
BindElement *BJTbasePrimeColPrimeStructPtr ;
|
||||
BindElement *BJTbasePrimeEmitPrimeStructPtr ;
|
||||
BindElement *BJTemitPrimeEmitStructPtr ;
|
||||
BindElement *BJTemitPrimeColPrimeStructPtr ;
|
||||
BindElement *BJTemitPrimeBasePrimeStructPtr ;
|
||||
BindElement *BJTcolColStructPtr ;
|
||||
BindElement *BJTbaseBaseStructPtr ;
|
||||
BindElement *BJTemitEmitStructPtr ;
|
||||
BindElement *BJTcolPrimeColPrimeStructPtr ;
|
||||
BindElement *BJTbasePrimeBasePrimeStructPtr ;
|
||||
BindElement *BJTemitPrimeEmitPrimeStructPtr ;
|
||||
BindElement *BJTsubstSubstStructPtr ;
|
||||
BindElement *BJTsubstConSubstStructPtr ;
|
||||
BindElement *BJTsubstSubstConStructPtr ;
|
||||
BindElement *BJTsubstConSubstConStructPtr ;
|
||||
BindElement *BJTbaseColPrimeStructPtr ;
|
||||
BindElement *BJTcolPrimeBaseStructPtr ;
|
||||
#endif
|
||||
|
||||
} BJTinstance ;
|
||||
|
||||
/* entries in the state vector for bjt: */
|
||||
|
|
|
|||
|
|
@ -34,3 +34,9 @@ extern int BJTdSetup(GENmodel*, register CKTcircuit*);
|
|||
extern int BJTsoaCheck(CKTcircuit *, GENmodel *);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef KLU
|
||||
extern int BJTbindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int BJTbindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int BJTbindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -73,7 +73,13 @@ SPICEdev BJTinfo = { /* description from struct IFdevice */
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &BJTiSize,
|
||||
/* DEVmodSize */ &BJTmSize
|
||||
/* DEVmodSize */ &BJTmSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ BJTbindCSC,
|
||||
/* DEVbindCSCComplex */ BJTbindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ BJTbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,11 @@ libbsim1_la_SOURCES = \
|
|||
bsim1itf.h
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libbsim1_la_SOURCES += b1bindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
|
|
|||
|
|
@ -0,0 +1,393 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "bsim1def.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
B1bindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
B1model *model = (B1model *)inModel ;
|
||||
B1instance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the B1 models */
|
||||
for ( ; model != NULL ; model = model->B1nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->B1instances ; here != NULL ; here = here->B1nextInstance)
|
||||
{
|
||||
if ((here-> B1dNode != 0) && (here-> B1dNode != 0))
|
||||
{
|
||||
i = here->B1DdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1DdStructPtr = matched ;
|
||||
here->B1DdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1gNode != 0) && (here-> B1gNode != 0))
|
||||
{
|
||||
i = here->B1GgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1GgStructPtr = matched ;
|
||||
here->B1GgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1sNode != 0) && (here-> B1sNode != 0))
|
||||
{
|
||||
i = here->B1SsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1SsStructPtr = matched ;
|
||||
here->B1SsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1bNode != 0) && (here-> B1bNode != 0))
|
||||
{
|
||||
i = here->B1BbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1BbStructPtr = matched ;
|
||||
here->B1BbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1dNodePrime != 0))
|
||||
{
|
||||
i = here->B1DPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1DPdpStructPtr = matched ;
|
||||
here->B1DPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1sNodePrime != 0))
|
||||
{
|
||||
i = here->B1SPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1SPspStructPtr = matched ;
|
||||
here->B1SPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1dNode != 0) && (here-> B1dNodePrime != 0))
|
||||
{
|
||||
i = here->B1DdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1DdpStructPtr = matched ;
|
||||
here->B1DdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1gNode != 0) && (here-> B1bNode != 0))
|
||||
{
|
||||
i = here->B1GbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1GbStructPtr = matched ;
|
||||
here->B1GbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1gNode != 0) && (here-> B1dNodePrime != 0))
|
||||
{
|
||||
i = here->B1GdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1GdpStructPtr = matched ;
|
||||
here->B1GdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1gNode != 0) && (here-> B1sNodePrime != 0))
|
||||
{
|
||||
i = here->B1GspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1GspStructPtr = matched ;
|
||||
here->B1GspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1sNode != 0) && (here-> B1sNodePrime != 0))
|
||||
{
|
||||
i = here->B1SspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1SspStructPtr = matched ;
|
||||
here->B1SspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1bNode != 0) && (here-> B1dNodePrime != 0))
|
||||
{
|
||||
i = here->B1BdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1BdpStructPtr = matched ;
|
||||
here->B1BdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1bNode != 0) && (here-> B1sNodePrime != 0))
|
||||
{
|
||||
i = here->B1BspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1BspStructPtr = matched ;
|
||||
here->B1BspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1sNodePrime != 0))
|
||||
{
|
||||
i = here->B1DPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1DPspStructPtr = matched ;
|
||||
here->B1DPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1dNode != 0))
|
||||
{
|
||||
i = here->B1DPdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1DPdStructPtr = matched ;
|
||||
here->B1DPdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1bNode != 0) && (here-> B1gNode != 0))
|
||||
{
|
||||
i = here->B1BgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1BgStructPtr = matched ;
|
||||
here->B1BgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1gNode != 0))
|
||||
{
|
||||
i = here->B1DPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1DPgStructPtr = matched ;
|
||||
here->B1DPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1gNode != 0))
|
||||
{
|
||||
i = here->B1SPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1SPgStructPtr = matched ;
|
||||
here->B1SPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1sNode != 0))
|
||||
{
|
||||
i = here->B1SPsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1SPsStructPtr = matched ;
|
||||
here->B1SPsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1bNode != 0))
|
||||
{
|
||||
i = here->B1DPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1DPbStructPtr = matched ;
|
||||
here->B1DPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1bNode != 0))
|
||||
{
|
||||
i = here->B1SPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1SPbStructPtr = matched ;
|
||||
here->B1SPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1dNodePrime != 0))
|
||||
{
|
||||
i = here->B1SPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B1SPdpStructPtr = matched ;
|
||||
here->B1SPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
B1bindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
B1model *model = (B1model *)inModel ;
|
||||
B1instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the B1 models */
|
||||
for ( ; model != NULL ; model = model->B1nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->B1instances ; here != NULL ; here = here->B1nextInstance)
|
||||
{
|
||||
if ((here-> B1dNode != 0) && (here-> B1dNode != 0))
|
||||
here->B1DdPtr = here->B1DdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1gNode != 0) && (here-> B1gNode != 0))
|
||||
here->B1GgPtr = here->B1GgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1sNode != 0) && (here-> B1sNode != 0))
|
||||
here->B1SsPtr = here->B1SsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1bNode != 0) && (here-> B1bNode != 0))
|
||||
here->B1BbPtr = here->B1BbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1dNodePrime != 0))
|
||||
here->B1DPdpPtr = here->B1DPdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1sNodePrime != 0))
|
||||
here->B1SPspPtr = here->B1SPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1dNode != 0) && (here-> B1dNodePrime != 0))
|
||||
here->B1DdpPtr = here->B1DdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1gNode != 0) && (here-> B1bNode != 0))
|
||||
here->B1GbPtr = here->B1GbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1gNode != 0) && (here-> B1dNodePrime != 0))
|
||||
here->B1GdpPtr = here->B1GdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1gNode != 0) && (here-> B1sNodePrime != 0))
|
||||
here->B1GspPtr = here->B1GspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1sNode != 0) && (here-> B1sNodePrime != 0))
|
||||
here->B1SspPtr = here->B1SspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1bNode != 0) && (here-> B1dNodePrime != 0))
|
||||
here->B1BdpPtr = here->B1BdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1bNode != 0) && (here-> B1sNodePrime != 0))
|
||||
here->B1BspPtr = here->B1BspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1sNodePrime != 0))
|
||||
here->B1DPspPtr = here->B1DPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1dNode != 0))
|
||||
here->B1DPdPtr = here->B1DPdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1bNode != 0) && (here-> B1gNode != 0))
|
||||
here->B1BgPtr = here->B1BgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1gNode != 0))
|
||||
here->B1DPgPtr = here->B1DPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1gNode != 0))
|
||||
here->B1SPgPtr = here->B1SPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1sNode != 0))
|
||||
here->B1SPsPtr = here->B1SPsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1bNode != 0))
|
||||
here->B1DPbPtr = here->B1DPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1bNode != 0))
|
||||
here->B1SPbPtr = here->B1SPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1dNodePrime != 0))
|
||||
here->B1SPdpPtr = here->B1SPdpStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
B1bindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
B1model *model = (B1model *)inModel ;
|
||||
B1instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the B1 models */
|
||||
for ( ; model != NULL ; model = model->B1nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->B1instances ; here != NULL ; here = here->B1nextInstance)
|
||||
{
|
||||
if ((here-> B1dNode != 0) && (here-> B1dNode != 0))
|
||||
here->B1DdPtr = here->B1DdStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1gNode != 0) && (here-> B1gNode != 0))
|
||||
here->B1GgPtr = here->B1GgStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1sNode != 0) && (here-> B1sNode != 0))
|
||||
here->B1SsPtr = here->B1SsStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1bNode != 0) && (here-> B1bNode != 0))
|
||||
here->B1BbPtr = here->B1BbStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1dNodePrime != 0))
|
||||
here->B1DPdpPtr = here->B1DPdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1sNodePrime != 0))
|
||||
here->B1SPspPtr = here->B1SPspStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1dNode != 0) && (here-> B1dNodePrime != 0))
|
||||
here->B1DdpPtr = here->B1DdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1gNode != 0) && (here-> B1bNode != 0))
|
||||
here->B1GbPtr = here->B1GbStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1gNode != 0) && (here-> B1dNodePrime != 0))
|
||||
here->B1GdpPtr = here->B1GdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1gNode != 0) && (here-> B1sNodePrime != 0))
|
||||
here->B1GspPtr = here->B1GspStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1sNode != 0) && (here-> B1sNodePrime != 0))
|
||||
here->B1SspPtr = here->B1SspStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1bNode != 0) && (here-> B1dNodePrime != 0))
|
||||
here->B1BdpPtr = here->B1BdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1bNode != 0) && (here-> B1sNodePrime != 0))
|
||||
here->B1BspPtr = here->B1BspStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1sNodePrime != 0))
|
||||
here->B1DPspPtr = here->B1DPspStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1dNode != 0))
|
||||
here->B1DPdPtr = here->B1DPdStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1bNode != 0) && (here-> B1gNode != 0))
|
||||
here->B1BgPtr = here->B1BgStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1gNode != 0))
|
||||
here->B1DPgPtr = here->B1DPgStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1gNode != 0))
|
||||
here->B1SPgPtr = here->B1SPgStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1sNode != 0))
|
||||
here->B1SPsPtr = here->B1SPsStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1dNodePrime != 0) && (here-> B1bNode != 0))
|
||||
here->B1DPbPtr = here->B1DPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1bNode != 0))
|
||||
here->B1SPbPtr = here->B1SPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> B1sNodePrime != 0) && (here-> B1dNodePrime != 0))
|
||||
here->B1SPdpPtr = here->B1SPdpStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -166,6 +166,30 @@ typedef struct sBSIM1instance {
|
|||
double **B1nVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *B1DdStructPtr ;
|
||||
BindElement *B1GgStructPtr ;
|
||||
BindElement *B1SsStructPtr ;
|
||||
BindElement *B1BbStructPtr ;
|
||||
BindElement *B1DPdpStructPtr ;
|
||||
BindElement *B1SPspStructPtr ;
|
||||
BindElement *B1DdpStructPtr ;
|
||||
BindElement *B1GbStructPtr ;
|
||||
BindElement *B1GdpStructPtr ;
|
||||
BindElement *B1GspStructPtr ;
|
||||
BindElement *B1SspStructPtr ;
|
||||
BindElement *B1BdpStructPtr ;
|
||||
BindElement *B1BspStructPtr ;
|
||||
BindElement *B1DPspStructPtr ;
|
||||
BindElement *B1DPdStructPtr ;
|
||||
BindElement *B1BgStructPtr ;
|
||||
BindElement *B1DPgStructPtr ;
|
||||
BindElement *B1SPgStructPtr ;
|
||||
BindElement *B1SPsStructPtr ;
|
||||
BindElement *B1DPbStructPtr ;
|
||||
BindElement *B1SPbStructPtr ;
|
||||
BindElement *B1SPdpStructPtr ;
|
||||
#endif
|
||||
|
||||
} B1instance ;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,3 +29,9 @@ extern int B1temp(GENmodel*,CKTcircuit*);
|
|||
extern int B1trunc(GENmodel*,CKTcircuit*,double*);
|
||||
extern int B1disto(int,GENmodel*,CKTcircuit*);
|
||||
extern int B1dSetup(GENmodel*, register CKTcircuit*);
|
||||
|
||||
#ifdef KLU
|
||||
extern int B1bindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int B1bindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int B1bindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -73,7 +73,13 @@ SPICEdev B1info = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &B1iSize,
|
||||
/* DEVmodSize */ &B1mSize
|
||||
/* DEVmodSize */ &B1mSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ B1bindCSC,
|
||||
/* DEVbindCSCComplex */ B1bindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ B1bindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ libbsim2_la_SOURCES = \
|
|||
bsim2itf.h
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libbsim2_la_SOURCES += b2bindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,393 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "bsim2def.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
B2bindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
B2model *model = (B2model *)inModel ;
|
||||
B2instance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the B2 models */
|
||||
for ( ; model != NULL ; model = model->B2nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->B2instances ; here != NULL ; here = here->B2nextInstance)
|
||||
{
|
||||
if ((here-> B2dNode != 0) && (here-> B2dNode != 0))
|
||||
{
|
||||
i = here->B2DdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2DdStructPtr = matched ;
|
||||
here->B2DdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2gNode != 0) && (here-> B2gNode != 0))
|
||||
{
|
||||
i = here->B2GgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2GgStructPtr = matched ;
|
||||
here->B2GgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2sNode != 0) && (here-> B2sNode != 0))
|
||||
{
|
||||
i = here->B2SsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2SsStructPtr = matched ;
|
||||
here->B2SsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2bNode != 0) && (here-> B2bNode != 0))
|
||||
{
|
||||
i = here->B2BbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2BbStructPtr = matched ;
|
||||
here->B2BbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2dNodePrime != 0))
|
||||
{
|
||||
i = here->B2DPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2DPdpStructPtr = matched ;
|
||||
here->B2DPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2sNodePrime != 0))
|
||||
{
|
||||
i = here->B2SPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2SPspStructPtr = matched ;
|
||||
here->B2SPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2dNode != 0) && (here-> B2dNodePrime != 0))
|
||||
{
|
||||
i = here->B2DdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2DdpStructPtr = matched ;
|
||||
here->B2DdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2gNode != 0) && (here-> B2bNode != 0))
|
||||
{
|
||||
i = here->B2GbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2GbStructPtr = matched ;
|
||||
here->B2GbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2gNode != 0) && (here-> B2dNodePrime != 0))
|
||||
{
|
||||
i = here->B2GdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2GdpStructPtr = matched ;
|
||||
here->B2GdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2gNode != 0) && (here-> B2sNodePrime != 0))
|
||||
{
|
||||
i = here->B2GspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2GspStructPtr = matched ;
|
||||
here->B2GspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2sNode != 0) && (here-> B2sNodePrime != 0))
|
||||
{
|
||||
i = here->B2SspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2SspStructPtr = matched ;
|
||||
here->B2SspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2bNode != 0) && (here-> B2dNodePrime != 0))
|
||||
{
|
||||
i = here->B2BdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2BdpStructPtr = matched ;
|
||||
here->B2BdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2bNode != 0) && (here-> B2sNodePrime != 0))
|
||||
{
|
||||
i = here->B2BspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2BspStructPtr = matched ;
|
||||
here->B2BspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2sNodePrime != 0))
|
||||
{
|
||||
i = here->B2DPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2DPspStructPtr = matched ;
|
||||
here->B2DPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2dNode != 0))
|
||||
{
|
||||
i = here->B2DPdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2DPdStructPtr = matched ;
|
||||
here->B2DPdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2bNode != 0) && (here-> B2gNode != 0))
|
||||
{
|
||||
i = here->B2BgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2BgStructPtr = matched ;
|
||||
here->B2BgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2gNode != 0))
|
||||
{
|
||||
i = here->B2DPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2DPgStructPtr = matched ;
|
||||
here->B2DPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2gNode != 0))
|
||||
{
|
||||
i = here->B2SPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2SPgStructPtr = matched ;
|
||||
here->B2SPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2sNode != 0))
|
||||
{
|
||||
i = here->B2SPsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2SPsStructPtr = matched ;
|
||||
here->B2SPsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2bNode != 0))
|
||||
{
|
||||
i = here->B2DPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2DPbStructPtr = matched ;
|
||||
here->B2DPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2bNode != 0))
|
||||
{
|
||||
i = here->B2SPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2SPbStructPtr = matched ;
|
||||
here->B2SPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2dNodePrime != 0))
|
||||
{
|
||||
i = here->B2SPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->B2SPdpStructPtr = matched ;
|
||||
here->B2SPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
B2bindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
B2model *model = (B2model *)inModel ;
|
||||
B2instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the B2 models */
|
||||
for ( ; model != NULL ; model = model->B2nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->B2instances ; here != NULL ; here = here->B2nextInstance)
|
||||
{
|
||||
if ((here-> B2dNode != 0) && (here-> B2dNode != 0))
|
||||
here->B2DdPtr = here->B2DdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2gNode != 0) && (here-> B2gNode != 0))
|
||||
here->B2GgPtr = here->B2GgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2sNode != 0) && (here-> B2sNode != 0))
|
||||
here->B2SsPtr = here->B2SsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2bNode != 0) && (here-> B2bNode != 0))
|
||||
here->B2BbPtr = here->B2BbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2dNodePrime != 0))
|
||||
here->B2DPdpPtr = here->B2DPdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2sNodePrime != 0))
|
||||
here->B2SPspPtr = here->B2SPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2dNode != 0) && (here-> B2dNodePrime != 0))
|
||||
here->B2DdpPtr = here->B2DdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2gNode != 0) && (here-> B2bNode != 0))
|
||||
here->B2GbPtr = here->B2GbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2gNode != 0) && (here-> B2dNodePrime != 0))
|
||||
here->B2GdpPtr = here->B2GdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2gNode != 0) && (here-> B2sNodePrime != 0))
|
||||
here->B2GspPtr = here->B2GspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2sNode != 0) && (here-> B2sNodePrime != 0))
|
||||
here->B2SspPtr = here->B2SspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2bNode != 0) && (here-> B2dNodePrime != 0))
|
||||
here->B2BdpPtr = here->B2BdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2bNode != 0) && (here-> B2sNodePrime != 0))
|
||||
here->B2BspPtr = here->B2BspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2sNodePrime != 0))
|
||||
here->B2DPspPtr = here->B2DPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2dNode != 0))
|
||||
here->B2DPdPtr = here->B2DPdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2bNode != 0) && (here-> B2gNode != 0))
|
||||
here->B2BgPtr = here->B2BgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2gNode != 0))
|
||||
here->B2DPgPtr = here->B2DPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2gNode != 0))
|
||||
here->B2SPgPtr = here->B2SPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2sNode != 0))
|
||||
here->B2SPsPtr = here->B2SPsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2bNode != 0))
|
||||
here->B2DPbPtr = here->B2DPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2bNode != 0))
|
||||
here->B2SPbPtr = here->B2SPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2dNodePrime != 0))
|
||||
here->B2SPdpPtr = here->B2SPdpStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
B2bindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
B2model *model = (B2model *)inModel ;
|
||||
B2instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the B2 models */
|
||||
for ( ; model != NULL ; model = model->B2nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->B2instances ; here != NULL ; here = here->B2nextInstance)
|
||||
{
|
||||
if ((here-> B2dNode != 0) && (here-> B2dNode != 0))
|
||||
here->B2DdPtr = here->B2DdStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2gNode != 0) && (here-> B2gNode != 0))
|
||||
here->B2GgPtr = here->B2GgStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2sNode != 0) && (here-> B2sNode != 0))
|
||||
here->B2SsPtr = here->B2SsStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2bNode != 0) && (here-> B2bNode != 0))
|
||||
here->B2BbPtr = here->B2BbStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2dNodePrime != 0))
|
||||
here->B2DPdpPtr = here->B2DPdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2sNodePrime != 0))
|
||||
here->B2SPspPtr = here->B2SPspStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2dNode != 0) && (here-> B2dNodePrime != 0))
|
||||
here->B2DdpPtr = here->B2DdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2gNode != 0) && (here-> B2bNode != 0))
|
||||
here->B2GbPtr = here->B2GbStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2gNode != 0) && (here-> B2dNodePrime != 0))
|
||||
here->B2GdpPtr = here->B2GdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2gNode != 0) && (here-> B2sNodePrime != 0))
|
||||
here->B2GspPtr = here->B2GspStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2sNode != 0) && (here-> B2sNodePrime != 0))
|
||||
here->B2SspPtr = here->B2SspStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2bNode != 0) && (here-> B2dNodePrime != 0))
|
||||
here->B2BdpPtr = here->B2BdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2bNode != 0) && (here-> B2sNodePrime != 0))
|
||||
here->B2BspPtr = here->B2BspStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2sNodePrime != 0))
|
||||
here->B2DPspPtr = here->B2DPspStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2dNode != 0))
|
||||
here->B2DPdPtr = here->B2DPdStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2bNode != 0) && (here-> B2gNode != 0))
|
||||
here->B2BgPtr = here->B2BgStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2gNode != 0))
|
||||
here->B2DPgPtr = here->B2DPgStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2gNode != 0))
|
||||
here->B2SPgPtr = here->B2SPgStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2sNode != 0))
|
||||
here->B2SPsPtr = here->B2SPsStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2dNodePrime != 0) && (here-> B2bNode != 0))
|
||||
here->B2DPbPtr = here->B2DPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2bNode != 0))
|
||||
here->B2SPbPtr = here->B2SPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> B2sNodePrime != 0) && (here-> B2dNodePrime != 0))
|
||||
here->B2SPdpPtr = here->B2SPdpStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -176,6 +176,31 @@ typedef struct sBSIM2instance {
|
|||
|
||||
#define B2numStates 35
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *B2DdStructPtr ;
|
||||
BindElement *B2GgStructPtr ;
|
||||
BindElement *B2SsStructPtr ;
|
||||
BindElement *B2BbStructPtr ;
|
||||
BindElement *B2DPdpStructPtr ;
|
||||
BindElement *B2SPspStructPtr ;
|
||||
BindElement *B2DdpStructPtr ;
|
||||
BindElement *B2GbStructPtr ;
|
||||
BindElement *B2GdpStructPtr ;
|
||||
BindElement *B2GspStructPtr ;
|
||||
BindElement *B2SspStructPtr ;
|
||||
BindElement *B2BdpStructPtr ;
|
||||
BindElement *B2BspStructPtr ;
|
||||
BindElement *B2DPspStructPtr ;
|
||||
BindElement *B2DPdStructPtr ;
|
||||
BindElement *B2BgStructPtr ;
|
||||
BindElement *B2DPgStructPtr ;
|
||||
BindElement *B2SPgStructPtr ;
|
||||
BindElement *B2SPsStructPtr ;
|
||||
BindElement *B2DPbStructPtr ;
|
||||
BindElement *B2SPbStructPtr ;
|
||||
BindElement *B2SPdpStructPtr ;
|
||||
#endif
|
||||
|
||||
} B2instance ;
|
||||
|
||||
struct bsim2SizeDependParam
|
||||
|
|
|
|||
|
|
@ -25,3 +25,9 @@ extern int B2setup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
|
|||
extern int B2unsetup(GENmodel*,CKTcircuit*);
|
||||
extern int B2temp(GENmodel*,CKTcircuit*);
|
||||
extern int B2trunc(GENmodel*,CKTcircuit*,double*);
|
||||
|
||||
#ifdef KLU
|
||||
extern int B2bindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int B2bindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int B2bindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -73,7 +73,13 @@ SPICEdev B2info = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &B2iSize,
|
||||
/* DEVmodSize */ &B2mSize
|
||||
/* DEVmodSize */ &B2mSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ B2bindCSC,
|
||||
/* DEVbindCSCComplex */ B2bindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ B2bindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ libbsim3_la_SOURCES = \
|
|||
bsim3itf.h
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libbsim3_la_SOURCES += b3bindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,519 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "bsim3def.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
BSIM3bindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BSIM3model *model = (BSIM3model *)inModel ;
|
||||
BSIM3instance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the BSIM3 models */
|
||||
for ( ; model != NULL ; model = model->BSIM3nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BSIM3instances ; here != NULL ; here = here->BSIM3nextInstance)
|
||||
{
|
||||
if ((here-> BSIM3dNode != 0) && (here-> BSIM3dNode != 0))
|
||||
{
|
||||
i = here->BSIM3DdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3DdStructPtr = matched ;
|
||||
here->BSIM3DdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3gNode != 0))
|
||||
{
|
||||
i = here->BSIM3GgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3GgStructPtr = matched ;
|
||||
here->BSIM3GgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3sNode != 0) && (here-> BSIM3sNode != 0))
|
||||
{
|
||||
i = here->BSIM3SsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3SsStructPtr = matched ;
|
||||
here->BSIM3SsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3bNode != 0))
|
||||
{
|
||||
i = here->BSIM3BbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3BbStructPtr = matched ;
|
||||
here->BSIM3BbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3DPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3DPdpStructPtr = matched ;
|
||||
here->BSIM3DPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3SPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3SPspStructPtr = matched ;
|
||||
here->BSIM3SPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3dNode != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3DdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3DdpStructPtr = matched ;
|
||||
here->BSIM3DdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3bNode != 0))
|
||||
{
|
||||
i = here->BSIM3GbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3GbStructPtr = matched ;
|
||||
here->BSIM3GbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3GdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3GdpStructPtr = matched ;
|
||||
here->BSIM3GdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3GspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3GspStructPtr = matched ;
|
||||
here->BSIM3GspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3sNode != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3SspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3SspStructPtr = matched ;
|
||||
here->BSIM3SspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3BdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3BdpStructPtr = matched ;
|
||||
here->BSIM3BdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3BspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3BspStructPtr = matched ;
|
||||
here->BSIM3BspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3DPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3DPspStructPtr = matched ;
|
||||
here->BSIM3DPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3dNode != 0))
|
||||
{
|
||||
i = here->BSIM3DPdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3DPdStructPtr = matched ;
|
||||
here->BSIM3DPdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3gNode != 0))
|
||||
{
|
||||
i = here->BSIM3BgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3BgStructPtr = matched ;
|
||||
here->BSIM3BgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3gNode != 0))
|
||||
{
|
||||
i = here->BSIM3DPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3DPgStructPtr = matched ;
|
||||
here->BSIM3DPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3gNode != 0))
|
||||
{
|
||||
i = here->BSIM3SPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3SPgStructPtr = matched ;
|
||||
here->BSIM3SPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3sNode != 0))
|
||||
{
|
||||
i = here->BSIM3SPsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3SPsStructPtr = matched ;
|
||||
here->BSIM3SPsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3bNode != 0))
|
||||
{
|
||||
i = here->BSIM3DPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3DPbStructPtr = matched ;
|
||||
here->BSIM3DPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3bNode != 0))
|
||||
{
|
||||
i = here->BSIM3SPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3SPbStructPtr = matched ;
|
||||
here->BSIM3SPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3SPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3SPdpStructPtr = matched ;
|
||||
here->BSIM3SPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3qNode != 0))
|
||||
{
|
||||
i = here->BSIM3QqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3QqStructPtr = matched ;
|
||||
here->BSIM3QqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3QdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3QdpStructPtr = matched ;
|
||||
here->BSIM3QdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3gNode != 0))
|
||||
{
|
||||
i = here->BSIM3QgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3QgStructPtr = matched ;
|
||||
here->BSIM3QgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3QspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3QspStructPtr = matched ;
|
||||
here->BSIM3QspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3bNode != 0))
|
||||
{
|
||||
i = here->BSIM3QbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3QbStructPtr = matched ;
|
||||
here->BSIM3QbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3qNode != 0))
|
||||
{
|
||||
i = here->BSIM3DPqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3DPqStructPtr = matched ;
|
||||
here->BSIM3DPqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3qNode != 0))
|
||||
{
|
||||
i = here->BSIM3GqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3GqStructPtr = matched ;
|
||||
here->BSIM3GqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3qNode != 0))
|
||||
{
|
||||
i = here->BSIM3SPqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3SPqStructPtr = matched ;
|
||||
here->BSIM3SPqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3qNode != 0))
|
||||
{
|
||||
i = here->BSIM3BqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3BqStructPtr = matched ;
|
||||
here->BSIM3BqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
BSIM3bindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BSIM3model *model = (BSIM3model *)inModel ;
|
||||
BSIM3instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the BSIM3 models */
|
||||
for ( ; model != NULL ; model = model->BSIM3nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BSIM3instances ; here != NULL ; here = here->BSIM3nextInstance)
|
||||
{
|
||||
if ((here-> BSIM3dNode != 0) && (here-> BSIM3dNode != 0))
|
||||
here->BSIM3DdPtr = here->BSIM3DdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3gNode != 0))
|
||||
here->BSIM3GgPtr = here->BSIM3GgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3sNode != 0) && (here-> BSIM3sNode != 0))
|
||||
here->BSIM3SsPtr = here->BSIM3SsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3bNode != 0))
|
||||
here->BSIM3BbPtr = here->BSIM3BbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
here->BSIM3DPdpPtr = here->BSIM3DPdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
here->BSIM3SPspPtr = here->BSIM3SPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3dNode != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
here->BSIM3DdpPtr = here->BSIM3DdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3bNode != 0))
|
||||
here->BSIM3GbPtr = here->BSIM3GbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
here->BSIM3GdpPtr = here->BSIM3GdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
here->BSIM3GspPtr = here->BSIM3GspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3sNode != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
here->BSIM3SspPtr = here->BSIM3SspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
here->BSIM3BdpPtr = here->BSIM3BdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
here->BSIM3BspPtr = here->BSIM3BspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
here->BSIM3DPspPtr = here->BSIM3DPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3dNode != 0))
|
||||
here->BSIM3DPdPtr = here->BSIM3DPdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3gNode != 0))
|
||||
here->BSIM3BgPtr = here->BSIM3BgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3gNode != 0))
|
||||
here->BSIM3DPgPtr = here->BSIM3DPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3gNode != 0))
|
||||
here->BSIM3SPgPtr = here->BSIM3SPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3sNode != 0))
|
||||
here->BSIM3SPsPtr = here->BSIM3SPsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3bNode != 0))
|
||||
here->BSIM3DPbPtr = here->BSIM3DPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3bNode != 0))
|
||||
here->BSIM3SPbPtr = here->BSIM3SPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
here->BSIM3SPdpPtr = here->BSIM3SPdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3qNode != 0))
|
||||
here->BSIM3QqPtr = here->BSIM3QqStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
here->BSIM3QdpPtr = here->BSIM3QdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3gNode != 0))
|
||||
here->BSIM3QgPtr = here->BSIM3QgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
here->BSIM3QspPtr = here->BSIM3QspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3bNode != 0))
|
||||
here->BSIM3QbPtr = here->BSIM3QbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3qNode != 0))
|
||||
here->BSIM3DPqPtr = here->BSIM3DPqStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3qNode != 0))
|
||||
here->BSIM3GqPtr = here->BSIM3GqStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3qNode != 0))
|
||||
here->BSIM3SPqPtr = here->BSIM3SPqStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3qNode != 0))
|
||||
here->BSIM3BqPtr = here->BSIM3BqStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
BSIM3bindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BSIM3model *model = (BSIM3model *)inModel ;
|
||||
BSIM3instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the BSIM3 models */
|
||||
for ( ; model != NULL ; model = model->BSIM3nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BSIM3instances ; here != NULL ; here = here->BSIM3nextInstance)
|
||||
{
|
||||
if ((here-> BSIM3dNode != 0) && (here-> BSIM3dNode != 0))
|
||||
here->BSIM3DdPtr = here->BSIM3DdStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3gNode != 0))
|
||||
here->BSIM3GgPtr = here->BSIM3GgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3sNode != 0) && (here-> BSIM3sNode != 0))
|
||||
here->BSIM3SsPtr = here->BSIM3SsStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3bNode != 0))
|
||||
here->BSIM3BbPtr = here->BSIM3BbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
here->BSIM3DPdpPtr = here->BSIM3DPdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
here->BSIM3SPspPtr = here->BSIM3SPspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3dNode != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
here->BSIM3DdpPtr = here->BSIM3DdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3bNode != 0))
|
||||
here->BSIM3GbPtr = here->BSIM3GbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
here->BSIM3GdpPtr = here->BSIM3GdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
here->BSIM3GspPtr = here->BSIM3GspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3sNode != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
here->BSIM3SspPtr = here->BSIM3SspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
here->BSIM3BdpPtr = here->BSIM3BdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
here->BSIM3BspPtr = here->BSIM3BspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
here->BSIM3DPspPtr = here->BSIM3DPspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3dNode != 0))
|
||||
here->BSIM3DPdPtr = here->BSIM3DPdStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3gNode != 0))
|
||||
here->BSIM3BgPtr = here->BSIM3BgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3gNode != 0))
|
||||
here->BSIM3DPgPtr = here->BSIM3DPgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3gNode != 0))
|
||||
here->BSIM3SPgPtr = here->BSIM3SPgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3sNode != 0))
|
||||
here->BSIM3SPsPtr = here->BSIM3SPsStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3bNode != 0))
|
||||
here->BSIM3DPbPtr = here->BSIM3DPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3bNode != 0))
|
||||
here->BSIM3SPbPtr = here->BSIM3SPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
here->BSIM3SPdpPtr = here->BSIM3SPdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3qNode != 0))
|
||||
here->BSIM3QqPtr = here->BSIM3QqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3dNodePrime != 0))
|
||||
here->BSIM3QdpPtr = here->BSIM3QdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3gNode != 0))
|
||||
here->BSIM3QgPtr = here->BSIM3QgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3sNodePrime != 0))
|
||||
here->BSIM3QspPtr = here->BSIM3QspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3qNode != 0) && (here-> BSIM3bNode != 0))
|
||||
here->BSIM3QbPtr = here->BSIM3QbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3dNodePrime != 0) && (here-> BSIM3qNode != 0))
|
||||
here->BSIM3DPqPtr = here->BSIM3DPqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3gNode != 0) && (here-> BSIM3qNode != 0))
|
||||
here->BSIM3GqPtr = here->BSIM3GqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3sNodePrime != 0) && (here-> BSIM3qNode != 0))
|
||||
here->BSIM3SPqPtr = here->BSIM3SPqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3bNode != 0) && (here-> BSIM3qNode != 0))
|
||||
here->BSIM3BqPtr = here->BSIM3BqStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -257,6 +257,40 @@ typedef struct sBSIM3instance
|
|||
double **BSIM3nVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *BSIM3DdStructPtr ;
|
||||
BindElement *BSIM3GgStructPtr ;
|
||||
BindElement *BSIM3SsStructPtr ;
|
||||
BindElement *BSIM3BbStructPtr ;
|
||||
BindElement *BSIM3DPdpStructPtr ;
|
||||
BindElement *BSIM3SPspStructPtr ;
|
||||
BindElement *BSIM3DdpStructPtr ;
|
||||
BindElement *BSIM3GbStructPtr ;
|
||||
BindElement *BSIM3GdpStructPtr ;
|
||||
BindElement *BSIM3GspStructPtr ;
|
||||
BindElement *BSIM3SspStructPtr ;
|
||||
BindElement *BSIM3BdpStructPtr ;
|
||||
BindElement *BSIM3BspStructPtr ;
|
||||
BindElement *BSIM3DPspStructPtr ;
|
||||
BindElement *BSIM3DPdStructPtr ;
|
||||
BindElement *BSIM3BgStructPtr ;
|
||||
BindElement *BSIM3DPgStructPtr ;
|
||||
BindElement *BSIM3SPgStructPtr ;
|
||||
BindElement *BSIM3SPsStructPtr ;
|
||||
BindElement *BSIM3DPbStructPtr ;
|
||||
BindElement *BSIM3SPbStructPtr ;
|
||||
BindElement *BSIM3SPdpStructPtr ;
|
||||
BindElement *BSIM3QqStructPtr ;
|
||||
BindElement *BSIM3QdpStructPtr ;
|
||||
BindElement *BSIM3QgStructPtr ;
|
||||
BindElement *BSIM3QspStructPtr ;
|
||||
BindElement *BSIM3QbStructPtr ;
|
||||
BindElement *BSIM3DPqStructPtr ;
|
||||
BindElement *BSIM3GqStructPtr ;
|
||||
BindElement *BSIM3SPqStructPtr ;
|
||||
BindElement *BSIM3BqStructPtr ;
|
||||
#endif
|
||||
|
||||
} BSIM3instance ;
|
||||
|
||||
struct bsim3SizeDependParam
|
||||
|
|
|
|||
|
|
@ -29,3 +29,9 @@ extern int BSIM3trunc(GENmodel*,CKTcircuit*,double*);
|
|||
extern int BSIM3noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||
extern int BSIM3unsetup(GENmodel*,CKTcircuit*);
|
||||
extern int BSIM3soaCheck(CKTcircuit *, GENmodel *);
|
||||
|
||||
#ifdef KLU
|
||||
extern int BSIM3bindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM3bindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM3bindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -72,7 +72,13 @@ SPICEdev BSIM3info = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &BSIM3iSize,
|
||||
/* DEVmodSize */ &BSIM3mSize
|
||||
/* DEVmodSize */ &BSIM3mSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ BSIM3bindCSC,
|
||||
/* DEVbindCSCComplex */ BSIM3bindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ BSIM3bindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ libbsim3soidd_la_SOURCES = \
|
|||
b3soidditf.h
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libbsim3soidd_la_SOURCES += b3soiddbindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -414,6 +414,102 @@ typedef struct sB3SOIDDinstance
|
|||
double **B3SOIDDnVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *B3SOIDDTemptempStructPtr ;
|
||||
BindElement *B3SOIDDTempdpStructPtr ;
|
||||
BindElement *B3SOIDDTempspStructPtr ;
|
||||
BindElement *B3SOIDDTempgStructPtr ;
|
||||
BindElement *B3SOIDDTempbStructPtr ;
|
||||
BindElement *B3SOIDDTempeStructPtr ;
|
||||
BindElement *B3SOIDDGtempStructPtr ;
|
||||
BindElement *B3SOIDDDPtempStructPtr ;
|
||||
BindElement *B3SOIDDSPtempStructPtr ;
|
||||
BindElement *B3SOIDDEtempStructPtr ;
|
||||
BindElement *B3SOIDDBtempStructPtr ;
|
||||
BindElement *B3SOIDDPtempStructPtr ;
|
||||
BindElement *B3SOIDDBpStructPtr ;
|
||||
BindElement *B3SOIDDPbStructPtr ;
|
||||
BindElement *B3SOIDDPpStructPtr ;
|
||||
BindElement *B3SOIDDPgStructPtr ;
|
||||
BindElement *B3SOIDDPdpStructPtr ;
|
||||
BindElement *B3SOIDDPspStructPtr ;
|
||||
BindElement *B3SOIDDPeStructPtr ;
|
||||
BindElement *B3SOIDDEgStructPtr ;
|
||||
BindElement *B3SOIDDEdpStructPtr ;
|
||||
BindElement *B3SOIDDEspStructPtr ;
|
||||
BindElement *B3SOIDDGeStructPtr ;
|
||||
BindElement *B3SOIDDDPeStructPtr ;
|
||||
BindElement *B3SOIDDSPeStructPtr ;
|
||||
BindElement *B3SOIDDEbStructPtr ;
|
||||
BindElement *B3SOIDDGbStructPtr ;
|
||||
BindElement *B3SOIDDDPbStructPtr ;
|
||||
BindElement *B3SOIDDSPbStructPtr ;
|
||||
BindElement *B3SOIDDBeStructPtr ;
|
||||
BindElement *B3SOIDDBgStructPtr ;
|
||||
BindElement *B3SOIDDBdpStructPtr ;
|
||||
BindElement *B3SOIDDBspStructPtr ;
|
||||
BindElement *B3SOIDDBbStructPtr ;
|
||||
BindElement *B3SOIDDEeStructPtr ;
|
||||
BindElement *B3SOIDDGgStructPtr ;
|
||||
BindElement *B3SOIDDGdpStructPtr ;
|
||||
BindElement *B3SOIDDGspStructPtr ;
|
||||
BindElement *B3SOIDDDPgStructPtr ;
|
||||
BindElement *B3SOIDDDPdpStructPtr ;
|
||||
BindElement *B3SOIDDDPspStructPtr ;
|
||||
BindElement *B3SOIDDDPdStructPtr ;
|
||||
BindElement *B3SOIDDSPgStructPtr ;
|
||||
BindElement *B3SOIDDSPdpStructPtr ;
|
||||
BindElement *B3SOIDDSPspStructPtr ;
|
||||
BindElement *B3SOIDDSPsStructPtr ;
|
||||
BindElement *B3SOIDDDdStructPtr ;
|
||||
BindElement *B3SOIDDDdpStructPtr ;
|
||||
BindElement *B3SOIDDSsStructPtr ;
|
||||
BindElement *B3SOIDDSspStructPtr ;
|
||||
BindElement *B3SOIDDVbsStructPtr ;
|
||||
BindElement *B3SOIDDIdsStructPtr ;
|
||||
BindElement *B3SOIDDIcStructPtr ;
|
||||
BindElement *B3SOIDDIbsStructPtr ;
|
||||
BindElement *B3SOIDDIbdStructPtr ;
|
||||
BindElement *B3SOIDDIiiStructPtr ;
|
||||
BindElement *B3SOIDDIgidlStructPtr ;
|
||||
BindElement *B3SOIDDItunStructPtr ;
|
||||
BindElement *B3SOIDDIbpStructPtr ;
|
||||
BindElement *B3SOIDDAbeffStructPtr ;
|
||||
BindElement *B3SOIDDVbs0effStructPtr ;
|
||||
BindElement *B3SOIDDVbseffStructPtr ;
|
||||
BindElement *B3SOIDDXcStructPtr ;
|
||||
BindElement *B3SOIDDCbbStructPtr ;
|
||||
BindElement *B3SOIDDCbdStructPtr ;
|
||||
BindElement *B3SOIDDCbgStructPtr ;
|
||||
BindElement *B3SOIDDqbStructPtr ;
|
||||
BindElement *B3SOIDDQbfStructPtr ;
|
||||
BindElement *B3SOIDDQjsStructPtr ;
|
||||
BindElement *B3SOIDDQjdStructPtr ;
|
||||
BindElement *B3SOIDDGmStructPtr ;
|
||||
BindElement *B3SOIDDGmbsStructPtr ;
|
||||
BindElement *B3SOIDDGdsStructPtr ;
|
||||
BindElement *B3SOIDDGmeStructPtr ;
|
||||
BindElement *B3SOIDDVbs0teffStructPtr ;
|
||||
BindElement *B3SOIDDVthStructPtr ;
|
||||
BindElement *B3SOIDDVgsteffStructPtr ;
|
||||
BindElement *B3SOIDDXcsatStructPtr ;
|
||||
BindElement *B3SOIDDVcscvStructPtr ;
|
||||
BindElement *B3SOIDDVdscvStructPtr ;
|
||||
BindElement *B3SOIDDCbeStructPtr ;
|
||||
BindElement *B3SOIDDDum1StructPtr ;
|
||||
BindElement *B3SOIDDDum2StructPtr ;
|
||||
BindElement *B3SOIDDDum3StructPtr ;
|
||||
BindElement *B3SOIDDDum4StructPtr ;
|
||||
BindElement *B3SOIDDDum5StructPtr ;
|
||||
BindElement *B3SOIDDQaccStructPtr ;
|
||||
BindElement *B3SOIDDQsub0StructPtr ;
|
||||
BindElement *B3SOIDDQsubs1StructPtr ;
|
||||
BindElement *B3SOIDDQsubs2StructPtr ;
|
||||
BindElement *B3SOIDDqeStructPtr ;
|
||||
BindElement *B3SOIDDqdStructPtr ;
|
||||
BindElement *B3SOIDDqgStructPtr ;
|
||||
#endif
|
||||
|
||||
} B3SOIDDinstance ;
|
||||
|
||||
struct b3soiddSizeDependParam
|
||||
|
|
|
|||
|
|
@ -28,3 +28,9 @@ extern int B3SOIDDtemp(GENmodel*,CKTcircuit*);
|
|||
extern int B3SOIDDtrunc(GENmodel*,CKTcircuit*,double*);
|
||||
extern int B3SOIDDnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||
extern int B3SOIDDunsetup(GENmodel*,CKTcircuit*);
|
||||
|
||||
#ifdef KLU
|
||||
extern int B3SOIDDbindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int B3SOIDDbindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int B3SOIDDbindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -70,7 +70,14 @@ SPICEdev B3SOIDDinfo = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &B3SOIDDiSize,
|
||||
/* DEVmodSize */ &B3SOIDDmSize
|
||||
/* DEVmodSize */ &B3SOIDDmSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ B3SOIDDbindCSC,
|
||||
/* DEVbindCSCComplex */ B3SOIDDbindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ B3SOIDDbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
SPICEdev *
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ libbsim3soifd_la_SOURCES = \
|
|||
b3soifditf.h
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libbsim3soifd_la_SOURCES += b3soifdbindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -414,6 +414,94 @@ typedef struct sB3SOIFDinstance
|
|||
double **B3SOIFDnVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *B3SOIFDTemptempStructPtr ;
|
||||
BindElement *B3SOIFDTempdpStructPtr ;
|
||||
BindElement *B3SOIFDTempspStructPtr ;
|
||||
BindElement *B3SOIFDTempgStructPtr ;
|
||||
BindElement *B3SOIFDTempbStructPtr ;
|
||||
BindElement *B3SOIFDTempeStructPtr ;
|
||||
BindElement *B3SOIFDGtempStructPtr ;
|
||||
BindElement *B3SOIFDDPtempStructPtr ;
|
||||
BindElement *B3SOIFDSPtempStructPtr ;
|
||||
BindElement *B3SOIFDEtempStructPtr ;
|
||||
BindElement *B3SOIFDBtempStructPtr ;
|
||||
BindElement *B3SOIFDPtempStructPtr ;
|
||||
BindElement *B3SOIFDBpStructPtr ;
|
||||
BindElement *B3SOIFDPbStructPtr ;
|
||||
BindElement *B3SOIFDPpStructPtr ;
|
||||
BindElement *B3SOIFDPgStructPtr ;
|
||||
BindElement *B3SOIFDPdpStructPtr ;
|
||||
BindElement *B3SOIFDPspStructPtr ;
|
||||
BindElement *B3SOIFDPeStructPtr ;
|
||||
BindElement *B3SOIFDEgStructPtr ;
|
||||
BindElement *B3SOIFDEdpStructPtr ;
|
||||
BindElement *B3SOIFDEspStructPtr ;
|
||||
BindElement *B3SOIFDGeStructPtr ;
|
||||
BindElement *B3SOIFDDPeStructPtr ;
|
||||
BindElement *B3SOIFDSPeStructPtr ;
|
||||
BindElement *B3SOIFDEbStructPtr ;
|
||||
BindElement *B3SOIFDEeStructPtr ;
|
||||
BindElement *B3SOIFDGgStructPtr ;
|
||||
BindElement *B3SOIFDGdpStructPtr ;
|
||||
BindElement *B3SOIFDGspStructPtr ;
|
||||
BindElement *B3SOIFDDPgStructPtr ;
|
||||
BindElement *B3SOIFDDPdpStructPtr ;
|
||||
BindElement *B3SOIFDDPspStructPtr ;
|
||||
BindElement *B3SOIFDDPdStructPtr ;
|
||||
BindElement *B3SOIFDSPgStructPtr ;
|
||||
BindElement *B3SOIFDSPdpStructPtr ;
|
||||
BindElement *B3SOIFDSPspStructPtr ;
|
||||
BindElement *B3SOIFDSPsStructPtr ;
|
||||
BindElement *B3SOIFDDdStructPtr ;
|
||||
BindElement *B3SOIFDDdpStructPtr ;
|
||||
BindElement *B3SOIFDSsStructPtr ;
|
||||
BindElement *B3SOIFDSspStructPtr ;
|
||||
BindElement *B3SOIFDVbsStructPtr ;
|
||||
BindElement *B3SOIFDIdsStructPtr ;
|
||||
BindElement *B3SOIFDIcStructPtr ;
|
||||
BindElement *B3SOIFDIbsStructPtr ;
|
||||
BindElement *B3SOIFDIbdStructPtr ;
|
||||
BindElement *B3SOIFDIiiStructPtr ;
|
||||
BindElement *B3SOIFDIgidlStructPtr ;
|
||||
BindElement *B3SOIFDItunStructPtr ;
|
||||
BindElement *B3SOIFDIbpStructPtr ;
|
||||
BindElement *B3SOIFDAbeffStructPtr ;
|
||||
BindElement *B3SOIFDVbs0effStructPtr ;
|
||||
BindElement *B3SOIFDVbseffStructPtr ;
|
||||
BindElement *B3SOIFDXcStructPtr ;
|
||||
BindElement *B3SOIFDCbbStructPtr ;
|
||||
BindElement *B3SOIFDCbdStructPtr ;
|
||||
BindElement *B3SOIFDCbgStructPtr ;
|
||||
BindElement *B3SOIFDqbStructPtr ;
|
||||
BindElement *B3SOIFDQbfStructPtr ;
|
||||
BindElement *B3SOIFDQjsStructPtr ;
|
||||
BindElement *B3SOIFDQjdStructPtr ;
|
||||
BindElement *B3SOIFDGmStructPtr ;
|
||||
BindElement *B3SOIFDGmbsStructPtr ;
|
||||
BindElement *B3SOIFDGdsStructPtr ;
|
||||
BindElement *B3SOIFDGmeStructPtr ;
|
||||
BindElement *B3SOIFDVbs0teffStructPtr ;
|
||||
BindElement *B3SOIFDVthStructPtr ;
|
||||
BindElement *B3SOIFDVgsteffStructPtr ;
|
||||
BindElement *B3SOIFDXcsatStructPtr ;
|
||||
BindElement *B3SOIFDVcscvStructPtr ;
|
||||
BindElement *B3SOIFDVdscvStructPtr ;
|
||||
BindElement *B3SOIFDCbeStructPtr ;
|
||||
BindElement *B3SOIFDDum1StructPtr ;
|
||||
BindElement *B3SOIFDDum2StructPtr ;
|
||||
BindElement *B3SOIFDDum3StructPtr ;
|
||||
BindElement *B3SOIFDDum4StructPtr ;
|
||||
BindElement *B3SOIFDDum5StructPtr ;
|
||||
BindElement *B3SOIFDQaccStructPtr ;
|
||||
BindElement *B3SOIFDQsub0StructPtr ;
|
||||
BindElement *B3SOIFDQsubs1StructPtr ;
|
||||
BindElement *B3SOIFDQsubs2StructPtr ;
|
||||
BindElement *B3SOIFDqeStructPtr ;
|
||||
BindElement *B3SOIFDqdStructPtr ;
|
||||
BindElement *B3SOIFDqgStructPtr ;
|
||||
#endif
|
||||
|
||||
} B3SOIFDinstance ;
|
||||
|
||||
struct b3soifdSizeDependParam
|
||||
|
|
|
|||
|
|
@ -29,3 +29,8 @@ extern int B3SOIFDtrunc(GENmodel*,CKTcircuit*,double*);
|
|||
extern int B3SOIFDnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||
extern int B3SOIFDunsetup(GENmodel*,CKTcircuit*);
|
||||
|
||||
#ifdef KLU
|
||||
extern int B3SOIFDbindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int B3SOIFDbindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int B3SOIFDbindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -71,7 +71,14 @@ SPICEdev B3SOIFDinfo = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize*/ &B3SOIFDiSize,
|
||||
/* DEVmodSize*/ &B3SOIFDmSize
|
||||
/* DEVmodSize*/ &B3SOIFDmSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ B3SOIFDbindCSC,
|
||||
/* DEVbindCSCComplex */ B3SOIFDbindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ B3SOIFDbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ libbsim3soipd_la_SOURCES = \
|
|||
b3soipditf.h
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libbsim3soipd_la_SOURCES += b3soipdbindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -379,6 +379,73 @@ typedef struct sB3SOIPDinstance
|
|||
double **B3SOIPDnVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *B3SOIPDTemptempStructPtr ;
|
||||
BindElement *B3SOIPDTempdpStructPtr ;
|
||||
BindElement *B3SOIPDTempspStructPtr ;
|
||||
BindElement *B3SOIPDTempgStructPtr ;
|
||||
BindElement *B3SOIPDTempbStructPtr ;
|
||||
BindElement *B3SOIPDGtempStructPtr ;
|
||||
BindElement *B3SOIPDDPtempStructPtr ;
|
||||
BindElement *B3SOIPDSPtempStructPtr ;
|
||||
BindElement *B3SOIPDEtempStructPtr ;
|
||||
BindElement *B3SOIPDBtempStructPtr ;
|
||||
BindElement *B3SOIPDPtempStructPtr ;
|
||||
BindElement *B3SOIPDBpStructPtr ;
|
||||
BindElement *B3SOIPDPbStructPtr ;
|
||||
BindElement *B3SOIPDPpStructPtr ;
|
||||
BindElement *B3SOIPDEbStructPtr ;
|
||||
BindElement *B3SOIPDGbStructPtr ;
|
||||
BindElement *B3SOIPDDPbStructPtr ;
|
||||
BindElement *B3SOIPDSPbStructPtr ;
|
||||
BindElement *B3SOIPDBeStructPtr ;
|
||||
BindElement *B3SOIPDBgStructPtr ;
|
||||
BindElement *B3SOIPDBdpStructPtr ;
|
||||
BindElement *B3SOIPDBspStructPtr ;
|
||||
BindElement *B3SOIPDBbStructPtr ;
|
||||
BindElement *B3SOIPDEgStructPtr ;
|
||||
BindElement *B3SOIPDEdpStructPtr ;
|
||||
BindElement *B3SOIPDEspStructPtr ;
|
||||
BindElement *B3SOIPDGeStructPtr ;
|
||||
BindElement *B3SOIPDDPeStructPtr ;
|
||||
BindElement *B3SOIPDSPeStructPtr ;
|
||||
BindElement *B3SOIPDEeStructPtr ;
|
||||
BindElement *B3SOIPDGgStructPtr ;
|
||||
BindElement *B3SOIPDGdpStructPtr ;
|
||||
BindElement *B3SOIPDGspStructPtr ;
|
||||
BindElement *B3SOIPDDPgStructPtr ;
|
||||
BindElement *B3SOIPDDPdpStructPtr ;
|
||||
BindElement *B3SOIPDDPspStructPtr ;
|
||||
BindElement *B3SOIPDDPdStructPtr ;
|
||||
BindElement *B3SOIPDSPgStructPtr ;
|
||||
BindElement *B3SOIPDSPdpStructPtr ;
|
||||
BindElement *B3SOIPDSPspStructPtr ;
|
||||
BindElement *B3SOIPDSPsStructPtr ;
|
||||
BindElement *B3SOIPDDdStructPtr ;
|
||||
BindElement *B3SOIPDDdpStructPtr ;
|
||||
BindElement *B3SOIPDSsStructPtr ;
|
||||
BindElement *B3SOIPDSspStructPtr ;
|
||||
BindElement *B3SOIPDVbsStructPtr ;
|
||||
BindElement *B3SOIPDIdsStructPtr ;
|
||||
BindElement *B3SOIPDIcStructPtr ;
|
||||
BindElement *B3SOIPDIbsStructPtr ;
|
||||
BindElement *B3SOIPDIbdStructPtr ;
|
||||
BindElement *B3SOIPDIiiStructPtr ;
|
||||
BindElement *B3SOIPDIgStructPtr ;
|
||||
BindElement *B3SOIPDGiggStructPtr ;
|
||||
BindElement *B3SOIPDGigdStructPtr ;
|
||||
BindElement *B3SOIPDGigbStructPtr ;
|
||||
BindElement *B3SOIPDIgidlStructPtr ;
|
||||
BindElement *B3SOIPDItunStructPtr ;
|
||||
BindElement *B3SOIPDIbpStructPtr ;
|
||||
BindElement *B3SOIPDCbbStructPtr ;
|
||||
BindElement *B3SOIPDCbdStructPtr ;
|
||||
BindElement *B3SOIPDCbgStructPtr ;
|
||||
BindElement *B3SOIPDQbfStructPtr ;
|
||||
BindElement *B3SOIPDQjsStructPtr ;
|
||||
BindElement *B3SOIPDQjdStructPtr ;
|
||||
#endif
|
||||
|
||||
} B3SOIPDinstance ;
|
||||
|
||||
struct b3soipdSizeDependParam
|
||||
|
|
|
|||
|
|
@ -28,3 +28,9 @@ extern int B3SOIPDtemp(GENmodel*,CKTcircuit*);
|
|||
extern int B3SOIPDtrunc(GENmodel*,CKTcircuit*,double*);
|
||||
extern int B3SOIPDnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||
extern int B3SOIPDunsetup(GENmodel*,CKTcircuit*);
|
||||
|
||||
#ifdef KLU
|
||||
extern int B3SOIPDbindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int B3SOIPDbindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int B3SOIPDbindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -72,7 +72,14 @@ SPICEdev B3SOIPDinfo = {
|
|||
/* DEVacct*/ NULL,
|
||||
#endif
|
||||
/* DEVinstSize*/ &B3SOIPDiSize,
|
||||
/* DEVmodSize*/ &B3SOIPDmSize
|
||||
/* DEVmodSize*/ &B3SOIPDmSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ B3SOIPDbindCSC,
|
||||
/* DEVbindCSCComplex */ B3SOIPDbindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ B3SOIPDbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
SPICEdev *
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ libbsim3v0_la_SOURCES = \
|
|||
bsim3v0itf.h
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libbsim3v0_la_SOURCES += b3v0bindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,519 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "bsim3v0def.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
BSIM3v0bindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BSIM3v0model *model = (BSIM3v0model *)inModel ;
|
||||
BSIM3v0instance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the BSIM3v0 models */
|
||||
for ( ; model != NULL ; model = model->BSIM3v0nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BSIM3v0instances ; here != NULL ; here = here->BSIM3v0nextInstance)
|
||||
{
|
||||
if ((here-> BSIM3v0dNode != 0) && (here-> BSIM3v0dNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0DdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0DdStructPtr = matched ;
|
||||
here->BSIM3v0DdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0gNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0GgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0GgStructPtr = matched ;
|
||||
here->BSIM3v0GgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0sNode != 0) && (here-> BSIM3v0sNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0SsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0SsStructPtr = matched ;
|
||||
here->BSIM3v0SsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0bNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0BbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0BbStructPtr = matched ;
|
||||
here->BSIM3v0BbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v0DPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0DPdpStructPtr = matched ;
|
||||
here->BSIM3v0DPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v0SPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0SPspStructPtr = matched ;
|
||||
here->BSIM3v0SPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0dNode != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v0DdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0DdpStructPtr = matched ;
|
||||
here->BSIM3v0DdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0bNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0GbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0GbStructPtr = matched ;
|
||||
here->BSIM3v0GbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v0GdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0GdpStructPtr = matched ;
|
||||
here->BSIM3v0GdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v0GspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0GspStructPtr = matched ;
|
||||
here->BSIM3v0GspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0sNode != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v0SspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0SspStructPtr = matched ;
|
||||
here->BSIM3v0SspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v0BdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0BdpStructPtr = matched ;
|
||||
here->BSIM3v0BdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v0BspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0BspStructPtr = matched ;
|
||||
here->BSIM3v0BspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v0DPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0DPspStructPtr = matched ;
|
||||
here->BSIM3v0DPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0dNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0DPdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0DPdStructPtr = matched ;
|
||||
here->BSIM3v0DPdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0gNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0BgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0BgStructPtr = matched ;
|
||||
here->BSIM3v0BgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0gNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0DPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0DPgStructPtr = matched ;
|
||||
here->BSIM3v0DPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0gNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0SPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0SPgStructPtr = matched ;
|
||||
here->BSIM3v0SPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0sNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0SPsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0SPsStructPtr = matched ;
|
||||
here->BSIM3v0SPsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0bNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0DPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0DPbStructPtr = matched ;
|
||||
here->BSIM3v0DPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0bNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0SPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0SPbStructPtr = matched ;
|
||||
here->BSIM3v0SPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v0SPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0SPdpStructPtr = matched ;
|
||||
here->BSIM3v0SPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0qNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0QqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0QqStructPtr = matched ;
|
||||
here->BSIM3v0QqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v0QdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0QdpStructPtr = matched ;
|
||||
here->BSIM3v0QdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v0QspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0QspStructPtr = matched ;
|
||||
here->BSIM3v0QspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0gNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0QgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0QgStructPtr = matched ;
|
||||
here->BSIM3v0QgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0bNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0QbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0QbStructPtr = matched ;
|
||||
here->BSIM3v0QbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0qNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0DPqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0DPqStructPtr = matched ;
|
||||
here->BSIM3v0DPqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0qNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0SPqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0SPqStructPtr = matched ;
|
||||
here->BSIM3v0SPqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0qNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0GqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0GqStructPtr = matched ;
|
||||
here->BSIM3v0GqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0qNode != 0))
|
||||
{
|
||||
i = here->BSIM3v0BqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v0BqStructPtr = matched ;
|
||||
here->BSIM3v0BqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
BSIM3v0bindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BSIM3v0model *model = (BSIM3v0model *)inModel ;
|
||||
BSIM3v0instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the BSIM3v0 models */
|
||||
for ( ; model != NULL ; model = model->BSIM3v0nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BSIM3v0instances ; here != NULL ; here = here->BSIM3v0nextInstance)
|
||||
{
|
||||
if ((here-> BSIM3v0dNode != 0) && (here-> BSIM3v0dNode != 0))
|
||||
here->BSIM3v0DdPtr = here->BSIM3v0DdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0gNode != 0))
|
||||
here->BSIM3v0GgPtr = here->BSIM3v0GgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0sNode != 0) && (here-> BSIM3v0sNode != 0))
|
||||
here->BSIM3v0SsPtr = here->BSIM3v0SsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0bNode != 0))
|
||||
here->BSIM3v0BbPtr = here->BSIM3v0BbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
here->BSIM3v0DPdpPtr = here->BSIM3v0DPdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
here->BSIM3v0SPspPtr = here->BSIM3v0SPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0dNode != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
here->BSIM3v0DdpPtr = here->BSIM3v0DdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0bNode != 0))
|
||||
here->BSIM3v0GbPtr = here->BSIM3v0GbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
here->BSIM3v0GdpPtr = here->BSIM3v0GdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
here->BSIM3v0GspPtr = here->BSIM3v0GspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0sNode != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
here->BSIM3v0SspPtr = here->BSIM3v0SspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
here->BSIM3v0BdpPtr = here->BSIM3v0BdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
here->BSIM3v0BspPtr = here->BSIM3v0BspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
here->BSIM3v0DPspPtr = here->BSIM3v0DPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0dNode != 0))
|
||||
here->BSIM3v0DPdPtr = here->BSIM3v0DPdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0gNode != 0))
|
||||
here->BSIM3v0BgPtr = here->BSIM3v0BgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0gNode != 0))
|
||||
here->BSIM3v0DPgPtr = here->BSIM3v0DPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0gNode != 0))
|
||||
here->BSIM3v0SPgPtr = here->BSIM3v0SPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0sNode != 0))
|
||||
here->BSIM3v0SPsPtr = here->BSIM3v0SPsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0bNode != 0))
|
||||
here->BSIM3v0DPbPtr = here->BSIM3v0DPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0bNode != 0))
|
||||
here->BSIM3v0SPbPtr = here->BSIM3v0SPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
here->BSIM3v0SPdpPtr = here->BSIM3v0SPdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0qNode != 0))
|
||||
here->BSIM3v0QqPtr = here->BSIM3v0QqStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
here->BSIM3v0QdpPtr = here->BSIM3v0QdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
here->BSIM3v0QspPtr = here->BSIM3v0QspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0gNode != 0))
|
||||
here->BSIM3v0QgPtr = here->BSIM3v0QgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0bNode != 0))
|
||||
here->BSIM3v0QbPtr = here->BSIM3v0QbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0qNode != 0))
|
||||
here->BSIM3v0DPqPtr = here->BSIM3v0DPqStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0qNode != 0))
|
||||
here->BSIM3v0SPqPtr = here->BSIM3v0SPqStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0qNode != 0))
|
||||
here->BSIM3v0GqPtr = here->BSIM3v0GqStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0qNode != 0))
|
||||
here->BSIM3v0BqPtr = here->BSIM3v0BqStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
BSIM3v0bindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BSIM3v0model *model = (BSIM3v0model *)inModel ;
|
||||
BSIM3v0instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the BSIM3v0 models */
|
||||
for ( ; model != NULL ; model = model->BSIM3v0nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BSIM3v0instances ; here != NULL ; here = here->BSIM3v0nextInstance)
|
||||
{
|
||||
if ((here-> BSIM3v0dNode != 0) && (here-> BSIM3v0dNode != 0))
|
||||
here->BSIM3v0DdPtr = here->BSIM3v0DdStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0gNode != 0))
|
||||
here->BSIM3v0GgPtr = here->BSIM3v0GgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0sNode != 0) && (here-> BSIM3v0sNode != 0))
|
||||
here->BSIM3v0SsPtr = here->BSIM3v0SsStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0bNode != 0))
|
||||
here->BSIM3v0BbPtr = here->BSIM3v0BbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
here->BSIM3v0DPdpPtr = here->BSIM3v0DPdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
here->BSIM3v0SPspPtr = here->BSIM3v0SPspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0dNode != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
here->BSIM3v0DdpPtr = here->BSIM3v0DdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0bNode != 0))
|
||||
here->BSIM3v0GbPtr = here->BSIM3v0GbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
here->BSIM3v0GdpPtr = here->BSIM3v0GdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
here->BSIM3v0GspPtr = here->BSIM3v0GspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0sNode != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
here->BSIM3v0SspPtr = here->BSIM3v0SspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
here->BSIM3v0BdpPtr = here->BSIM3v0BdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
here->BSIM3v0BspPtr = here->BSIM3v0BspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
here->BSIM3v0DPspPtr = here->BSIM3v0DPspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0dNode != 0))
|
||||
here->BSIM3v0DPdPtr = here->BSIM3v0DPdStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0gNode != 0))
|
||||
here->BSIM3v0BgPtr = here->BSIM3v0BgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0gNode != 0))
|
||||
here->BSIM3v0DPgPtr = here->BSIM3v0DPgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0gNode != 0))
|
||||
here->BSIM3v0SPgPtr = here->BSIM3v0SPgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0sNode != 0))
|
||||
here->BSIM3v0SPsPtr = here->BSIM3v0SPsStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0bNode != 0))
|
||||
here->BSIM3v0DPbPtr = here->BSIM3v0DPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0bNode != 0))
|
||||
here->BSIM3v0SPbPtr = here->BSIM3v0SPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
here->BSIM3v0SPdpPtr = here->BSIM3v0SPdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0qNode != 0))
|
||||
here->BSIM3v0QqPtr = here->BSIM3v0QqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0dNodePrime != 0))
|
||||
here->BSIM3v0QdpPtr = here->BSIM3v0QdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0sNodePrime != 0))
|
||||
here->BSIM3v0QspPtr = here->BSIM3v0QspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0gNode != 0))
|
||||
here->BSIM3v0QgPtr = here->BSIM3v0QgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0qNode != 0) && (here-> BSIM3v0bNode != 0))
|
||||
here->BSIM3v0QbPtr = here->BSIM3v0QbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0dNodePrime != 0) && (here-> BSIM3v0qNode != 0))
|
||||
here->BSIM3v0DPqPtr = here->BSIM3v0DPqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0sNodePrime != 0) && (here-> BSIM3v0qNode != 0))
|
||||
here->BSIM3v0SPqPtr = here->BSIM3v0SPqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0gNode != 0) && (here-> BSIM3v0qNode != 0))
|
||||
here->BSIM3v0GqPtr = here->BSIM3v0GqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v0bNode != 0) && (here-> BSIM3v0qNode != 0))
|
||||
here->BSIM3v0BqPtr = here->BSIM3v0BqStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -188,6 +188,40 @@ typedef struct sBSIM3v0instance
|
|||
double **BSIM3v0nVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *BSIM3v0DdStructPtr ;
|
||||
BindElement *BSIM3v0GgStructPtr ;
|
||||
BindElement *BSIM3v0SsStructPtr ;
|
||||
BindElement *BSIM3v0BbStructPtr ;
|
||||
BindElement *BSIM3v0DPdpStructPtr ;
|
||||
BindElement *BSIM3v0SPspStructPtr ;
|
||||
BindElement *BSIM3v0DdpStructPtr ;
|
||||
BindElement *BSIM3v0GbStructPtr ;
|
||||
BindElement *BSIM3v0GdpStructPtr ;
|
||||
BindElement *BSIM3v0GspStructPtr ;
|
||||
BindElement *BSIM3v0SspStructPtr ;
|
||||
BindElement *BSIM3v0BdpStructPtr ;
|
||||
BindElement *BSIM3v0BspStructPtr ;
|
||||
BindElement *BSIM3v0DPspStructPtr ;
|
||||
BindElement *BSIM3v0DPdStructPtr ;
|
||||
BindElement *BSIM3v0BgStructPtr ;
|
||||
BindElement *BSIM3v0DPgStructPtr ;
|
||||
BindElement *BSIM3v0SPgStructPtr ;
|
||||
BindElement *BSIM3v0SPsStructPtr ;
|
||||
BindElement *BSIM3v0DPbStructPtr ;
|
||||
BindElement *BSIM3v0SPbStructPtr ;
|
||||
BindElement *BSIM3v0SPdpStructPtr ;
|
||||
BindElement *BSIM3v0QqStructPtr ;
|
||||
BindElement *BSIM3v0QdpStructPtr ;
|
||||
BindElement *BSIM3v0QspStructPtr ;
|
||||
BindElement *BSIM3v0QgStructPtr ;
|
||||
BindElement *BSIM3v0QbStructPtr ;
|
||||
BindElement *BSIM3v0DPqStructPtr ;
|
||||
BindElement *BSIM3v0SPqStructPtr ;
|
||||
BindElement *BSIM3v0GqStructPtr ;
|
||||
BindElement *BSIM3v0BqStructPtr ;
|
||||
#endif
|
||||
|
||||
} BSIM3v0instance ;
|
||||
|
||||
struct bsim3v0SizeDependParam
|
||||
|
|
|
|||
|
|
@ -28,3 +28,8 @@ extern int BSIM3v0trunc(GENmodel*,CKTcircuit*,double*);
|
|||
extern int BSIM3v0noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||
extern int BSIM3v0unsetup(GENmodel *, CKTcircuit *);
|
||||
|
||||
#ifdef KLU
|
||||
extern int BSIM3v0bindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM3v0bindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM3v0bindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -71,7 +71,13 @@ SPICEdev B3v0info = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &BSIM3v0iSize,
|
||||
/* DEVmodSize */ &BSIM3v0mSize
|
||||
/* DEVmodSize */ &BSIM3v0mSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ BSIM3v0bindCSC,
|
||||
/* DEVbindCSCComplex */ BSIM3v0bindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ BSIM3v0bindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ libbsim3v1_la_SOURCES = \
|
|||
bsim3v1itf.h
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libbsim3v1_la_SOURCES += b3v1bindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,519 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "bsim3v1def.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
BSIM3v1bindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BSIM3v1model *model = (BSIM3v1model *)inModel ;
|
||||
BSIM3v1instance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the BSIM3v1 models */
|
||||
for ( ; model != NULL ; model = model->BSIM3v1nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BSIM3v1instances ; here != NULL ; here = here->BSIM3v1nextInstance)
|
||||
{
|
||||
if ((here-> BSIM3v1dNode != 0) && (here-> BSIM3v1dNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1DdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1DdStructPtr = matched ;
|
||||
here->BSIM3v1DdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1gNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1GgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1GgStructPtr = matched ;
|
||||
here->BSIM3v1GgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1sNode != 0) && (here-> BSIM3v1sNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1SsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1SsStructPtr = matched ;
|
||||
here->BSIM3v1SsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1bNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1BbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1BbStructPtr = matched ;
|
||||
here->BSIM3v1BbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v1DPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1DPdpStructPtr = matched ;
|
||||
here->BSIM3v1DPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v1SPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1SPspStructPtr = matched ;
|
||||
here->BSIM3v1SPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1dNode != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v1DdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1DdpStructPtr = matched ;
|
||||
here->BSIM3v1DdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1bNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1GbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1GbStructPtr = matched ;
|
||||
here->BSIM3v1GbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v1GdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1GdpStructPtr = matched ;
|
||||
here->BSIM3v1GdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v1GspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1GspStructPtr = matched ;
|
||||
here->BSIM3v1GspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1sNode != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v1SspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1SspStructPtr = matched ;
|
||||
here->BSIM3v1SspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v1BdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1BdpStructPtr = matched ;
|
||||
here->BSIM3v1BdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v1BspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1BspStructPtr = matched ;
|
||||
here->BSIM3v1BspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v1DPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1DPspStructPtr = matched ;
|
||||
here->BSIM3v1DPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1dNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1DPdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1DPdStructPtr = matched ;
|
||||
here->BSIM3v1DPdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1gNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1BgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1BgStructPtr = matched ;
|
||||
here->BSIM3v1BgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1gNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1DPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1DPgStructPtr = matched ;
|
||||
here->BSIM3v1DPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1gNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1SPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1SPgStructPtr = matched ;
|
||||
here->BSIM3v1SPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1sNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1SPsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1SPsStructPtr = matched ;
|
||||
here->BSIM3v1SPsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1bNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1DPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1DPbStructPtr = matched ;
|
||||
here->BSIM3v1DPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1bNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1SPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1SPbStructPtr = matched ;
|
||||
here->BSIM3v1SPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v1SPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1SPdpStructPtr = matched ;
|
||||
here->BSIM3v1SPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1qNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1QqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1QqStructPtr = matched ;
|
||||
here->BSIM3v1QqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v1QdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1QdpStructPtr = matched ;
|
||||
here->BSIM3v1QdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
{
|
||||
i = here->BSIM3v1QspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1QspStructPtr = matched ;
|
||||
here->BSIM3v1QspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1gNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1QgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1QgStructPtr = matched ;
|
||||
here->BSIM3v1QgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1bNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1QbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1QbStructPtr = matched ;
|
||||
here->BSIM3v1QbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1qNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1DPqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1DPqStructPtr = matched ;
|
||||
here->BSIM3v1DPqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1qNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1SPqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1SPqStructPtr = matched ;
|
||||
here->BSIM3v1SPqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1qNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1GqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1GqStructPtr = matched ;
|
||||
here->BSIM3v1GqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1qNode != 0))
|
||||
{
|
||||
i = here->BSIM3v1BqPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->BSIM3v1BqStructPtr = matched ;
|
||||
here->BSIM3v1BqPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
BSIM3v1bindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BSIM3v1model *model = (BSIM3v1model *)inModel ;
|
||||
BSIM3v1instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the BSIM3v1 models */
|
||||
for ( ; model != NULL ; model = model->BSIM3v1nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BSIM3v1instances ; here != NULL ; here = here->BSIM3v1nextInstance)
|
||||
{
|
||||
if ((here-> BSIM3v1dNode != 0) && (here-> BSIM3v1dNode != 0))
|
||||
here->BSIM3v1DdPtr = here->BSIM3v1DdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1gNode != 0))
|
||||
here->BSIM3v1GgPtr = here->BSIM3v1GgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1sNode != 0) && (here-> BSIM3v1sNode != 0))
|
||||
here->BSIM3v1SsPtr = here->BSIM3v1SsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1bNode != 0))
|
||||
here->BSIM3v1BbPtr = here->BSIM3v1BbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
here->BSIM3v1DPdpPtr = here->BSIM3v1DPdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
here->BSIM3v1SPspPtr = here->BSIM3v1SPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1dNode != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
here->BSIM3v1DdpPtr = here->BSIM3v1DdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1bNode != 0))
|
||||
here->BSIM3v1GbPtr = here->BSIM3v1GbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
here->BSIM3v1GdpPtr = here->BSIM3v1GdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
here->BSIM3v1GspPtr = here->BSIM3v1GspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1sNode != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
here->BSIM3v1SspPtr = here->BSIM3v1SspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
here->BSIM3v1BdpPtr = here->BSIM3v1BdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
here->BSIM3v1BspPtr = here->BSIM3v1BspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
here->BSIM3v1DPspPtr = here->BSIM3v1DPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1dNode != 0))
|
||||
here->BSIM3v1DPdPtr = here->BSIM3v1DPdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1gNode != 0))
|
||||
here->BSIM3v1BgPtr = here->BSIM3v1BgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1gNode != 0))
|
||||
here->BSIM3v1DPgPtr = here->BSIM3v1DPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1gNode != 0))
|
||||
here->BSIM3v1SPgPtr = here->BSIM3v1SPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1sNode != 0))
|
||||
here->BSIM3v1SPsPtr = here->BSIM3v1SPsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1bNode != 0))
|
||||
here->BSIM3v1DPbPtr = here->BSIM3v1DPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1bNode != 0))
|
||||
here->BSIM3v1SPbPtr = here->BSIM3v1SPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
here->BSIM3v1SPdpPtr = here->BSIM3v1SPdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1qNode != 0))
|
||||
here->BSIM3v1QqPtr = here->BSIM3v1QqStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
here->BSIM3v1QdpPtr = here->BSIM3v1QdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
here->BSIM3v1QspPtr = here->BSIM3v1QspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1gNode != 0))
|
||||
here->BSIM3v1QgPtr = here->BSIM3v1QgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1bNode != 0))
|
||||
here->BSIM3v1QbPtr = here->BSIM3v1QbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1qNode != 0))
|
||||
here->BSIM3v1DPqPtr = here->BSIM3v1DPqStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1qNode != 0))
|
||||
here->BSIM3v1SPqPtr = here->BSIM3v1SPqStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1qNode != 0))
|
||||
here->BSIM3v1GqPtr = here->BSIM3v1GqStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1qNode != 0))
|
||||
here->BSIM3v1BqPtr = here->BSIM3v1BqStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
BSIM3v1bindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BSIM3v1model *model = (BSIM3v1model *)inModel ;
|
||||
BSIM3v1instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the BSIM3v1 models */
|
||||
for ( ; model != NULL ; model = model->BSIM3v1nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BSIM3v1instances ; here != NULL ; here = here->BSIM3v1nextInstance)
|
||||
{
|
||||
if ((here-> BSIM3v1dNode != 0) && (here-> BSIM3v1dNode != 0))
|
||||
here->BSIM3v1DdPtr = here->BSIM3v1DdStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1gNode != 0))
|
||||
here->BSIM3v1GgPtr = here->BSIM3v1GgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1sNode != 0) && (here-> BSIM3v1sNode != 0))
|
||||
here->BSIM3v1SsPtr = here->BSIM3v1SsStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1bNode != 0))
|
||||
here->BSIM3v1BbPtr = here->BSIM3v1BbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
here->BSIM3v1DPdpPtr = here->BSIM3v1DPdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
here->BSIM3v1SPspPtr = here->BSIM3v1SPspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1dNode != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
here->BSIM3v1DdpPtr = here->BSIM3v1DdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1bNode != 0))
|
||||
here->BSIM3v1GbPtr = here->BSIM3v1GbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
here->BSIM3v1GdpPtr = here->BSIM3v1GdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
here->BSIM3v1GspPtr = here->BSIM3v1GspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1sNode != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
here->BSIM3v1SspPtr = here->BSIM3v1SspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
here->BSIM3v1BdpPtr = here->BSIM3v1BdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
here->BSIM3v1BspPtr = here->BSIM3v1BspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
here->BSIM3v1DPspPtr = here->BSIM3v1DPspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1dNode != 0))
|
||||
here->BSIM3v1DPdPtr = here->BSIM3v1DPdStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1gNode != 0))
|
||||
here->BSIM3v1BgPtr = here->BSIM3v1BgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1gNode != 0))
|
||||
here->BSIM3v1DPgPtr = here->BSIM3v1DPgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1gNode != 0))
|
||||
here->BSIM3v1SPgPtr = here->BSIM3v1SPgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1sNode != 0))
|
||||
here->BSIM3v1SPsPtr = here->BSIM3v1SPsStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1bNode != 0))
|
||||
here->BSIM3v1DPbPtr = here->BSIM3v1DPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1bNode != 0))
|
||||
here->BSIM3v1SPbPtr = here->BSIM3v1SPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
here->BSIM3v1SPdpPtr = here->BSIM3v1SPdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1qNode != 0))
|
||||
here->BSIM3v1QqPtr = here->BSIM3v1QqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1dNodePrime != 0))
|
||||
here->BSIM3v1QdpPtr = here->BSIM3v1QdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1sNodePrime != 0))
|
||||
here->BSIM3v1QspPtr = here->BSIM3v1QspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1gNode != 0))
|
||||
here->BSIM3v1QgPtr = here->BSIM3v1QgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1qNode != 0) && (here-> BSIM3v1bNode != 0))
|
||||
here->BSIM3v1QbPtr = here->BSIM3v1QbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1dNodePrime != 0) && (here-> BSIM3v1qNode != 0))
|
||||
here->BSIM3v1DPqPtr = here->BSIM3v1DPqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1sNodePrime != 0) && (here-> BSIM3v1qNode != 0))
|
||||
here->BSIM3v1SPqPtr = here->BSIM3v1SPqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1gNode != 0) && (here-> BSIM3v1qNode != 0))
|
||||
here->BSIM3v1GqPtr = here->BSIM3v1GqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v1bNode != 0) && (here-> BSIM3v1qNode != 0))
|
||||
here->BSIM3v1BqPtr = here->BSIM3v1BqStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -189,6 +189,40 @@ typedef struct sBSIM3v1instance
|
|||
double **BSIM3v1nVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *BSIM3v1DdStructPtr ;
|
||||
BindElement *BSIM3v1GgStructPtr ;
|
||||
BindElement *BSIM3v1SsStructPtr ;
|
||||
BindElement *BSIM3v1BbStructPtr ;
|
||||
BindElement *BSIM3v1DPdpStructPtr ;
|
||||
BindElement *BSIM3v1SPspStructPtr ;
|
||||
BindElement *BSIM3v1DdpStructPtr ;
|
||||
BindElement *BSIM3v1GbStructPtr ;
|
||||
BindElement *BSIM3v1GdpStructPtr ;
|
||||
BindElement *BSIM3v1GspStructPtr ;
|
||||
BindElement *BSIM3v1SspStructPtr ;
|
||||
BindElement *BSIM3v1BdpStructPtr ;
|
||||
BindElement *BSIM3v1BspStructPtr ;
|
||||
BindElement *BSIM3v1DPspStructPtr ;
|
||||
BindElement *BSIM3v1DPdStructPtr ;
|
||||
BindElement *BSIM3v1BgStructPtr ;
|
||||
BindElement *BSIM3v1DPgStructPtr ;
|
||||
BindElement *BSIM3v1SPgStructPtr ;
|
||||
BindElement *BSIM3v1SPsStructPtr ;
|
||||
BindElement *BSIM3v1DPbStructPtr ;
|
||||
BindElement *BSIM3v1SPbStructPtr ;
|
||||
BindElement *BSIM3v1SPdpStructPtr ;
|
||||
BindElement *BSIM3v1QqStructPtr ;
|
||||
BindElement *BSIM3v1QdpStructPtr ;
|
||||
BindElement *BSIM3v1QspStructPtr ;
|
||||
BindElement *BSIM3v1QgStructPtr ;
|
||||
BindElement *BSIM3v1QbStructPtr ;
|
||||
BindElement *BSIM3v1DPqStructPtr ;
|
||||
BindElement *BSIM3v1SPqStructPtr ;
|
||||
BindElement *BSIM3v1GqStructPtr ;
|
||||
BindElement *BSIM3v1BqStructPtr ;
|
||||
#endif
|
||||
|
||||
} BSIM3v1instance ;
|
||||
|
||||
struct bsim3v1SizeDependParam
|
||||
|
|
|
|||
|
|
@ -29,3 +29,8 @@ extern int BSIM3v1trunc(GENmodel *, CKTcircuit *, double *);
|
|||
extern int BSIM3v1noise(int, int, GENmodel *, CKTcircuit *, Ndata *, double *);
|
||||
extern int BSIM3v1unsetup(GENmodel *, CKTcircuit *);
|
||||
|
||||
#ifdef KLU
|
||||
extern int BSIM3v1bindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM3v1bindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM3v1bindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -71,7 +71,13 @@ SPICEdev BSIM3v1info = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &BSIM3v1iSize,
|
||||
/* DEVmodSize */ &BSIM3v1mSize
|
||||
/* DEVmodSize */ &BSIM3v1mSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ BSIM3v1bindCSC,
|
||||
/* DEVbindCSCComplex */ BSIM3v1bindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ BSIM3v1bindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ libbsim3v32_la_SOURCES = \
|
|||
bsim3v32itf.h
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libbsim3v32_la_SOURCES += b3v32bindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,519 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "bsim3v32def.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
BSIM3v32bindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BSIM3v32model *model = (BSIM3v32model *)inModel ;
|
||||
BSIM3v32instance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
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)
|
||||
{
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
BSIM3v32bindCSCComplexToReal (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 ;
|
||||
|
||||
if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32gNode != 0))
|
||||
here->BSIM3v32GgPtr = here->BSIM3v32GgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32sNode != 0) && (here-> BSIM3v32sNode != 0))
|
||||
here->BSIM3v32SsPtr = here->BSIM3v32SsStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32bNode != 0))
|
||||
here->BSIM3v32BbPtr = here->BSIM3v32BbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32dNodePrime != 0))
|
||||
here->BSIM3v32DPdpPtr = here->BSIM3v32DPdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32sNodePrime != 0))
|
||||
here->BSIM3v32SPspPtr = here->BSIM3v32SPspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32dNode != 0) && (here-> BSIM3v32dNodePrime != 0))
|
||||
here->BSIM3v32DdpPtr = here->BSIM3v32DdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32bNode != 0))
|
||||
here->BSIM3v32GbPtr = here->BSIM3v32GbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32dNodePrime != 0))
|
||||
here->BSIM3v32GdpPtr = here->BSIM3v32GdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32sNodePrime != 0))
|
||||
here->BSIM3v32GspPtr = here->BSIM3v32GspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32sNode != 0) && (here-> BSIM3v32sNodePrime != 0))
|
||||
here->BSIM3v32SspPtr = here->BSIM3v32SspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32dNodePrime != 0))
|
||||
here->BSIM3v32BdpPtr = here->BSIM3v32BdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32sNodePrime != 0))
|
||||
here->BSIM3v32BspPtr = here->BSIM3v32BspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32sNodePrime != 0))
|
||||
here->BSIM3v32DPspPtr = here->BSIM3v32DPspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32dNode != 0))
|
||||
here->BSIM3v32DPdPtr = here->BSIM3v32DPdStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32gNode != 0))
|
||||
here->BSIM3v32BgPtr = here->BSIM3v32BgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32gNode != 0))
|
||||
here->BSIM3v32DPgPtr = here->BSIM3v32DPgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32gNode != 0))
|
||||
here->BSIM3v32SPgPtr = here->BSIM3v32SPgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32sNode != 0))
|
||||
here->BSIM3v32SPsPtr = here->BSIM3v32SPsStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32bNode != 0))
|
||||
here->BSIM3v32DPbPtr = here->BSIM3v32DPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32bNode != 0))
|
||||
here->BSIM3v32SPbPtr = here->BSIM3v32SPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32dNodePrime != 0))
|
||||
here->BSIM3v32SPdpPtr = here->BSIM3v32SPdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32qNode != 0))
|
||||
here->BSIM3v32QqPtr = here->BSIM3v32QqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32dNodePrime != 0))
|
||||
here->BSIM3v32QdpPtr = here->BSIM3v32QdpStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32sNodePrime != 0))
|
||||
here->BSIM3v32QspPtr = here->BSIM3v32QspStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32gNode != 0))
|
||||
here->BSIM3v32QgPtr = here->BSIM3v32QgStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32qNode != 0) && (here-> BSIM3v32bNode != 0))
|
||||
here->BSIM3v32QbPtr = here->BSIM3v32QbStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32dNodePrime != 0) && (here-> BSIM3v32qNode != 0))
|
||||
here->BSIM3v32DPqPtr = here->BSIM3v32DPqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32sNodePrime != 0) && (here-> BSIM3v32qNode != 0))
|
||||
here->BSIM3v32SPqPtr = here->BSIM3v32SPqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32gNode != 0) && (here-> BSIM3v32qNode != 0))
|
||||
here->BSIM3v32GqPtr = here->BSIM3v32GqStructPtr->CSC ;
|
||||
|
||||
if ((here-> BSIM3v32bNode != 0) && (here-> BSIM3v32qNode != 0))
|
||||
here->BSIM3v32BqPtr = here->BSIM3v32BqStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -212,6 +212,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
|
||||
|
|
|
|||
|
|
@ -30,3 +30,9 @@ extern int BSIM3v32trunc(GENmodel*,CKTcircuit*,double*);
|
|||
extern int BSIM3v32noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||
extern int BSIM3v32unsetup(GENmodel*,CKTcircuit*);
|
||||
extern int BSIM3v32soaCheck(CKTcircuit *, GENmodel *);
|
||||
|
||||
#ifdef KLU
|
||||
extern int BSIM3v32bindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM3v32bindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM3v32bindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -72,7 +72,13 @@ SPICEdev BSIM3v32info = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &BSIM3v32iSize,
|
||||
/* DEVmodSize */ &BSIM3v32mSize
|
||||
/* DEVmodSize */ &BSIM3v32mSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ BSIM3v32bindCSC,
|
||||
/* DEVbindCSCComplex */ BSIM3v32bindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ BSIM3v32bindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ libbsim4v5_la_SOURCES = \
|
|||
bsim4v5itf.h
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libbsim4v5_la_SOURCES += b4v5bindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -438,6 +438,79 @@ typedef struct sBSIM4v5instance
|
|||
double **BSIM4v5nVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *BSIM4v5DPbpStructPtr ;
|
||||
BindElement *BSIM4v5GPbpStructPtr ;
|
||||
BindElement *BSIM4v5SPbpStructPtr ;
|
||||
BindElement *BSIM4v5BPdpStructPtr ;
|
||||
BindElement *BSIM4v5BPgpStructPtr ;
|
||||
BindElement *BSIM4v5BPspStructPtr ;
|
||||
BindElement *BSIM4v5BPbpStructPtr ;
|
||||
BindElement *BSIM4v5DdStructPtr ;
|
||||
BindElement *BSIM4v5GPgpStructPtr ;
|
||||
BindElement *BSIM4v5SsStructPtr ;
|
||||
BindElement *BSIM4v5DPdpStructPtr ;
|
||||
BindElement *BSIM4v5SPspStructPtr ;
|
||||
BindElement *BSIM4v5DdpStructPtr ;
|
||||
BindElement *BSIM4v5GPdpStructPtr ;
|
||||
BindElement *BSIM4v5GPspStructPtr ;
|
||||
BindElement *BSIM4v5SspStructPtr ;
|
||||
BindElement *BSIM4v5DPspStructPtr ;
|
||||
BindElement *BSIM4v5DPdStructPtr ;
|
||||
BindElement *BSIM4v5DPgpStructPtr ;
|
||||
BindElement *BSIM4v5SPgpStructPtr ;
|
||||
BindElement *BSIM4v5SPsStructPtr ;
|
||||
BindElement *BSIM4v5SPdpStructPtr ;
|
||||
BindElement *BSIM4v5QqStructPtr ;
|
||||
BindElement *BSIM4v5QbpStructPtr ;
|
||||
BindElement *BSIM4v5QdpStructPtr ;
|
||||
BindElement *BSIM4v5QspStructPtr ;
|
||||
BindElement *BSIM4v5QgpStructPtr ;
|
||||
BindElement *BSIM4v5DPqStructPtr ;
|
||||
BindElement *BSIM4v5SPqStructPtr ;
|
||||
BindElement *BSIM4v5GPqStructPtr ;
|
||||
BindElement *BSIM4v5GEgeStructPtr ;
|
||||
BindElement *BSIM4v5GEgpStructPtr ;
|
||||
BindElement *BSIM4v5GPgeStructPtr ;
|
||||
BindElement *BSIM4v5GEdpStructPtr ;
|
||||
BindElement *BSIM4v5GEspStructPtr ;
|
||||
BindElement *BSIM4v5GEbpStructPtr ;
|
||||
BindElement *BSIM4v5GMdpStructPtr ;
|
||||
BindElement *BSIM4v5GMgpStructPtr ;
|
||||
BindElement *BSIM4v5GMgmStructPtr ;
|
||||
BindElement *BSIM4v5GMgeStructPtr ;
|
||||
BindElement *BSIM4v5GMspStructPtr ;
|
||||
BindElement *BSIM4v5GMbpStructPtr ;
|
||||
BindElement *BSIM4v5DPgmStructPtr ;
|
||||
BindElement *BSIM4v5GPgmStructPtr ;
|
||||
BindElement *BSIM4v5GEgmStructPtr ;
|
||||
BindElement *BSIM4v5SPgmStructPtr ;
|
||||
BindElement *BSIM4v5BPgmStructPtr ;
|
||||
BindElement *BSIM4v5DPdbStructPtr ;
|
||||
BindElement *BSIM4v5SPsbStructPtr ;
|
||||
BindElement *BSIM4v5DBdpStructPtr ;
|
||||
BindElement *BSIM4v5DBdbStructPtr ;
|
||||
BindElement *BSIM4v5DBbpStructPtr ;
|
||||
BindElement *BSIM4v5DBbStructPtr ;
|
||||
BindElement *BSIM4v5BPdbStructPtr ;
|
||||
BindElement *BSIM4v5BPbStructPtr ;
|
||||
BindElement *BSIM4v5BPsbStructPtr ;
|
||||
BindElement *BSIM4v5SBspStructPtr ;
|
||||
BindElement *BSIM4v5SBbpStructPtr ;
|
||||
BindElement *BSIM4v5SBbStructPtr ;
|
||||
BindElement *BSIM4v5SBsbStructPtr ;
|
||||
BindElement *BSIM4v5BdbStructPtr ;
|
||||
BindElement *BSIM4v5BbpStructPtr ;
|
||||
BindElement *BSIM4v5BsbStructPtr ;
|
||||
BindElement *BSIM4v5BbStructPtr ;
|
||||
BindElement *BSIM4v5DgpStructPtr ;
|
||||
BindElement *BSIM4v5DspStructPtr ;
|
||||
BindElement *BSIM4v5DbpStructPtr ;
|
||||
BindElement *BSIM4v5SdpStructPtr ;
|
||||
BindElement *BSIM4v5SgpStructPtr ;
|
||||
BindElement *BSIM4v5SbpStructPtr ;
|
||||
#endif
|
||||
|
||||
} BSIM4v5instance ;
|
||||
|
||||
struct bsim4v5SizeDependParam
|
||||
|
|
|
|||
|
|
@ -29,3 +29,9 @@ extern int BSIM4v5trunc(GENmodel*,CKTcircuit*,double*);
|
|||
extern int BSIM4v5noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||
extern int BSIM4v5unsetup(GENmodel*,CKTcircuit*);
|
||||
extern int BSIM4v5soaCheck(CKTcircuit *, GENmodel *);
|
||||
|
||||
#ifdef KLU
|
||||
extern int BSIM4v5bindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM4v5bindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM4v5bindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -73,7 +73,14 @@ SPICEdev BSIM4v5info = {
|
|||
NULL, /* DEVacct */
|
||||
#endif
|
||||
&BSIM4v5iSize, /* DEVinstSize */
|
||||
&BSIM4v5mSize /* DEVmodSize */
|
||||
&BSIM4v5mSize, /* DEVmodSize */
|
||||
|
||||
#ifdef KLU
|
||||
BSIM4v5bindCSC, /* DEVbindCSC */
|
||||
BSIM4v5bindCSCComplex, /* DEVbindCSCComplex */
|
||||
BSIM4v5bindCSCComplexToReal, /* DEVbindCSCComplexToReal */
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ libbsim4v6_la_SOURCES = \
|
|||
bsim4v6itf.h
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libbsim4v6_la_SOURCES += b4v6bindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -566,6 +566,79 @@ typedef struct sBSIM4v6instance
|
|||
double **BSIM4v6nVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *BSIM4v6DPbpStructPtr ;
|
||||
BindElement *BSIM4v6GPbpStructPtr ;
|
||||
BindElement *BSIM4v6SPbpStructPtr ;
|
||||
BindElement *BSIM4v6BPdpStructPtr ;
|
||||
BindElement *BSIM4v6BPgpStructPtr ;
|
||||
BindElement *BSIM4v6BPspStructPtr ;
|
||||
BindElement *BSIM4v6BPbpStructPtr ;
|
||||
BindElement *BSIM4v6DdStructPtr ;
|
||||
BindElement *BSIM4v6GPgpStructPtr ;
|
||||
BindElement *BSIM4v6SsStructPtr ;
|
||||
BindElement *BSIM4v6DPdpStructPtr ;
|
||||
BindElement *BSIM4v6SPspStructPtr ;
|
||||
BindElement *BSIM4v6DdpStructPtr ;
|
||||
BindElement *BSIM4v6GPdpStructPtr ;
|
||||
BindElement *BSIM4v6GPspStructPtr ;
|
||||
BindElement *BSIM4v6SspStructPtr ;
|
||||
BindElement *BSIM4v6DPspStructPtr ;
|
||||
BindElement *BSIM4v6DPdStructPtr ;
|
||||
BindElement *BSIM4v6DPgpStructPtr ;
|
||||
BindElement *BSIM4v6SPgpStructPtr ;
|
||||
BindElement *BSIM4v6SPsStructPtr ;
|
||||
BindElement *BSIM4v6SPdpStructPtr ;
|
||||
BindElement *BSIM4v6QqStructPtr ;
|
||||
BindElement *BSIM4v6QbpStructPtr ;
|
||||
BindElement *BSIM4v6QdpStructPtr ;
|
||||
BindElement *BSIM4v6QspStructPtr ;
|
||||
BindElement *BSIM4v6QgpStructPtr ;
|
||||
BindElement *BSIM4v6DPqStructPtr ;
|
||||
BindElement *BSIM4v6SPqStructPtr ;
|
||||
BindElement *BSIM4v6GPqStructPtr ;
|
||||
BindElement *BSIM4v6GEgeStructPtr ;
|
||||
BindElement *BSIM4v6GEgpStructPtr ;
|
||||
BindElement *BSIM4v6GPgeStructPtr ;
|
||||
BindElement *BSIM4v6GEdpStructPtr ;
|
||||
BindElement *BSIM4v6GEspStructPtr ;
|
||||
BindElement *BSIM4v6GEbpStructPtr ;
|
||||
BindElement *BSIM4v6GMdpStructPtr ;
|
||||
BindElement *BSIM4v6GMgpStructPtr ;
|
||||
BindElement *BSIM4v6GMgmStructPtr ;
|
||||
BindElement *BSIM4v6GMgeStructPtr ;
|
||||
BindElement *BSIM4v6GMspStructPtr ;
|
||||
BindElement *BSIM4v6GMbpStructPtr ;
|
||||
BindElement *BSIM4v6DPgmStructPtr ;
|
||||
BindElement *BSIM4v6GPgmStructPtr ;
|
||||
BindElement *BSIM4v6GEgmStructPtr ;
|
||||
BindElement *BSIM4v6SPgmStructPtr ;
|
||||
BindElement *BSIM4v6BPgmStructPtr ;
|
||||
BindElement *BSIM4v6DPdbStructPtr ;
|
||||
BindElement *BSIM4v6SPsbStructPtr ;
|
||||
BindElement *BSIM4v6DBdpStructPtr ;
|
||||
BindElement *BSIM4v6DBdbStructPtr ;
|
||||
BindElement *BSIM4v6DBbpStructPtr ;
|
||||
BindElement *BSIM4v6DBbStructPtr ;
|
||||
BindElement *BSIM4v6BPdbStructPtr ;
|
||||
BindElement *BSIM4v6BPbStructPtr ;
|
||||
BindElement *BSIM4v6BPsbStructPtr ;
|
||||
BindElement *BSIM4v6SBspStructPtr ;
|
||||
BindElement *BSIM4v6SBbpStructPtr ;
|
||||
BindElement *BSIM4v6SBbStructPtr ;
|
||||
BindElement *BSIM4v6SBsbStructPtr ;
|
||||
BindElement *BSIM4v6BdbStructPtr ;
|
||||
BindElement *BSIM4v6BbpStructPtr ;
|
||||
BindElement *BSIM4v6BsbStructPtr ;
|
||||
BindElement *BSIM4v6BbStructPtr ;
|
||||
BindElement *BSIM4v6DgpStructPtr ;
|
||||
BindElement *BSIM4v6DspStructPtr ;
|
||||
BindElement *BSIM4v6DbpStructPtr ;
|
||||
BindElement *BSIM4v6SdpStructPtr ;
|
||||
BindElement *BSIM4v6SgpStructPtr ;
|
||||
BindElement *BSIM4v6SbpStructPtr ;
|
||||
#endif
|
||||
|
||||
} BSIM4v6instance ;
|
||||
|
||||
struct bsim4v6SizeDependParam
|
||||
|
|
|
|||
|
|
@ -29,3 +29,9 @@ extern int BSIM4v6trunc(GENmodel*,CKTcircuit*,double*);
|
|||
extern int BSIM4v6noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||
extern int BSIM4v6unsetup(GENmodel*,CKTcircuit*);
|
||||
extern int BSIM4v6soaCheck(CKTcircuit *, GENmodel *);
|
||||
|
||||
#ifdef KLU
|
||||
extern int BSIM4v6bindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM4v6bindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM4v6bindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -73,7 +73,14 @@ SPICEdev BSIM4v6info = {
|
|||
NULL, /* DEVacct */
|
||||
#endif
|
||||
&BSIM4v6iSize, /* DEVinstSize */
|
||||
&BSIM4v6mSize /* DEVmodSize */
|
||||
&BSIM4v6mSize, /* DEVmodSize */
|
||||
|
||||
#ifdef KLU
|
||||
BSIM4v6bindCSC, /* DEVbindCSC */
|
||||
BSIM4v6bindCSCComplex, /* DEVbindCSCComplex */
|
||||
BSIM4v6bindCSCComplexToReal, /* DEVbindCSCComplexToReal */
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ libbsim4soi_la_SOURCES = \
|
|||
b4soiitf.h
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libbsim4soi_la_SOURCES += b4soibindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -736,6 +736,110 @@ typedef struct sB4SOIinstance
|
|||
double **B4SOInVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *B4SOITemptempStructPtr ;
|
||||
BindElement *B4SOITempdpStructPtr ;
|
||||
BindElement *B4SOITempspStructPtr ;
|
||||
BindElement *B4SOITempgStructPtr ;
|
||||
BindElement *B4SOITempbStructPtr ;
|
||||
BindElement *B4SOIGtempStructPtr ;
|
||||
BindElement *B4SOIDPtempStructPtr ;
|
||||
BindElement *B4SOISPtempStructPtr ;
|
||||
BindElement *B4SOIEtempStructPtr ;
|
||||
BindElement *B4SOIBtempStructPtr ;
|
||||
BindElement *B4SOIPtempStructPtr ;
|
||||
BindElement *B4SOITempeStructPtr ;
|
||||
BindElement *B4SOIBpStructPtr ;
|
||||
BindElement *B4SOIPbStructPtr ;
|
||||
BindElement *B4SOIPpStructPtr ;
|
||||
BindElement *B4SOIPgStructPtr ;
|
||||
BindElement *B4SOIGpStructPtr ;
|
||||
BindElement *B4SOIGEgeStructPtr ;
|
||||
BindElement *B4SOIGEgStructPtr ;
|
||||
BindElement *B4SOIGgeStructPtr ;
|
||||
BindElement *B4SOIGEdpStructPtr ;
|
||||
BindElement *B4SOIGEspStructPtr ;
|
||||
BindElement *B4SOIGEbStructPtr ;
|
||||
BindElement *B4SOIGMdpStructPtr ;
|
||||
BindElement *B4SOIGMgStructPtr ;
|
||||
BindElement *B4SOIGMgmStructPtr ;
|
||||
BindElement *B4SOIGMgeStructPtr ;
|
||||
BindElement *B4SOIGMspStructPtr ;
|
||||
BindElement *B4SOIGMbStructPtr ;
|
||||
BindElement *B4SOIGMeStructPtr ;
|
||||
BindElement *B4SOIDPgmStructPtr ;
|
||||
BindElement *B4SOIGgmStructPtr ;
|
||||
BindElement *B4SOIGEgmStructPtr ;
|
||||
BindElement *B4SOISPgmStructPtr ;
|
||||
BindElement *B4SOIEgmStructPtr ;
|
||||
BindElement *B4SOIEbStructPtr ;
|
||||
BindElement *B4SOIGbStructPtr ;
|
||||
BindElement *B4SOIDPbStructPtr ;
|
||||
BindElement *B4SOISPbStructPtr ;
|
||||
BindElement *B4SOIBeStructPtr ;
|
||||
BindElement *B4SOIBgStructPtr ;
|
||||
BindElement *B4SOIBdpStructPtr ;
|
||||
BindElement *B4SOIBspStructPtr ;
|
||||
BindElement *B4SOIBbStructPtr ;
|
||||
BindElement *B4SOIEgStructPtr ;
|
||||
BindElement *B4SOIEdpStructPtr ;
|
||||
BindElement *B4SOIEspStructPtr ;
|
||||
BindElement *B4SOIGeStructPtr ;
|
||||
BindElement *B4SOIDPeStructPtr ;
|
||||
BindElement *B4SOISPeStructPtr ;
|
||||
BindElement *B4SOIEeStructPtr ;
|
||||
BindElement *B4SOIGgStructPtr ;
|
||||
BindElement *B4SOIGdpStructPtr ;
|
||||
BindElement *B4SOIGspStructPtr ;
|
||||
BindElement *B4SOIDPgStructPtr ;
|
||||
BindElement *B4SOIDPdpStructPtr ;
|
||||
BindElement *B4SOIDPspStructPtr ;
|
||||
BindElement *B4SOIDPdStructPtr ;
|
||||
BindElement *B4SOISPgStructPtr ;
|
||||
BindElement *B4SOISPdpStructPtr ;
|
||||
BindElement *B4SOISPspStructPtr ;
|
||||
BindElement *B4SOISPsStructPtr ;
|
||||
BindElement *B4SOIDdStructPtr ;
|
||||
BindElement *B4SOIDdpStructPtr ;
|
||||
BindElement *B4SOISsStructPtr ;
|
||||
BindElement *B4SOISspStructPtr ;
|
||||
BindElement *B4SOIDPdbStructPtr ;
|
||||
BindElement *B4SOISPsbStructPtr ;
|
||||
BindElement *B4SOIDBdpStructPtr ;
|
||||
BindElement *B4SOIDBdbStructPtr ;
|
||||
BindElement *B4SOIDBbStructPtr ;
|
||||
BindElement *B4SOISBspStructPtr ;
|
||||
BindElement *B4SOISBsbStructPtr ;
|
||||
BindElement *B4SOISBbStructPtr ;
|
||||
BindElement *B4SOIBdbStructPtr ;
|
||||
BindElement *B4SOIBsbStructPtr ;
|
||||
BindElement *B4SOIDgStructPtr ;
|
||||
BindElement *B4SOIDspStructPtr ;
|
||||
BindElement *B4SOISdpStructPtr ;
|
||||
BindElement *B4SOISgStructPtr ;
|
||||
BindElement *B4SOIDbStructPtr ;
|
||||
BindElement *B4SOISbStructPtr ;
|
||||
BindElement *B4SOIVbsStructPtr ;
|
||||
BindElement *B4SOIIdsStructPtr ;
|
||||
BindElement *B4SOIIcStructPtr ;
|
||||
BindElement *B4SOIIbsStructPtr ;
|
||||
BindElement *B4SOIIbdStructPtr ;
|
||||
BindElement *B4SOIIiiStructPtr ;
|
||||
BindElement *B4SOIIgStructPtr ;
|
||||
BindElement *B4SOIGiggStructPtr ;
|
||||
BindElement *B4SOIGigdStructPtr ;
|
||||
BindElement *B4SOIGigbStructPtr ;
|
||||
BindElement *B4SOIIgidlStructPtr ;
|
||||
BindElement *B4SOIItunStructPtr ;
|
||||
BindElement *B4SOIIbpStructPtr ;
|
||||
BindElement *B4SOICbbStructPtr ;
|
||||
BindElement *B4SOICbdStructPtr ;
|
||||
BindElement *B4SOICbgStructPtr ;
|
||||
BindElement *B4SOIQbfStructPtr ;
|
||||
BindElement *B4SOIQjsStructPtr ;
|
||||
BindElement *B4SOIQjdStructPtr ;
|
||||
#endif
|
||||
|
||||
} B4SOIinstance ;
|
||||
|
||||
struct b4soiSizeDependParam
|
||||
|
|
|
|||
|
|
@ -31,3 +31,9 @@ extern int B4SOItrunc(GENmodel*,CKTcircuit*,double*);
|
|||
extern int B4SOInoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||
extern int B4SOIunsetup(GENmodel*,CKTcircuit*);
|
||||
extern int B4SOIsoaCheck(CKTcircuit *, GENmodel *);
|
||||
|
||||
#ifdef KLU
|
||||
extern int B4SOIbindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int B4SOIbindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int B4SOIbindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -71,7 +71,14 @@ SPICEdev B4SOIinfo = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &B4SOIiSize,
|
||||
/* DEVmodSize */ &B4SOImSize
|
||||
/* DEVmodSize */ &B4SOImSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ B4SOIbindCSC,
|
||||
/* DEVbindCSCComplex */ B4SOIbindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ B4SOIbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
SPICEdev *
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ libcap_la_SOURCES = \
|
|||
captrunc.c
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libcap_la_SOURCES += capbindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,140 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "capdefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
CAPbindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
CAPmodel *model = (CAPmodel *)inModel ;
|
||||
CAPinstance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the CAP models */
|
||||
for ( ; model != NULL ; model = model->CAPnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->CAPinstances ; here != NULL ; here = here->CAPnextInstance)
|
||||
{
|
||||
if ((here->CAPposNode != 0) && (here->CAPposNode != 0))
|
||||
{
|
||||
i = here->CAPposPosptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CAPposPosptrStructPtr = matched ;
|
||||
here->CAPposPosptr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->CAPnegNode != 0) && (here->CAPnegNode != 0))
|
||||
{
|
||||
i = here->CAPnegNegptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CAPnegNegptrStructPtr = matched ;
|
||||
here->CAPnegNegptr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->CAPposNode != 0) && (here->CAPnegNode != 0))
|
||||
{
|
||||
i = here->CAPposNegptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CAPposNegptrStructPtr = matched ;
|
||||
here->CAPposNegptr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->CAPnegNode != 0) && (here->CAPposNode != 0))
|
||||
{
|
||||
i = here->CAPnegPosptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CAPnegPosptrStructPtr = matched ;
|
||||
here->CAPnegPosptr = matched->CSC ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
CAPbindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
CAPmodel *model = (CAPmodel *)inModel ;
|
||||
CAPinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the CAP models */
|
||||
for ( ; model != NULL ; model = model->CAPnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->CAPinstances ; here != NULL ; here = here->CAPnextInstance)
|
||||
{
|
||||
if ((here->CAPposNode != 0) && (here->CAPposNode != 0))
|
||||
here->CAPposPosptr = here->CAPposPosptrStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->CAPnegNode != 0) && (here->CAPnegNode != 0))
|
||||
here->CAPnegNegptr = here->CAPnegNegptrStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->CAPposNode != 0) && (here->CAPnegNode != 0))
|
||||
here->CAPposNegptr = here->CAPposNegptrStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->CAPnegNode != 0) && (here->CAPposNode != 0))
|
||||
here->CAPnegPosptr = here->CAPnegPosptrStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
CAPbindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
CAPmodel *model = (CAPmodel *)inModel ;
|
||||
CAPinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the CAP models */
|
||||
for ( ; model != NULL ; model = model->CAPnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->CAPinstances ; here != NULL ; here = here->CAPnextInstance)
|
||||
{
|
||||
if ((here->CAPposNode != 0) && (here->CAPposNode != 0))
|
||||
here->CAPposPosptr = here->CAPposPosptrStructPtr->CSC ;
|
||||
|
||||
if ((here->CAPnegNode != 0) && (here->CAPnegNode != 0))
|
||||
here->CAPnegNegptr = here->CAPnegNegptrStructPtr->CSC ;
|
||||
|
||||
if ((here->CAPposNode != 0) && (here->CAPnegNode != 0))
|
||||
here->CAPposNegptr = here->CAPposNegptrStructPtr->CSC ;
|
||||
|
||||
if ((here->CAPnegNode != 0) && (here->CAPposNode != 0))
|
||||
here->CAPnegPosptr = here->CAPnegPosptrStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -61,6 +61,13 @@ typedef struct sCAPinstance {
|
|||
int CAPsenParmNo; /* parameter # for sensitivity use;
|
||||
set equal to 0 if not a design parameter*/
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *CAPposPosptrStructPtr ;
|
||||
BindElement *CAPnegNegptrStructPtr ;
|
||||
BindElement *CAPposNegptrStructPtr ;
|
||||
BindElement *CAPnegPosptrStructPtr ;
|
||||
#endif
|
||||
|
||||
} CAPinstance ;
|
||||
|
||||
#define CAPqcap CAPstate /* charge on the capacitor */
|
||||
|
|
|
|||
|
|
@ -24,3 +24,8 @@ extern int CAPtemp(GENmodel*,CKTcircuit*);
|
|||
extern int CAPtrunc(GENmodel*,CKTcircuit*,double*);
|
||||
extern int CAPsoaCheck(CKTcircuit *, GENmodel *);
|
||||
|
||||
#ifdef KLU
|
||||
extern int CAPbindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int CAPbindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int CAPbindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -72,7 +72,14 @@ SPICEdev CAPinfo = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &CAPiSize,
|
||||
/* DEVmodSize */ &CAPmSize
|
||||
/* DEVmodSize */ &CAPmSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ CAPbindCSC,
|
||||
/* DEVbindCSCComplex */ CAPbindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ CAPbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,11 @@ libcccs_la_SOURCES = \
|
|||
cccssset.c
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libcccs_la_SOURCES += cccsbindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
|
|
|||
|
|
@ -0,0 +1,113 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "cccsdefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
CCCSbindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
CCCSmodel *model = (CCCSmodel *)inModel ;
|
||||
CCCSinstance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the CCCS models */
|
||||
for ( ; model != NULL ; model = model->CCCSnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->CCCSinstances ; here != NULL ; here = here->CCCSnextInstance)
|
||||
{
|
||||
if ((here->CCCSposNode != 0) && (here->CCCScontBranch != 0))
|
||||
{
|
||||
i = here->CCCSposContBrptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CCCSposContBrptrStructPtr = matched ;
|
||||
here->CCCSposContBrptr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->CCCSnegNode != 0) && (here->CCCScontBranch != 0))
|
||||
{
|
||||
i = here->CCCSnegContBrptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CCCSnegContBrptrStructPtr = matched ;
|
||||
here->CCCSnegContBrptr = matched->CSC ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
CCCSbindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
CCCSmodel *model = (CCCSmodel *)inModel ;
|
||||
CCCSinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the CCCS models */
|
||||
for ( ; model != NULL ; model = model->CCCSnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->CCCSinstances ; here != NULL ; here = here->CCCSnextInstance)
|
||||
{
|
||||
if ((here->CCCSposNode != 0) && (here->CCCScontBranch != 0))
|
||||
here->CCCSposContBrptr = here->CCCSposContBrptrStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->CCCSnegNode != 0) && (here->CCCScontBranch != 0))
|
||||
here->CCCSnegContBrptr = here->CCCSnegContBrptrStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
CCCSbindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
CCCSmodel *model = (CCCSmodel *)inModel ;
|
||||
CCCSinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the CCCS models */
|
||||
for ( ; model != NULL ; model = model->CCCSnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->CCCSinstances ; here != NULL ; here = here->CCCSnextInstance)
|
||||
{
|
||||
if ((here->CCCSposNode != 0) && (here->CCCScontBranch != 0))
|
||||
here->CCCSposContBrptr = here->CCCSposContBrptrStructPtr->CSC ;
|
||||
|
||||
if ((here->CCCSnegNode != 0) && (here->CCCScontBranch != 0))
|
||||
here->CCCSnegContBrptr = here->CCCSnegContBrptrStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -42,6 +42,11 @@ typedef struct sCCCSinstance {
|
|||
int CCCSsenParmNo; /* parameter # for sensitivity use;
|
||||
set equal to 0 if not a design parameter*/
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *CCCSposContBrptrStructPtr ;
|
||||
BindElement *CCCSnegContBrptrStructPtr ;
|
||||
#endif
|
||||
|
||||
} CCCSinstance ;
|
||||
|
||||
/* per model data */
|
||||
|
|
|
|||
|
|
@ -17,3 +17,8 @@ extern void CCCSsPrint(GENmodel*,CKTcircuit*);
|
|||
extern int CCCSsSetup(SENstruct*,GENmodel*);
|
||||
extern int CCCSsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
|
||||
|
||||
#ifdef KLU
|
||||
extern int CCCSbindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int CCCSbindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int CCCSbindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -72,7 +72,13 @@ SPICEdev CCCSinfo = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &CCCSiSize,
|
||||
/* DEVmodSize */ &CCCSmSize
|
||||
/* DEVmodSize */ &CCCSmSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ CCCSbindCSC,
|
||||
/* DEVbindCSCComplex */ CCCSbindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ CCCSbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ libccvs_la_SOURCES = \
|
|||
ccvssset.c
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libccvs_la_SOURCES += ccvsbindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,155 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "ccvsdefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
CCVSbindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
CCVSmodel *model = (CCVSmodel *)inModel ;
|
||||
CCVSinstance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the CCVS models */
|
||||
for ( ; model != NULL ; model = model->CCVSnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->CCVSinstances ; here != NULL ; here = here->CCVSnextInstance)
|
||||
{
|
||||
if ((here-> CCVSposNode != 0) && (here-> CCVSbranch != 0))
|
||||
{
|
||||
i = here->CCVSposIbrptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CCVSposIbrptrStructPtr = matched ;
|
||||
here->CCVSposIbrptr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> CCVSnegNode != 0) && (here-> CCVSbranch != 0))
|
||||
{
|
||||
i = here->CCVSnegIbrptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CCVSnegIbrptrStructPtr = matched ;
|
||||
here->CCVSnegIbrptr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> CCVSbranch != 0) && (here-> CCVSnegNode != 0))
|
||||
{
|
||||
i = here->CCVSibrNegptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CCVSibrNegptrStructPtr = matched ;
|
||||
here->CCVSibrNegptr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> CCVSbranch != 0) && (here-> CCVSposNode != 0))
|
||||
{
|
||||
i = here->CCVSibrPosptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CCVSibrPosptrStructPtr = matched ;
|
||||
here->CCVSibrPosptr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> CCVSbranch != 0) && (here-> CCVScontBranch != 0))
|
||||
{
|
||||
i = here->CCVSibrContBrptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CCVSibrContBrptrStructPtr = matched ;
|
||||
here->CCVSibrContBrptr = matched->CSC ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
CCVSbindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
CCVSmodel *model = (CCVSmodel *)inModel ;
|
||||
CCVSinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the CCVS models */
|
||||
for ( ; model != NULL ; model = model->CCVSnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->CCVSinstances ; here != NULL ; here = here->CCVSnextInstance)
|
||||
{
|
||||
if ((here-> CCVSposNode != 0) && (here-> CCVSbranch != 0))
|
||||
here->CCVSposIbrptr = here->CCVSposIbrptrStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> CCVSnegNode != 0) && (here-> CCVSbranch != 0))
|
||||
here->CCVSnegIbrptr = here->CCVSnegIbrptrStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> CCVSbranch != 0) && (here-> CCVSnegNode != 0))
|
||||
here->CCVSibrNegptr = here->CCVSibrNegptrStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> CCVSbranch != 0) && (here-> CCVSposNode != 0))
|
||||
here->CCVSibrPosptr = here->CCVSibrPosptrStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> CCVSbranch != 0) && (here-> CCVScontBranch != 0))
|
||||
here->CCVSibrContBrptr = here->CCVSibrContBrptrStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
CCVSbindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
CCVSmodel *model = (CCVSmodel *)inModel ;
|
||||
CCVSinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the CCVS models */
|
||||
for ( ; model != NULL ; model = model->CCVSnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->CCVSinstances ; here != NULL ; here = here->CCVSnextInstance)
|
||||
{
|
||||
if ((here-> CCVSposNode != 0) && (here-> CCVSbranch != 0))
|
||||
here->CCVSposIbrptr = here->CCVSposIbrptrStructPtr->CSC ;
|
||||
|
||||
if ((here-> CCVSnegNode != 0) && (here-> CCVSbranch != 0))
|
||||
here->CCVSnegIbrptr = here->CCVSnegIbrptrStructPtr->CSC ;
|
||||
|
||||
if ((here-> CCVSbranch != 0) && (here-> CCVSnegNode != 0))
|
||||
here->CCVSibrNegptr = here->CCVSibrNegptrStructPtr->CSC ;
|
||||
|
||||
if ((here-> CCVSbranch != 0) && (here-> CCVSposNode != 0))
|
||||
here->CCVSibrPosptr = here->CCVSibrPosptrStructPtr->CSC ;
|
||||
|
||||
if ((here-> CCVSbranch != 0) && (here-> CCVScontBranch != 0))
|
||||
here->CCVSibrContBrptr = here->CCVSibrContBrptrStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -46,6 +46,14 @@ typedef struct sCCVSinstance {
|
|||
int CCVSsenParmNo; /* parameter # for sensitivity use;
|
||||
set equal to 0 if not a design parameter*/
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *CCVSposIbrptrStructPtr ;
|
||||
BindElement *CCVSnegIbrptrStructPtr ;
|
||||
BindElement *CCVSibrNegptrStructPtr ;
|
||||
BindElement *CCVSibrPosptrStructPtr ;
|
||||
BindElement *CCVSibrContBrptrStructPtr ;
|
||||
#endif
|
||||
|
||||
} CCVSinstance ;
|
||||
|
||||
/* per model data */
|
||||
|
|
|
|||
|
|
@ -17,3 +17,9 @@ extern void CCVSsPrint(GENmodel*,CKTcircuit*);
|
|||
extern int CCVSsSetup(SENstruct*,GENmodel*);
|
||||
extern int CCVSsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
|
||||
extern int CCVSunsetup(GENmodel*,CKTcircuit*);
|
||||
|
||||
#ifdef KLU
|
||||
extern int CCVSbindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int CCVSbindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int CCVSbindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -73,7 +73,13 @@ SPICEdev CCVSinfo = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &CCVSiSize,
|
||||
/* DEVmodSize */ &CCVSmSize
|
||||
/* DEVmodSize */ &CCVSmSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ CCVSbindCSC,
|
||||
/* DEVbindCSCComplex */ CCVSbindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ CCVSbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,13 @@ SPICEdev CPLinfo = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &CPLiSize,
|
||||
/* DEVmodSize */ &CPLmSize
|
||||
/* DEVmodSize */ &CPLmSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ NULL,
|
||||
/* DEVbindCSCComplex */ NULL,
|
||||
/* DEVbindCSCComplexToReal */ NULL,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,11 @@ libcsw_la_SOURCES = \
|
|||
cswtrunc.c
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libcsw_la_SOURCES += cswbindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
|
|
|||
|
|
@ -0,0 +1,141 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "cswdefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
CSWbindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
CSWmodel *model = (CSWmodel *)inModel ;
|
||||
CSWinstance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the CSW models */
|
||||
for ( ; model != NULL ; model = model->CSWnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->CSWinstances ; here != NULL ; here = here->CSWnextInstance)
|
||||
{
|
||||
if ((here-> CSWposNode != 0) && (here-> CSWposNode != 0))
|
||||
{
|
||||
i = here->CSWposPosptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CSWposPosptrStructPtr = matched ;
|
||||
here->CSWposPosptr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> CSWposNode != 0) && (here-> CSWnegNode != 0))
|
||||
{
|
||||
i = here->CSWposNegptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CSWposNegptrStructPtr = matched ;
|
||||
here->CSWposNegptr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> CSWnegNode != 0) && (here-> CSWposNode != 0))
|
||||
{
|
||||
i = here->CSWnegPosptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CSWnegPosptrStructPtr = matched ;
|
||||
here->CSWnegPosptr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here-> CSWnegNode != 0) && (here-> CSWnegNode != 0))
|
||||
{
|
||||
i = here->CSWnegNegptr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->CSWnegNegptrStructPtr = matched ;
|
||||
here->CSWnegNegptr = matched->CSC ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
CSWbindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
CSWmodel *model = (CSWmodel *)inModel ;
|
||||
CSWinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the CSW models */
|
||||
for ( ; model != NULL ; model = model->CSWnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->CSWinstances ; here != NULL ; here = here->CSWnextInstance)
|
||||
{
|
||||
if ((here-> CSWposNode != 0) && (here-> CSWposNode != 0))
|
||||
here->CSWposPosptr = here->CSWposPosptrStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> CSWposNode != 0) && (here-> CSWnegNode != 0))
|
||||
here->CSWposNegptr = here->CSWposNegptrStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> CSWnegNode != 0) && (here-> CSWposNode != 0))
|
||||
here->CSWnegPosptr = here->CSWnegPosptrStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> CSWnegNode != 0) && (here-> CSWnegNode != 0))
|
||||
here->CSWnegNegptr = here->CSWnegNegptrStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
CSWbindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
CSWmodel *model = (CSWmodel *)inModel ;
|
||||
CSWinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the CSW models */
|
||||
for ( ; model != NULL ; model = model->CSWnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->CSWinstances ; here != NULL ; here = here->CSWnextInstance)
|
||||
{
|
||||
if ((here-> CSWposNode != 0) && (here-> CSWposNode != 0))
|
||||
here->CSWposPosptr = here->CSWposPosptrStructPtr->CSC ;
|
||||
|
||||
if ((here-> CSWposNode != 0) && (here-> CSWnegNode != 0))
|
||||
here->CSWposNegptr = here->CSWposNegptrStructPtr->CSC ;
|
||||
|
||||
if ((here-> CSWnegNode != 0) && (here-> CSWposNode != 0))
|
||||
here->CSWnegPosptr = here->CSWnegPosptrStructPtr->CSC ;
|
||||
|
||||
if ((here-> CSWnegNode != 0) && (here-> CSWnegNode != 0))
|
||||
here->CSWnegNegptr = here->CSWnegNegptrStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -48,6 +48,14 @@ typedef struct sCSWinstance {
|
|||
#else /* NONOISE */
|
||||
double *CSWnVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *CSWposPosptrStructPtr ;
|
||||
BindElement *CSWposNegptrStructPtr ;
|
||||
BindElement *CSWnegPosptrStructPtr ;
|
||||
BindElement *CSWnegNegptrStructPtr ;
|
||||
#endif
|
||||
|
||||
} CSWinstance ;
|
||||
|
||||
/* data per model */
|
||||
|
|
|
|||
|
|
@ -17,3 +17,9 @@ extern int CSWpzLoad(GENmodel*,CKTcircuit*,SPcomplex*);
|
|||
extern int CSWsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
|
||||
extern int CSWnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||
extern int CSWtrunc(GENmodel*,CKTcircuit*,double*);
|
||||
|
||||
#ifdef KLU
|
||||
extern int CSWbindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int CSWbindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int CSWbindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -75,7 +75,13 @@ SPICEdev CSWinfo = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &CSWiSize,
|
||||
/* DEVmodSize */ &CSWmSize
|
||||
/* DEVmodSize */ &CSWmSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ CSWbindCSC,
|
||||
/* DEVbindCSCComplex */ CSWbindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ CSWbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,11 @@ libdio_la_SOURCES = \
|
|||
diotrunc.c
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libdio_la_SOURCES += diobindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
|
|
|||
|
|
@ -0,0 +1,183 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "diodefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
DIObindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
DIOmodel *model = (DIOmodel *)inModel ;
|
||||
DIOinstance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the DIO models */
|
||||
for ( ; model != NULL ; model = model->DIOnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->DIOinstances ; here != NULL ; here = here->DIOnextInstance)
|
||||
{
|
||||
if ((here->DIOposNode != 0) && (here->DIOposPrimeNode != 0))
|
||||
{
|
||||
i = here->DIOposPosPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->DIOposPosPrimeStructPtr = matched ;
|
||||
here->DIOposPosPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->DIOnegNode != 0) && (here->DIOposPrimeNode != 0))
|
||||
{
|
||||
i = here->DIOnegPosPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->DIOnegPosPrimeStructPtr = matched ;
|
||||
here->DIOnegPosPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->DIOposPrimeNode != 0) && (here->DIOposNode != 0))
|
||||
{
|
||||
i = here->DIOposPrimePosPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->DIOposPrimePosStructPtr = matched ;
|
||||
here->DIOposPrimePosPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->DIOposPrimeNode != 0) && (here->DIOnegNode != 0))
|
||||
{
|
||||
i = here->DIOposPrimeNegPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->DIOposPrimeNegStructPtr = matched ;
|
||||
here->DIOposPrimeNegPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->DIOposNode != 0) && (here->DIOposNode != 0))
|
||||
{
|
||||
i = here->DIOposPosPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->DIOposPosStructPtr = matched ;
|
||||
here->DIOposPosPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->DIOnegNode != 0) && (here->DIOnegNode != 0))
|
||||
{
|
||||
i = here->DIOnegNegPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->DIOnegNegStructPtr = matched ;
|
||||
here->DIOnegNegPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->DIOposPrimeNode != 0) && (here->DIOposPrimeNode != 0))
|
||||
{
|
||||
i = here->DIOposPrimePosPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->DIOposPrimePosPrimeStructPtr = matched ;
|
||||
here->DIOposPrimePosPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
DIObindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
DIOmodel *model = (DIOmodel *)inModel ;
|
||||
DIOinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the DIO models */
|
||||
for ( ; model != NULL ; model = model->DIOnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->DIOinstances ; here != NULL ; here = here->DIOnextInstance)
|
||||
{
|
||||
if ((here->DIOposNode != 0) && (here->DIOposPrimeNode != 0))
|
||||
here->DIOposPosPrimePtr = here->DIOposPosPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->DIOnegNode != 0) && (here->DIOposPrimeNode != 0))
|
||||
here->DIOnegPosPrimePtr = here->DIOnegPosPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->DIOposPrimeNode != 0) && (here->DIOposNode != 0))
|
||||
here->DIOposPrimePosPtr = here->DIOposPrimePosStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->DIOposPrimeNode != 0) && (here->DIOnegNode != 0))
|
||||
here->DIOposPrimeNegPtr = here->DIOposPrimeNegStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->DIOposNode != 0) && (here->DIOposNode != 0))
|
||||
here->DIOposPosPtr = here->DIOposPosStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->DIOnegNode != 0) && (here->DIOnegNode != 0))
|
||||
here->DIOnegNegPtr = here->DIOnegNegStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->DIOposPrimeNode != 0) && (here->DIOposPrimeNode != 0))
|
||||
here->DIOposPrimePosPrimePtr = here->DIOposPrimePosPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
DIObindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
DIOmodel *model = (DIOmodel *)inModel ;
|
||||
DIOinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the DIO models */
|
||||
for ( ; model != NULL ; model = model->DIOnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->DIOinstances ; here != NULL ; here = here->DIOnextInstance)
|
||||
{
|
||||
if ((here->DIOposNode != 0) && (here->DIOposPrimeNode != 0))
|
||||
here->DIOposPosPrimePtr = here->DIOposPosPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->DIOnegNode != 0) && (here->DIOposPrimeNode != 0))
|
||||
here->DIOnegPosPrimePtr = here->DIOnegPosPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->DIOposPrimeNode != 0) && (here->DIOposNode != 0))
|
||||
here->DIOposPrimePosPtr = here->DIOposPrimePosStructPtr->CSC ;
|
||||
|
||||
if ((here->DIOposPrimeNode != 0) && (here->DIOnegNode != 0))
|
||||
here->DIOposPrimeNegPtr = here->DIOposPrimeNegStructPtr->CSC ;
|
||||
|
||||
if ((here->DIOposNode != 0) && (here->DIOposNode != 0))
|
||||
here->DIOposPosPtr = here->DIOposPosStructPtr->CSC ;
|
||||
|
||||
if ((here->DIOnegNode != 0) && (here->DIOnegNode != 0))
|
||||
here->DIOnegNegPtr = here->DIOnegNegStructPtr->CSC ;
|
||||
|
||||
if ((here->DIOposPrimeNode != 0) && (here->DIOposPrimeNode != 0))
|
||||
here->DIOposPrimePosPrimePtr = here->DIOposPrimePosPrimeStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -144,6 +144,16 @@ typedef struct sDIOinstance {
|
|||
double **DIOnVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *DIOposPosPrimeStructPtr ;
|
||||
BindElement *DIOnegPosPrimeStructPtr ;
|
||||
BindElement *DIOposPrimePosStructPtr ;
|
||||
BindElement *DIOposPrimeNegStructPtr ;
|
||||
BindElement *DIOposPosStructPtr ;
|
||||
BindElement *DIOnegNegStructPtr ;
|
||||
BindElement *DIOposPrimePosPrimeStructPtr ;
|
||||
#endif
|
||||
|
||||
} DIOinstance ;
|
||||
|
||||
#define DIOsenGeq DIOsens /* stores the perturbed values of geq */
|
||||
|
|
|
|||
|
|
@ -30,3 +30,8 @@ extern int DIOnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
|||
extern int DIOdSetup(DIOmodel*,CKTcircuit*);
|
||||
extern int DIOsoaCheck(CKTcircuit *, GENmodel *);
|
||||
|
||||
#ifdef KLU
|
||||
extern int DIObindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int DIObindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int DIObindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -74,7 +74,14 @@ SPICEdev DIOinfo = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &DIOiSize,
|
||||
/* DEVmodSize */ &DIOmSize
|
||||
/* DEVmodSize */ &DIOmSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ DIObindCSC,
|
||||
/* DEVbindCSCComplex */ DIObindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ DIObindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,11 @@ libhfet_la_SOURCES = \
|
|||
hfettrunc.c
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libhfet_la_SOURCES += hfetbindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
|
|
|||
|
|
@ -0,0 +1,477 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "hfetdefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
HFETAbindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
HFETAmodel *model = (HFETAmodel *)inModel ;
|
||||
HFETAinstance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the HFETA models */
|
||||
for ( ; model != NULL ; model = model->HFETAnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->HFETAinstances ; here != NULL ; here = here->HFETAnextInstance)
|
||||
{
|
||||
if ((here->HFETAdrainNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAdrainDrainPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAdrainDrainPrimeStructPtr = matched ;
|
||||
here->HFETAdrainDrainPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAgatePrimeDrainPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAgatePrimeDrainPrimeStructPtr = matched ;
|
||||
here->HFETAgatePrimeDrainPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAgatePrimeSourcePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAgatePrimeSourcePrimeStructPtr = matched ;
|
||||
here->HFETAgatePrimeSourcePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAsourceNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAsourceSourcePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAsourceSourcePrimeStructPtr = matched ;
|
||||
here->HFETAsourceSourcePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAdrainNode != 0))
|
||||
{
|
||||
i = here->HFETAdrainPrimeDrainPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAdrainPrimeDrainStructPtr = matched ;
|
||||
here->HFETAdrainPrimeDrainPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAdrainPrimeGatePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAdrainPrimeGatePrimeStructPtr = matched ;
|
||||
here->HFETAdrainPrimeGatePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAdrainPrimeSourcePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAdrainPrimeSourcePrimeStructPtr = matched ;
|
||||
here->HFETAdrainPrimeSourcePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAsourcePrimeGatePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAsourcePrimeGatePrimeStructPtr = matched ;
|
||||
here->HFETAsourcePrimeGatePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAsourceNode != 0))
|
||||
{
|
||||
i = here->HFETAsourcePrimeSourcePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAsourcePrimeSourceStructPtr = matched ;
|
||||
here->HFETAsourcePrimeSourcePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAsourcePrimeDrainPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAsourcePrimeDrainPrimeStructPtr = matched ;
|
||||
here->HFETAsourcePrimeDrainPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAdrainNode != 0) && (here->HFETAdrainNode != 0))
|
||||
{
|
||||
i = here->HFETAdrainDrainPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAdrainDrainStructPtr = matched ;
|
||||
here->HFETAdrainDrainPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAgatePrimeGatePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAgatePrimeGatePrimeStructPtr = matched ;
|
||||
here->HFETAgatePrimeGatePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAsourceNode != 0) && (here->HFETAsourceNode != 0))
|
||||
{
|
||||
i = here->HFETAsourceSourcePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAsourceSourceStructPtr = matched ;
|
||||
here->HFETAsourceSourcePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAdrainPrimeDrainPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAdrainPrimeDrainPrimeStructPtr = matched ;
|
||||
here->HFETAdrainPrimeDrainPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAsourcePrimeSourcePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAsourcePrimeSourcePrimeStructPtr = matched ;
|
||||
here->HFETAsourcePrimeSourcePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAdrainPrmPrmNode != 0))
|
||||
{
|
||||
i = here->HFETAdrainPrimeDrainPrmPrmPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAdrainPrimeDrainPrmPrmStructPtr = matched ;
|
||||
here->HFETAdrainPrimeDrainPrmPrmPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAdrainPrmPrmNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAdrainPrmPrmDrainPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAdrainPrmPrmDrainPrimeStructPtr = matched ;
|
||||
here->HFETAdrainPrmPrmDrainPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAdrainPrmPrmNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAdrainPrmPrmGatePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAdrainPrmPrmGatePrimeStructPtr = matched ;
|
||||
here->HFETAdrainPrmPrmGatePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAdrainPrmPrmNode != 0))
|
||||
{
|
||||
i = here->HFETAgatePrimeDrainPrmPrmPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAgatePrimeDrainPrmPrmStructPtr = matched ;
|
||||
here->HFETAgatePrimeDrainPrmPrmPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAdrainPrmPrmNode != 0) && (here->HFETAdrainPrmPrmNode != 0))
|
||||
{
|
||||
i = here->HFETAdrainPrmPrmDrainPrmPrmPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAdrainPrmPrmDrainPrmPrmStructPtr = matched ;
|
||||
here->HFETAdrainPrmPrmDrainPrmPrmPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAsourcePrmPrmNode != 0))
|
||||
{
|
||||
i = here->HFETAsourcePrimeSourcePrmPrmPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAsourcePrimeSourcePrmPrmStructPtr = matched ;
|
||||
here->HFETAsourcePrimeSourcePrmPrmPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAsourcePrmPrmNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAsourcePrmPrmSourcePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAsourcePrmPrmSourcePrimeStructPtr = matched ;
|
||||
here->HFETAsourcePrmPrmSourcePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAsourcePrmPrmNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAsourcePrmPrmGatePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAsourcePrmPrmGatePrimeStructPtr = matched ;
|
||||
here->HFETAsourcePrmPrmGatePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAsourcePrmPrmNode != 0))
|
||||
{
|
||||
i = here->HFETAgatePrimeSourcePrmPrmPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAgatePrimeSourcePrmPrmStructPtr = matched ;
|
||||
here->HFETAgatePrimeSourcePrmPrmPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAsourcePrmPrmNode != 0) && (here->HFETAsourcePrmPrmNode != 0))
|
||||
{
|
||||
i = here->HFETAsourcePrmPrmSourcePrmPrmPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAsourcePrmPrmSourcePrmPrmStructPtr = matched ;
|
||||
here->HFETAsourcePrmPrmSourcePrmPrmPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAgateNode != 0) && (here->HFETAgateNode != 0))
|
||||
{
|
||||
i = here->HFETAgateGatePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAgateGateStructPtr = matched ;
|
||||
here->HFETAgateGatePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAgateNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
{
|
||||
i = here->HFETAgateGatePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAgateGatePrimeStructPtr = matched ;
|
||||
here->HFETAgateGatePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAgateNode != 0))
|
||||
{
|
||||
i = here->HFETAgatePrimeGatePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFETAgatePrimeGateStructPtr = matched ;
|
||||
here->HFETAgatePrimeGatePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
HFETAbindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
HFETAmodel *model = (HFETAmodel *)inModel ;
|
||||
HFETAinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the HFETA models */
|
||||
for ( ; model != NULL ; model = model->HFETAnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->HFETAinstances ; here != NULL ; here = here->HFETAnextInstance)
|
||||
{
|
||||
if ((here->HFETAdrainNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
here->HFETAdrainDrainPrimePtr = here->HFETAdrainDrainPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
here->HFETAgatePrimeDrainPrimePtr = here->HFETAgatePrimeDrainPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
here->HFETAgatePrimeSourcePrimePtr = here->HFETAgatePrimeSourcePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAsourceNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
here->HFETAsourceSourcePrimePtr = here->HFETAsourceSourcePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAdrainNode != 0))
|
||||
here->HFETAdrainPrimeDrainPtr = here->HFETAdrainPrimeDrainStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
here->HFETAdrainPrimeGatePrimePtr = here->HFETAdrainPrimeGatePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
here->HFETAdrainPrimeSourcePrimePtr = here->HFETAdrainPrimeSourcePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
here->HFETAsourcePrimeGatePrimePtr = here->HFETAsourcePrimeGatePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAsourceNode != 0))
|
||||
here->HFETAsourcePrimeSourcePtr = here->HFETAsourcePrimeSourceStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
here->HFETAsourcePrimeDrainPrimePtr = here->HFETAsourcePrimeDrainPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAdrainNode != 0) && (here->HFETAdrainNode != 0))
|
||||
here->HFETAdrainDrainPtr = here->HFETAdrainDrainStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
here->HFETAgatePrimeGatePrimePtr = here->HFETAgatePrimeGatePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAsourceNode != 0) && (here->HFETAsourceNode != 0))
|
||||
here->HFETAsourceSourcePtr = here->HFETAsourceSourceStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
here->HFETAdrainPrimeDrainPrimePtr = here->HFETAdrainPrimeDrainPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
here->HFETAsourcePrimeSourcePrimePtr = here->HFETAsourcePrimeSourcePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAdrainPrmPrmNode != 0))
|
||||
here->HFETAdrainPrimeDrainPrmPrmPtr = here->HFETAdrainPrimeDrainPrmPrmStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAdrainPrmPrmNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
here->HFETAdrainPrmPrmDrainPrimePtr = here->HFETAdrainPrmPrmDrainPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAdrainPrmPrmNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
here->HFETAdrainPrmPrmGatePrimePtr = here->HFETAdrainPrmPrmGatePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAdrainPrmPrmNode != 0))
|
||||
here->HFETAgatePrimeDrainPrmPrmPtr = here->HFETAgatePrimeDrainPrmPrmStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAdrainPrmPrmNode != 0) && (here->HFETAdrainPrmPrmNode != 0))
|
||||
here->HFETAdrainPrmPrmDrainPrmPrmPtr = here->HFETAdrainPrmPrmDrainPrmPrmStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAsourcePrmPrmNode != 0))
|
||||
here->HFETAsourcePrimeSourcePrmPrmPtr = here->HFETAsourcePrimeSourcePrmPrmStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAsourcePrmPrmNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
here->HFETAsourcePrmPrmSourcePrimePtr = here->HFETAsourcePrmPrmSourcePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAsourcePrmPrmNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
here->HFETAsourcePrmPrmGatePrimePtr = here->HFETAsourcePrmPrmGatePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAsourcePrmPrmNode != 0))
|
||||
here->HFETAgatePrimeSourcePrmPrmPtr = here->HFETAgatePrimeSourcePrmPrmStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAsourcePrmPrmNode != 0) && (here->HFETAsourcePrmPrmNode != 0))
|
||||
here->HFETAsourcePrmPrmSourcePrmPrmPtr = here->HFETAsourcePrmPrmSourcePrmPrmStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAgateNode != 0) && (here->HFETAgateNode != 0))
|
||||
here->HFETAgateGatePtr = here->HFETAgateGateStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAgateNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
here->HFETAgateGatePrimePtr = here->HFETAgateGatePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAgateNode != 0))
|
||||
here->HFETAgatePrimeGatePtr = here->HFETAgatePrimeGateStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
HFETAbindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
HFETAmodel *model = (HFETAmodel *)inModel ;
|
||||
HFETAinstance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the HFETA models */
|
||||
for ( ; model != NULL ; model = model->HFETAnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->HFETAinstances ; here != NULL ; here = here->HFETAnextInstance)
|
||||
{
|
||||
if ((here->HFETAdrainNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
here->HFETAdrainDrainPrimePtr = here->HFETAdrainDrainPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
here->HFETAgatePrimeDrainPrimePtr = here->HFETAgatePrimeDrainPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
here->HFETAgatePrimeSourcePrimePtr = here->HFETAgatePrimeSourcePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAsourceNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
here->HFETAsourceSourcePrimePtr = here->HFETAsourceSourcePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAdrainNode != 0))
|
||||
here->HFETAdrainPrimeDrainPtr = here->HFETAdrainPrimeDrainStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
here->HFETAdrainPrimeGatePrimePtr = here->HFETAdrainPrimeGatePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
here->HFETAdrainPrimeSourcePrimePtr = here->HFETAdrainPrimeSourcePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
here->HFETAsourcePrimeGatePrimePtr = here->HFETAsourcePrimeGatePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAsourceNode != 0))
|
||||
here->HFETAsourcePrimeSourcePtr = here->HFETAsourcePrimeSourceStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
here->HFETAsourcePrimeDrainPrimePtr = here->HFETAsourcePrimeDrainPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAdrainNode != 0) && (here->HFETAdrainNode != 0))
|
||||
here->HFETAdrainDrainPtr = here->HFETAdrainDrainStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
here->HFETAgatePrimeGatePrimePtr = here->HFETAgatePrimeGatePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAsourceNode != 0) && (here->HFETAsourceNode != 0))
|
||||
here->HFETAsourceSourcePtr = here->HFETAsourceSourceStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
here->HFETAdrainPrimeDrainPrimePtr = here->HFETAdrainPrimeDrainPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
here->HFETAsourcePrimeSourcePrimePtr = here->HFETAsourcePrimeSourcePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAdrainPrimeNode != 0) && (here->HFETAdrainPrmPrmNode != 0))
|
||||
here->HFETAdrainPrimeDrainPrmPrmPtr = here->HFETAdrainPrimeDrainPrmPrmStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAdrainPrmPrmNode != 0) && (here->HFETAdrainPrimeNode != 0))
|
||||
here->HFETAdrainPrmPrmDrainPrimePtr = here->HFETAdrainPrmPrmDrainPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAdrainPrmPrmNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
here->HFETAdrainPrmPrmGatePrimePtr = here->HFETAdrainPrmPrmGatePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAdrainPrmPrmNode != 0))
|
||||
here->HFETAgatePrimeDrainPrmPrmPtr = here->HFETAgatePrimeDrainPrmPrmStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAdrainPrmPrmNode != 0) && (here->HFETAdrainPrmPrmNode != 0))
|
||||
here->HFETAdrainPrmPrmDrainPrmPrmPtr = here->HFETAdrainPrmPrmDrainPrmPrmStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAsourcePrimeNode != 0) && (here->HFETAsourcePrmPrmNode != 0))
|
||||
here->HFETAsourcePrimeSourcePrmPrmPtr = here->HFETAsourcePrimeSourcePrmPrmStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAsourcePrmPrmNode != 0) && (here->HFETAsourcePrimeNode != 0))
|
||||
here->HFETAsourcePrmPrmSourcePrimePtr = here->HFETAsourcePrmPrmSourcePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAsourcePrmPrmNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
here->HFETAsourcePrmPrmGatePrimePtr = here->HFETAsourcePrmPrmGatePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAsourcePrmPrmNode != 0))
|
||||
here->HFETAgatePrimeSourcePrmPrmPtr = here->HFETAgatePrimeSourcePrmPrmStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAsourcePrmPrmNode != 0) && (here->HFETAsourcePrmPrmNode != 0))
|
||||
here->HFETAsourcePrmPrmSourcePrmPrmPtr = here->HFETAsourcePrmPrmSourcePrmPrmStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAgateNode != 0) && (here->HFETAgateNode != 0))
|
||||
here->HFETAgateGatePtr = here->HFETAgateGateStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAgateNode != 0) && (here->HFETAgatePrimeNode != 0))
|
||||
here->HFETAgateGatePrimePtr = here->HFETAgateGatePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFETAgatePrimeNode != 0) && (here->HFETAgateNode != 0))
|
||||
here->HFETAgatePrimeGatePtr = here->HFETAgatePrimeGateStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -122,6 +122,37 @@ typedef struct sHFETAinstance {
|
|||
double HFETAfgds;
|
||||
double HFETAggrwl;
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *HFETAdrainDrainPrimeStructPtr ;
|
||||
BindElement *HFETAgatePrimeDrainPrimeStructPtr ;
|
||||
BindElement *HFETAgatePrimeSourcePrimeStructPtr ;
|
||||
BindElement *HFETAsourceSourcePrimeStructPtr ;
|
||||
BindElement *HFETAdrainPrimeDrainStructPtr ;
|
||||
BindElement *HFETAdrainPrimeGatePrimeStructPtr ;
|
||||
BindElement *HFETAdrainPrimeSourcePrimeStructPtr ;
|
||||
BindElement *HFETAsourcePrimeGatePrimeStructPtr ;
|
||||
BindElement *HFETAsourcePrimeSourceStructPtr ;
|
||||
BindElement *HFETAsourcePrimeDrainPrimeStructPtr ;
|
||||
BindElement *HFETAdrainDrainStructPtr ;
|
||||
BindElement *HFETAgatePrimeGatePrimeStructPtr ;
|
||||
BindElement *HFETAsourceSourceStructPtr ;
|
||||
BindElement *HFETAdrainPrimeDrainPrimeStructPtr ;
|
||||
BindElement *HFETAsourcePrimeSourcePrimeStructPtr ;
|
||||
BindElement *HFETAdrainPrimeDrainPrmPrmStructPtr ;
|
||||
BindElement *HFETAdrainPrmPrmDrainPrimeStructPtr ;
|
||||
BindElement *HFETAdrainPrmPrmGatePrimeStructPtr ;
|
||||
BindElement *HFETAgatePrimeDrainPrmPrmStructPtr ;
|
||||
BindElement *HFETAdrainPrmPrmDrainPrmPrmStructPtr ;
|
||||
BindElement *HFETAsourcePrimeSourcePrmPrmStructPtr ;
|
||||
BindElement *HFETAsourcePrmPrmSourcePrimeStructPtr ;
|
||||
BindElement *HFETAsourcePrmPrmGatePrimeStructPtr ;
|
||||
BindElement *HFETAgatePrimeSourcePrmPrmStructPtr ;
|
||||
BindElement *HFETAsourcePrmPrmSourcePrmPrmStructPtr ;
|
||||
BindElement *HFETAgateGateStructPtr ;
|
||||
BindElement *HFETAgateGatePrimeStructPtr ;
|
||||
BindElement *HFETAgatePrimeGateStructPtr ;
|
||||
#endif
|
||||
|
||||
} HFETAinstance ;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,3 +18,9 @@ extern int HFETAsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
|
|||
extern int HFETAtemp(GENmodel*,CKTcircuit*);
|
||||
extern int HFETAtrunc(GENmodel*,CKTcircuit*,double*);
|
||||
extern int HFETAunsetup(GENmodel*,CKTcircuit*);
|
||||
|
||||
#ifdef KLU
|
||||
extern int HFETAbindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int HFETAbindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int HFETAbindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -73,7 +73,13 @@ SPICEdev HFETAinfo = {
|
|||
/* DEVacct */ NULL,
|
||||
#endif
|
||||
/* DEVinstSize */ &HFETAiSize,
|
||||
/* DEVmodSize */ &HFETAmSize
|
||||
/* DEVmodSize */ &HFETAmSize,
|
||||
|
||||
#ifdef KLU
|
||||
/* DEVbindCSC */ HFETAbindCSC,
|
||||
/* DEVbindCSCComplex */ HFETAbindCSC,
|
||||
/* DEVbindCSCComplexToReal */ HFETAbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,11 @@ libhfet2_la_SOURCES = \
|
|||
hfet2trunc.c
|
||||
|
||||
|
||||
if KLU_WANTED
|
||||
libhfet2_la_SOURCES += hfet2bindCSC.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
|
|
|||
|
|
@ -0,0 +1,295 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "hfet2defs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
HFET2bindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
HFET2model *model = (HFET2model *)inModel ;
|
||||
HFET2instance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the HFET2 models */
|
||||
for ( ; model != NULL ; model = model->HFET2nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->HFET2instances ; here != NULL ; here = here->HFET2nextInstance)
|
||||
{
|
||||
if ((here->HFET2drainNode != 0) && (here->HFET2drainPrimeNode != 0))
|
||||
{
|
||||
i = here->HFET2drainDrainPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2drainDrainPrimeStructPtr = matched ;
|
||||
here->HFET2drainDrainPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2gateNode != 0) && (here->HFET2drainPrimeNode != 0))
|
||||
{
|
||||
i = here->HFET2gateDrainPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2gateDrainPrimeStructPtr = matched ;
|
||||
here->HFET2gateDrainPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2gateNode != 0) && (here->HFET2sourcePrimeNode != 0))
|
||||
{
|
||||
i = here->HFET2gateSourcePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2gateSourcePrimeStructPtr = matched ;
|
||||
here->HFET2gateSourcePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2sourceNode != 0) && (here->HFET2sourcePrimeNode != 0))
|
||||
{
|
||||
i = here->HFET2sourceSourcePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2sourceSourcePrimeStructPtr = matched ;
|
||||
here->HFET2sourceSourcePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2drainPrimeNode != 0) && (here->HFET2drainNode != 0))
|
||||
{
|
||||
i = here->HFET2drainPrimeDrainPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2drainPrimeDrainStructPtr = matched ;
|
||||
here->HFET2drainPrimeDrainPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2drainPrimeNode != 0) && (here->HFET2gateNode != 0))
|
||||
{
|
||||
i = here->HFET2drainPrimeGatePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2drainPrimeGateStructPtr = matched ;
|
||||
here->HFET2drainPrimeGatePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2drainPrimeNode != 0) && (here->HFET2sourcePrimeNode != 0))
|
||||
{
|
||||
i = here->HFET2drainPriHFET2ourcePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2drainPriHFET2ourcePrimeStructPtr = matched ;
|
||||
here->HFET2drainPriHFET2ourcePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2sourcePrimeNode != 0) && (here->HFET2gateNode != 0))
|
||||
{
|
||||
i = here->HFET2sourcePrimeGatePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2sourcePrimeGateStructPtr = matched ;
|
||||
here->HFET2sourcePrimeGatePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2sourcePrimeNode != 0) && (here->HFET2sourceNode != 0))
|
||||
{
|
||||
i = here->HFET2sourcePriHFET2ourcePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2sourcePriHFET2ourceStructPtr = matched ;
|
||||
here->HFET2sourcePriHFET2ourcePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2sourcePrimeNode != 0) && (here->HFET2drainPrimeNode != 0))
|
||||
{
|
||||
i = here->HFET2sourcePrimeDrainPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2sourcePrimeDrainPrimeStructPtr = matched ;
|
||||
here->HFET2sourcePrimeDrainPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2drainNode != 0) && (here->HFET2drainNode != 0))
|
||||
{
|
||||
i = here->HFET2drainDrainPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2drainDrainStructPtr = matched ;
|
||||
here->HFET2drainDrainPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2gateNode != 0) && (here->HFET2gateNode != 0))
|
||||
{
|
||||
i = here->HFET2gateGatePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2gateGateStructPtr = matched ;
|
||||
here->HFET2gateGatePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2sourceNode != 0) && (here->HFET2sourceNode != 0))
|
||||
{
|
||||
i = here->HFET2sourceSourcePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2sourceSourceStructPtr = matched ;
|
||||
here->HFET2sourceSourcePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2drainPrimeNode != 0) && (here->HFET2drainPrimeNode != 0))
|
||||
{
|
||||
i = here->HFET2drainPrimeDrainPrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2drainPrimeDrainPrimeStructPtr = matched ;
|
||||
here->HFET2drainPrimeDrainPrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
if ((here->HFET2sourcePrimeNode != 0) && (here->HFET2sourcePrimeNode != 0))
|
||||
{
|
||||
i = here->HFET2sourcePriHFET2ourcePrimePtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->HFET2sourcePriHFET2ourcePrimeStructPtr = matched ;
|
||||
here->HFET2sourcePriHFET2ourcePrimePtr = matched->CSC ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
HFET2bindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
HFET2model *model = (HFET2model *)inModel ;
|
||||
HFET2instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the HFET2 models */
|
||||
for ( ; model != NULL ; model = model->HFET2nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->HFET2instances ; here != NULL ; here = here->HFET2nextInstance)
|
||||
{
|
||||
if ((here->HFET2drainNode != 0) && (here->HFET2drainPrimeNode != 0))
|
||||
here->HFET2drainDrainPrimePtr = here->HFET2drainDrainPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2gateNode != 0) && (here->HFET2drainPrimeNode != 0))
|
||||
here->HFET2gateDrainPrimePtr = here->HFET2gateDrainPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2gateNode != 0) && (here->HFET2sourcePrimeNode != 0))
|
||||
here->HFET2gateSourcePrimePtr = here->HFET2gateSourcePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2sourceNode != 0) && (here->HFET2sourcePrimeNode != 0))
|
||||
here->HFET2sourceSourcePrimePtr = here->HFET2sourceSourcePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2drainPrimeNode != 0) && (here->HFET2drainNode != 0))
|
||||
here->HFET2drainPrimeDrainPtr = here->HFET2drainPrimeDrainStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2drainPrimeNode != 0) && (here->HFET2gateNode != 0))
|
||||
here->HFET2drainPrimeGatePtr = here->HFET2drainPrimeGateStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2drainPrimeNode != 0) && (here->HFET2sourcePrimeNode != 0))
|
||||
here->HFET2drainPriHFET2ourcePrimePtr = here->HFET2drainPriHFET2ourcePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2sourcePrimeNode != 0) && (here->HFET2gateNode != 0))
|
||||
here->HFET2sourcePrimeGatePtr = here->HFET2sourcePrimeGateStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2sourcePrimeNode != 0) && (here->HFET2sourceNode != 0))
|
||||
here->HFET2sourcePriHFET2ourcePtr = here->HFET2sourcePriHFET2ourceStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2sourcePrimeNode != 0) && (here->HFET2drainPrimeNode != 0))
|
||||
here->HFET2sourcePrimeDrainPrimePtr = here->HFET2sourcePrimeDrainPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2drainNode != 0) && (here->HFET2drainNode != 0))
|
||||
here->HFET2drainDrainPtr = here->HFET2drainDrainStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2gateNode != 0) && (here->HFET2gateNode != 0))
|
||||
here->HFET2gateGatePtr = here->HFET2gateGateStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2sourceNode != 0) && (here->HFET2sourceNode != 0))
|
||||
here->HFET2sourceSourcePtr = here->HFET2sourceSourceStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2drainPrimeNode != 0) && (here->HFET2drainPrimeNode != 0))
|
||||
here->HFET2drainPrimeDrainPrimePtr = here->HFET2drainPrimeDrainPrimeStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->HFET2sourcePrimeNode != 0) && (here->HFET2sourcePrimeNode != 0))
|
||||
here->HFET2sourcePriHFET2ourcePrimePtr = here->HFET2sourcePriHFET2ourcePrimeStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
HFET2bindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
HFET2model *model = (HFET2model *)inModel ;
|
||||
HFET2instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the HFET2 models */
|
||||
for ( ; model != NULL ; model = model->HFET2nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->HFET2instances ; here != NULL ; here = here->HFET2nextInstance)
|
||||
{
|
||||
if ((here->HFET2drainNode != 0) && (here->HFET2drainPrimeNode != 0))
|
||||
here->HFET2drainDrainPrimePtr = here->HFET2drainDrainPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2gateNode != 0) && (here->HFET2drainPrimeNode != 0))
|
||||
here->HFET2gateDrainPrimePtr = here->HFET2gateDrainPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2gateNode != 0) && (here->HFET2sourcePrimeNode != 0))
|
||||
here->HFET2gateSourcePrimePtr = here->HFET2gateSourcePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2sourceNode != 0) && (here->HFET2sourcePrimeNode != 0))
|
||||
here->HFET2sourceSourcePrimePtr = here->HFET2sourceSourcePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2drainPrimeNode != 0) && (here->HFET2drainNode != 0))
|
||||
here->HFET2drainPrimeDrainPtr = here->HFET2drainPrimeDrainStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2drainPrimeNode != 0) && (here->HFET2gateNode != 0))
|
||||
here->HFET2drainPrimeGatePtr = here->HFET2drainPrimeGateStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2drainPrimeNode != 0) && (here->HFET2sourcePrimeNode != 0))
|
||||
here->HFET2drainPriHFET2ourcePrimePtr = here->HFET2drainPriHFET2ourcePrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2sourcePrimeNode != 0) && (here->HFET2gateNode != 0))
|
||||
here->HFET2sourcePrimeGatePtr = here->HFET2sourcePrimeGateStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2sourcePrimeNode != 0) && (here->HFET2sourceNode != 0))
|
||||
here->HFET2sourcePriHFET2ourcePtr = here->HFET2sourcePriHFET2ourceStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2sourcePrimeNode != 0) && (here->HFET2drainPrimeNode != 0))
|
||||
here->HFET2sourcePrimeDrainPrimePtr = here->HFET2sourcePrimeDrainPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2drainNode != 0) && (here->HFET2drainNode != 0))
|
||||
here->HFET2drainDrainPtr = here->HFET2drainDrainStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2gateNode != 0) && (here->HFET2gateNode != 0))
|
||||
here->HFET2gateGatePtr = here->HFET2gateGateStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2sourceNode != 0) && (here->HFET2sourceNode != 0))
|
||||
here->HFET2sourceSourcePtr = here->HFET2sourceSourceStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2drainPrimeNode != 0) && (here->HFET2drainPrimeNode != 0))
|
||||
here->HFET2drainPrimeDrainPrimePtr = here->HFET2drainPrimeDrainPrimeStructPtr->CSC ;
|
||||
|
||||
if ((here->HFET2sourcePrimeNode != 0) && (here->HFET2sourcePrimeNode != 0))
|
||||
here->HFET2sourcePriHFET2ourcePrimePtr = here->HFET2sourcePriHFET2ourcePrimeStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -80,7 +80,25 @@ typedef struct sHFET2instance {
|
|||
double HFET2vcrit;
|
||||
double HFET2ggrlw;
|
||||
double HFET2jslw;
|
||||
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *HFET2drainDrainPrimeStructPtr ;
|
||||
BindElement *HFET2gateDrainPrimeStructPtr ;
|
||||
BindElement *HFET2gateSourcePrimeStructPtr ;
|
||||
BindElement *HFET2sourceSourcePrimeStructPtr ;
|
||||
BindElement *HFET2drainPrimeDrainStructPtr ;
|
||||
BindElement *HFET2drainPrimeGateStructPtr ;
|
||||
BindElement *HFET2drainPriHFET2ourcePrimeStructPtr ;
|
||||
BindElement *HFET2sourcePrimeGateStructPtr ;
|
||||
BindElement *HFET2sourcePriHFET2ourceStructPtr ;
|
||||
BindElement *HFET2sourcePrimeDrainPrimeStructPtr ;
|
||||
BindElement *HFET2drainDrainStructPtr ;
|
||||
BindElement *HFET2gateGateStructPtr ;
|
||||
BindElement *HFET2sourceSourceStructPtr ;
|
||||
BindElement *HFET2drainPrimeDrainPrimeStructPtr ;
|
||||
BindElement *HFET2sourcePriHFET2ourcePrimeStructPtr ;
|
||||
#endif
|
||||
|
||||
} HFET2instance ;
|
||||
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue