Jspice3
capsetup.c File Reference
#include "spice.h"
#include <stdio.h>
#include "capdefs.h"
#include "sperror.h"
#include "util.h"
Include dependency graph for capsetup.c:

Go to the source code of this file.

Functions

int CAPsetup (SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
 

Function Documentation

int CAPsetup ( SMPmatrix matrix,
GENmodel inModel,
CKTcircuit ckt,
int *  states 
)

Definition at line 17 of file capsetup.c.

26 {
27  CAPmodel *model = (CAPmodel*)inModel;
28  CAPinstance *here;
29 
30  /* loop through all the capacitor models */
31  for ( ; model != NULL; model = model->CAPnextModel) {
32 
33  /*Default Value Processing for Model Parameters */
34  if (!model->CAPcjGiven) {
35  model->CAPcj = 0;
36  }
37  if (!model->CAPcjswGiven){
38  model->CAPcjsw = 0;
39  }
40  if (!model->CAPdefWidthGiven) {
41  model->CAPdefWidth = 10.e-6;
42  }
43  if (!model->CAPnarrowGiven) {
44  model->CAPnarrow = 0;
45  }
46 
47  /* loop through all the instances of the model */
48  for (here = model->CAPinstances; here != NULL;
49  here = here->CAPnextInstance) {
50 
51  /* Default Value Processing for Capacitor Instance */
52  if (!here->CAPlengthGiven) {
53  here->CAPlength = 0;
54  }
55  TSTALLOC(CAPposPosptr,CAPposNode,CAPposNode)
56  TSTALLOC(CAPnegNegptr,CAPnegNode,CAPnegNode)
57  TSTALLOC(CAPposNegptr,CAPposNode,CAPnegNode)
58  TSTALLOC(CAPnegPosptr,CAPnegNode,CAPposNode)
59  here->CAPqcap = *states;
60  *states += 2;
61  }
62  }
63  return (OK);
64 }
unsigned CAPnarrowGiven
Definition: capdefs.h:67
struct sCAPinstance * CAPnextInstance
Definition: capdefs.h:21
#define CAPqcap
Definition: capdefs.h:72
unsigned CAPdefWidthGiven
Definition: capdefs.h:66
double CAPcjsw
Definition: capdefs.h:61
unsigned CAPlengthGiven
Definition: capdefs.h:47
unsigned CAPcjGiven
Definition: capdefs.h:64
double CAPcj
Definition: capdefs.h:60
#define TSTALLOC(ptr, first, second)
Definition: devdefs.h:124
CAPinstance * CAPinstances
Definition: capdefs.h:57
#define OK
Definition: iferrmsg.h:17
double CAPnarrow
Definition: capdefs.h:63
#define NULL
Definition: spdefs.h:121
unsigned CAPcjswGiven
Definition: capdefs.h:65
double CAPlength
Definition: capdefs.h:32
double CAPdefWidth
Definition: capdefs.h:62
static char model[32]
Definition: subckt.c:76
return(True)
struct sCAPmodel * CAPnextModel
Definition: capdefs.h:55