Jspice3
b2getic.c File Reference
#include "spice.h"
#include <stdio.h>
#include "bsim2def.h"
#include "sperror.h"
Include dependency graph for b2getic.c:

Go to the source code of this file.

Functions

int B2getic (GENmodel *inModel, CKTcircuit *ckt)
 

Function Documentation

int B2getic ( GENmodel inModel,
CKTcircuit ckt 
)

Definition at line 15 of file b2getic.c.

19 {
20 
21  B2model *model = (B2model*)inModel;
22  B2instance *here;
23  /*
24  * grab initial conditions out of rhs array. User specified, so use
25  * external nodes to get values
26  */
27 
28  for( ; model ; model = model->B2nextModel) {
29  for(here = model->B2instances; here ; here = here->B2nextInstance) {
30  if(!here->B2icVBSGiven) {
31  here->B2icVBS =
32  *(ckt->CKTrhs + here->B2bNode) -
33  *(ckt->CKTrhs + here->B2sNode);
34  }
35  if(!here->B2icVDSGiven) {
36  here->B2icVDS =
37  *(ckt->CKTrhs + here->B2dNode) -
38  *(ckt->CKTrhs + here->B2sNode);
39  }
40  if(!here->B2icVGSGiven) {
41  here->B2icVGS =
42  *(ckt->CKTrhs + here->B2gNode) -
43  *(ckt->CKTrhs + here->B2sNode);
44  }
45  }
46  }
47  return(OK);
48 }
B2instance * B2instances
Definition: bsim2def.h:226
struct sBSIM2instance * B2nextInstance
Definition: bsim2def.h:19
double B2icVBS
Definition: bsim2def.h:42
double B2icVGS
Definition: bsim2def.h:44
unsigned B2icVBSGiven
Definition: bsim2def.h:63
unsigned B2icVDSGiven
Definition: bsim2def.h:64
#define OK
Definition: iferrmsg.h:17
double B2icVDS
Definition: bsim2def.h:43
static char model[32]
Definition: subckt.c:76
struct sBSIM2model * B2nextModel
Definition: bsim2def.h:224
unsigned B2icVGSGiven
Definition: bsim2def.h:65
double * CKTrhs
Definition: cktdefs.h:97