New Binding Method extended to MOS1, MOS2, MOS3 and MOS9 devices
This commit is contained in:
parent
d77b9958bf
commit
136e74c9bc
|
|
@ -1,5 +1,5 @@
|
|||
/**********
|
||||
Author: 2012 Francesco Lannutti
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
|
|
@ -7,304 +7,303 @@ Author: 2012 Francesco Lannutti
|
|||
#include "mos1defs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
MOS1bindCSC(GENmodel *inModel, CKTcircuit *ckt)
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
MOS1model *model = (MOS1model *)inModel;
|
||||
int i ;
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
/* loop through all the mos1 models */
|
||||
for( ; model != NULL; model = model->MOS1nextModel ) {
|
||||
MOS1instance *here;
|
||||
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS1instances; here != NULL ;
|
||||
here = here->MOS1nextInstance) {
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNode != 0) && (here->MOS1dNode != 0)) {
|
||||
while (here->MOS1DdPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1DdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1gNode != 0)) {
|
||||
while (here->MOS1GgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1GgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNode != 0) && (here->MOS1sNode != 0)) {
|
||||
while (here->MOS1SsPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1SsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1bNode != 0)) {
|
||||
while (here->MOS1BbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1BbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1dNodePrime != 0)) {
|
||||
while (here->MOS1DPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1DPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1sNodePrime != 0)) {
|
||||
while (here->MOS1SPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1SPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNode != 0) && (here->MOS1dNodePrime != 0)) {
|
||||
while (here->MOS1DdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1DdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1bNode != 0)) {
|
||||
while (here->MOS1GbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1GbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1dNodePrime != 0)) {
|
||||
while (here->MOS1GdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1GdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1sNodePrime != 0)) {
|
||||
while (here->MOS1GspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1GspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNode != 0) && (here->MOS1sNodePrime != 0)) {
|
||||
while (here->MOS1SspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1SspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1dNodePrime != 0)) {
|
||||
while (here->MOS1BdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1BdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1sNodePrime != 0)) {
|
||||
while (here->MOS1BspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1BspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1sNodePrime != 0)) {
|
||||
while (here->MOS1DPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1DPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1dNode != 0)) {
|
||||
while (here->MOS1DPdPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1DPdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1gNode != 0)) {
|
||||
while (here->MOS1BgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1BgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1gNode != 0)) {
|
||||
while (here->MOS1DPgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1DPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1gNode != 0)) {
|
||||
while (here->MOS1SPgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1SPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1sNode != 0)) {
|
||||
while (here->MOS1SPsPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1SPsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1bNode != 0)) {
|
||||
while (here->MOS1DPbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1DPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1bNode != 0)) {
|
||||
while (here->MOS1SPbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1SPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1dNodePrime != 0)) {
|
||||
while (here->MOS1SPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS1SPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return(OK);
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
MOS1bindCSCComplex(GENmodel *inModel, CKTcircuit *ckt)
|
||||
MOS1bindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS1model *model = (MOS1model *)inModel;
|
||||
int i ;
|
||||
MOS1model *model = (MOS1model *)inModel ;
|
||||
MOS1instance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
/* loop through all the mos1 models */
|
||||
for( ; model != NULL; model = model->MOS1nextModel ) {
|
||||
MOS1instance *here;
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the MOS1 models */
|
||||
for ( ; model != NULL ; model = model->MOS1nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS1instances; here != NULL ;
|
||||
here = here->MOS1nextInstance) {
|
||||
for (here = model->MOS1instances ; here != NULL ; here = here->MOS1nextInstance)
|
||||
{
|
||||
if ((here->MOS1dNode != 0) && (here->MOS1dNode != 0))
|
||||
{
|
||||
i = here->MOS1DdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1DdStructPtr = matched ;
|
||||
here->MOS1DdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNode != 0) && (here->MOS1dNode != 0)) {
|
||||
while (here->MOS1DdPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1DdPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1gNode != 0))
|
||||
{
|
||||
i = here->MOS1GgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1GgStructPtr = matched ;
|
||||
here->MOS1GgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1gNode != 0)) {
|
||||
while (here->MOS1GgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1GgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1sNode != 0) && (here->MOS1sNode != 0))
|
||||
{
|
||||
i = here->MOS1SsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1SsStructPtr = matched ;
|
||||
here->MOS1SsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNode != 0) && (here->MOS1sNode != 0)) {
|
||||
while (here->MOS1SsPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1SsPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1bNode != 0))
|
||||
{
|
||||
i = here->MOS1BbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1BbStructPtr = matched ;
|
||||
here->MOS1BbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1bNode != 0)) {
|
||||
while (here->MOS1BbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1BbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS1DPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1DPdpStructPtr = matched ;
|
||||
here->MOS1DPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1dNodePrime != 0)) {
|
||||
while (here->MOS1DPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1DPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS1SPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1SPspStructPtr = matched ;
|
||||
here->MOS1SPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1sNodePrime != 0)) {
|
||||
while (here->MOS1SPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1SPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1dNode != 0) && (here->MOS1dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS1DdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1DdpStructPtr = matched ;
|
||||
here->MOS1DdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNode != 0) && (here->MOS1dNodePrime != 0)) {
|
||||
while (here->MOS1DdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1DdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1bNode != 0))
|
||||
{
|
||||
i = here->MOS1GbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1GbStructPtr = matched ;
|
||||
here->MOS1GbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1bNode != 0)) {
|
||||
while (here->MOS1GbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1GbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS1GdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1GdpStructPtr = matched ;
|
||||
here->MOS1GdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1dNodePrime != 0)) {
|
||||
while (here->MOS1GdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1GdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS1GspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1GspStructPtr = matched ;
|
||||
here->MOS1GspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1sNodePrime != 0)) {
|
||||
while (here->MOS1GspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1GspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1sNode != 0) && (here->MOS1sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS1SspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1SspStructPtr = matched ;
|
||||
here->MOS1SspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNode != 0) && (here->MOS1sNodePrime != 0)) {
|
||||
while (here->MOS1SspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1SspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS1BdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1BdpStructPtr = matched ;
|
||||
here->MOS1BdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1dNodePrime != 0)) {
|
||||
while (here->MOS1BdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1BdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS1BspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1BspStructPtr = matched ;
|
||||
here->MOS1BspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1sNodePrime != 0)) {
|
||||
while (here->MOS1BspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1BspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS1DPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1DPspStructPtr = matched ;
|
||||
here->MOS1DPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1sNodePrime != 0)) {
|
||||
while (here->MOS1DPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1DPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1dNode != 0))
|
||||
{
|
||||
i = here->MOS1DPdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1DPdStructPtr = matched ;
|
||||
here->MOS1DPdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1dNode != 0)) {
|
||||
while (here->MOS1DPdPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1DPdPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1gNode != 0))
|
||||
{
|
||||
i = here->MOS1BgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1BgStructPtr = matched ;
|
||||
here->MOS1BgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1gNode != 0)) {
|
||||
while (here->MOS1BgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1BgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1gNode != 0))
|
||||
{
|
||||
i = here->MOS1DPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1DPgStructPtr = matched ;
|
||||
here->MOS1DPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1gNode != 0)) {
|
||||
while (here->MOS1DPgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1DPgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1gNode != 0))
|
||||
{
|
||||
i = here->MOS1SPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1SPgStructPtr = matched ;
|
||||
here->MOS1SPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1gNode != 0)) {
|
||||
while (here->MOS1SPgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1SPgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1sNode != 0))
|
||||
{
|
||||
i = here->MOS1SPsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1SPsStructPtr = matched ;
|
||||
here->MOS1SPsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1sNode != 0)) {
|
||||
while (here->MOS1SPsPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1SPsPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1bNode != 0))
|
||||
{
|
||||
i = here->MOS1DPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1DPbStructPtr = matched ;
|
||||
here->MOS1DPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1bNode != 0)) {
|
||||
while (here->MOS1DPbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1DPbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1bNode != 0))
|
||||
{
|
||||
i = here->MOS1SPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1SPbStructPtr = matched ;
|
||||
here->MOS1SPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1bNode != 0)) {
|
||||
while (here->MOS1SPbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1SPbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS1SPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS1SPdpStructPtr = matched ;
|
||||
here->MOS1SPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1dNodePrime != 0)) {
|
||||
while (here->MOS1SPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS1SPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return(OK);
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
MOS1bindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS1model *model = (MOS1model *)inModel ;
|
||||
MOS1instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the MOS1 models */
|
||||
for ( ; model != NULL ; model = model->MOS1nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS1instances ; here != NULL ; here = here->MOS1nextInstance)
|
||||
{
|
||||
if ((here->MOS1dNode != 0) && (here->MOS1dNode != 0))
|
||||
here->MOS1DdPtr = here->MOS1DdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1gNode != 0))
|
||||
here->MOS1GgPtr = here->MOS1GgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1sNode != 0) && (here->MOS1sNode != 0))
|
||||
here->MOS1SsPtr = here->MOS1SsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1bNode != 0))
|
||||
here->MOS1BbPtr = here->MOS1BbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1dNodePrime != 0))
|
||||
here->MOS1DPdpPtr = here->MOS1DPdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1sNodePrime != 0))
|
||||
here->MOS1SPspPtr = here->MOS1SPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1dNode != 0) && (here->MOS1dNodePrime != 0))
|
||||
here->MOS1DdpPtr = here->MOS1DdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1bNode != 0))
|
||||
here->MOS1GbPtr = here->MOS1GbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1dNodePrime != 0))
|
||||
here->MOS1GdpPtr = here->MOS1GdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1sNodePrime != 0))
|
||||
here->MOS1GspPtr = here->MOS1GspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1sNode != 0) && (here->MOS1sNodePrime != 0))
|
||||
here->MOS1SspPtr = here->MOS1SspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1dNodePrime != 0))
|
||||
here->MOS1BdpPtr = here->MOS1BdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1sNodePrime != 0))
|
||||
here->MOS1BspPtr = here->MOS1BspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1sNodePrime != 0))
|
||||
here->MOS1DPspPtr = here->MOS1DPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1dNode != 0))
|
||||
here->MOS1DPdPtr = here->MOS1DPdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1gNode != 0))
|
||||
here->MOS1BgPtr = here->MOS1BgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1gNode != 0))
|
||||
here->MOS1DPgPtr = here->MOS1DPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1gNode != 0))
|
||||
here->MOS1SPgPtr = here->MOS1SPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1sNode != 0))
|
||||
here->MOS1SPsPtr = here->MOS1SPsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1bNode != 0))
|
||||
here->MOS1DPbPtr = here->MOS1DPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1bNode != 0))
|
||||
here->MOS1SPbPtr = here->MOS1SPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1dNodePrime != 0))
|
||||
here->MOS1SPdpPtr = here->MOS1SPdpStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -312,169 +311,83 @@ MOS1bindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
|||
{
|
||||
MOS1model *model = (MOS1model *)inModel ;
|
||||
MOS1instance *here ;
|
||||
int i ;
|
||||
|
||||
/* loop through all the mos1 models */
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the MOS1 models */
|
||||
for ( ; model != NULL ; model = model->MOS1nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS1instances ; here != NULL ; here = here->MOS1nextInstance)
|
||||
{
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNode != 0) && (here->MOS1dNode != 0))
|
||||
{
|
||||
while (here->MOS1DdPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1DdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1DdPtr = here->MOS1DdStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1gNode != 0))
|
||||
{
|
||||
while (here->MOS1GgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1GgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1GgPtr = here->MOS1GgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNode != 0) && (here->MOS1sNode != 0))
|
||||
{
|
||||
while (here->MOS1SsPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1SsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1SsPtr = here->MOS1SsStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1bNode != 0))
|
||||
{
|
||||
while (here->MOS1BbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1BbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1BbPtr = here->MOS1BbStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS1DPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1DPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1DPdpPtr = here->MOS1DPdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS1SPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1SPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1SPspPtr = here->MOS1SPspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNode != 0) && (here->MOS1dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS1DdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1DdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1DdpPtr = here->MOS1DdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1bNode != 0))
|
||||
{
|
||||
while (here->MOS1GbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1GbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1GbPtr = here->MOS1GbStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS1GdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1GdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1GdpPtr = here->MOS1GdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1gNode != 0) && (here->MOS1sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS1GspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1GspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1GspPtr = here->MOS1GspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNode != 0) && (here->MOS1sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS1SspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1SspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1SspPtr = here->MOS1SspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS1BdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1BdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1BdpPtr = here->MOS1BdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS1BspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1BspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1BspPtr = here->MOS1BspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS1DPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1DPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1DPspPtr = here->MOS1DPspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1dNode != 0))
|
||||
{
|
||||
while (here->MOS1DPdPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1DPdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1DPdPtr = here->MOS1DPdStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1bNode != 0) && (here->MOS1gNode != 0))
|
||||
{
|
||||
while (here->MOS1BgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1BgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1BgPtr = here->MOS1BgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1gNode != 0))
|
||||
{
|
||||
while (here->MOS1DPgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1DPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1DPgPtr = here->MOS1DPgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1gNode != 0))
|
||||
{
|
||||
while (here->MOS1SPgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1SPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1SPgPtr = here->MOS1SPgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1sNode != 0))
|
||||
{
|
||||
while (here->MOS1SPsPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1SPsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1SPsPtr = here->MOS1SPsStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1dNodePrime != 0) && (here->MOS1bNode != 0))
|
||||
{
|
||||
while (here->MOS1DPbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1DPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1DPbPtr = here->MOS1DPbStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1bNode != 0))
|
||||
{
|
||||
while (here->MOS1SPbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1SPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1SPbPtr = here->MOS1SPbStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS1sNodePrime != 0) && (here->MOS1dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS1SPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS1SPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
here->MOS1SPdpPtr = here->MOS1SPdpStructPtr->CSC ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -264,6 +264,31 @@ typedef struct sMOS1instance {
|
|||
#define MOS1dphibs_dw MOS1sens + 68
|
||||
#define MOS1dphibd_dw MOS1sens + 69
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *MOS1DdStructPtr ;
|
||||
BindElement *MOS1GgStructPtr ;
|
||||
BindElement *MOS1SsStructPtr ;
|
||||
BindElement *MOS1BbStructPtr ;
|
||||
BindElement *MOS1DPdpStructPtr ;
|
||||
BindElement *MOS1SPspStructPtr ;
|
||||
BindElement *MOS1DdpStructPtr ;
|
||||
BindElement *MOS1GbStructPtr ;
|
||||
BindElement *MOS1GdpStructPtr ;
|
||||
BindElement *MOS1GspStructPtr ;
|
||||
BindElement *MOS1SspStructPtr ;
|
||||
BindElement *MOS1BdpStructPtr ;
|
||||
BindElement *MOS1BspStructPtr ;
|
||||
BindElement *MOS1DPspStructPtr ;
|
||||
BindElement *MOS1DPdStructPtr ;
|
||||
BindElement *MOS1BgStructPtr ;
|
||||
BindElement *MOS1DPgStructPtr ;
|
||||
BindElement *MOS1SPgStructPtr ;
|
||||
BindElement *MOS1SPsStructPtr ;
|
||||
BindElement *MOS1DPbStructPtr ;
|
||||
BindElement *MOS1SPbStructPtr ;
|
||||
BindElement *MOS1SPdpStructPtr ;
|
||||
#endif
|
||||
|
||||
} MOS1instance ;
|
||||
|
||||
#define MOS1vbd MOS1states+ 0 /* bulk-drain voltage */
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**********
|
||||
Author: 2012 Francesco Lannutti
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
|
|
@ -7,304 +7,303 @@ Author: 2012 Francesco Lannutti
|
|||
#include "mos2defs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
MOS2bindCSC(GENmodel *inModel, CKTcircuit *ckt)
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
MOS2model *model = (MOS2model *)inModel;
|
||||
int i ;
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
/* loop through all the mos2 models */
|
||||
for( ; model != NULL; model = model->MOS2nextModel ) {
|
||||
MOS2instance *here;
|
||||
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS2instances; here != NULL ;
|
||||
here = here->MOS2nextInstance) {
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNode != 0) && (here-> MOS2dNode != 0)) {
|
||||
while (here->MOS2DdPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2DdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2gNode != 0)) {
|
||||
while (here->MOS2GgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2GgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNode != 0) && (here-> MOS2sNode != 0)) {
|
||||
while (here->MOS2SsPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2SsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2bNode != 0)) {
|
||||
while (here->MOS2BbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2BbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2dNodePrime != 0)) {
|
||||
while (here->MOS2DPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2DPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2sNodePrime != 0)) {
|
||||
while (here->MOS2SPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2SPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNode != 0) && (here-> MOS2dNodePrime != 0)) {
|
||||
while (here->MOS2DdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2DdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2bNode != 0)) {
|
||||
while (here->MOS2GbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2GbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2dNodePrime != 0)) {
|
||||
while (here->MOS2GdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2GdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2sNodePrime != 0)) {
|
||||
while (here->MOS2GspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2GspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNode != 0) && (here-> MOS2sNodePrime != 0)) {
|
||||
while (here->MOS2SspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2SspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2dNodePrime != 0)) {
|
||||
while (here->MOS2BdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2BdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2sNodePrime != 0)) {
|
||||
while (here->MOS2BspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2BspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2sNodePrime != 0)) {
|
||||
while (here->MOS2DPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2DPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2dNode != 0)) {
|
||||
while (here->MOS2DPdPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2DPdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2gNode != 0)) {
|
||||
while (here->MOS2BgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2BgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2gNode != 0)) {
|
||||
while (here->MOS2DPgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2DPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2gNode != 0)) {
|
||||
while (here->MOS2SPgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2SPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2sNode != 0)) {
|
||||
while (here->MOS2SPsPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2SPsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2bNode != 0)) {
|
||||
while (here->MOS2DPbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2DPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2bNode != 0)) {
|
||||
while (here->MOS2SPbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2SPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2dNodePrime != 0)) {
|
||||
while (here->MOS2SPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS2SPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return(OK);
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
MOS2bindCSCComplex(GENmodel *inModel, CKTcircuit *ckt)
|
||||
MOS2bindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS2model *model = (MOS2model *)inModel;
|
||||
int i ;
|
||||
MOS2model *model = (MOS2model *)inModel ;
|
||||
MOS2instance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
/* loop through all the mos2 models */
|
||||
for( ; model != NULL; model = model->MOS2nextModel ) {
|
||||
MOS2instance *here;
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the MOS2 models */
|
||||
for ( ; model != NULL ; model = model->MOS2nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS2instances; here != NULL ;
|
||||
here = here->MOS2nextInstance) {
|
||||
for (here = model->MOS2instances ; here != NULL ; here = here->MOS2nextInstance)
|
||||
{
|
||||
if ((here-> MOS2dNode != 0) && (here-> MOS2dNode != 0))
|
||||
{
|
||||
i = here->MOS2DdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2DdStructPtr = matched ;
|
||||
here->MOS2DdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNode != 0) && (here-> MOS2dNode != 0)) {
|
||||
while (here->MOS2DdPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2DdPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2gNode != 0))
|
||||
{
|
||||
i = here->MOS2GgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2GgStructPtr = matched ;
|
||||
here->MOS2GgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2gNode != 0)) {
|
||||
while (here->MOS2GgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2GgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2sNode != 0) && (here-> MOS2sNode != 0))
|
||||
{
|
||||
i = here->MOS2SsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2SsStructPtr = matched ;
|
||||
here->MOS2SsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNode != 0) && (here-> MOS2sNode != 0)) {
|
||||
while (here->MOS2SsPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2SsPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2bNode != 0))
|
||||
{
|
||||
i = here->MOS2BbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2BbStructPtr = matched ;
|
||||
here->MOS2BbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2bNode != 0)) {
|
||||
while (here->MOS2BbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2BbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS2DPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2DPdpStructPtr = matched ;
|
||||
here->MOS2DPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2dNodePrime != 0)) {
|
||||
while (here->MOS2DPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2DPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS2SPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2SPspStructPtr = matched ;
|
||||
here->MOS2SPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2sNodePrime != 0)) {
|
||||
while (here->MOS2SPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2SPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2dNode != 0) && (here-> MOS2dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS2DdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2DdpStructPtr = matched ;
|
||||
here->MOS2DdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNode != 0) && (here-> MOS2dNodePrime != 0)) {
|
||||
while (here->MOS2DdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2DdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2bNode != 0))
|
||||
{
|
||||
i = here->MOS2GbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2GbStructPtr = matched ;
|
||||
here->MOS2GbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2bNode != 0)) {
|
||||
while (here->MOS2GbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2GbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS2GdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2GdpStructPtr = matched ;
|
||||
here->MOS2GdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2dNodePrime != 0)) {
|
||||
while (here->MOS2GdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2GdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS2GspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2GspStructPtr = matched ;
|
||||
here->MOS2GspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2sNodePrime != 0)) {
|
||||
while (here->MOS2GspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2GspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2sNode != 0) && (here-> MOS2sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS2SspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2SspStructPtr = matched ;
|
||||
here->MOS2SspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNode != 0) && (here-> MOS2sNodePrime != 0)) {
|
||||
while (here->MOS2SspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2SspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS2BdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2BdpStructPtr = matched ;
|
||||
here->MOS2BdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2dNodePrime != 0)) {
|
||||
while (here->MOS2BdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2BdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS2BspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2BspStructPtr = matched ;
|
||||
here->MOS2BspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2sNodePrime != 0)) {
|
||||
while (here->MOS2BspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2BspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS2DPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2DPspStructPtr = matched ;
|
||||
here->MOS2DPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2sNodePrime != 0)) {
|
||||
while (here->MOS2DPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2DPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2dNode != 0))
|
||||
{
|
||||
i = here->MOS2DPdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2DPdStructPtr = matched ;
|
||||
here->MOS2DPdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2dNode != 0)) {
|
||||
while (here->MOS2DPdPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2DPdPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2gNode != 0))
|
||||
{
|
||||
i = here->MOS2BgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2BgStructPtr = matched ;
|
||||
here->MOS2BgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2gNode != 0)) {
|
||||
while (here->MOS2BgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2BgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2gNode != 0))
|
||||
{
|
||||
i = here->MOS2DPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2DPgStructPtr = matched ;
|
||||
here->MOS2DPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2gNode != 0)) {
|
||||
while (here->MOS2DPgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2DPgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2gNode != 0))
|
||||
{
|
||||
i = here->MOS2SPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2SPgStructPtr = matched ;
|
||||
here->MOS2SPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2gNode != 0)) {
|
||||
while (here->MOS2SPgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2SPgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2sNode != 0))
|
||||
{
|
||||
i = here->MOS2SPsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2SPsStructPtr = matched ;
|
||||
here->MOS2SPsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2sNode != 0)) {
|
||||
while (here->MOS2SPsPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2SPsPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2bNode != 0))
|
||||
{
|
||||
i = here->MOS2DPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2DPbStructPtr = matched ;
|
||||
here->MOS2DPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2bNode != 0)) {
|
||||
while (here->MOS2DPbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2DPbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2bNode != 0))
|
||||
{
|
||||
i = here->MOS2SPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2SPbStructPtr = matched ;
|
||||
here->MOS2SPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2bNode != 0)) {
|
||||
while (here->MOS2SPbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2SPbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS2SPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS2SPdpStructPtr = matched ;
|
||||
here->MOS2SPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2dNodePrime != 0)) {
|
||||
while (here->MOS2SPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS2SPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return(OK);
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
MOS2bindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS2model *model = (MOS2model *)inModel ;
|
||||
MOS2instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the MOS2 models */
|
||||
for ( ; model != NULL ; model = model->MOS2nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS2instances ; here != NULL ; here = here->MOS2nextInstance)
|
||||
{
|
||||
if ((here-> MOS2dNode != 0) && (here-> MOS2dNode != 0))
|
||||
here->MOS2DdPtr = here->MOS2DdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2gNode != 0))
|
||||
here->MOS2GgPtr = here->MOS2GgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2sNode != 0) && (here-> MOS2sNode != 0))
|
||||
here->MOS2SsPtr = here->MOS2SsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2bNode != 0))
|
||||
here->MOS2BbPtr = here->MOS2BbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2dNodePrime != 0))
|
||||
here->MOS2DPdpPtr = here->MOS2DPdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2sNodePrime != 0))
|
||||
here->MOS2SPspPtr = here->MOS2SPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2dNode != 0) && (here-> MOS2dNodePrime != 0))
|
||||
here->MOS2DdpPtr = here->MOS2DdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2bNode != 0))
|
||||
here->MOS2GbPtr = here->MOS2GbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2dNodePrime != 0))
|
||||
here->MOS2GdpPtr = here->MOS2GdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2sNodePrime != 0))
|
||||
here->MOS2GspPtr = here->MOS2GspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2sNode != 0) && (here-> MOS2sNodePrime != 0))
|
||||
here->MOS2SspPtr = here->MOS2SspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2dNodePrime != 0))
|
||||
here->MOS2BdpPtr = here->MOS2BdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2sNodePrime != 0))
|
||||
here->MOS2BspPtr = here->MOS2BspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2sNodePrime != 0))
|
||||
here->MOS2DPspPtr = here->MOS2DPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2dNode != 0))
|
||||
here->MOS2DPdPtr = here->MOS2DPdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2gNode != 0))
|
||||
here->MOS2BgPtr = here->MOS2BgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2gNode != 0))
|
||||
here->MOS2DPgPtr = here->MOS2DPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2gNode != 0))
|
||||
here->MOS2SPgPtr = here->MOS2SPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2sNode != 0))
|
||||
here->MOS2SPsPtr = here->MOS2SPsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2bNode != 0))
|
||||
here->MOS2DPbPtr = here->MOS2DPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2bNode != 0))
|
||||
here->MOS2SPbPtr = here->MOS2SPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2dNodePrime != 0))
|
||||
here->MOS2SPdpPtr = here->MOS2SPdpStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -312,169 +311,83 @@ MOS2bindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
|||
{
|
||||
MOS2model *model = (MOS2model *)inModel ;
|
||||
MOS2instance *here ;
|
||||
int i ;
|
||||
|
||||
/* loop through all the mos2 models */
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the MOS2 models */
|
||||
for ( ; model != NULL ; model = model->MOS2nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS2instances ; here != NULL ; here = here->MOS2nextInstance)
|
||||
{
|
||||
i = 0 ;
|
||||
if ((here->MOS2dNode != 0) && (here->MOS2dNode != 0))
|
||||
{
|
||||
while (here->MOS2DdPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2DdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2dNode != 0) && (here-> MOS2dNode != 0))
|
||||
here->MOS2DdPtr = here->MOS2DdStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2gNode != 0) && (here->MOS2gNode != 0))
|
||||
{
|
||||
while (here->MOS2GgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2GgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2gNode != 0))
|
||||
here->MOS2GgPtr = here->MOS2GgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2sNode != 0) && (here->MOS2sNode != 0))
|
||||
{
|
||||
while (here->MOS2SsPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2SsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2sNode != 0) && (here-> MOS2sNode != 0))
|
||||
here->MOS2SsPtr = here->MOS2SsStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2bNode != 0) && (here->MOS2bNode != 0))
|
||||
{
|
||||
while (here->MOS2BbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2BbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2bNode != 0))
|
||||
here->MOS2BbPtr = here->MOS2BbStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2dNodePrime != 0) && (here->MOS2dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS2DPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2DPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2dNodePrime != 0))
|
||||
here->MOS2DPdpPtr = here->MOS2DPdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2sNodePrime != 0) && (here->MOS2sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS2SPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2SPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2sNodePrime != 0))
|
||||
here->MOS2SPspPtr = here->MOS2SPspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2dNode != 0) && (here->MOS2dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS2DdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2DdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2dNode != 0) && (here-> MOS2dNodePrime != 0))
|
||||
here->MOS2DdpPtr = here->MOS2DdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2gNode != 0) && (here->MOS2bNode != 0))
|
||||
{
|
||||
while (here->MOS2GbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2GbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2bNode != 0))
|
||||
here->MOS2GbPtr = here->MOS2GbStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2gNode != 0) && (here->MOS2dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS2GdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2GdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2dNodePrime != 0))
|
||||
here->MOS2GdpPtr = here->MOS2GdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2gNode != 0) && (here->MOS2sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS2GspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2GspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2gNode != 0) && (here-> MOS2sNodePrime != 0))
|
||||
here->MOS2GspPtr = here->MOS2GspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2sNode != 0) && (here->MOS2sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS2SspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2SspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2sNode != 0) && (here-> MOS2sNodePrime != 0))
|
||||
here->MOS2SspPtr = here->MOS2SspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2bNode != 0) && (here->MOS2dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS2BdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2BdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2dNodePrime != 0))
|
||||
here->MOS2BdpPtr = here->MOS2BdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2bNode != 0) && (here->MOS2sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS2BspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2BspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2sNodePrime != 0))
|
||||
here->MOS2BspPtr = here->MOS2BspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2dNodePrime != 0) && (here->MOS2sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS2DPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2DPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2sNodePrime != 0))
|
||||
here->MOS2DPspPtr = here->MOS2DPspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2dNodePrime != 0) && (here->MOS2dNode != 0))
|
||||
{
|
||||
while (here->MOS2DPdPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2DPdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2dNode != 0))
|
||||
here->MOS2DPdPtr = here->MOS2DPdStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2bNode != 0) && (here->MOS2gNode != 0))
|
||||
{
|
||||
while (here->MOS2BgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2BgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2bNode != 0) && (here-> MOS2gNode != 0))
|
||||
here->MOS2BgPtr = here->MOS2BgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2dNodePrime != 0) && (here->MOS2gNode != 0))
|
||||
{
|
||||
while (here->MOS2DPgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2DPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2gNode != 0))
|
||||
here->MOS2DPgPtr = here->MOS2DPgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2sNodePrime != 0) && (here->MOS2gNode != 0))
|
||||
{
|
||||
while (here->MOS2SPgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2SPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2gNode != 0))
|
||||
here->MOS2SPgPtr = here->MOS2SPgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2sNodePrime != 0) && (here->MOS2sNode != 0))
|
||||
{
|
||||
while (here->MOS2SPsPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2SPsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2sNode != 0))
|
||||
here->MOS2SPsPtr = here->MOS2SPsStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2dNodePrime != 0) && (here->MOS2bNode != 0))
|
||||
{
|
||||
while (here->MOS2DPbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2DPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2dNodePrime != 0) && (here-> MOS2bNode != 0))
|
||||
here->MOS2DPbPtr = here->MOS2DPbStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2sNodePrime != 0) && (here->MOS2bNode != 0))
|
||||
{
|
||||
while (here->MOS2SPbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2SPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2bNode != 0))
|
||||
here->MOS2SPbPtr = here->MOS2SPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> MOS2sNodePrime != 0) && (here-> MOS2dNodePrime != 0))
|
||||
here->MOS2SPdpPtr = here->MOS2SPdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS2sNodePrime != 0) && (here->MOS2dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS2SPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS2SPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -267,7 +267,30 @@ typedef struct sMOS2instance {
|
|||
double **MOS2nVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *MOS2DdStructPtr ;
|
||||
BindElement *MOS2GgStructPtr ;
|
||||
BindElement *MOS2SsStructPtr ;
|
||||
BindElement *MOS2BbStructPtr ;
|
||||
BindElement *MOS2DPdpStructPtr ;
|
||||
BindElement *MOS2SPspStructPtr ;
|
||||
BindElement *MOS2DdpStructPtr ;
|
||||
BindElement *MOS2GbStructPtr ;
|
||||
BindElement *MOS2GdpStructPtr ;
|
||||
BindElement *MOS2GspStructPtr ;
|
||||
BindElement *MOS2SspStructPtr ;
|
||||
BindElement *MOS2BdpStructPtr ;
|
||||
BindElement *MOS2BspStructPtr ;
|
||||
BindElement *MOS2DPspStructPtr ;
|
||||
BindElement *MOS2DPdStructPtr ;
|
||||
BindElement *MOS2BgStructPtr ;
|
||||
BindElement *MOS2DPgStructPtr ;
|
||||
BindElement *MOS2SPgStructPtr ;
|
||||
BindElement *MOS2SPsStructPtr ;
|
||||
BindElement *MOS2DPbStructPtr ;
|
||||
BindElement *MOS2SPbStructPtr ;
|
||||
BindElement *MOS2SPdpStructPtr ;
|
||||
#endif
|
||||
|
||||
} MOS2instance ;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**********
|
||||
Author: 2012 Francesco Lannutti
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
|
|
@ -7,304 +7,303 @@ Author: 2012 Francesco Lannutti
|
|||
#include "mos3defs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
MOS3bindCSC(GENmodel *inModel, CKTcircuit *ckt)
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
MOS3model *model = (MOS3model *)inModel;
|
||||
int i ;
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
/* loop through all the mos3 models */
|
||||
for( ; model != NULL; model = model->MOS3nextModel ) {
|
||||
MOS3instance *here;
|
||||
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS3instances; here != NULL ;
|
||||
here = here->MOS3nextInstance) {
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNode != 0) && (here-> MOS3dNode != 0)) {
|
||||
while (here->MOS3DdPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3DdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3gNode != 0)) {
|
||||
while (here->MOS3GgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3GgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNode != 0) && (here-> MOS3sNode != 0)) {
|
||||
while (here->MOS3SsPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3SsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3bNode != 0)) {
|
||||
while (here->MOS3BbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3BbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3dNodePrime != 0)) {
|
||||
while (here->MOS3DPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3DPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3sNodePrime != 0)) {
|
||||
while (here->MOS3SPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3SPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNode != 0) && (here-> MOS3dNodePrime != 0)) {
|
||||
while (here->MOS3DdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3DdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3bNode != 0)) {
|
||||
while (here->MOS3GbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3GbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3dNodePrime != 0)) {
|
||||
while (here->MOS3GdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3GdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3sNodePrime != 0)) {
|
||||
while (here->MOS3GspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3GspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNode != 0) && (here-> MOS3sNodePrime != 0)) {
|
||||
while (here->MOS3SspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3SspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3dNodePrime != 0)) {
|
||||
while (here->MOS3BdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3BdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3sNodePrime != 0)) {
|
||||
while (here->MOS3BspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3BspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3sNodePrime != 0)) {
|
||||
while (here->MOS3DPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3DPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3dNode != 0)) {
|
||||
while (here->MOS3DPdPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3DPdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3gNode != 0)) {
|
||||
while (here->MOS3BgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3BgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3gNode != 0)) {
|
||||
while (here->MOS3DPgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3DPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3gNode != 0)) {
|
||||
while (here->MOS3SPgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3SPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3sNode != 0)) {
|
||||
while (here->MOS3SPsPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3SPsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3bNode != 0)) {
|
||||
while (here->MOS3DPbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3DPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3bNode != 0)) {
|
||||
while (here->MOS3SPbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3SPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3dNodePrime != 0)) {
|
||||
while (here->MOS3SPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS3SPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return(OK);
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
MOS3bindCSCComplex(GENmodel *inModel, CKTcircuit *ckt)
|
||||
MOS3bindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS3model *model = (MOS3model *)inModel;
|
||||
int i ;
|
||||
MOS3model *model = (MOS3model *)inModel ;
|
||||
MOS3instance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
/* loop through all the mos3 models */
|
||||
for( ; model != NULL; model = model->MOS3nextModel ) {
|
||||
MOS3instance *here;
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the MOS3 models */
|
||||
for ( ; model != NULL ; model = model->MOS3nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS3instances; here != NULL ;
|
||||
here = here->MOS3nextInstance) {
|
||||
for (here = model->MOS3instances ; here != NULL ; here = here->MOS3nextInstance)
|
||||
{
|
||||
if ((here-> MOS3dNode != 0) && (here-> MOS3dNode != 0))
|
||||
{
|
||||
i = here->MOS3DdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3DdStructPtr = matched ;
|
||||
here->MOS3DdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNode != 0) && (here-> MOS3dNode != 0)) {
|
||||
while (here->MOS3DdPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3DdPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3gNode != 0))
|
||||
{
|
||||
i = here->MOS3GgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3GgStructPtr = matched ;
|
||||
here->MOS3GgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3gNode != 0)) {
|
||||
while (here->MOS3GgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3GgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3sNode != 0) && (here-> MOS3sNode != 0))
|
||||
{
|
||||
i = here->MOS3SsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3SsStructPtr = matched ;
|
||||
here->MOS3SsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNode != 0) && (here-> MOS3sNode != 0)) {
|
||||
while (here->MOS3SsPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3SsPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3bNode != 0))
|
||||
{
|
||||
i = here->MOS3BbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3BbStructPtr = matched ;
|
||||
here->MOS3BbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3bNode != 0)) {
|
||||
while (here->MOS3BbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3BbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS3DPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3DPdpStructPtr = matched ;
|
||||
here->MOS3DPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3dNodePrime != 0)) {
|
||||
while (here->MOS3DPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3DPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS3SPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3SPspStructPtr = matched ;
|
||||
here->MOS3SPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3sNodePrime != 0)) {
|
||||
while (here->MOS3SPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3SPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3dNode != 0) && (here-> MOS3dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS3DdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3DdpStructPtr = matched ;
|
||||
here->MOS3DdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNode != 0) && (here-> MOS3dNodePrime != 0)) {
|
||||
while (here->MOS3DdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3DdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3bNode != 0))
|
||||
{
|
||||
i = here->MOS3GbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3GbStructPtr = matched ;
|
||||
here->MOS3GbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3bNode != 0)) {
|
||||
while (here->MOS3GbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3GbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS3GdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3GdpStructPtr = matched ;
|
||||
here->MOS3GdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3dNodePrime != 0)) {
|
||||
while (here->MOS3GdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3GdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS3GspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3GspStructPtr = matched ;
|
||||
here->MOS3GspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3sNodePrime != 0)) {
|
||||
while (here->MOS3GspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3GspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3sNode != 0) && (here-> MOS3sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS3SspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3SspStructPtr = matched ;
|
||||
here->MOS3SspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNode != 0) && (here-> MOS3sNodePrime != 0)) {
|
||||
while (here->MOS3SspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3SspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS3BdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3BdpStructPtr = matched ;
|
||||
here->MOS3BdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3dNodePrime != 0)) {
|
||||
while (here->MOS3BdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3BdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS3BspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3BspStructPtr = matched ;
|
||||
here->MOS3BspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3sNodePrime != 0)) {
|
||||
while (here->MOS3BspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3BspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS3DPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3DPspStructPtr = matched ;
|
||||
here->MOS3DPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3sNodePrime != 0)) {
|
||||
while (here->MOS3DPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3DPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3dNode != 0))
|
||||
{
|
||||
i = here->MOS3DPdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3DPdStructPtr = matched ;
|
||||
here->MOS3DPdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3dNode != 0)) {
|
||||
while (here->MOS3DPdPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3DPdPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3gNode != 0))
|
||||
{
|
||||
i = here->MOS3BgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3BgStructPtr = matched ;
|
||||
here->MOS3BgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3gNode != 0)) {
|
||||
while (here->MOS3BgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3BgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3gNode != 0))
|
||||
{
|
||||
i = here->MOS3DPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3DPgStructPtr = matched ;
|
||||
here->MOS3DPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3gNode != 0)) {
|
||||
while (here->MOS3DPgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3DPgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3gNode != 0))
|
||||
{
|
||||
i = here->MOS3SPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3SPgStructPtr = matched ;
|
||||
here->MOS3SPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3gNode != 0)) {
|
||||
while (here->MOS3SPgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3SPgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3sNode != 0))
|
||||
{
|
||||
i = here->MOS3SPsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3SPsStructPtr = matched ;
|
||||
here->MOS3SPsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3sNode != 0)) {
|
||||
while (here->MOS3SPsPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3SPsPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3bNode != 0))
|
||||
{
|
||||
i = here->MOS3DPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3DPbStructPtr = matched ;
|
||||
here->MOS3DPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3bNode != 0)) {
|
||||
while (here->MOS3DPbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3DPbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3bNode != 0))
|
||||
{
|
||||
i = here->MOS3SPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3SPbStructPtr = matched ;
|
||||
here->MOS3SPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3bNode != 0)) {
|
||||
while (here->MOS3SPbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3SPbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS3SPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS3SPdpStructPtr = matched ;
|
||||
here->MOS3SPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3dNodePrime != 0)) {
|
||||
while (here->MOS3SPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS3SPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return(OK);
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
MOS3bindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS3model *model = (MOS3model *)inModel ;
|
||||
MOS3instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the MOS3 models */
|
||||
for ( ; model != NULL ; model = model->MOS3nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS3instances ; here != NULL ; here = here->MOS3nextInstance)
|
||||
{
|
||||
if ((here-> MOS3dNode != 0) && (here-> MOS3dNode != 0))
|
||||
here->MOS3DdPtr = here->MOS3DdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3gNode != 0))
|
||||
here->MOS3GgPtr = here->MOS3GgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3sNode != 0) && (here-> MOS3sNode != 0))
|
||||
here->MOS3SsPtr = here->MOS3SsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3bNode != 0))
|
||||
here->MOS3BbPtr = here->MOS3BbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3dNodePrime != 0))
|
||||
here->MOS3DPdpPtr = here->MOS3DPdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3sNodePrime != 0))
|
||||
here->MOS3SPspPtr = here->MOS3SPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3dNode != 0) && (here-> MOS3dNodePrime != 0))
|
||||
here->MOS3DdpPtr = here->MOS3DdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3bNode != 0))
|
||||
here->MOS3GbPtr = here->MOS3GbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3dNodePrime != 0))
|
||||
here->MOS3GdpPtr = here->MOS3GdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3sNodePrime != 0))
|
||||
here->MOS3GspPtr = here->MOS3GspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3sNode != 0) && (here-> MOS3sNodePrime != 0))
|
||||
here->MOS3SspPtr = here->MOS3SspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3dNodePrime != 0))
|
||||
here->MOS3BdpPtr = here->MOS3BdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3sNodePrime != 0))
|
||||
here->MOS3BspPtr = here->MOS3BspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3sNodePrime != 0))
|
||||
here->MOS3DPspPtr = here->MOS3DPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3dNode != 0))
|
||||
here->MOS3DPdPtr = here->MOS3DPdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3gNode != 0))
|
||||
here->MOS3BgPtr = here->MOS3BgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3gNode != 0))
|
||||
here->MOS3DPgPtr = here->MOS3DPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3gNode != 0))
|
||||
here->MOS3SPgPtr = here->MOS3SPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3sNode != 0))
|
||||
here->MOS3SPsPtr = here->MOS3SPsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3bNode != 0))
|
||||
here->MOS3DPbPtr = here->MOS3DPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3bNode != 0))
|
||||
here->MOS3SPbPtr = here->MOS3SPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3dNodePrime != 0))
|
||||
here->MOS3SPdpPtr = here->MOS3SPdpStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -312,169 +311,83 @@ MOS3bindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
|||
{
|
||||
MOS3model *model = (MOS3model *)inModel ;
|
||||
MOS3instance *here ;
|
||||
int i ;
|
||||
|
||||
/* loop through all the mos3 models */
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the MOS3 models */
|
||||
for ( ; model != NULL ; model = model->MOS3nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS3instances ; here != NULL ; here = here->MOS3nextInstance)
|
||||
{
|
||||
i = 0 ;
|
||||
if ((here->MOS3dNode != 0) && (here->MOS3dNode != 0))
|
||||
{
|
||||
while (here->MOS3DdPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3DdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3dNode != 0) && (here-> MOS3dNode != 0))
|
||||
here->MOS3DdPtr = here->MOS3DdStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3gNode != 0) && (here->MOS3gNode != 0))
|
||||
{
|
||||
while (here->MOS3GgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3GgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3gNode != 0))
|
||||
here->MOS3GgPtr = here->MOS3GgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3sNode != 0) && (here->MOS3sNode != 0))
|
||||
{
|
||||
while (here->MOS3SsPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3SsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3sNode != 0) && (here-> MOS3sNode != 0))
|
||||
here->MOS3SsPtr = here->MOS3SsStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3bNode != 0) && (here->MOS3bNode != 0))
|
||||
{
|
||||
while (here->MOS3BbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3BbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3bNode != 0))
|
||||
here->MOS3BbPtr = here->MOS3BbStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3dNodePrime != 0) && (here->MOS3dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS3DPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3DPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3dNodePrime != 0))
|
||||
here->MOS3DPdpPtr = here->MOS3DPdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3sNodePrime != 0) && (here->MOS3sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS3SPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3SPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3sNodePrime != 0))
|
||||
here->MOS3SPspPtr = here->MOS3SPspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3dNode != 0) && (here->MOS3dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS3DdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3DdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3dNode != 0) && (here-> MOS3dNodePrime != 0))
|
||||
here->MOS3DdpPtr = here->MOS3DdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3gNode != 0) && (here->MOS3bNode != 0))
|
||||
{
|
||||
while (here->MOS3GbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3GbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3bNode != 0))
|
||||
here->MOS3GbPtr = here->MOS3GbStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3gNode != 0) && (here->MOS3dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS3GdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3GdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3dNodePrime != 0))
|
||||
here->MOS3GdpPtr = here->MOS3GdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3gNode != 0) && (here->MOS3sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS3GspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3GspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3gNode != 0) && (here-> MOS3sNodePrime != 0))
|
||||
here->MOS3GspPtr = here->MOS3GspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3sNode != 0) && (here->MOS3sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS3SspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3SspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3sNode != 0) && (here-> MOS3sNodePrime != 0))
|
||||
here->MOS3SspPtr = here->MOS3SspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3bNode != 0) && (here->MOS3dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS3BdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3BdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3dNodePrime != 0))
|
||||
here->MOS3BdpPtr = here->MOS3BdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3bNode != 0) && (here->MOS3sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS3BspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3BspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3sNodePrime != 0))
|
||||
here->MOS3BspPtr = here->MOS3BspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3dNodePrime != 0) && (here->MOS3sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS3DPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3DPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3sNodePrime != 0))
|
||||
here->MOS3DPspPtr = here->MOS3DPspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3dNodePrime != 0) && (here->MOS3dNode != 0))
|
||||
{
|
||||
while (here->MOS3DPdPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3DPdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3dNode != 0))
|
||||
here->MOS3DPdPtr = here->MOS3DPdStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3bNode != 0) && (here->MOS3gNode != 0))
|
||||
{
|
||||
while (here->MOS3BgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3BgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3bNode != 0) && (here-> MOS3gNode != 0))
|
||||
here->MOS3BgPtr = here->MOS3BgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3dNodePrime != 0) && (here->MOS3gNode != 0))
|
||||
{
|
||||
while (here->MOS3DPgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3DPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3gNode != 0))
|
||||
here->MOS3DPgPtr = here->MOS3DPgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3sNodePrime != 0) && (here->MOS3gNode != 0))
|
||||
{
|
||||
while (here->MOS3SPgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3SPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3gNode != 0))
|
||||
here->MOS3SPgPtr = here->MOS3SPgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3sNodePrime != 0) && (here->MOS3sNode != 0))
|
||||
{
|
||||
while (here->MOS3SPsPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3SPsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3sNode != 0))
|
||||
here->MOS3SPsPtr = here->MOS3SPsStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3dNodePrime != 0) && (here->MOS3bNode != 0))
|
||||
{
|
||||
while (here->MOS3DPbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3DPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3dNodePrime != 0) && (here-> MOS3bNode != 0))
|
||||
here->MOS3DPbPtr = here->MOS3DPbStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3sNodePrime != 0) && (here->MOS3bNode != 0))
|
||||
{
|
||||
while (here->MOS3SPbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3SPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3bNode != 0))
|
||||
here->MOS3SPbPtr = here->MOS3SPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> MOS3sNodePrime != 0) && (here-> MOS3dNodePrime != 0))
|
||||
here->MOS3SPdpPtr = here->MOS3SPdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS3sNodePrime != 0) && (here->MOS3dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS3SPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS3SPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -266,6 +266,31 @@ typedef struct sMOS3instance {
|
|||
double **MOS3nVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *MOS3DdStructPtr ;
|
||||
BindElement *MOS3GgStructPtr ;
|
||||
BindElement *MOS3SsStructPtr ;
|
||||
BindElement *MOS3BbStructPtr ;
|
||||
BindElement *MOS3DPdpStructPtr ;
|
||||
BindElement *MOS3SPspStructPtr ;
|
||||
BindElement *MOS3DdpStructPtr ;
|
||||
BindElement *MOS3GbStructPtr ;
|
||||
BindElement *MOS3GdpStructPtr ;
|
||||
BindElement *MOS3GspStructPtr ;
|
||||
BindElement *MOS3SspStructPtr ;
|
||||
BindElement *MOS3BdpStructPtr ;
|
||||
BindElement *MOS3BspStructPtr ;
|
||||
BindElement *MOS3DPspStructPtr ;
|
||||
BindElement *MOS3DPdStructPtr ;
|
||||
BindElement *MOS3BgStructPtr ;
|
||||
BindElement *MOS3DPgStructPtr ;
|
||||
BindElement *MOS3SPgStructPtr ;
|
||||
BindElement *MOS3SPsStructPtr ;
|
||||
BindElement *MOS3DPbStructPtr ;
|
||||
BindElement *MOS3SPbStructPtr ;
|
||||
BindElement *MOS3SPdpStructPtr ;
|
||||
#endif
|
||||
|
||||
} MOS3instance ;
|
||||
|
||||
#define MOS3vbd MOS3states+ 0
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**********
|
||||
Author: 2012 Francesco Lannutti
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
|
|
@ -7,304 +7,303 @@ Author: 2012 Francesco Lannutti
|
|||
#include "mos9defs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static
|
||||
int
|
||||
MOS9bindCSC(GENmodel *inModel, CKTcircuit *ckt)
|
||||
BindCompare (const void *a, const void *b)
|
||||
{
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
int i ;
|
||||
BindElement *A, *B ;
|
||||
A = (BindElement *)a ;
|
||||
B = (BindElement *)b ;
|
||||
|
||||
/* loop through all the mos9 models */
|
||||
for( ; model != NULL; model = model->MOS9nextModel ) {
|
||||
MOS9instance *here;
|
||||
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS9instances; here != NULL ;
|
||||
here = here->MOS9nextInstance) {
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNode != 0) && (here-> MOS9dNode != 0)) {
|
||||
while (here->MOS9DdPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9DdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9gNode != 0)) {
|
||||
while (here->MOS9GgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9GgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNode != 0) && (here-> MOS9sNode != 0)) {
|
||||
while (here->MOS9SsPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9SsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9bNode != 0)) {
|
||||
while (here->MOS9BbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9BbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9dNodePrime != 0)) {
|
||||
while (here->MOS9DPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9DPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9sNodePrime != 0)) {
|
||||
while (here->MOS9SPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9SPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNode != 0) && (here-> MOS9dNodePrime != 0)) {
|
||||
while (here->MOS9DdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9DdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9bNode != 0)) {
|
||||
while (here->MOS9GbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9GbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9dNodePrime != 0)) {
|
||||
while (here->MOS9GdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9GdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9sNodePrime != 0)) {
|
||||
while (here->MOS9GspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9GspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNode != 0) && (here-> MOS9sNodePrime != 0)) {
|
||||
while (here->MOS9SspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9SspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9dNodePrime != 0)) {
|
||||
while (here->MOS9BdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9BdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9sNodePrime != 0)) {
|
||||
while (here->MOS9BspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9BspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9sNodePrime != 0)) {
|
||||
while (here->MOS9DPspPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9DPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9dNode != 0)) {
|
||||
while (here->MOS9DPdPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9DPdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9gNode != 0)) {
|
||||
while (here->MOS9BgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9BgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9gNode != 0)) {
|
||||
while (here->MOS9DPgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9DPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9gNode != 0)) {
|
||||
while (here->MOS9SPgPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9SPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9sNode != 0)) {
|
||||
while (here->MOS9SPsPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9SPsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9bNode != 0)) {
|
||||
while (here->MOS9DPbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9DPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9bNode != 0)) {
|
||||
while (here->MOS9SPbPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9SPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9dNodePrime != 0)) {
|
||||
while (here->MOS9SPdpPtr != ckt->CKTmatrix->CKTbind_Sparse [i]) i ++ ;
|
||||
here->MOS9SPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return(OK);
|
||||
return ((int)(A->Sparse - B->Sparse)) ;
|
||||
}
|
||||
|
||||
int
|
||||
MOS9bindCSCComplex(GENmodel *inModel, CKTcircuit *ckt)
|
||||
MOS9bindCSC (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
int i ;
|
||||
MOS9model *model = (MOS9model *)inModel ;
|
||||
MOS9instance *here ;
|
||||
double *i ;
|
||||
BindElement *matched, *BindStruct ;
|
||||
size_t nz ;
|
||||
|
||||
/* loop through all the mos9 models */
|
||||
for( ; model != NULL; model = model->MOS9nextModel ) {
|
||||
MOS9instance *here;
|
||||
BindStruct = ckt->CKTmatrix->CKTbindStruct ;
|
||||
nz = (size_t)ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
/* loop through all the MOS9 models */
|
||||
for ( ; model != NULL ; model = model->MOS9nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS9instances; here != NULL ;
|
||||
here = here->MOS9nextInstance) {
|
||||
for (here = model->MOS9instances ; here != NULL ; here = here->MOS9nextInstance)
|
||||
{
|
||||
if ((here-> MOS9dNode != 0) && (here-> MOS9dNode != 0))
|
||||
{
|
||||
i = here->MOS9DdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9DdStructPtr = matched ;
|
||||
here->MOS9DdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNode != 0) && (here-> MOS9dNode != 0)) {
|
||||
while (here->MOS9DdPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9DdPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9gNode != 0))
|
||||
{
|
||||
i = here->MOS9GgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9GgStructPtr = matched ;
|
||||
here->MOS9GgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9gNode != 0)) {
|
||||
while (here->MOS9GgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9GgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9sNode != 0) && (here-> MOS9sNode != 0))
|
||||
{
|
||||
i = here->MOS9SsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9SsStructPtr = matched ;
|
||||
here->MOS9SsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNode != 0) && (here-> MOS9sNode != 0)) {
|
||||
while (here->MOS9SsPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9SsPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9bNode != 0))
|
||||
{
|
||||
i = here->MOS9BbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9BbStructPtr = matched ;
|
||||
here->MOS9BbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9bNode != 0)) {
|
||||
while (here->MOS9BbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9BbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS9DPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9DPdpStructPtr = matched ;
|
||||
here->MOS9DPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9dNodePrime != 0)) {
|
||||
while (here->MOS9DPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9DPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS9SPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9SPspStructPtr = matched ;
|
||||
here->MOS9SPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9sNodePrime != 0)) {
|
||||
while (here->MOS9SPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9SPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9dNode != 0) && (here-> MOS9dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS9DdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9DdpStructPtr = matched ;
|
||||
here->MOS9DdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNode != 0) && (here-> MOS9dNodePrime != 0)) {
|
||||
while (here->MOS9DdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9DdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9bNode != 0))
|
||||
{
|
||||
i = here->MOS9GbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9GbStructPtr = matched ;
|
||||
here->MOS9GbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9bNode != 0)) {
|
||||
while (here->MOS9GbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9GbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS9GdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9GdpStructPtr = matched ;
|
||||
here->MOS9GdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9dNodePrime != 0)) {
|
||||
while (here->MOS9GdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9GdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS9GspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9GspStructPtr = matched ;
|
||||
here->MOS9GspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9sNodePrime != 0)) {
|
||||
while (here->MOS9GspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9GspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9sNode != 0) && (here-> MOS9sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS9SspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9SspStructPtr = matched ;
|
||||
here->MOS9SspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNode != 0) && (here-> MOS9sNodePrime != 0)) {
|
||||
while (here->MOS9SspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9SspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS9BdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9BdpStructPtr = matched ;
|
||||
here->MOS9BdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9dNodePrime != 0)) {
|
||||
while (here->MOS9BdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9BdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS9BspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9BspStructPtr = matched ;
|
||||
here->MOS9BspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9sNodePrime != 0)) {
|
||||
while (here->MOS9BspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9BspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9sNodePrime != 0))
|
||||
{
|
||||
i = here->MOS9DPspPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9DPspStructPtr = matched ;
|
||||
here->MOS9DPspPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9sNodePrime != 0)) {
|
||||
while (here->MOS9DPspPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9DPspPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9dNode != 0))
|
||||
{
|
||||
i = here->MOS9DPdPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9DPdStructPtr = matched ;
|
||||
here->MOS9DPdPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9dNode != 0)) {
|
||||
while (here->MOS9DPdPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9DPdPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9gNode != 0))
|
||||
{
|
||||
i = here->MOS9BgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9BgStructPtr = matched ;
|
||||
here->MOS9BgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9gNode != 0)) {
|
||||
while (here->MOS9BgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9BgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9gNode != 0))
|
||||
{
|
||||
i = here->MOS9DPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9DPgStructPtr = matched ;
|
||||
here->MOS9DPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9gNode != 0)) {
|
||||
while (here->MOS9DPgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9DPgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9gNode != 0))
|
||||
{
|
||||
i = here->MOS9SPgPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9SPgStructPtr = matched ;
|
||||
here->MOS9SPgPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9gNode != 0)) {
|
||||
while (here->MOS9SPgPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9SPgPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9sNode != 0))
|
||||
{
|
||||
i = here->MOS9SPsPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9SPsStructPtr = matched ;
|
||||
here->MOS9SPsPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9sNode != 0)) {
|
||||
while (here->MOS9SPsPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9SPsPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9bNode != 0))
|
||||
{
|
||||
i = here->MOS9DPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9DPbStructPtr = matched ;
|
||||
here->MOS9DPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9bNode != 0)) {
|
||||
while (here->MOS9DPbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9DPbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9bNode != 0))
|
||||
{
|
||||
i = here->MOS9SPbPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9SPbStructPtr = matched ;
|
||||
here->MOS9SPbPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9bNode != 0)) {
|
||||
while (here->MOS9SPbPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9SPbPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9dNodePrime != 0))
|
||||
{
|
||||
i = here->MOS9SPdpPtr ;
|
||||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ;
|
||||
here->MOS9SPdpStructPtr = matched ;
|
||||
here->MOS9SPdpPtr = matched->CSC ;
|
||||
}
|
||||
|
||||
i = 0 ;
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9dNodePrime != 0)) {
|
||||
while (here->MOS9SPdpPtr != ckt->CKTmatrix->CKTbind_CSC [i]) i ++ ;
|
||||
here->MOS9SPdpPtr = ckt->CKTmatrix->CKTbind_CSC_Complex [i] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return(OK);
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
MOS9bindCSCComplex (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS9model *model = (MOS9model *)inModel ;
|
||||
MOS9instance *here ;
|
||||
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the MOS9 models */
|
||||
for ( ; model != NULL ; model = model->MOS9nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS9instances ; here != NULL ; here = here->MOS9nextInstance)
|
||||
{
|
||||
if ((here-> MOS9dNode != 0) && (here-> MOS9dNode != 0))
|
||||
here->MOS9DdPtr = here->MOS9DdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9gNode != 0))
|
||||
here->MOS9GgPtr = here->MOS9GgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9sNode != 0) && (here-> MOS9sNode != 0))
|
||||
here->MOS9SsPtr = here->MOS9SsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9bNode != 0))
|
||||
here->MOS9BbPtr = here->MOS9BbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9dNodePrime != 0))
|
||||
here->MOS9DPdpPtr = here->MOS9DPdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9sNodePrime != 0))
|
||||
here->MOS9SPspPtr = here->MOS9SPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9dNode != 0) && (here-> MOS9dNodePrime != 0))
|
||||
here->MOS9DdpPtr = here->MOS9DdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9bNode != 0))
|
||||
here->MOS9GbPtr = here->MOS9GbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9dNodePrime != 0))
|
||||
here->MOS9GdpPtr = here->MOS9GdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9sNodePrime != 0))
|
||||
here->MOS9GspPtr = here->MOS9GspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9sNode != 0) && (here-> MOS9sNodePrime != 0))
|
||||
here->MOS9SspPtr = here->MOS9SspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9dNodePrime != 0))
|
||||
here->MOS9BdpPtr = here->MOS9BdpStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9sNodePrime != 0))
|
||||
here->MOS9BspPtr = here->MOS9BspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9sNodePrime != 0))
|
||||
here->MOS9DPspPtr = here->MOS9DPspStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9dNode != 0))
|
||||
here->MOS9DPdPtr = here->MOS9DPdStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9gNode != 0))
|
||||
here->MOS9BgPtr = here->MOS9BgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9gNode != 0))
|
||||
here->MOS9DPgPtr = here->MOS9DPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9gNode != 0))
|
||||
here->MOS9SPgPtr = here->MOS9SPgStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9sNode != 0))
|
||||
here->MOS9SPsPtr = here->MOS9SPsStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9bNode != 0))
|
||||
here->MOS9DPbPtr = here->MOS9DPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9bNode != 0))
|
||||
here->MOS9SPbPtr = here->MOS9SPbStructPtr->CSC_Complex ;
|
||||
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9dNodePrime != 0))
|
||||
here->MOS9SPdpPtr = here->MOS9SPdpStructPtr->CSC_Complex ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -312,169 +311,83 @@ MOS9bindCSCComplexToReal (GENmodel *inModel, CKTcircuit *ckt)
|
|||
{
|
||||
MOS9model *model = (MOS9model *)inModel ;
|
||||
MOS9instance *here ;
|
||||
int i ;
|
||||
|
||||
/* loop through all the mos9 models */
|
||||
NG_IGNORE (ckt) ;
|
||||
|
||||
/* loop through all the MOS9 models */
|
||||
for ( ; model != NULL ; model = model->MOS9nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS9instances ; here != NULL ; here = here->MOS9nextInstance)
|
||||
{
|
||||
i = 0 ;
|
||||
if ((here->MOS9dNode != 0) && (here->MOS9dNode != 0))
|
||||
{
|
||||
while (here->MOS9DdPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9DdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9dNode != 0) && (here-> MOS9dNode != 0))
|
||||
here->MOS9DdPtr = here->MOS9DdStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9gNode != 0) && (here->MOS9gNode != 0))
|
||||
{
|
||||
while (here->MOS9GgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9GgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9gNode != 0))
|
||||
here->MOS9GgPtr = here->MOS9GgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9sNode != 0) && (here->MOS9sNode != 0))
|
||||
{
|
||||
while (here->MOS9SsPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9SsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9sNode != 0) && (here-> MOS9sNode != 0))
|
||||
here->MOS9SsPtr = here->MOS9SsStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9bNode != 0) && (here->MOS9bNode != 0))
|
||||
{
|
||||
while (here->MOS9BbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9BbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9bNode != 0))
|
||||
here->MOS9BbPtr = here->MOS9BbStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9dNodePrime != 0) && (here->MOS9dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS9DPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9DPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9dNodePrime != 0))
|
||||
here->MOS9DPdpPtr = here->MOS9DPdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9sNodePrime != 0) && (here->MOS9sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS9SPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9SPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9sNodePrime != 0))
|
||||
here->MOS9SPspPtr = here->MOS9SPspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9dNode != 0) && (here->MOS9dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS9DdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9DdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9dNode != 0) && (here-> MOS9dNodePrime != 0))
|
||||
here->MOS9DdpPtr = here->MOS9DdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9gNode != 0) && (here->MOS9bNode != 0))
|
||||
{
|
||||
while (here->MOS9GbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9GbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9bNode != 0))
|
||||
here->MOS9GbPtr = here->MOS9GbStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9gNode != 0) && (here->MOS9dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS9GdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9GdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9dNodePrime != 0))
|
||||
here->MOS9GdpPtr = here->MOS9GdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9gNode != 0) && (here->MOS9sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS9GspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9GspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9gNode != 0) && (here-> MOS9sNodePrime != 0))
|
||||
here->MOS9GspPtr = here->MOS9GspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9sNode != 0) && (here->MOS9sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS9SspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9SspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9sNode != 0) && (here-> MOS9sNodePrime != 0))
|
||||
here->MOS9SspPtr = here->MOS9SspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9bNode != 0) && (here->MOS9dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS9BdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9BdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9dNodePrime != 0))
|
||||
here->MOS9BdpPtr = here->MOS9BdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9bNode != 0) && (here->MOS9sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS9BspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9BspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9sNodePrime != 0))
|
||||
here->MOS9BspPtr = here->MOS9BspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9dNodePrime != 0) && (here->MOS9sNodePrime != 0))
|
||||
{
|
||||
while (here->MOS9DPspPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9DPspPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9sNodePrime != 0))
|
||||
here->MOS9DPspPtr = here->MOS9DPspStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9dNodePrime != 0) && (here->MOS9dNode != 0))
|
||||
{
|
||||
while (here->MOS9DPdPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9DPdPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9dNode != 0))
|
||||
here->MOS9DPdPtr = here->MOS9DPdStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9bNode != 0) && (here->MOS9gNode != 0))
|
||||
{
|
||||
while (here->MOS9BgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9BgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9bNode != 0) && (here-> MOS9gNode != 0))
|
||||
here->MOS9BgPtr = here->MOS9BgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9dNodePrime != 0) && (here->MOS9gNode != 0))
|
||||
{
|
||||
while (here->MOS9DPgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9DPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9gNode != 0))
|
||||
here->MOS9DPgPtr = here->MOS9DPgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9sNodePrime != 0) && (here->MOS9gNode != 0))
|
||||
{
|
||||
while (here->MOS9SPgPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9SPgPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9gNode != 0))
|
||||
here->MOS9SPgPtr = here->MOS9SPgStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9sNodePrime != 0) && (here->MOS9sNode != 0))
|
||||
{
|
||||
while (here->MOS9SPsPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9SPsPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9sNode != 0))
|
||||
here->MOS9SPsPtr = here->MOS9SPsStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9dNodePrime != 0) && (here->MOS9bNode != 0))
|
||||
{
|
||||
while (here->MOS9DPbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9DPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9dNodePrime != 0) && (here-> MOS9bNode != 0))
|
||||
here->MOS9DPbPtr = here->MOS9DPbStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9sNodePrime != 0) && (here->MOS9bNode != 0))
|
||||
{
|
||||
while (here->MOS9SPbPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9SPbPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9bNode != 0))
|
||||
here->MOS9SPbPtr = here->MOS9SPbStructPtr->CSC ;
|
||||
|
||||
if ((here-> MOS9sNodePrime != 0) && (here-> MOS9dNodePrime != 0))
|
||||
here->MOS9SPdpPtr = here->MOS9SPdpStructPtr->CSC ;
|
||||
|
||||
i = 0 ;
|
||||
if ((here->MOS9sNodePrime != 0) && (here->MOS9dNodePrime != 0))
|
||||
{
|
||||
while (here->MOS9SPdpPtr != ckt->CKTmatrix->CKTbind_CSC_Complex [i]) i ++ ;
|
||||
here->MOS9SPdpPtr = ckt->CKTmatrix->CKTbind_CSC [i] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -268,6 +268,31 @@ typedef struct sMOS9instance {
|
|||
double **MOS9nVar;
|
||||
#endif /* NONOISE */
|
||||
|
||||
#ifdef KLU
|
||||
BindElement *MOS9DdStructPtr ;
|
||||
BindElement *MOS9GgStructPtr ;
|
||||
BindElement *MOS9SsStructPtr ;
|
||||
BindElement *MOS9BbStructPtr ;
|
||||
BindElement *MOS9DPdpStructPtr ;
|
||||
BindElement *MOS9SPspStructPtr ;
|
||||
BindElement *MOS9DdpStructPtr ;
|
||||
BindElement *MOS9GbStructPtr ;
|
||||
BindElement *MOS9GdpStructPtr ;
|
||||
BindElement *MOS9GspStructPtr ;
|
||||
BindElement *MOS9SspStructPtr ;
|
||||
BindElement *MOS9BdpStructPtr ;
|
||||
BindElement *MOS9BspStructPtr ;
|
||||
BindElement *MOS9DPspStructPtr ;
|
||||
BindElement *MOS9DPdStructPtr ;
|
||||
BindElement *MOS9BgStructPtr ;
|
||||
BindElement *MOS9DPgStructPtr ;
|
||||
BindElement *MOS9SPgStructPtr ;
|
||||
BindElement *MOS9SPsStructPtr ;
|
||||
BindElement *MOS9DPbStructPtr ;
|
||||
BindElement *MOS9SPbStructPtr ;
|
||||
BindElement *MOS9SPdpStructPtr ;
|
||||
#endif
|
||||
|
||||
} MOS9instance ;
|
||||
|
||||
#define MOS9vbd MOS9states+ 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue