Jspice3
capdefs.h
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 Thomas L. Quarles
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #ifndef CAP
9 #define CAP
10 
11 
12 #include "devdefs.h"
13 
14  /* structures used to describe capacitors */
15 
16 
17 /* information to describe each instance */
18 
19 typedef struct sCAPinstance {
20  struct sCAPmodel *CAPmodPtr; /* backpointer to model */
21  struct sCAPinstance *CAPnextInstance; /* pointer to next instance of
22  * current model*/
23  IFuid CAPname; /* pointer to character string naming this instance */
24  int CAPstate; /* pointer to start of capacitor state vector */
25  int CAPposNode; /* number of positive node of capacitor */
26  int CAPnegNode; /* number of negative node of capacitor */
27  double CAPcapac; /* capacitance */
28  double CAPinitCond; /* initial capacitor voltage if specified */
29  double CAPceq; /* storage for ceq, rhs entry */
30  double CAPgeq; /* stroage for geq, matrix entry */
31  double CAPwidth; /* width of the capacitor */
32  double CAPlength; /* length of the capacitor */
33 
34  double *CAPposPosptr; /* pointer to sparse matrix diagonal at
35  * (positive,positive) */
36  double *CAPnegNegptr; /* pointer to sparse matrix diagonal at
37  * (negative,negative) */
38  double *CAPposNegptr; /* pointer to sparse matrix offdiagonal at
39  * (positive,negative) */
40  double *CAPnegPosptr; /* pointer to sparse matrix offdiagonal at
41  * (negative,positive) */
42 
43  /* flags to indicate... */
44  unsigned CAPcapGiven : 1; /* capacitance was specified */
45  unsigned CAPicGiven : 1; /* init. condition was specified */
46  unsigned CAPwidthGiven : 1; /* capacitor width given */
47  unsigned CAPlengthGiven : 1; /* capacitor length given */
48 
49 } CAPinstance;
50 
51 /* data per model */
52 
53 typedef struct sCAPmodel { /* model structure for a capacitor */
54  int CAPmodType; /* type index of this device type */
55  struct sCAPmodel *CAPnextModel; /* pointer to next possible model in
56  * linked list */
57  CAPinstance * CAPinstances; /* pointer to list of instances that have this
58  * model */
59  IFuid CAPmodName; /* pointer to character string naming this model */
60  double CAPcj; /* Unit Area Capacitance ( F/ M**2 ) */
61  double CAPcjsw; /* Unit Length Sidewall Capacitance ( F / M ) */
62  double CAPdefWidth; /* the default width of a capacitor */
63  double CAPnarrow; /* amount by which length/width are less than drawn */
64  unsigned CAPcjGiven : 1; /* Unit Area Capacitance ( F/ M**2 ) */
65  unsigned CAPcjswGiven : 1; /* Unit Length Sidewall Capacitance(F/M) */
66  unsigned CAPdefWidthGiven : 1; /* flag indicates default width given*/
67  unsigned CAPnarrowGiven : 1; /* flag indicates narrowing factor given */
68 
69 } CAPmodel;
70 
71 
72 #define CAPqcap CAPstate /* charge on the capacitor */
73 #define CAPccap CAPstate+1 /* current through the capacitor */
74 
75 /* device parameters */
76 #define CAP_CAP 1
77 #define CAP_IC 2
78 #define CAP_WIDTH 3
79 #define CAP_LENGTH 4
80 #define CAP_CURRENT 5
81 #define CAP_POWER 6
82 
83 /* model parameters */
84 #define CAP_MOD_CJ 101
85 #define CAP_MOD_CJSW 102
86 #define CAP_MOD_DEFWIDTH 103
87 #define CAP_MOD_C 104
88 #define CAP_MOD_NARROW 105
89 
90 
91 #ifdef __STDC__
92 
93 extern int CAPacLoad(GENmodel*,CKTcircuit*);
94 extern int CAPask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*);
95 extern int CAPgetic(GENmodel*,CKTcircuit*);
96 extern int CAPload(GENmodel*,CKTcircuit*);
97 extern int CAPmAsk(CKTcircuit*,GENmodel*,int,IFvalue*);
98 extern int CAPmParam(int,IFvalue*,GENmodel*);
99 extern int CAPparam(CKTcircuit*,int,IFvalue*,GENinstance*,IFvalue*);
100 extern void CAPparse(int,GENERIC*,GENERIC*,GENERIC*);
101 extern int CAPpzLoad(GENmodel*,CKTcircuit*,SPcomplex*);
102 extern int CAPsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
103 extern int CAPtemp(GENmodel*,CKTcircuit*);
104 extern int CAPtrunc(GENmodel*,CKTcircuit*,double*);
105 
106 #else /* stdc */
107 
108 extern int CAPacLoad();
109 extern int CAPask();
110 extern int CAPgetic();
111 extern int CAPload();
112 extern int CAPmAsk();
113 extern int CAPmParam();
114 extern int CAPparam();
115 extern void CAPparse();
116 extern int CAPpzLoad();
117 extern int CAPsetup();
118 extern int CAPtemp();
119 extern int CAPtrunc();
120 
121 #endif /* stdc */
122 
123 
124 #endif /*CAP*/
int CAPtrunc()
int CAPsetup()
int CAPnegNode
Definition: capdefs.h:26
int CAPtemp()
int CAPpzLoad()
unsigned CAPnarrowGiven
Definition: capdefs.h:67
struct sCAPmodel * CAPmodPtr
Definition: capdefs.h:20
double * CAPnegPosptr
Definition: capdefs.h:40
struct sCAPinstance * CAPnextInstance
Definition: capdefs.h:21
struct sCAPinstance CAPinstance
unsigned CAPdefWidthGiven
Definition: capdefs.h:66
double CAPceq
Definition: capdefs.h:29
int CAPload()
double CAPcjsw
Definition: capdefs.h:61
unsigned CAPlengthGiven
Definition: capdefs.h:47
double CAPgeq
Definition: capdefs.h:30
unsigned CAPcjGiven
Definition: capdefs.h:64
unsigned CAPicGiven
Definition: capdefs.h:45
double CAPcj
Definition: capdefs.h:60
double * CAPposNegptr
Definition: capdefs.h:38
CAPinstance * CAPinstances
Definition: capdefs.h:57
double CAPwidth
Definition: capdefs.h:31
GENERIC * IFuid
Definition: ifsim.h:72
double * CAPposPosptr
Definition: capdefs.h:34
double CAPnarrow
Definition: capdefs.h:63
int CAPstate
Definition: capdefs.h:24
int CAPposNode
Definition: capdefs.h:25
double CAPinitCond
Definition: capdefs.h:28
unsigned CAPcjswGiven
Definition: capdefs.h:65
double CAPlength
Definition: capdefs.h:32
int CAPmParam()
IFuid CAPmodName
Definition: capdefs.h:59
double CAPdefWidth
Definition: capdefs.h:62
int CAPmodType
Definition: capdefs.h:54
int CAPgetic()
double * CAPnegNegptr
Definition: capdefs.h:36
int CAPask()
int CAPmAsk()
unsigned CAPcapGiven
Definition: capdefs.h:44
int CAPparam()
IFuid CAPname
Definition: capdefs.h:23
unsigned CAPwidthGiven
Definition: capdefs.h:46
#define SMPmatrix
Definition: smpdefs.h:11
double CAPcapac
Definition: capdefs.h:27
void CAPparse()
int CAPacLoad()
struct sCAPmodel * CAPnextModel
Definition: capdefs.h:55
struct sCAPmodel CAPmodel
char GENERIC
Definition: ifsim.h:27