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

Go to the source code of this file.

Functions

int MOSgetic (GENmodel *inModel, CKTcircuit *ckt)
 

Function Documentation

int MOSgetic ( GENmodel inModel,
CKTcircuit ckt 
)

Definition at line 16 of file mosic.c.

20 {
21  MOSmodel *model = (MOSmodel *)inModel;
22  MOSinstance *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->MOSnextModel) {
29  for (here = model->MOSinstances; here;
30  here = here->MOSnextInstance) {
31 
32  if (!here->MOSicVBSGiven) {
33  here->MOSicVBS =
34  *(ckt->CKTrhs + here->MOSbNode) -
35  *(ckt->CKTrhs + here->MOSsNode);
36  }
37  if (!here->MOSicVDSGiven) {
38  here->MOSicVDS =
39  *(ckt->CKTrhs + here->MOSdNode) -
40  *(ckt->CKTrhs + here->MOSsNode);
41  }
42  if (!here->MOSicVGSGiven) {
43  here->MOSicVGS =
44  *(ckt->CKTrhs + here->MOSgNode) -
45  *(ckt->CKTrhs + here->MOSsNode);
46  }
47  }
48  }
49  return (OK);
50 }
struct sMOSmodel * MOSnextModel
Definition: mosdefs.h:274
MOSinstance * MOSinstances
Definition: mosdefs.h:276
unsigned MOSicVGSGiven
Definition: mosdefs.h:229
unsigned MOSicVDSGiven
Definition: mosdefs.h:228
int MOSsNode
Definition: mosdefs.h:27
#define OK
Definition: iferrmsg.h:17
int MOSgNode
Definition: mosdefs.h:26
double MOSicVBS
Definition: mosdefs.h:63
unsigned MOSicVBSGiven
Definition: mosdefs.h:227
int MOSdNode
Definition: mosdefs.h:25
double MOSicVGS
Definition: mosdefs.h:65
static char model[32]
Definition: subckt.c:76
int MOSbNode
Definition: mosdefs.h:28
struct sMOSinstance * MOSnextInstance
Definition: mosdefs.h:20
double * CKTrhs
Definition: cktdefs.h:97
double MOSicVDS
Definition: mosdefs.h:64