devices/**/*defs*.h, use a struct GENmodule slot
This commit is contained in:
parent
8c4ae60189
commit
9b45dbbbba
|
|
@ -44,6 +44,7 @@ NON-STANDARD FEATURES
|
||||||
|
|
||||||
|
|
||||||
#include "ngspice/mifcmdat.h"
|
#include "ngspice/mifcmdat.h"
|
||||||
|
#include "ngspice/gendefs.h"
|
||||||
#include "ngspice/ifsim.h"
|
#include "ngspice/ifsim.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -89,12 +90,12 @@ struct MIFinstance {
|
||||||
|
|
||||||
struct MIFmodel {
|
struct MIFmodel {
|
||||||
|
|
||||||
int MIFmodType; /* type index of this device type */
|
struct GENmodel gen;
|
||||||
struct MIFmodel *MIFnextModel; /* pointer to next possible model in linked list */
|
|
||||||
struct MIFinstance *MIFinstances; /* pointer to list of instances that have this model */
|
|
||||||
IFuid MIFmodName; /* pointer to character string naming this model */
|
|
||||||
|
|
||||||
/* --- end of generic struct GENmodel --- */
|
#define MIFmodType gen.GENmodType
|
||||||
|
#define MIFnextModel(inst) ((struct MIFmodel*)((inst)->gen.GENnextModel))
|
||||||
|
#define MIFinstances(inst) ((struct MIFinstance*)((inst)->gen.GENinstances))
|
||||||
|
#define MIFmodName gen.GENmodName
|
||||||
|
|
||||||
int num_param; /* number of parameters on the code model */
|
int num_param; /* number of parameters on the code model */
|
||||||
Mif_Param_Data_t **param; /* array of structs for each parameter */
|
Mif_Param_Data_t **param; /* array of structs for each parameter */
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,7 @@ Authors: 1991 David Gates
|
||||||
#include "ngspice/carddefs.h"
|
#include "ngspice/carddefs.h"
|
||||||
|
|
||||||
typedef struct sGENnumModel { /* model structure for a numerical device */
|
typedef struct sGENnumModel { /* model structure for a numerical device */
|
||||||
int GENmodType; /* type index of this device type */
|
struct GENmodel gen;
|
||||||
struct sGENnumModel *GENnextModel; /* pointer to next model in list */
|
|
||||||
GENinstance *GENinstances; /* pointer to list of instances */
|
|
||||||
IFuid GENmodName; /* pointer to string naming this model */
|
|
||||||
|
|
||||||
/* --- end of generic struct GENmodel --- */
|
|
||||||
|
|
||||||
/* Everything below here is numerical-device-specific */
|
/* Everything below here is numerical-device-specific */
|
||||||
MESHcard *GENxMeshes; /* list of xmesh cards */
|
MESHcard *GENxMeshes; /* list of xmesh cards */
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,8 @@ CKTdisto (CKTcircuit *ckt, int mode)
|
||||||
VSRCinstance *here;
|
VSRCinstance *here;
|
||||||
VSRCmodel *model;
|
VSRCmodel *model;
|
||||||
for(model = (VSRCmodel *)ckt->CKThead[vcode];model != NULL;
|
for(model = (VSRCmodel *)ckt->CKThead[vcode];model != NULL;
|
||||||
model=model->VSRCnextModel){
|
model=VSRCnextModel(model)){
|
||||||
for(here=model->VSRCinstances;here!=NULL;
|
for(here=VSRCinstances(model);here!=NULL;
|
||||||
here=here->VSRCnextInstance) {
|
here=here->VSRCnextInstance) {
|
||||||
|
|
||||||
/* check if the source has a distortion input*/
|
/* check if the source has a distortion input*/
|
||||||
|
|
@ -125,8 +125,8 @@ if (((here->VSRCdF1given) && (mode == D_RHSF1)) ||
|
||||||
ISRCmodel *model;
|
ISRCmodel *model;
|
||||||
|
|
||||||
for(model= (ISRCmodel *)ckt->CKThead[icode];model != NULL;
|
for(model= (ISRCmodel *)ckt->CKThead[icode];model != NULL;
|
||||||
model=model->ISRCnextModel){
|
model=ISRCnextModel(model)){
|
||||||
for(here=model->ISRCinstances;here!=NULL;
|
for(here=ISRCinstances(model);here!=NULL;
|
||||||
here=here->ISRCnextInstance) {
|
here=here->ISRCnextInstance) {
|
||||||
|
|
||||||
/* check if the source has a distortion input*/
|
/* check if the source has a distortion input*/
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,8 @@ DCtrCurv(CKTcircuit *ckt, int restart)
|
||||||
RESinstance *here;
|
RESinstance *here;
|
||||||
RESmodel *model;
|
RESmodel *model;
|
||||||
|
|
||||||
for (model = (RESmodel *)ckt->CKThead[rcode]; model; model = model->RESnextModel)
|
for (model = (RESmodel *)ckt->CKThead[rcode]; model; model = RESnextModel(model))
|
||||||
for (here = model->RESinstances; here; here = here->RESnextInstance)
|
for (here = RESinstances(model); here; here = here->RESnextInstance)
|
||||||
if (here->RESname == job->TRCVvName[i]) {
|
if (here->RESname == job->TRCVvName[i]) {
|
||||||
job->TRCVvElt[i] = (GENinstance *)here;
|
job->TRCVvElt[i] = (GENinstance *)here;
|
||||||
job->TRCVvSave[i] = here->RESresist;
|
job->TRCVvSave[i] = here->RESresist;
|
||||||
|
|
@ -109,8 +109,8 @@ DCtrCurv(CKTcircuit *ckt, int restart)
|
||||||
VSRCinstance *here;
|
VSRCinstance *here;
|
||||||
VSRCmodel *model;
|
VSRCmodel *model;
|
||||||
|
|
||||||
for (model = (VSRCmodel *)ckt->CKThead[vcode]; model; model = model->VSRCnextModel)
|
for (model = (VSRCmodel *)ckt->CKThead[vcode]; model; model = VSRCnextModel(model))
|
||||||
for (here = model->VSRCinstances; here; here = here->VSRCnextInstance)
|
for (here = VSRCinstances(model); here; here = here->VSRCnextInstance)
|
||||||
if (here->VSRCname == job->TRCVvName[i]) {
|
if (here->VSRCname == job->TRCVvName[i]) {
|
||||||
job->TRCVvElt[i] = (GENinstance *)here;
|
job->TRCVvElt[i] = (GENinstance *)here;
|
||||||
job->TRCVvSave[i] = here->VSRCdcValue;
|
job->TRCVvSave[i] = here->VSRCdcValue;
|
||||||
|
|
@ -127,8 +127,8 @@ DCtrCurv(CKTcircuit *ckt, int restart)
|
||||||
ISRCinstance *here;
|
ISRCinstance *here;
|
||||||
ISRCmodel *model;
|
ISRCmodel *model;
|
||||||
|
|
||||||
for (model = (ISRCmodel *)ckt->CKThead[icode]; model; model = model->ISRCnextModel)
|
for (model = (ISRCmodel *)ckt->CKThead[icode]; model; model = ISRCnextModel(model))
|
||||||
for (here = model->ISRCinstances; here; here = here->ISRCnextInstance)
|
for (here = ISRCinstances(model); here; here = here->ISRCnextInstance)
|
||||||
if (here->ISRCname == job->TRCVvName[i]) {
|
if (here->ISRCname == job->TRCVvName[i]) {
|
||||||
job->TRCVvElt[i] = (GENinstance *)here;
|
job->TRCVvElt[i] = (GENinstance *)here;
|
||||||
job->TRCVvSave[i] = here->ISRCdcValue;
|
job->TRCVvSave[i] = here->ISRCdcValue;
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@ ASRCacLoad(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
||||||
NG_IGNORE(ckt);
|
NG_IGNORE(ckt);
|
||||||
|
|
||||||
for (; model; model = model->ASRCnextModel) {
|
for (; model; model = ASRCnextModel(model)) {
|
||||||
for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) {
|
for (here = ASRCinstances(model); here; here = here->ASRCnextInstance) {
|
||||||
|
|
||||||
difference = (here->ASRCtemp + here->ASRCdtemp) - 300.15;
|
difference = (here->ASRCtemp + here->ASRCdtemp) - 300.15;
|
||||||
factor = 1.0
|
factor = 1.0
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ ASRCconvTest(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
double tol;
|
double tol;
|
||||||
double rhs;
|
double rhs;
|
||||||
|
|
||||||
for (; model; model = model->ASRCnextModel) {
|
for (; model; model = ASRCnextModel(model)) {
|
||||||
for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) {
|
for (here = ASRCinstances(model); here; here = here->ASRCnextInstance) {
|
||||||
|
|
||||||
i = here->ASRCtree->numVars;
|
i = here->ASRCtree->numVars;
|
||||||
if (asrc_nvals < i) {
|
if (asrc_nvals < i) {
|
||||||
|
|
|
||||||
|
|
@ -56,14 +56,12 @@ typedef struct sASRCinstance {
|
||||||
/* per model data */
|
/* per model data */
|
||||||
|
|
||||||
typedef struct sASRCmodel { /* model structure for a source */
|
typedef struct sASRCmodel { /* model structure for a source */
|
||||||
int ASRCmodType; /* type index of this device */
|
struct GENmodel gen;
|
||||||
struct sASRCmodel *ASRCnextModel; /* pointer to next possible model
|
|
||||||
* in linked list */
|
|
||||||
ASRCinstance *ASRCinstances; /* pointer to list of instances
|
|
||||||
* that have this model */
|
|
||||||
IFuid ASRCmodName; /* pointer to character string naming this model */
|
|
||||||
|
|
||||||
/* --- end of generic struct GENmodel --- */
|
#define ASRCmodType gen.GENmodType
|
||||||
|
#define ASRCnextModel(inst) ((struct sASRCmodel*)((inst)->gen.GENnextModel))
|
||||||
|
#define ASRCinstances(inst) ((ASRCinstance*)((inst)->gen.GENinstances))
|
||||||
|
#define ASRCmodName gen.GENmodName
|
||||||
|
|
||||||
} ASRCmodel;
|
} ASRCmodel;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ ASRCdestroy(GENmodel **inModel)
|
||||||
ASRCmodel *mod = *(ASRCmodel**) inModel;
|
ASRCmodel *mod = *(ASRCmodel**) inModel;
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
ASRCmodel *next_mod = mod->ASRCnextModel;
|
ASRCmodel *next_mod = ASRCnextModel(mod);
|
||||||
ASRCinstance *inst = mod->ASRCinstances;
|
ASRCinstance *inst = ASRCinstances(mod);
|
||||||
while (inst) {
|
while (inst) {
|
||||||
ASRCinstance *next_inst = inst->ASRCnextInstance;
|
ASRCinstance *next_inst = inst->ASRCnextInstance;
|
||||||
INPfreeTree(inst->ASRCtree);
|
INPfreeTree(inst->ASRCtree);
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ ASRCfindBr(CKTcircuit *ckt, GENmodel *inputModel, IFuid name)
|
||||||
int error;
|
int error;
|
||||||
CKTnode *tmp;
|
CKTnode *tmp;
|
||||||
|
|
||||||
for (; model; model = model->ASRCnextModel)
|
for (; model; model = ASRCnextModel(model))
|
||||||
for (here = model->ASRCinstances; here; here = here->ASRCnextInstance)
|
for (here = ASRCinstances(model); here; here = here->ASRCnextInstance)
|
||||||
if (here->ASRCname == name) {
|
if (here->ASRCname == name) {
|
||||||
if (here->ASRCbranch == 0) {
|
if (here->ASRCbranch == 0) {
|
||||||
error = CKTmkCur(ckt, &tmp, here->ASRCname, "branch");
|
error = CKTmkCur(ckt, &tmp, here->ASRCname, "branch");
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ ASRCload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
double difference;
|
double difference;
|
||||||
double factor;
|
double factor;
|
||||||
|
|
||||||
for (; model; model = model->ASRCnextModel) {
|
for (; model; model = ASRCnextModel(model)) {
|
||||||
for (here = model->ASRCinstances; here; here=here->ASRCnextInstance) {
|
for (here = ASRCinstances(model); here; here=here->ASRCnextInstance) {
|
||||||
|
|
||||||
difference = (here->ASRCtemp + here->ASRCdtemp) - 300.15;
|
difference = (here->ASRCtemp + here->ASRCdtemp) - 300.15;
|
||||||
factor = 1.0
|
factor = 1.0
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ ASRCpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
|
||||||
|
|
||||||
NG_IGNORE(s);
|
NG_IGNORE(s);
|
||||||
|
|
||||||
for (; model; model = model->ASRCnextModel) {
|
for (; model; model = ASRCnextModel(model)) {
|
||||||
for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) {
|
for (here = ASRCinstances(model); here; here = here->ASRCnextInstance) {
|
||||||
|
|
||||||
difference = (here->ASRCtemp + here->ASRCdtemp) - 300.15;
|
difference = (here->ASRCtemp + here->ASRCdtemp) - 300.15;
|
||||||
factor = 1.0
|
factor = 1.0
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ ASRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
|
|
||||||
NG_IGNORE(states);
|
NG_IGNORE(states);
|
||||||
|
|
||||||
for (; model; model = model->ASRCnextModel) {
|
for (; model; model = ASRCnextModel(model)) {
|
||||||
for (here = model->ASRCinstances; here; here=here->ASRCnextInstance) {
|
for (here = ASRCinstances(model); here; here=here->ASRCnextInstance) {
|
||||||
|
|
||||||
if (!here->ASRCtree)
|
if (!here->ASRCtree)
|
||||||
return E_PARMVAL;
|
return E_PARMVAL;
|
||||||
|
|
@ -126,8 +126,8 @@ ASRCunsetup(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
ASRCmodel *model = (ASRCmodel *) inModel;
|
ASRCmodel *model = (ASRCmodel *) inModel;
|
||||||
ASRCinstance *here;
|
ASRCinstance *here;
|
||||||
|
|
||||||
for (; model; model = model->ASRCnextModel)
|
for (; model; model = ASRCnextModel(model))
|
||||||
for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) {
|
for (here = ASRCinstances(model); here; here = here->ASRCnextInstance) {
|
||||||
if (here->ASRCbranch > 0)
|
if (here->ASRCbranch > 0)
|
||||||
CKTdltNNum(ckt, here->ASRCbranch);
|
CKTdltNNum(ckt, here->ASRCbranch);
|
||||||
here->ASRCbranch = 0;
|
here->ASRCbranch = 0;
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ ASRCtemp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
ASRCmodel *model = (ASRCmodel *) inModel;
|
ASRCmodel *model = (ASRCmodel *) inModel;
|
||||||
ASRCinstance *here;
|
ASRCinstance *here;
|
||||||
|
|
||||||
for (; model; model = model->ASRCnextModel) {
|
for (; model; model = ASRCnextModel(model)) {
|
||||||
for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) {
|
for (here = ASRCinstances(model); here; here = here->ASRCnextInstance) {
|
||||||
|
|
||||||
/* Default Value Processing for Source Instance */
|
/* Default Value Processing for Source Instance */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ BJTacLoad(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
double xcmcb;
|
double xcmcb;
|
||||||
double m;
|
double m;
|
||||||
|
|
||||||
for( ; model != NULL; model = model->BJTnextModel) {
|
for( ; model != NULL; model = BJTnextModel(model)) {
|
||||||
for( here = model->BJTinstances; here!= NULL;
|
for( here = BJTinstances(model); here!= NULL;
|
||||||
here = here->BJTnextInstance) {
|
here = here->BJTnextInstance) {
|
||||||
|
|
||||||
m = here->BJTm;
|
m = here->BJTm;
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@ BJTconvTest(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for( ; model != NULL; model = model->BJTnextModel) {
|
for( ; model != NULL; model = BJTnextModel(model)) {
|
||||||
for(here=model->BJTinstances;here!=NULL;here = here->BJTnextInstance){
|
for(here=BJTinstances(model);here!=NULL;here = here->BJTnextInstance){
|
||||||
|
|
||||||
vbe=model->BJTtype*(
|
vbe=model->BJTtype*(
|
||||||
*(ckt->CKTrhsOld+here->BJTbasePrimeNode)-
|
*(ckt->CKTrhsOld+here->BJTbasePrimeNode)-
|
||||||
|
|
|
||||||
|
|
@ -323,14 +323,12 @@ typedef struct sBJTinstance {
|
||||||
|
|
||||||
/* per model data */
|
/* per model data */
|
||||||
typedef struct sBJTmodel { /* model structure for a bjt */
|
typedef struct sBJTmodel { /* model structure for a bjt */
|
||||||
int BJTmodType; /* type index of this device type */
|
struct GENmodel gen;
|
||||||
struct sBJTmodel *BJTnextModel; /* pointer to next possible model in
|
|
||||||
* linked list */
|
|
||||||
BJTinstance * BJTinstances; /* pointer to list of instances
|
|
||||||
* that have this model */
|
|
||||||
IFuid BJTmodName; /* pointer to character string naming this model */
|
|
||||||
|
|
||||||
/* --- end of generic struct GENmodel --- */
|
#define BJTmodType gen.GENmodType
|
||||||
|
#define BJTnextModel(inst) ((struct sBJTmodel*)((inst)->gen.GENnextModel))
|
||||||
|
#define BJTinstances(inst) ((BJTinstance*)((inst)->gen.GENinstances))
|
||||||
|
#define BJTmodName gen.GENmodName
|
||||||
|
|
||||||
int BJTtype;
|
int BJTtype;
|
||||||
int BJTsubs;
|
int BJTsubs;
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ BJTdestroy(GENmodel **inModel)
|
||||||
BJTmodel *mod = *(BJTmodel**) inModel;
|
BJTmodel *mod = *(BJTmodel**) inModel;
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
BJTmodel *next_mod = mod->BJTnextModel;
|
BJTmodel *next_mod = BJTnextModel(mod);
|
||||||
BJTinstance *inst = mod->BJTinstances;
|
BJTinstance *inst = BJTinstances(mod);
|
||||||
while (inst) {
|
while (inst) {
|
||||||
BJTinstance *next_inst = inst->BJTnextInstance;
|
BJTinstance *next_inst = inst->BJTnextInstance;
|
||||||
FREE(inst->BJTsens);
|
FREE(inst->BJTsens);
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,11 @@ BJTdisto(int mode, GENmodel *genmodel, CKTcircuit *ckt)
|
||||||
(mode == D_2F1MF2)) {
|
(mode == D_2F1MF2)) {
|
||||||
|
|
||||||
/* loop through all the BJT models */
|
/* loop through all the BJT models */
|
||||||
for( ; model != NULL; model = model->BJTnextModel ) {
|
for( ; model != NULL; model = BJTnextModel(model) ) {
|
||||||
td = model->BJTexcessPhaseFactor;
|
td = model->BJTexcessPhaseFactor;
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BJTinstances; here != NULL ;
|
for (here = BJTinstances(model); here != NULL ;
|
||||||
here=here->BJTnextInstance) {
|
here=here->BJTnextInstance) {
|
||||||
|
|
||||||
/* getting Volterra kernels */
|
/* getting Volterra kernels */
|
||||||
|
|
|
||||||
|
|
@ -141,10 +141,10 @@ int BJTdSetup(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
||||||
|
|
||||||
/* loop through all the models */
|
/* loop through all the models */
|
||||||
for( ; model != NULL; model = model->BJTnextModel ) {
|
for( ; model != NULL; model = BJTnextModel(model) ) {
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BJTinstances; here != NULL ;
|
for (here = BJTinstances(model); here != NULL ;
|
||||||
here=here->BJTnextInstance) {
|
here=here->BJTnextInstance) {
|
||||||
|
|
||||||
vt = here->BJTtemp * CONSTKoverQ;
|
vt = here->BJTtemp * CONSTKoverQ;
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ BJTgetic(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
* external nodes to get values
|
* external nodes to get values
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for( ; model ; model = model->BJTnextModel) {
|
for( ; model ; model = BJTnextModel(model)) {
|
||||||
for(here = model->BJTinstances; here ; here = here->BJTnextInstance) {
|
for(here = BJTinstances(model); here ; here = here->BJTnextInstance) {
|
||||||
|
|
||||||
if(!here->BJTicVBEGiven) {
|
if(!here->BJTicVBEGiven) {
|
||||||
here->BJTicVBE =
|
here->BJTicVBE =
|
||||||
|
|
|
||||||
|
|
@ -139,10 +139,10 @@ BJTload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
double m;
|
double m;
|
||||||
|
|
||||||
/* loop through all the models */
|
/* loop through all the models */
|
||||||
for( ; model != NULL; model = model->BJTnextModel ) {
|
for( ; model != NULL; model = BJTnextModel(model) ) {
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BJTinstances; here != NULL ;
|
for (here = BJTinstances(model); here != NULL ;
|
||||||
here=here->BJTnextInstance) {
|
here=here->BJTnextInstance) {
|
||||||
|
|
||||||
vt = here->BJTtemp * CONSTKoverQ;
|
vt = here->BJTtemp * CONSTKoverQ;
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,8 @@ BJTnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt,
|
||||||
"" /* total transistor noise */
|
"" /* total transistor noise */
|
||||||
};
|
};
|
||||||
|
|
||||||
for (model=firstModel; model != NULL; model=model->BJTnextModel) {
|
for (model=firstModel; model != NULL; model=BJTnextModel(model)) {
|
||||||
for (inst=model->BJTinstances; inst != NULL;
|
for (inst=BJTinstances(model); inst != NULL;
|
||||||
inst=inst->BJTnextInstance) {
|
inst=inst->BJTnextInstance) {
|
||||||
|
|
||||||
switch (operation) {
|
switch (operation) {
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@ BJTpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
|
||||||
double xcmcb;
|
double xcmcb;
|
||||||
double m;
|
double m;
|
||||||
|
|
||||||
for( ; model != NULL; model = model->BJTnextModel) {
|
for( ; model != NULL; model = BJTnextModel(model)) {
|
||||||
for( here = model->BJTinstances; here!= NULL;
|
for( here = BJTinstances(model); here!= NULL;
|
||||||
here = here->BJTnextInstance) {
|
here = here->BJTnextInstance) {
|
||||||
|
|
||||||
m = here->BJTm;
|
m = here->BJTm;
|
||||||
|
|
|
||||||
|
|
@ -92,10 +92,10 @@ BJTsAcLoad(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
info->SENstatus = PERTURBATION;
|
info->SENstatus = PERTURBATION;
|
||||||
|
|
||||||
/* loop through all the models */
|
/* loop through all the models */
|
||||||
for( ; model != NULL; model = model->BJTnextModel ) {
|
for( ; model != NULL; model = BJTnextModel(model) ) {
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BJTinstances; here != NULL ;
|
for (here = BJTinstances(model); here != NULL ;
|
||||||
here=here->BJTnextInstance) {
|
here=here->BJTnextInstance) {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ BJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
CKTnode *tmp;
|
CKTnode *tmp;
|
||||||
|
|
||||||
/* loop through all the diode models */
|
/* loop through all the diode models */
|
||||||
for( ; model != NULL; model = model->BJTnextModel ) {
|
for( ; model != NULL; model = BJTnextModel(model) ) {
|
||||||
|
|
||||||
if(model->BJTtype != NPN && model->BJTtype != PNP) {
|
if(model->BJTtype != NPN && model->BJTtype != PNP) {
|
||||||
model->BJTtype = NPN;
|
model->BJTtype = NPN;
|
||||||
|
|
@ -345,7 +345,7 @@ BJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BJTinstances; here != NULL ;
|
for (here = BJTinstances(model); here != NULL ;
|
||||||
here=here->BJTnextInstance) {
|
here=here->BJTnextInstance) {
|
||||||
CKTnode *tmpNode;
|
CKTnode *tmpNode;
|
||||||
IFuid tmpName;
|
IFuid tmpName;
|
||||||
|
|
@ -476,9 +476,9 @@ BJTunsetup(
|
||||||
BJTinstance *here;
|
BJTinstance *here;
|
||||||
|
|
||||||
for (model = (BJTmodel *)inModel; model != NULL;
|
for (model = (BJTmodel *)inModel; model != NULL;
|
||||||
model = model->BJTnextModel)
|
model = BJTnextModel(model))
|
||||||
{
|
{
|
||||||
for (here = model->BJTinstances; here != NULL;
|
for (here = BJTinstances(model); here != NULL;
|
||||||
here=here->BJTnextInstance)
|
here=here->BJTnextInstance)
|
||||||
{
|
{
|
||||||
if (here->BJTemitPrimeNode > 0
|
if (here->BJTemitPrimeNode > 0
|
||||||
|
|
|
||||||
|
|
@ -86,10 +86,10 @@ BJTsLoad(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
info->SENstatus = PERTURBATION;
|
info->SENstatus = PERTURBATION;
|
||||||
|
|
||||||
/* loop through all the models */
|
/* loop through all the models */
|
||||||
for( ; model != NULL; model = model->BJTnextModel ) {
|
for( ; model != NULL; model = BJTnextModel(model) ) {
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BJTinstances; here != NULL ;
|
for (here = BJTinstances(model); here != NULL ;
|
||||||
here=here->BJTnextInstance) {
|
here=here->BJTnextInstance) {
|
||||||
|
|
||||||
#ifdef SENSDEBUG
|
#ifdef SENSDEBUG
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,9 @@ BJTsoaCheck(CKTcircuit *ckt, GENmodel *inModel)
|
||||||
|
|
||||||
maxwarns = ckt->CKTsoaMaxWarns;
|
maxwarns = ckt->CKTsoaMaxWarns;
|
||||||
|
|
||||||
for (; model; model = model->BJTnextModel) {
|
for (; model; model = BJTnextModel(model)) {
|
||||||
|
|
||||||
for (here = model->BJTinstances; here; here=here->BJTnextInstance) {
|
for (here = BJTinstances(model); here; here=here->BJTnextInstance) {
|
||||||
|
|
||||||
vbe = fabs(ckt->CKTrhsOld [here->BJTbasePrimeNode] -
|
vbe = fabs(ckt->CKTrhsOld [here->BJTbasePrimeNode] -
|
||||||
ckt->CKTrhsOld [here->BJTemitPrimeNode]);
|
ckt->CKTrhsOld [here->BJTemitPrimeNode]);
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,12 @@ BJTsPrint(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
||||||
printf("BJTS-----------------\n");
|
printf("BJTS-----------------\n");
|
||||||
/* loop through all the BJT models */
|
/* loop through all the BJT models */
|
||||||
for( ; model != NULL; model = model->BJTnextModel ) {
|
for( ; model != NULL; model = BJTnextModel(model) ) {
|
||||||
|
|
||||||
printf("Model name:%s\n",model->BJTmodName);
|
printf("Model name:%s\n",model->BJTmodName);
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BJTinstances; here != NULL ;
|
for (here = BJTinstances(model); here != NULL ;
|
||||||
here=here->BJTnextInstance) {
|
here=here->BJTnextInstance) {
|
||||||
|
|
||||||
ckt->CKTsenInfo->SEN_parmVal[here->BJTsenParmNo] = here->BJTarea;
|
ckt->CKTsenInfo->SEN_parmVal[here->BJTsenParmNo] = here->BJTarea;
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,11 @@ BJTsSetup(SENstruct *info, GENmodel *inModel)
|
||||||
#endif /* STEPDEBUG */
|
#endif /* STEPDEBUG */
|
||||||
|
|
||||||
/* loop through all the diode models */
|
/* loop through all the diode models */
|
||||||
for( ; model != NULL; model = model->BJTnextModel ) {
|
for( ; model != NULL; model = BJTnextModel(model) ) {
|
||||||
|
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BJTinstances; here != NULL ;
|
for (here = BJTinstances(model); here != NULL ;
|
||||||
here=here->BJTnextInstance) {
|
here=here->BJTnextInstance) {
|
||||||
|
|
||||||
if(here->BJTsenParmNo){
|
if(here->BJTsenParmNo){
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,10 @@ BJTsUpdate(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
printf("CKTtime = %.5e\n",ckt->CKTtime);
|
printf("CKTtime = %.5e\n",ckt->CKTtime);
|
||||||
#endif /* SENSDEBUG */
|
#endif /* SENSDEBUG */
|
||||||
/* loop through all the BJT models */
|
/* loop through all the BJT models */
|
||||||
for( ; model != NULL; model = model->BJTnextModel ) {
|
for( ; model != NULL; model = BJTnextModel(model) ) {
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BJTinstances; here != NULL ;
|
for (here = BJTinstances(model); here != NULL ;
|
||||||
here=here->BJTnextInstance) {
|
here=here->BJTnextInstance) {
|
||||||
|
|
||||||
sxpbe = 0;
|
sxpbe = 0;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ BJTtemp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
double dt;
|
double dt;
|
||||||
|
|
||||||
/* loop through all the bipolar models */
|
/* loop through all the bipolar models */
|
||||||
for( ; model != NULL; model = model->BJTnextModel ) {
|
for( ; model != NULL; model = BJTnextModel(model) ) {
|
||||||
|
|
||||||
if(!model->BJTtnomGiven) model->BJTtnom = ckt->CKTnomTemp;
|
if(!model->BJTtnomGiven) model->BJTtnom = ckt->CKTnomTemp;
|
||||||
vtnom = CONSTKoverQ * model->BJTtnom;
|
vtnom = CONSTKoverQ * model->BJTtnom;
|
||||||
|
|
@ -100,7 +100,7 @@ BJTtemp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
(1 + model->BJTjunctionExpBC);
|
(1 + model->BJTjunctionExpBC);
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BJTinstances; here != NULL ;
|
for (here = BJTinstances(model); here != NULL ;
|
||||||
here=here->BJTnextInstance) {
|
here=here->BJTnextInstance) {
|
||||||
|
|
||||||
double arg1, pbfact1, egfet1;
|
double arg1, pbfact1, egfet1;
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ BJTtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep)
|
||||||
BJTmodel *model = (BJTmodel*)inModel;
|
BJTmodel *model = (BJTmodel*)inModel;
|
||||||
BJTinstance *here;
|
BJTinstance *here;
|
||||||
|
|
||||||
for( ; model != NULL; model = model->BJTnextModel) {
|
for( ; model != NULL; model = BJTnextModel(model)) {
|
||||||
for(here=model->BJTinstances;here!=NULL;here = here->BJTnextInstance){
|
for(here=BJTinstances(model);here!=NULL;here = here->BJTnextInstance){
|
||||||
|
|
||||||
CKTterr(here->BJTqbe,ckt,timeStep);
|
CKTterr(here->BJTqbe,ckt,timeStep);
|
||||||
CKTterr(here->BJTqbc,ckt,timeStep);
|
CKTterr(here->BJTqbc,ckt,timeStep);
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,8 @@ B1acLoad(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
double m; /* parallel multiplier */
|
double m; /* parallel multiplier */
|
||||||
|
|
||||||
omega = ckt->CKTomega;
|
omega = ckt->CKTomega;
|
||||||
for( ; model != NULL; model = model->B1nextModel) {
|
for( ; model != NULL; model = B1nextModel(model)) {
|
||||||
for(here = model->B1instances; here!= NULL;
|
for(here = B1instances(model); here!= NULL;
|
||||||
here = here->B1nextInstance) {
|
here = here->B1nextInstance) {
|
||||||
|
|
||||||
if (here->B1mode >= 0) {
|
if (here->B1mode >= 0) {
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,10 @@ B1convTest(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
||||||
|
|
||||||
/* loop through all the B1 device models */
|
/* loop through all the B1 device models */
|
||||||
for( ; model != NULL; model = model->B1nextModel ) {
|
for( ; model != NULL; model = B1nextModel(model) ) {
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->B1instances; here != NULL ;
|
for (here = B1instances(model); here != NULL ;
|
||||||
here=here->B1nextInstance) {
|
here=here->B1nextInstance) {
|
||||||
|
|
||||||
vbs = model->B1type * (
|
vbs = model->B1type * (
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ B1destroy(GENmodel **inModel)
|
||||||
B1model *mod = *(B1model**) inModel;
|
B1model *mod = *(B1model**) inModel;
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
B1model *next_mod = mod->B1nextModel;
|
B1model *next_mod = B1nextModel(mod);
|
||||||
B1instance *inst = mod->B1instances;
|
B1instance *inst = B1instances(mod);
|
||||||
while (inst) {
|
while (inst) {
|
||||||
B1instance *next_inst = inst->B1nextInstance;
|
B1instance *next_inst = inst->B1nextInstance;
|
||||||
FREE(inst);
|
FREE(inst);
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,10 @@ if ((mode == D_TWOF1) || (mode == D_THRF1) ||
|
||||||
(mode == D_2F1MF2)) {
|
(mode == D_2F1MF2)) {
|
||||||
|
|
||||||
/* loop through all the B1 models */
|
/* loop through all the B1 models */
|
||||||
for( ; model != NULL; model = model->B1nextModel ) {
|
for( ; model != NULL; model = B1nextModel(model) ) {
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->B1instances; here != NULL ;
|
for (here = B1instances(model); here != NULL ;
|
||||||
here=here->B1nextInstance) {
|
here=here->B1nextInstance) {
|
||||||
|
|
||||||
/* loading starts here */
|
/* loading starts here */
|
||||||
|
|
|
||||||
|
|
@ -125,10 +125,10 @@ B1dSetup(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
||||||
|
|
||||||
/* loop through all the B1 device models */
|
/* loop through all the B1 device models */
|
||||||
for( ; model != NULL; model = model->B1nextModel ) {
|
for( ; model != NULL; model = B1nextModel(model) ) {
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->B1instances; here != NULL ;
|
for (here = B1instances(model); here != NULL ;
|
||||||
here=here->B1nextInstance) {
|
here=here->B1nextInstance) {
|
||||||
|
|
||||||
EffectiveLength=here->B1l - model->B1deltaL * 1.e-6;/* m */
|
EffectiveLength=here->B1l - model->B1deltaL * 1.e-6;/* m */
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ B1getic(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
* external nodes to get values
|
* external nodes to get values
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for( ; model ; model = model->B1nextModel) {
|
for( ; model ; model = B1nextModel(model)) {
|
||||||
for(here = model->B1instances; here ; here = here->B1nextInstance) {
|
for(here = B1instances(model); here ; here = here->B1nextInstance) {
|
||||||
|
|
||||||
if(!here->B1icVBSGiven) {
|
if(!here->B1icVBSGiven) {
|
||||||
here->B1icVBS =
|
here->B1icVBS =
|
||||||
|
|
|
||||||
|
|
@ -129,10 +129,10 @@ B1load(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
double m; /* parallel multiplier */
|
double m; /* parallel multiplier */
|
||||||
|
|
||||||
/* loop through all the B1 device models */
|
/* loop through all the B1 device models */
|
||||||
for( ; model != NULL; model = model->B1nextModel ) {
|
for( ; model != NULL; model = B1nextModel(model) ) {
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->B1instances; here != NULL ;
|
for (here = B1instances(model); here != NULL ;
|
||||||
here=here->B1nextInstance) {
|
here=here->B1nextInstance) {
|
||||||
|
|
||||||
EffectiveLength=here->B1l - model->B1deltaL * 1.e-6;/* m */
|
EffectiveLength=here->B1l - model->B1deltaL * 1.e-6;/* m */
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@ B1noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt,
|
||||||
"" /* total transistor noise */
|
"" /* total transistor noise */
|
||||||
};
|
};
|
||||||
|
|
||||||
for (model=firstModel; model != NULL; model=model->B1nextModel) {
|
for (model=firstModel; model != NULL; model=B1nextModel(model)) {
|
||||||
for (inst=model->B1instances; inst != NULL; inst=inst->B1nextInstance) {
|
for (inst=B1instances(model); inst != NULL; inst=inst->B1nextInstance) {
|
||||||
|
|
||||||
switch (operation) {
|
switch (operation) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,8 @@ B1pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
|
||||||
|
|
||||||
double m;
|
double m;
|
||||||
|
|
||||||
for( ; model != NULL; model = model->B1nextModel) {
|
for( ; model != NULL; model = B1nextModel(model)) {
|
||||||
for(here = model->B1instances; here!= NULL;
|
for(here = B1instances(model); here!= NULL;
|
||||||
here = here->B1nextInstance) {
|
here = here->B1nextInstance) {
|
||||||
|
|
||||||
if (here->B1mode >= 0) {
|
if (here->B1mode >= 0) {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ B1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt,
|
||||||
CKTnode *tmp;
|
CKTnode *tmp;
|
||||||
|
|
||||||
/* loop through all the B1 device models */
|
/* loop through all the B1 device models */
|
||||||
for( ; model != NULL; model = model->B1nextModel ) {
|
for( ; model != NULL; model = B1nextModel(model) ) {
|
||||||
|
|
||||||
/* Default value Processing for B1 MOSFET Models */
|
/* Default value Processing for B1 MOSFET Models */
|
||||||
if( ! model->B1typeGiven) {
|
if( ! model->B1typeGiven) {
|
||||||
|
|
@ -270,7 +270,7 @@ B1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->B1instances; here != NULL ;
|
for (here = B1instances(model); here != NULL ;
|
||||||
here=here->B1nextInstance) {
|
here=here->B1nextInstance) {
|
||||||
|
|
||||||
CKTnode *tmpNode;
|
CKTnode *tmpNode;
|
||||||
|
|
@ -407,9 +407,9 @@ B1unsetup(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
B1instance *here;
|
B1instance *here;
|
||||||
|
|
||||||
for (model = (B1model *)inModel; model != NULL;
|
for (model = (B1model *)inModel; model != NULL;
|
||||||
model = model->B1nextModel)
|
model = B1nextModel(model))
|
||||||
{
|
{
|
||||||
for (here = model->B1instances; here != NULL;
|
for (here = B1instances(model); here != NULL;
|
||||||
here=here->B1nextInstance)
|
here=here->B1nextInstance)
|
||||||
{
|
{
|
||||||
if (here->B1sNodePrime > 0
|
if (here->B1sNodePrime > 0
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ B1temp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
NG_IGNORE(ckt);
|
NG_IGNORE(ckt);
|
||||||
|
|
||||||
/* loop through all the B1 device models */
|
/* loop through all the B1 device models */
|
||||||
for( ; model != NULL; model = model->B1nextModel ) {
|
for( ; model != NULL; model = B1nextModel(model) ) {
|
||||||
|
|
||||||
/* Default value Processing for B1 MOSFET Models */
|
/* Default value Processing for B1 MOSFET Models */
|
||||||
/* Some Limiting for Model Parameters */
|
/* Some Limiting for Model Parameters */
|
||||||
|
|
@ -45,7 +45,7 @@ B1temp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
model->B1Cox = Cox; /* unit: F/cm**2 */
|
model->B1Cox = Cox; /* unit: F/cm**2 */
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->B1instances; here != NULL ;
|
for (here = B1instances(model); here != NULL ;
|
||||||
here=here->B1nextInstance) {
|
here=here->B1nextInstance) {
|
||||||
|
|
||||||
if( (EffChanLength = here->B1l - model->B1deltaL *1e-6 )<=0) {
|
if( (EffChanLength = here->B1l - model->B1deltaL *1e-6 )<=0) {
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ B1trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep)
|
||||||
double debugtemp;
|
double debugtemp;
|
||||||
#endif /* STEPDEBUG */
|
#endif /* STEPDEBUG */
|
||||||
|
|
||||||
for( ; model != NULL; model = model->B1nextModel) {
|
for( ; model != NULL; model = B1nextModel(model)) {
|
||||||
for(here=model->B1instances;here!=NULL;here = here->B1nextInstance){
|
for(here=B1instances(model);here!=NULL;here = here->B1nextInstance){
|
||||||
|
|
||||||
#ifdef STEPDEBUG
|
#ifdef STEPDEBUG
|
||||||
debugtemp = *timeStep;
|
debugtemp = *timeStep;
|
||||||
|
|
|
||||||
|
|
@ -315,14 +315,12 @@ typedef struct sBSIM1instance {
|
||||||
/* per model data */
|
/* per model data */
|
||||||
|
|
||||||
typedef struct sBSIM1model { /* model structure for a resistor */
|
typedef struct sBSIM1model { /* model structure for a resistor */
|
||||||
int B1modType; /* type index of this device type */
|
struct GENmodel gen;
|
||||||
struct sBSIM1model *B1nextModel; /* pointer to next possible model
|
|
||||||
*in linked list */
|
|
||||||
B1instance * B1instances; /* pointer to list of instances
|
|
||||||
* that have this model */
|
|
||||||
IFuid B1modName; /* pointer to character string naming this model */
|
|
||||||
|
|
||||||
/* --- end of generic struct GENmodel --- */
|
#define B1modType gen.GENmodType
|
||||||
|
#define B1nextModel(inst) ((struct sBSIM1model*)((inst)->gen.GENnextModel))
|
||||||
|
#define B1instances(inst) ((B1instance*)((inst)->gen.GENinstances))
|
||||||
|
#define B1modName gen.GENmodName
|
||||||
|
|
||||||
int B1type; /* device type : 1 = nmos, -1 = pmos */
|
int B1type; /* device type : 1 = nmos, -1 = pmos */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,8 @@ B2acLoad(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
double m; /* parallel multiplier */
|
double m; /* parallel multiplier */
|
||||||
|
|
||||||
omega = ckt->CKTomega;
|
omega = ckt->CKTomega;
|
||||||
for( ; model != NULL; model = model->B2nextModel) {
|
for( ; model != NULL; model = B2nextModel(model)) {
|
||||||
for(here = model->B2instances; here!= NULL;
|
for(here = B2instances(model); here!= NULL;
|
||||||
here = here->B2nextInstance) {
|
here = here->B2nextInstance) {
|
||||||
|
|
||||||
if (here->B2mode >= 0) {
|
if (here->B2mode >= 0) {
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,10 @@ B2convTest(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
||||||
|
|
||||||
/* loop through all the B2 device models */
|
/* loop through all the B2 device models */
|
||||||
for( ; model != NULL; model = model->B2nextModel ) {
|
for( ; model != NULL; model = B2nextModel(model) ) {
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->B2instances; here != NULL ;
|
for (here = B2instances(model); here != NULL ;
|
||||||
here=here->B2nextInstance) {
|
here=here->B2nextInstance) {
|
||||||
|
|
||||||
vbs = model->B2type * (
|
vbs = model->B2type * (
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ B2destroy(GENmodel **inModel)
|
||||||
B2model *mod = *(B2model**) inModel;
|
B2model *mod = *(B2model**) inModel;
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
B2model *next_mod = mod->B2nextModel;
|
B2model *next_mod = B2nextModel(mod);
|
||||||
B2instance *inst = mod->B2instances;
|
B2instance *inst = B2instances(mod);
|
||||||
while (inst) {
|
while (inst) {
|
||||||
B2instance *next_inst = inst->B2nextInstance;
|
B2instance *next_inst = inst->B2nextInstance;
|
||||||
FREE(inst);
|
FREE(inst);
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ B2getic(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
* external nodes to get values
|
* external nodes to get values
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for( ; model ; model = model->B2nextModel) {
|
for( ; model ; model = B2nextModel(model)) {
|
||||||
for(here = model->B2instances; here ; here = here->B2nextInstance) {
|
for(here = B2instances(model); here ; here = here->B2nextInstance) {
|
||||||
|
|
||||||
if(!here->B2icVBSGiven) {
|
if(!here->B2icVBSGiven) {
|
||||||
here->B2icVBS =
|
here->B2icVBS =
|
||||||
|
|
|
||||||
|
|
@ -130,10 +130,10 @@ B2load(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
||||||
|
|
||||||
/* loop through all the B2 device models */
|
/* loop through all the B2 device models */
|
||||||
for( ; model != NULL; model = model->B2nextModel ) {
|
for( ; model != NULL; model = B2nextModel(model) ) {
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->B2instances; here != NULL ;
|
for (here = B2instances(model); here != NULL ;
|
||||||
here=here->B2nextInstance) {
|
here=here->B2nextInstance) {
|
||||||
|
|
||||||
EffectiveLength=here->B2l - model->B2deltaL * 1.e-6;/* m */
|
EffectiveLength=here->B2l - model->B2deltaL * 1.e-6;/* m */
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@ B2noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt,
|
||||||
"" /* total transistor noise */
|
"" /* total transistor noise */
|
||||||
};
|
};
|
||||||
|
|
||||||
for (model=firstModel; model != NULL; model=model->B2nextModel) {
|
for (model=firstModel; model != NULL; model=B2nextModel(model)) {
|
||||||
for (inst=model->B2instances; inst != NULL; inst=inst->B2nextInstance) {
|
for (inst=B2instances(model); inst != NULL; inst=inst->B2nextInstance) {
|
||||||
|
|
||||||
switch (operation) {
|
switch (operation) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,8 @@ B2pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
|
||||||
|
|
||||||
double m;
|
double m;
|
||||||
|
|
||||||
for( ; model != NULL; model = model->B2nextModel) {
|
for( ; model != NULL; model = B2nextModel(model)) {
|
||||||
for(here = model->B2instances; here!= NULL;
|
for(here = B2instances(model); here!= NULL;
|
||||||
here = here->B2nextInstance) {
|
here = here->B2nextInstance) {
|
||||||
|
|
||||||
if (here->B2mode >= 0) {
|
if (here->B2mode >= 0) {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ B2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
CKTnode *tmp;
|
CKTnode *tmp;
|
||||||
|
|
||||||
/* loop through all the B2 device models */
|
/* loop through all the B2 device models */
|
||||||
for( ; model != NULL; model = model->B2nextModel ) {
|
for( ; model != NULL; model = B2nextModel(model) ) {
|
||||||
|
|
||||||
/* Default value Processing for B2 MOSFET Models */
|
/* Default value Processing for B2 MOSFET Models */
|
||||||
if( ! model->B2typeGiven) {
|
if( ! model->B2typeGiven) {
|
||||||
|
|
@ -431,7 +431,7 @@ B2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->B2instances; here != NULL ;
|
for (here = B2instances(model); here != NULL ;
|
||||||
here=here->B2nextInstance) {
|
here=here->B2nextInstance) {
|
||||||
|
|
||||||
/* allocate a chunk of the state vector */
|
/* allocate a chunk of the state vector */
|
||||||
|
|
@ -576,9 +576,9 @@ B2unsetup(
|
||||||
B2instance *here;
|
B2instance *here;
|
||||||
|
|
||||||
for (model = (B2model *)inModel; model != NULL;
|
for (model = (B2model *)inModel; model != NULL;
|
||||||
model = model->B2nextModel)
|
model = B2nextModel(model))
|
||||||
{
|
{
|
||||||
for (here = model->B2instances; here != NULL;
|
for (here = B2instances(model); here != NULL;
|
||||||
here=here->B2nextInstance)
|
here=here->B2nextInstance)
|
||||||
{
|
{
|
||||||
if (here->B2sNodePrime > 0
|
if (here->B2sNodePrime > 0
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ B2temp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
NG_IGNORE(ckt);
|
NG_IGNORE(ckt);
|
||||||
|
|
||||||
/* loop through all the B2 device models */
|
/* loop through all the B2 device models */
|
||||||
for( ; model != NULL; model = model->B2nextModel ) {
|
for( ; model != NULL; model = B2nextModel(model) ) {
|
||||||
|
|
||||||
/* Default value Processing for B2 MOSFET Models */
|
/* Default value Processing for B2 MOSFET Models */
|
||||||
/* Some Limiting for Model Parameters */
|
/* Some Limiting for Model Parameters */
|
||||||
|
|
@ -50,7 +50,7 @@ B2temp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
pLastKnot = NULL;
|
pLastKnot = NULL;
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->B2instances; here != NULL ;
|
for (here = B2instances(model); here != NULL ;
|
||||||
here=here->B2nextInstance) {
|
here=here->B2nextInstance) {
|
||||||
|
|
||||||
pSizeDependParamKnot = model->pSizeDependParamKnot;
|
pSizeDependParamKnot = model->pSizeDependParamKnot;
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ B2trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep)
|
||||||
double debugtemp;
|
double debugtemp;
|
||||||
#endif /* STEPDEBUG */
|
#endif /* STEPDEBUG */
|
||||||
|
|
||||||
for( ; model != NULL; model = model->B2nextModel) {
|
for( ; model != NULL; model = B2nextModel(model)) {
|
||||||
for(here=model->B2instances;here!=NULL;here = here->B2nextInstance){
|
for(here=B2instances(model);here!=NULL;here = here->B2nextInstance){
|
||||||
|
|
||||||
#ifdef STEPDEBUG
|
#ifdef STEPDEBUG
|
||||||
debugtemp = *timeStep;
|
debugtemp = *timeStep;
|
||||||
|
|
|
||||||
|
|
@ -237,14 +237,12 @@ struct bsim2SizeDependParam
|
||||||
/* per model data */
|
/* per model data */
|
||||||
|
|
||||||
typedef struct sBSIM2model { /* model structure for a resistor */
|
typedef struct sBSIM2model { /* model structure for a resistor */
|
||||||
int B2modType; /* type index of this device type */
|
struct GENmodel gen;
|
||||||
struct sBSIM2model *B2nextModel; /* pointer to next possible model
|
|
||||||
*in linked list */
|
|
||||||
B2instance * B2instances; /* pointer to list of instances
|
|
||||||
* that have this model */
|
|
||||||
IFuid B2modName; /* pointer to the name of this model */
|
|
||||||
|
|
||||||
/* --- end of generic struct GENmodel --- */
|
#define B2modType gen.GENmodType
|
||||||
|
#define B2nextModel(inst) ((struct sBSIM2model*)((inst)->gen.GENnextModel))
|
||||||
|
#define B2instances(inst) ((B2instance*)((inst)->gen.GENinstances))
|
||||||
|
#define B2modName gen.GENmodName
|
||||||
|
|
||||||
int B2type; /* device type: 1 = nmos, -1 = pmos */
|
int B2type; /* device type: 1 = nmos, -1 = pmos */
|
||||||
int pad;
|
int pad;
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,8 @@ double xcsbbi, xcggbi, xcgdbi, xcgsbi, xcgbbi;
|
||||||
double m;
|
double m;
|
||||||
|
|
||||||
omega = ckt->CKTomega;
|
omega = ckt->CKTomega;
|
||||||
for (; model != NULL; model = model->BSIM3nextModel)
|
for (; model != NULL; model = BSIM3nextModel(model))
|
||||||
{ for (here = model->BSIM3instances; here!= NULL;
|
{ for (here = BSIM3instances(model); here!= NULL;
|
||||||
here = here->BSIM3nextInstance)
|
here = here->BSIM3nextInstance)
|
||||||
{
|
{
|
||||||
Csd = -(here->BSIM3cddb + here->BSIM3cgdb + here->BSIM3cbdb);
|
Csd = -(here->BSIM3cddb + here->BSIM3cgdb + here->BSIM3cbdb);
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@ double delvbd, delvbs, delvds, delvgd, delvgs, vbd, vbs, vds;
|
||||||
double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs;
|
double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs;
|
||||||
|
|
||||||
/* loop through all the BSIM3 device models */
|
/* loop through all the BSIM3 device models */
|
||||||
for (; model != NULL; model = model->BSIM3nextModel)
|
for (; model != NULL; model = BSIM3nextModel(model))
|
||||||
{ /* loop through all the instances of the model */
|
{ /* loop through all the instances of the model */
|
||||||
for (here = model->BSIM3instances; here != NULL ;
|
for (here = BSIM3instances(model); here != NULL ;
|
||||||
here=here->BSIM3nextInstance)
|
here=here->BSIM3nextInstance)
|
||||||
{
|
{
|
||||||
vbs = model->BSIM3type
|
vbs = model->BSIM3type
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ BSIM3destroy(GENmodel **inModel)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
BSIM3model *next_mod = mod->BSIM3nextModel;
|
BSIM3model *next_mod = BSIM3nextModel(mod);
|
||||||
BSIM3instance *inst = mod->BSIM3instances;
|
BSIM3instance *inst = BSIM3instances(mod);
|
||||||
|
|
||||||
/** added to get rid of link list pSizeDependParamKnot **/
|
/** added to get rid of link list pSizeDependParamKnot **/
|
||||||
struct bsim3SizeDependParam *p = mod->pSizeDependParamKnot;
|
struct bsim3SizeDependParam *p = mod->pSizeDependParamKnot;
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ CKTcircuit *ckt)
|
||||||
BSIM3model *model = (BSIM3model*)inModel;
|
BSIM3model *model = (BSIM3model*)inModel;
|
||||||
BSIM3instance *here;
|
BSIM3instance *here;
|
||||||
|
|
||||||
for (; model ; model = model->BSIM3nextModel)
|
for (; model ; model = BSIM3nextModel(model))
|
||||||
{ for (here = model->BSIM3instances; here; here = here->BSIM3nextInstance)
|
{ for (here = BSIM3instances(model); here; here = here->BSIM3nextInstance)
|
||||||
{
|
{
|
||||||
if (!here->BSIM3icVBSGiven)
|
if (!here->BSIM3icVBSGiven)
|
||||||
{ here->BSIM3icVBS = *(ckt->CKTrhs + here->BSIM3bNode)
|
{ here->BSIM3icVBS = *(ckt->CKTrhs + here->BSIM3bNode)
|
||||||
|
|
|
||||||
|
|
@ -179,8 +179,8 @@ ChargeComputationNeeded =
|
||||||
((ckt->CKTmode & MODETRANOP) && (ckt->CKTmode & MODEUIC)))
|
((ckt->CKTmode & MODETRANOP) && (ckt->CKTmode & MODEUIC)))
|
||||||
? 1 : 0;
|
? 1 : 0;
|
||||||
#ifndef USE_OMP
|
#ifndef USE_OMP
|
||||||
for (; model != NULL; model = model->BSIM3nextModel)
|
for (; model != NULL; model = BSIM3nextModel(model))
|
||||||
{ for (here = model->BSIM3instances; here != NULL;
|
{ for (here = BSIM3instances(model); here != NULL;
|
||||||
here = here->BSIM3nextInstance)
|
here = here->BSIM3nextInstance)
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -139,8 +139,8 @@ int i;
|
||||||
"" /* total transistor noise */
|
"" /* total transistor noise */
|
||||||
};
|
};
|
||||||
|
|
||||||
for (; model != NULL; model = model->BSIM3nextModel)
|
for (; model != NULL; model = BSIM3nextModel(model))
|
||||||
{ for (here = model->BSIM3instances; here != NULL;
|
{ for (here = BSIM3instances(model); here != NULL;
|
||||||
here = here->BSIM3nextInstance)
|
here = here->BSIM3nextInstance)
|
||||||
{ pParam = here->pParam;
|
{ pParam = here->pParam;
|
||||||
switch (operation)
|
switch (operation)
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ double T1, CoxWL, qcheq, Cdg, Cdd, Cds, Csg, Csd, Css;
|
||||||
double ScalingFactor = 1.0e-9;
|
double ScalingFactor = 1.0e-9;
|
||||||
double m;
|
double m;
|
||||||
|
|
||||||
for (; model != NULL; model = model->BSIM3nextModel)
|
for (; model != NULL; model = BSIM3nextModel(model))
|
||||||
{ for (here = model->BSIM3instances; here!= NULL;
|
{ for (here = BSIM3instances(model); here!= NULL;
|
||||||
here = here->BSIM3nextInstance)
|
here = here->BSIM3nextInstance)
|
||||||
{
|
{
|
||||||
if (here->BSIM3mode >= 0)
|
if (here->BSIM3mode >= 0)
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ BSIM3instance **InstArray;
|
||||||
|
|
||||||
|
|
||||||
/* loop through all the BSIM3 device models */
|
/* loop through all the BSIM3 device models */
|
||||||
for( ; model != NULL; model = model->BSIM3nextModel )
|
for( ; model != NULL; model = BSIM3nextModel(model) )
|
||||||
{
|
{
|
||||||
/* Default value Processing for BSIM3 MOSFET Models */
|
/* Default value Processing for BSIM3 MOSFET Models */
|
||||||
if (!model->BSIM3typeGiven)
|
if (!model->BSIM3typeGiven)
|
||||||
|
|
@ -920,7 +920,7 @@ BSIM3instance **InstArray;
|
||||||
model->BSIM3vbdrMax = 1e99;
|
model->BSIM3vbdrMax = 1e99;
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BSIM3instances; here != NULL ;
|
for (here = BSIM3instances(model); here != NULL ;
|
||||||
here=here->BSIM3nextInstance)
|
here=here->BSIM3nextInstance)
|
||||||
{
|
{
|
||||||
/* allocate a chunk of the state vector */
|
/* allocate a chunk of the state vector */
|
||||||
|
|
@ -1129,10 +1129,10 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
||||||
/* loop through all the BSIM3 device models
|
/* loop through all the BSIM3 device models
|
||||||
to count the number of instances */
|
to count the number of instances */
|
||||||
|
|
||||||
for( ; model != NULL; model = model->BSIM3nextModel )
|
for( ; model != NULL; model = BSIM3nextModel(model) )
|
||||||
{
|
{
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BSIM3instances; here != NULL ;
|
for (here = BSIM3instances(model); here != NULL ;
|
||||||
here=here->BSIM3nextInstance)
|
here=here->BSIM3nextInstance)
|
||||||
{
|
{
|
||||||
InstCount++;
|
InstCount++;
|
||||||
|
|
@ -1141,10 +1141,10 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
||||||
InstArray = TMALLOC(BSIM3instance*, InstCount);
|
InstArray = TMALLOC(BSIM3instance*, InstCount);
|
||||||
model = (BSIM3model*)inModel;
|
model = (BSIM3model*)inModel;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
for( ; model != NULL; model = model->BSIM3nextModel )
|
for( ; model != NULL; model = BSIM3nextModel(model) )
|
||||||
{
|
{
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BSIM3instances; here != NULL ;
|
for (here = BSIM3instances(model); here != NULL ;
|
||||||
here=here->BSIM3nextInstance)
|
here=here->BSIM3nextInstance)
|
||||||
{
|
{
|
||||||
InstArray[idx] = here;
|
InstArray[idx] = here;
|
||||||
|
|
@ -1168,9 +1168,9 @@ BSIM3unsetup(
|
||||||
BSIM3instance *here;
|
BSIM3instance *here;
|
||||||
|
|
||||||
for (model = (BSIM3model *)inModel; model != NULL;
|
for (model = (BSIM3model *)inModel; model != NULL;
|
||||||
model = model->BSIM3nextModel)
|
model = BSIM3nextModel(model))
|
||||||
{
|
{
|
||||||
for (here = model->BSIM3instances; here != NULL;
|
for (here = BSIM3instances(model); here != NULL;
|
||||||
here=here->BSIM3nextInstance)
|
here=here->BSIM3nextInstance)
|
||||||
{
|
{
|
||||||
if (here->BSIM3qNode > 0)
|
if (here->BSIM3qNode > 0)
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,9 @@ BSIM3soaCheck(CKTcircuit *ckt, GENmodel *inModel)
|
||||||
|
|
||||||
maxwarns = ckt->CKTsoaMaxWarns;
|
maxwarns = ckt->CKTsoaMaxWarns;
|
||||||
|
|
||||||
for (; model; model = model->BSIM3nextModel) {
|
for (; model; model = BSIM3nextModel(model)) {
|
||||||
|
|
||||||
for (here = model->BSIM3instances; here; here = here->BSIM3nextInstance) {
|
for (here = BSIM3instances(model); here; here = here->BSIM3nextInstance) {
|
||||||
|
|
||||||
vgs = ckt->CKTrhsOld [here->BSIM3gNode] -
|
vgs = ckt->CKTrhsOld [here->BSIM3gNode] -
|
||||||
ckt->CKTrhsOld [here->BSIM3sNodePrime];
|
ckt->CKTrhsOld [here->BSIM3sNodePrime];
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ double Nvtm, SourceSatCurrent, DrainSatCurrent;
|
||||||
int Size_Not_Found, error;
|
int Size_Not_Found, error;
|
||||||
|
|
||||||
/* loop through all the BSIM3 device models */
|
/* loop through all the BSIM3 device models */
|
||||||
for (; model != NULL; model = model->BSIM3nextModel)
|
for (; model != NULL; model = BSIM3nextModel(model))
|
||||||
{ Temp = ckt->CKTtemp;
|
{ Temp = ckt->CKTtemp;
|
||||||
if (model->BSIM3bulkJctPotential < 0.1)
|
if (model->BSIM3bulkJctPotential < 0.1)
|
||||||
{ model->BSIM3bulkJctPotential = 0.1;
|
{ model->BSIM3bulkJctPotential = 0.1;
|
||||||
|
|
@ -143,7 +143,7 @@ int Size_Not_Found, error;
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
/* MCJ: Length and Width not initialized */
|
/* MCJ: Length and Width not initialized */
|
||||||
for (here = model->BSIM3instances; here != NULL;
|
for (here = BSIM3instances(model); here != NULL;
|
||||||
here = here->BSIM3nextInstance)
|
here = here->BSIM3nextInstance)
|
||||||
{
|
{
|
||||||
pSizeDependParamKnot = model->pSizeDependParamKnot;
|
pSizeDependParamKnot = model->pSizeDependParamKnot;
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@ BSIM3instance *here;
|
||||||
double debugtemp;
|
double debugtemp;
|
||||||
#endif /* STEPDEBUG */
|
#endif /* STEPDEBUG */
|
||||||
|
|
||||||
for (; model != NULL; model = model->BSIM3nextModel)
|
for (; model != NULL; model = BSIM3nextModel(model))
|
||||||
{ for (here = model->BSIM3instances; here != NULL;
|
{ for (here = BSIM3instances(model); here != NULL;
|
||||||
here = here->BSIM3nextInstance)
|
here = here->BSIM3nextInstance)
|
||||||
{
|
{
|
||||||
#ifdef STEPDEBUG
|
#ifdef STEPDEBUG
|
||||||
|
|
|
||||||
|
|
@ -399,12 +399,12 @@ struct bsim3SizeDependParam
|
||||||
|
|
||||||
typedef struct sBSIM3model
|
typedef struct sBSIM3model
|
||||||
{
|
{
|
||||||
int BSIM3modType;
|
struct GENmodel gen;
|
||||||
struct sBSIM3model *BSIM3nextModel;
|
|
||||||
BSIM3instance *BSIM3instances;
|
|
||||||
IFuid BSIM3modName;
|
|
||||||
|
|
||||||
/* --- end of generic struct GENmodel --- */
|
#define BSIM3modType gen.GENmodType
|
||||||
|
#define BSIM3nextModel(inst) ((struct sBSIM3model*)((inst)->gen.GENnextModel))
|
||||||
|
#define BSIM3instances(inst) ((BSIM3instance*)((inst)->gen.GENinstances))
|
||||||
|
#define BSIM3modName gen.GENmodName
|
||||||
|
|
||||||
int BSIM3type;
|
int BSIM3type;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,10 @@ FILE *fpdebug = NULL;
|
||||||
double m;
|
double m;
|
||||||
|
|
||||||
omega = ckt->CKTomega;
|
omega = ckt->CKTomega;
|
||||||
for (; model != NULL; model = model->B3SOIDDnextModel)
|
for (; model != NULL; model = B3SOIDDnextModel(model))
|
||||||
{
|
{
|
||||||
|
|
||||||
for (here = model->B3SOIDDinstances; here!= NULL;
|
for (here = B3SOIDDinstances(model); here!= NULL;
|
||||||
here = here->B3SOIDDnextInstance)
|
here = here->B3SOIDDnextInstance)
|
||||||
{
|
{
|
||||||
selfheat = (model->B3SOIDDshMod == 1) && (here->B3SOIDDrth0 != 0.0);
|
selfheat = (model->B3SOIDDshMod == 1) && (here->B3SOIDDrth0 != 0.0);
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@ double delvbd, delvbs, delvds, delvgd, delvgs, vbd, vbs, vds;
|
||||||
double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs;
|
double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs;
|
||||||
|
|
||||||
/* loop through all the B3SOIDD device models */
|
/* loop through all the B3SOIDD device models */
|
||||||
for (; model != NULL; model = model->B3SOIDDnextModel)
|
for (; model != NULL; model = B3SOIDDnextModel(model))
|
||||||
{ /* loop through all the instances of the model */
|
{ /* loop through all the instances of the model */
|
||||||
for (here = model->B3SOIDDinstances; here != NULL ;
|
for (here = B3SOIDDinstances(model); here != NULL ;
|
||||||
here=here->B3SOIDDnextInstance)
|
here=here->B3SOIDDnextInstance)
|
||||||
{
|
{
|
||||||
vbs = model->B3SOIDDtype
|
vbs = model->B3SOIDDtype
|
||||||
|
|
|
||||||
|
|
@ -597,12 +597,12 @@ struct b3soiddSizeDependParam
|
||||||
|
|
||||||
typedef struct sB3SOIDDmodel
|
typedef struct sB3SOIDDmodel
|
||||||
{
|
{
|
||||||
int B3SOIDDmodType;
|
struct GENmodel gen;
|
||||||
struct sB3SOIDDmodel *B3SOIDDnextModel;
|
|
||||||
B3SOIDDinstance *B3SOIDDinstances;
|
|
||||||
IFuid B3SOIDDmodName;
|
|
||||||
|
|
||||||
/* --- end of generic struct GENmodel --- */
|
#define B3SOIDDmodType gen.GENmodType
|
||||||
|
#define B3SOIDDnextModel(inst) ((struct sB3SOIDDmodel*)((inst)->gen.GENnextModel))
|
||||||
|
#define B3SOIDDinstances(inst) ((B3SOIDDinstance*)((inst)->gen.GENinstances))
|
||||||
|
#define B3SOIDDmodName gen.GENmodName
|
||||||
|
|
||||||
int B3SOIDDtype;
|
int B3SOIDDtype;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ B3SOIDDdestroy(GENmodel **inModel)
|
||||||
B3SOIDDmodel *mod = *(B3SOIDDmodel**) inModel;
|
B3SOIDDmodel *mod = *(B3SOIDDmodel**) inModel;
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
B3SOIDDmodel *next_mod = mod->B3SOIDDnextModel;
|
B3SOIDDmodel *next_mod = B3SOIDDnextModel(mod);
|
||||||
B3SOIDDinstance *inst = mod->B3SOIDDinstances;
|
B3SOIDDinstance *inst = B3SOIDDinstances(mod);
|
||||||
while (inst) {
|
while (inst) {
|
||||||
B3SOIDDinstance *next_inst = inst->B3SOIDDnextInstance;
|
B3SOIDDinstance *next_inst = inst->B3SOIDDnextInstance;
|
||||||
FREE(inst);
|
FREE(inst);
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ B3SOIDDgetic(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
B3SOIDDmodel *model = (B3SOIDDmodel*)inModel;
|
B3SOIDDmodel *model = (B3SOIDDmodel*)inModel;
|
||||||
B3SOIDDinstance *here;
|
B3SOIDDinstance *here;
|
||||||
|
|
||||||
for (; model ; model = model->B3SOIDDnextModel)
|
for (; model ; model = B3SOIDDnextModel(model))
|
||||||
{ for (here = model->B3SOIDDinstances; here; here = here->B3SOIDDnextInstance)
|
{ for (here = B3SOIDDinstances(model); here; here = here->B3SOIDDnextInstance)
|
||||||
{
|
{
|
||||||
if(!here->B3SOIDDicVBSGiven)
|
if(!here->B3SOIDDicVBSGiven)
|
||||||
{ here->B3SOIDDicVBS = *(ckt->CKTrhs + here->B3SOIDDbNode)
|
{ here->B3SOIDDicVBS = *(ckt->CKTrhs + here->B3SOIDDbNode)
|
||||||
|
|
|
||||||
|
|
@ -304,8 +304,8 @@ char nanmessage [12];
|
||||||
double m;
|
double m;
|
||||||
|
|
||||||
|
|
||||||
for (; model != NULL; model = model->B3SOIDDnextModel)
|
for (; model != NULL; model = B3SOIDDnextModel(model))
|
||||||
{ for (here = model->B3SOIDDinstances; here != NULL;
|
{ for (here = B3SOIDDinstances(model); here != NULL;
|
||||||
here = here->B3SOIDDnextInstance)
|
here = here->B3SOIDDnextInstance)
|
||||||
{
|
{
|
||||||
Check = 0;
|
Check = 0;
|
||||||
|
|
|
||||||
|
|
@ -127,8 +127,8 @@ int i;
|
||||||
"" /* total transistor noise */
|
"" /* total transistor noise */
|
||||||
};
|
};
|
||||||
|
|
||||||
for (; model != NULL; model = model->B3SOIDDnextModel)
|
for (; model != NULL; model = B3SOIDDnextModel(model))
|
||||||
{ for (here = model->B3SOIDDinstances; here != NULL;
|
{ for (here = B3SOIDDinstances(model); here != NULL;
|
||||||
here = here->B3SOIDDnextInstance)
|
here = here->B3SOIDDnextInstance)
|
||||||
{
|
{
|
||||||
pParam = here->pParam;
|
pParam = here->pParam;
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,8 @@ double m;
|
||||||
|
|
||||||
NG_IGNORE(ckt);
|
NG_IGNORE(ckt);
|
||||||
|
|
||||||
for (; model != NULL; model = model->B3SOIDDnextModel)
|
for (; model != NULL; model = B3SOIDDnextModel(model))
|
||||||
{ for (here = model->B3SOIDDinstances; here!= NULL;
|
{ for (here = B3SOIDDinstances(model); here!= NULL;
|
||||||
here = here->B3SOIDDnextInstance)
|
here = here->B3SOIDDnextInstance)
|
||||||
{
|
{
|
||||||
if (here->B3SOIDDmode >= 0)
|
if (here->B3SOIDDmode >= 0)
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ IFuid tmpName;
|
||||||
|
|
||||||
|
|
||||||
/* loop through all the B3SOIDD device models */
|
/* loop through all the B3SOIDD device models */
|
||||||
for( ; model != NULL; model = model->B3SOIDDnextModel )
|
for( ; model != NULL; model = B3SOIDDnextModel(model) )
|
||||||
{
|
{
|
||||||
/* Default value Processing for B3SOIDD MOSFET Models */
|
/* Default value Processing for B3SOIDD MOSFET Models */
|
||||||
|
|
||||||
|
|
@ -874,7 +874,7 @@ IFuid tmpName;
|
||||||
model->B3SOIDDnoif = 1.0;
|
model->B3SOIDDnoif = 1.0;
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->B3SOIDDinstances; here != NULL ;
|
for (here = B3SOIDDinstances(model); here != NULL ;
|
||||||
here=here->B3SOIDDnextInstance)
|
here=here->B3SOIDDnextInstance)
|
||||||
{
|
{
|
||||||
/* allocate a chunk of the state vector */
|
/* allocate a chunk of the state vector */
|
||||||
|
|
@ -1357,9 +1357,9 @@ B3SOIDDunsetup(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
B3SOIDDinstance *here;
|
B3SOIDDinstance *here;
|
||||||
|
|
||||||
for (model = (B3SOIDDmodel *)inModel; model != NULL;
|
for (model = (B3SOIDDmodel *)inModel; model != NULL;
|
||||||
model = model->B3SOIDDnextModel)
|
model = B3SOIDDnextModel(model))
|
||||||
{
|
{
|
||||||
for (here = model->B3SOIDDinstances; here != NULL;
|
for (here = B3SOIDDinstances(model); here != NULL;
|
||||||
here=here->B3SOIDDnextInstance)
|
here=here->B3SOIDDnextInstance)
|
||||||
{
|
{
|
||||||
/* here for debugging purpose only */
|
/* here for debugging purpose only */
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ double SDphi, SDgamma;
|
||||||
int Size_Not_Found;
|
int Size_Not_Found;
|
||||||
|
|
||||||
/* loop through all the B3SOIDD device models */
|
/* loop through all the B3SOIDD device models */
|
||||||
for (; model != NULL; model = model->B3SOIDDnextModel)
|
for (; model != NULL; model = B3SOIDDnextModel(model))
|
||||||
{ Temp = ckt->CKTtemp;
|
{ Temp = ckt->CKTtemp;
|
||||||
if (model->B3SOIDDGatesidewallJctPotential < 0.1)
|
if (model->B3SOIDDGatesidewallJctPotential < 0.1)
|
||||||
model->B3SOIDDGatesidewallJctPotential = 0.1;
|
model->B3SOIDDGatesidewallJctPotential = 0.1;
|
||||||
|
|
@ -72,7 +72,7 @@ int Size_Not_Found;
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
/* MCJ: Length and Width not initialized */
|
/* MCJ: Length and Width not initialized */
|
||||||
for (here = model->B3SOIDDinstances; here != NULL;
|
for (here = B3SOIDDinstances(model); here != NULL;
|
||||||
here = here->B3SOIDDnextInstance)
|
here = here->B3SOIDDnextInstance)
|
||||||
{
|
{
|
||||||
here->B3SOIDDrbodyext = here->B3SOIDDbodySquares *
|
here->B3SOIDDrbodyext = here->B3SOIDDbodySquares *
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ B3SOIDDinstance *here;
|
||||||
double debugtemp;
|
double debugtemp;
|
||||||
#endif /* STEPDEBUG */
|
#endif /* STEPDEBUG */
|
||||||
|
|
||||||
for (; model != NULL; model = model->B3SOIDDnextModel)
|
for (; model != NULL; model = B3SOIDDnextModel(model))
|
||||||
{ for (here = model->B3SOIDDinstances; here != NULL;
|
{ for (here = B3SOIDDinstances(model); here != NULL;
|
||||||
here = here->B3SOIDDnextInstance)
|
here = here->B3SOIDDnextInstance)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,10 @@ FILE *fpdebug = NULL;
|
||||||
double m;
|
double m;
|
||||||
|
|
||||||
omega = ckt->CKTomega;
|
omega = ckt->CKTomega;
|
||||||
for (; model != NULL; model = model->B3SOIFDnextModel)
|
for (; model != NULL; model = B3SOIFDnextModel(model))
|
||||||
{
|
{
|
||||||
|
|
||||||
for (here = model->B3SOIFDinstances; here!= NULL;
|
for (here = B3SOIFDinstances(model); here!= NULL;
|
||||||
here = here->B3SOIFDnextInstance)
|
here = here->B3SOIFDnextInstance)
|
||||||
{
|
{
|
||||||
selfheat = (model->B3SOIFDshMod == 1) && (here->B3SOIFDrth0 != 0.0);
|
selfheat = (model->B3SOIFDshMod == 1) && (here->B3SOIFDrth0 != 0.0);
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@ double delvbd, delvbs, delvds, delvgd, delvgs, vbd, vbs, vds;
|
||||||
double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs;
|
double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs;
|
||||||
|
|
||||||
/* loop through all the B3SOIFD device models */
|
/* loop through all the B3SOIFD device models */
|
||||||
for (; model != NULL; model = model->B3SOIFDnextModel)
|
for (; model != NULL; model = B3SOIFDnextModel(model))
|
||||||
{ /* loop through all the instances of the model */
|
{ /* loop through all the instances of the model */
|
||||||
for (here = model->B3SOIFDinstances; here != NULL ;
|
for (here = B3SOIFDinstances(model); here != NULL ;
|
||||||
here=here->B3SOIFDnextInstance)
|
here=here->B3SOIFDnextInstance)
|
||||||
{
|
{
|
||||||
vbs = model->B3SOIFDtype
|
vbs = model->B3SOIFDtype
|
||||||
|
|
|
||||||
|
|
@ -597,12 +597,12 @@ struct b3soifdSizeDependParam
|
||||||
|
|
||||||
typedef struct sB3SOIFDmodel
|
typedef struct sB3SOIFDmodel
|
||||||
{
|
{
|
||||||
int B3SOIFDmodType;
|
struct GENmodel gen;
|
||||||
struct sB3SOIFDmodel *B3SOIFDnextModel;
|
|
||||||
B3SOIFDinstance *B3SOIFDinstances;
|
|
||||||
IFuid B3SOIFDmodName;
|
|
||||||
|
|
||||||
/* --- end of generic struct GENmodel --- */
|
#define B3SOIFDmodType gen.GENmodType
|
||||||
|
#define B3SOIFDnextModel(inst) ((struct sB3SOIFDmodel*)((inst)->gen.GENnextModel))
|
||||||
|
#define B3SOIFDinstances(inst) ((B3SOIFDinstance*)((inst)->gen.GENinstances))
|
||||||
|
#define B3SOIFDmodName gen.GENmodName
|
||||||
|
|
||||||
int B3SOIFDtype;
|
int B3SOIFDtype;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ B3SOIFDdestroy(GENmodel **inModel)
|
||||||
B3SOIFDmodel *mod = *(B3SOIFDmodel**) inModel;
|
B3SOIFDmodel *mod = *(B3SOIFDmodel**) inModel;
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
B3SOIFDmodel *next_mod = mod->B3SOIFDnextModel;
|
B3SOIFDmodel *next_mod = B3SOIFDnextModel(mod);
|
||||||
B3SOIFDinstance *inst = mod->B3SOIFDinstances;
|
B3SOIFDinstance *inst = B3SOIFDinstances(mod);
|
||||||
while (inst) {
|
while (inst) {
|
||||||
B3SOIFDinstance *next_inst = inst->B3SOIFDnextInstance;
|
B3SOIFDinstance *next_inst = inst->B3SOIFDnextInstance;
|
||||||
FREE(inst);
|
FREE(inst);
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ B3SOIFDgetic(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
B3SOIFDmodel *model = (B3SOIFDmodel*)inModel;
|
B3SOIFDmodel *model = (B3SOIFDmodel*)inModel;
|
||||||
B3SOIFDinstance *here;
|
B3SOIFDinstance *here;
|
||||||
|
|
||||||
for (; model ; model = model->B3SOIFDnextModel)
|
for (; model ; model = B3SOIFDnextModel(model))
|
||||||
{ for (here = model->B3SOIFDinstances; here; here = here->B3SOIFDnextInstance)
|
{ for (here = B3SOIFDinstances(model); here; here = here->B3SOIFDnextInstance)
|
||||||
{
|
{
|
||||||
if(!here->B3SOIFDicVBSGiven)
|
if(!here->B3SOIFDicVBSGiven)
|
||||||
{ here->B3SOIFDicVBS = *(ckt->CKTrhs + here->B3SOIFDbNode)
|
{ here->B3SOIFDicVBS = *(ckt->CKTrhs + here->B3SOIFDbNode)
|
||||||
|
|
|
||||||
|
|
@ -274,8 +274,8 @@ char nanmessage [12];
|
||||||
|
|
||||||
double m;
|
double m;
|
||||||
|
|
||||||
for (; model != NULL; model = model->B3SOIFDnextModel)
|
for (; model != NULL; model = B3SOIFDnextModel(model))
|
||||||
{ for (here = model->B3SOIFDinstances; here != NULL;
|
{ for (here = B3SOIFDinstances(model); here != NULL;
|
||||||
here = here->B3SOIFDnextInstance)
|
here = here->B3SOIFDnextInstance)
|
||||||
{
|
{
|
||||||
Check = 0;
|
Check = 0;
|
||||||
|
|
|
||||||
|
|
@ -127,8 +127,8 @@ int i;
|
||||||
"" /* total transistor noise */
|
"" /* total transistor noise */
|
||||||
};
|
};
|
||||||
|
|
||||||
for (; model != NULL; model = model->B3SOIFDnextModel)
|
for (; model != NULL; model = B3SOIFDnextModel(model))
|
||||||
{ for (here = model->B3SOIFDinstances; here != NULL;
|
{ for (here = B3SOIFDinstances(model); here != NULL;
|
||||||
here = here->B3SOIFDnextInstance)
|
here = here->B3SOIFDnextInstance)
|
||||||
{
|
{
|
||||||
pParam = here->pParam;
|
pParam = here->pParam;
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@ double m;
|
||||||
|
|
||||||
NG_IGNORE(ckt);
|
NG_IGNORE(ckt);
|
||||||
|
|
||||||
for (; model != NULL; model = model->B3SOIFDnextModel)
|
for (; model != NULL; model = B3SOIFDnextModel(model))
|
||||||
{ for (here = model->B3SOIFDinstances; here!= NULL;
|
{ for (here = B3SOIFDinstances(model); here!= NULL;
|
||||||
here = here->B3SOIFDnextInstance)
|
here = here->B3SOIFDnextInstance)
|
||||||
{
|
{
|
||||||
if (here->B3SOIFDmode >= 0)
|
if (here->B3SOIFDmode >= 0)
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ IFuid tmpName;
|
||||||
|
|
||||||
|
|
||||||
/* loop through all the B3SOIFD device models */
|
/* loop through all the B3SOIFD device models */
|
||||||
for( ; model != NULL; model = model->B3SOIFDnextModel )
|
for( ; model != NULL; model = B3SOIFDnextModel(model) )
|
||||||
{
|
{
|
||||||
/* Default value Processing for B3SOIFD MOSFET Models */
|
/* Default value Processing for B3SOIFD MOSFET Models */
|
||||||
|
|
||||||
|
|
@ -875,7 +875,7 @@ IFuid tmpName;
|
||||||
model->B3SOIFDnoif = 1.0;
|
model->B3SOIFDnoif = 1.0;
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->B3SOIFDinstances; here != NULL ;
|
for (here = B3SOIFDinstances(model); here != NULL ;
|
||||||
here=here->B3SOIFDnextInstance)
|
here=here->B3SOIFDnextInstance)
|
||||||
{
|
{
|
||||||
/* allocate a chunk of the state vector */
|
/* allocate a chunk of the state vector */
|
||||||
|
|
@ -1346,9 +1346,9 @@ B3SOIFDunsetup(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
B3SOIFDinstance *here;
|
B3SOIFDinstance *here;
|
||||||
|
|
||||||
for (model = (B3SOIFDmodel *)inModel; model != NULL;
|
for (model = (B3SOIFDmodel *)inModel; model != NULL;
|
||||||
model = model->B3SOIFDnextModel)
|
model = B3SOIFDnextModel(model))
|
||||||
{
|
{
|
||||||
for (here = model->B3SOIFDinstances; here != NULL;
|
for (here = B3SOIFDinstances(model); here != NULL;
|
||||||
here=here->B3SOIFDnextInstance)
|
here=here->B3SOIFDnextInstance)
|
||||||
{
|
{
|
||||||
/* here for debugging purpose only */
|
/* here for debugging purpose only */
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ double SDphi, SDgamma;
|
||||||
int Size_Not_Found;
|
int Size_Not_Found;
|
||||||
|
|
||||||
/* loop through all the B3SOIFD device models */
|
/* loop through all the B3SOIFD device models */
|
||||||
for (; model != NULL; model = model->B3SOIFDnextModel)
|
for (; model != NULL; model = B3SOIFDnextModel(model))
|
||||||
{ Temp = ckt->CKTtemp;
|
{ Temp = ckt->CKTtemp;
|
||||||
if (model->B3SOIFDGatesidewallJctPotential < 0.1)
|
if (model->B3SOIFDGatesidewallJctPotential < 0.1)
|
||||||
model->B3SOIFDGatesidewallJctPotential = 0.1;
|
model->B3SOIFDGatesidewallJctPotential = 0.1;
|
||||||
|
|
@ -71,7 +71,7 @@ int Size_Not_Found;
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
/* MCJ: Length and Width not initialized */
|
/* MCJ: Length and Width not initialized */
|
||||||
for (here = model->B3SOIFDinstances; here != NULL;
|
for (here = B3SOIFDinstances(model); here != NULL;
|
||||||
here = here->B3SOIFDnextInstance)
|
here = here->B3SOIFDnextInstance)
|
||||||
{
|
{
|
||||||
here->B3SOIFDrbodyext = here->B3SOIFDbodySquares *
|
here->B3SOIFDrbodyext = here->B3SOIFDbodySquares *
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ B3SOIFDinstance *here;
|
||||||
double debugtemp;
|
double debugtemp;
|
||||||
#endif /* STEPDEBUG */
|
#endif /* STEPDEBUG */
|
||||||
|
|
||||||
for (; model != NULL; model = model->B3SOIFDnextModel)
|
for (; model != NULL; model = B3SOIFDnextModel(model))
|
||||||
{ for (here = model->B3SOIFDinstances; here != NULL;
|
{ for (here = B3SOIFDinstances(model); here != NULL;
|
||||||
here = here->B3SOIFDnextInstance)
|
here = here->B3SOIFDnextInstance)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,10 @@ double xcedb, xcesb;
|
||||||
double m;
|
double m;
|
||||||
|
|
||||||
omega = ckt->CKTomega;
|
omega = ckt->CKTomega;
|
||||||
for (; model != NULL; model = model->B3SOIPDnextModel)
|
for (; model != NULL; model = B3SOIPDnextModel(model))
|
||||||
{
|
{
|
||||||
|
|
||||||
for (here = model->B3SOIPDinstances; here!= NULL;
|
for (here = B3SOIPDinstances(model); here!= NULL;
|
||||||
here = here->B3SOIPDnextInstance)
|
here = here->B3SOIPDnextInstance)
|
||||||
{
|
{
|
||||||
selfheat = (model->B3SOIPDshMod == 1) && (here->B3SOIPDrth0 != 0.0);
|
selfheat = (model->B3SOIPDshMod == 1) && (here->B3SOIPDrth0 != 0.0);
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@ double delvbd, delvbs, delvds, delvgd, delvgs, vbd, vbs, vds;
|
||||||
double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs;
|
double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs;
|
||||||
|
|
||||||
/* loop through all the B3SOIPD device models */
|
/* loop through all the B3SOIPD device models */
|
||||||
for (; model != NULL; model = model->B3SOIPDnextModel)
|
for (; model != NULL; model = B3SOIPDnextModel(model))
|
||||||
{ /* loop through all the instances of the model */
|
{ /* loop through all the instances of the model */
|
||||||
for (here = model->B3SOIPDinstances; here != NULL ;
|
for (here = B3SOIPDinstances(model); here != NULL ;
|
||||||
here=here->B3SOIPDnextInstance)
|
here=here->B3SOIPDnextInstance)
|
||||||
{
|
{
|
||||||
vbs = model->B3SOIPDtype
|
vbs = model->B3SOIPDtype
|
||||||
|
|
|
||||||
|
|
@ -587,12 +587,12 @@ struct b3soipdSizeDependParam
|
||||||
|
|
||||||
typedef struct sB3SOIPDmodel
|
typedef struct sB3SOIPDmodel
|
||||||
{
|
{
|
||||||
int B3SOIPDmodType;
|
struct GENmodel gen;
|
||||||
struct sB3SOIPDmodel *B3SOIPDnextModel;
|
|
||||||
B3SOIPDinstance *B3SOIPDinstances;
|
|
||||||
IFuid B3SOIPDmodName;
|
|
||||||
|
|
||||||
/* --- end of generic struct GENmodel --- */
|
#define B3SOIPDmodType gen.GENmodType
|
||||||
|
#define B3SOIPDnextModel(inst) ((struct sB3SOIPDmodel*)((inst)->gen.GENnextModel))
|
||||||
|
#define B3SOIPDinstances(inst) ((B3SOIPDinstance*)((inst)->gen.GENinstances))
|
||||||
|
#define B3SOIPDmodName gen.GENmodName
|
||||||
|
|
||||||
int B3SOIPDtype;
|
int B3SOIPDtype;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ B3SOIPDdestroy(GENmodel **inModel)
|
||||||
B3SOIPDmodel *mod = *(B3SOIPDmodel**) inModel;
|
B3SOIPDmodel *mod = *(B3SOIPDmodel**) inModel;
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
B3SOIPDmodel *next_mod = mod->B3SOIPDnextModel;
|
B3SOIPDmodel *next_mod = B3SOIPDnextModel(mod);
|
||||||
B3SOIPDinstance *inst = mod->B3SOIPDinstances;
|
B3SOIPDinstance *inst = B3SOIPDinstances(mod);
|
||||||
while (inst) {
|
while (inst) {
|
||||||
B3SOIPDinstance *next_inst = inst->B3SOIPDnextInstance;
|
B3SOIPDinstance *next_inst = inst->B3SOIPDnextInstance;
|
||||||
FREE(inst);
|
FREE(inst);
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ B3SOIPDgetic(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
B3SOIPDmodel *model = (B3SOIPDmodel*)inModel;
|
B3SOIPDmodel *model = (B3SOIPDmodel*)inModel;
|
||||||
B3SOIPDinstance *here;
|
B3SOIPDinstance *here;
|
||||||
|
|
||||||
for (; model ; model = model->B3SOIPDnextModel)
|
for (; model ; model = B3SOIPDnextModel(model))
|
||||||
{ for (here = model->B3SOIPDinstances; here; here = here->B3SOIPDnextInstance)
|
{ for (here = B3SOIPDinstances(model); here; here = here->B3SOIPDnextInstance)
|
||||||
{
|
{
|
||||||
if(!here->B3SOIPDicVBSGiven)
|
if(!here->B3SOIPDicVBSGiven)
|
||||||
{ here->B3SOIPDicVBS = *(ckt->CKTrhs + here->B3SOIPDbNode)
|
{ here->B3SOIPDicVBS = *(ckt->CKTrhs + here->B3SOIPDbNode)
|
||||||
|
|
|
||||||
|
|
@ -291,8 +291,8 @@ double gigT;
|
||||||
|
|
||||||
double m;
|
double m;
|
||||||
|
|
||||||
for (; model != NULL; model = model->B3SOIPDnextModel)
|
for (; model != NULL; model = B3SOIPDnextModel(model))
|
||||||
{ for (here = model->B3SOIPDinstances; here != NULL;
|
{ for (here = B3SOIPDinstances(model); here != NULL;
|
||||||
here = here->B3SOIPDnextInstance)
|
here = here->B3SOIPDnextInstance)
|
||||||
{
|
{
|
||||||
Check = 0;
|
Check = 0;
|
||||||
|
|
|
||||||
|
|
@ -131,8 +131,8 @@ int i;
|
||||||
"" /* total transistor noise */
|
"" /* total transistor noise */
|
||||||
};
|
};
|
||||||
|
|
||||||
for (; model != NULL; model = model->B3SOIPDnextModel)
|
for (; model != NULL; model = B3SOIPDnextModel(model))
|
||||||
{ for (here = model->B3SOIPDinstances; here != NULL;
|
{ for (here = B3SOIPDinstances(model); here != NULL;
|
||||||
here = here->B3SOIPDnextInstance)
|
here = here->B3SOIPDnextInstance)
|
||||||
{
|
{
|
||||||
pParam = here->pParam;
|
pParam = here->pParam;
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@ double m;
|
||||||
|
|
||||||
NG_IGNORE(ckt);
|
NG_IGNORE(ckt);
|
||||||
|
|
||||||
for (; model != NULL; model = model->B3SOIPDnextModel)
|
for (; model != NULL; model = B3SOIPDnextModel(model))
|
||||||
{ for (here = model->B3SOIPDinstances; here!= NULL;
|
{ for (here = B3SOIPDinstances(model); here!= NULL;
|
||||||
here = here->B3SOIPDnextInstance)
|
here = here->B3SOIPDnextInstance)
|
||||||
{
|
{
|
||||||
if (here->B3SOIPDmode >= 0)
|
if (here->B3SOIPDmode >= 0)
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ IFuid tmpName;
|
||||||
|
|
||||||
|
|
||||||
/* loop through all the B3SOIPD device models */
|
/* loop through all the B3SOIPD device models */
|
||||||
for( ; model != NULL; model = model->B3SOIPDnextModel )
|
for( ; model != NULL; model = B3SOIPDnextModel(model) )
|
||||||
{
|
{
|
||||||
/* Default value Processing for B3SOIPD MOSFET Models */
|
/* Default value Processing for B3SOIPD MOSFET Models */
|
||||||
|
|
||||||
|
|
@ -1048,7 +1048,7 @@ IFuid tmpName;
|
||||||
model->B3SOIPDnoif = 1.0;
|
model->B3SOIPDnoif = 1.0;
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->B3SOIPDinstances; here != NULL ;
|
for (here = B3SOIPDinstances(model); here != NULL ;
|
||||||
here=here->B3SOIPDnextInstance)
|
here=here->B3SOIPDnextInstance)
|
||||||
{
|
{
|
||||||
/* allocate a chunk of the state vector */
|
/* allocate a chunk of the state vector */
|
||||||
|
|
@ -1461,9 +1461,9 @@ B3SOIPDunsetup(
|
||||||
B3SOIPDinstance *here;
|
B3SOIPDinstance *here;
|
||||||
|
|
||||||
for (model = (B3SOIPDmodel *)inModel; model != NULL;
|
for (model = (B3SOIPDmodel *)inModel; model != NULL;
|
||||||
model = model->B3SOIPDnextModel)
|
model = B3SOIPDnextModel(model))
|
||||||
{
|
{
|
||||||
for (here = model->B3SOIPDinstances; here != NULL;
|
for (here = B3SOIPDinstances(model); here != NULL;
|
||||||
here=here->B3SOIPDnextInstance)
|
here=here->B3SOIPDnextInstance)
|
||||||
{
|
{
|
||||||
/* here for debugging purpose only */
|
/* here for debugging purpose only */
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ double tmp3, T7;
|
||||||
|
|
||||||
|
|
||||||
/* loop through all the B3SOIPD device models */
|
/* loop through all the B3SOIPD device models */
|
||||||
for (; model != NULL; model = model->B3SOIPDnextModel)
|
for (; model != NULL; model = B3SOIPDnextModel(model))
|
||||||
{ Temp = ckt->CKTtemp;
|
{ Temp = ckt->CKTtemp;
|
||||||
if (model->B3SOIPDGatesidewallJctPotential < 0.1)
|
if (model->B3SOIPDGatesidewallJctPotential < 0.1)
|
||||||
model->B3SOIPDGatesidewallJctPotential = 0.1;
|
model->B3SOIPDGatesidewallJctPotential = 0.1;
|
||||||
|
|
@ -90,7 +90,7 @@ double tmp3, T7;
|
||||||
|
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
/* MCJ: Length and Width not initialized */
|
/* MCJ: Length and Width not initialized */
|
||||||
for (here = model->B3SOIPDinstances; here != NULL;
|
for (here = B3SOIPDinstances(model); here != NULL;
|
||||||
here = here->B3SOIPDnextInstance)
|
here = here->B3SOIPDnextInstance)
|
||||||
{
|
{
|
||||||
here->B3SOIPDrbodyext = here->B3SOIPDbodySquares *
|
here->B3SOIPDrbodyext = here->B3SOIPDbodySquares *
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue