Jspice3
b2getic.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1985 Hong June Park, Thomas L. Quarles
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "bsim2def.h"
11 #include "sperror.h"
12 
13 
14 int
15 B2getic(inModel,ckt)
16  GENmodel *inModel;
17  CKTcircuit *ckt;
18 
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 }
49 
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
int B2getic(GENmodel *inModel, CKTcircuit *ckt)
Definition: b2getic.c:15
unsigned B2icVGSGiven
Definition: bsim2def.h:65
double * CKTrhs
Definition: cktdefs.h:97