Jspice3
diodefs.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 DIO
9 #define DIO
10 
11 #include "devdefs.h"
12 
13  /* data structures used to describe diodes */
14 
15 
16 /* information needed per instance */
17 
18 typedef struct sDIOinstance {
19  struct sDIOmodel *DIOmodPtr; /* backpointer to model */
20  struct sDIOinstance *DIOnextInstance; /* pointer to next instance of
21  * current model*/
22  IFuid DIOname; /* pointer to character string naming this instance */
23  int DIOstate; /* pointer to start of state vector for diode */
24  int DIOposNode; /* number of positive node of diode */
25  int DIOnegNode; /* number of negative node of diode */
26  int DIOposPrimeNode;/* number of positive prime node of diode */
27  double *DIOposPosPrimePtr; /* pointer to sparse matrix at
28  * (positive,positive prime) */
29  double *DIOnegPosPrimePtr; /* pointer to sparse matrix at
30  * (negative,positive prime) */
31  double *DIOposPrimePosPtr; /* pointer to sparse matrix at
32  * (positive prime,positive) */
33  double *DIOposPrimeNegPtr; /* pointer to sparse matrix at
34  * (positive prime,negative) */
35  double *DIOposPosPtr; /* pointer to sparse matrix at
36  * (positive,positive) */
37  double *DIOnegNegPtr; /* pointer to sparse matrix at
38  * (negative,negative) */
39  double *DIOposPrimePosPrimePtr; /* pointer to sparse matrix at
40  * (positive prime,positive prime) */
41 
42  unsigned DIOoff : 1; /* 'off' flag for diode */
43  unsigned DIOareaGiven : 1; /* flag to indicate area was specified */
44  unsigned DIOinitCondGiven : 1;/* flag to indicate ic was specified */
45  unsigned DIOtempGiven : 1; /* flag to indicate temperature was specified */
46 
47 
48  double DIOarea; /* area factor for the diode */
49  double DIOinitCond; /* initial condition */
50  double DIOtemp; /* temperature of the instance */
51  double DIOtJctPot; /* temperature adjusted junction potential */
52  double DIOtJctCap; /* temperature adjusted junction capacitance */
53  double DIOtDepCap; /* temperature adjusted transition point in */
54  /* the curve matching (Fc * Vj ) */
55  double DIOtSatCur; /* temperature adjusted saturation current */
56  double DIOtVcrit; /* temperature adjusted V crit */
57  double DIOtF1; /* temperature adjusted f1 */
58  double DIOtBrkdwnV; /* temperature adjusted breakdown voltage */
59  double DIOvte;
60  double DIOcd; /* diode current */
61  double DIOgd; /* diode conductance */
62  double DIOcap; /* diode capacitance */
63  double DIOvd; /* temporary diode voltage */
64 
65 /*
66  * naming convention:
67  * x = vdiode
68  */
69 
70 /* the following are relevant to s.s. sinusoidal distortion analysis */
71 
72 #define DIONDCOEFFS 6
73 
74 #ifndef NODISTO
76 #else /* NODISTO */
77  double *DIOdCoeffs;
78 #endif /* NODISTO */
79 
80 #ifndef CONFIG
81 
82 #define id_x2 DIOdCoeffs[0]
83 #define id_x3 DIOdCoeffs[1]
84 #define cdif_x2 DIOdCoeffs[2]
85 #define cdif_x3 DIOdCoeffs[3]
86 #define cjnc_x2 DIOdCoeffs[4]
87 #define cjnc_x3 DIOdCoeffs[5]
88 
89 #endif
90 
91 /* indices to array of diode noise sources */
92 
93 #define DIORSNOIZ 0
94 #define DIOIDNOIZ 1
95 #define DIOFLNOIZ 2
96 #define DIOTOTNOIZ 3
97 
98 #define DIONSRCS 4
99 
100 #ifndef NONOISE
102 #else /* NONOISE */
103  double **DIOnVar;
104 #endif /* NONOISE */
105 
106 } DIOinstance ;
107 
108 
109 #define DIOvoltage DIOstate
110 #define DIOcapCharge DIOstate+1
111 #define DIOcapCurrent DIOstate+2
112 
113 #define DIOnumStates 3
114 
115 /* per model data */
116 
117 typedef struct sDIOmodel { /* model structure for a diode */
118  int DIOmodType; /* type index of this device type */
119  struct sDIOmodel *DIOnextModel; /* pointer to next possible model in
120  * linked list */
121  DIOinstance * DIOinstances; /* pointer to list of instances
122  * that have this model */
123  IFuid DIOmodName; /* pointer to character string naming this model */
124 
125  unsigned DIOsatCurGiven : 1;
126  unsigned DIOresistGiven : 1;
127  unsigned DIOemissionCoeffGiven : 1;
128  unsigned DIOtransitTimeGiven : 1;
129  unsigned DIOjunctionCapGiven : 1;
130  unsigned DIOjunctionPotGiven : 1;
131  unsigned DIOgradingCoeffGiven : 1;
137  unsigned DIOnomTempGiven : 1;
138  unsigned DIOfNcoefGiven : 1;
139  unsigned DIOfNexpGiven : 1;
140 
141  double DIOsatCur; /* saturation current */
142  double DIOresist; /* ohmic series resistance */
143  double DIOconductance; /* conductance corresponding to ohmic R */
144  double DIOemissionCoeff;/* emission coefficient (N) */
145  double DIOtransitTime; /* transit time (TT) */
146  double DIOjunctionCap; /* Junction Capacitance (Cj0) */
147  double DIOjunctionPot; /* Junction Potential (Vj) or (PB) */
148  double DIOgradingCoeff; /* grading coefficient (m) */
149  double DIOactivationEnergy; /* activation energy (EG) */
150  double DIOsaturationCurrentExp; /* Saturation current exponential (XTI) */
151  double DIOdepletionCapCoeff;/* Depletion Cap fraction coefficient (FC)*/
152  double DIObreakdownVoltage; /* Voltage at reverse breakdown */
153  double DIObreakdownCurrent; /* Current at above voltage */
154  double DIOf2; /* coefficient for capacitance equation precomputation */
155  double DIOf3; /* coefficient for capacitance equation precomputation */
156  double DIOnomTemp; /* nominal temperature (temp at which parms measured */
157  double DIOfNcoef;
158  double DIOfNexp;
159 
160 
161 } DIOmodel;
162 
163 
164 /* device parameters */
165 #define DIO_AREA 1
166 #define DIO_IC 2
167 #define DIO_OFF 3
168 #define DIO_CURRENT 4
169 #define DIO_VOLTAGE 5
170 #define DIO_CHARGE 6
171 #define DIO_CAPCUR 7
172 #define DIO_CONDUCT 8
173 #define DIO_POWER 9
174 #define DIO_TEMP 10
175 #define DIO_CAP 11
176 
177 
178 /* model parameters */
179 #define DIO_MOD_IS 101
180 #define DIO_MOD_RS 102
181 #define DIO_MOD_N 103
182 #define DIO_MOD_TT 104
183 #define DIO_MOD_CJO 105
184 #define DIO_MOD_VJ 106
185 #define DIO_MOD_M 107
186 #define DIO_MOD_EG 108
187 #define DIO_MOD_XTI 109
188 #define DIO_MOD_FC 110
189 #define DIO_MOD_BV 111
190 #define DIO_MOD_IBV 112
191 #define DIO_MOD_D 113
192 #define DIO_MOD_COND 114
193 #define DIO_MOD_TNOM 115
194 #define DIO_MOD_KF 116
195 #define DIO_MOD_AF 117
196 
197 
198 #ifdef __STDC__
199 
200 extern int DIOacLoad(GENmodel*,CKTcircuit*);
201 extern int DIOask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*);
202 extern int DIOconvTest(GENmodel *,CKTcircuit*);
203 extern int DIOdisto(int,GENmodel*,CKTcircuit*);
204 extern int DIOgetic(GENmodel*,CKTcircuit*);
205 extern int DIOload(GENmodel*,CKTcircuit*);
206 extern int DIOmAsk(CKTcircuit*,GENmodel*,int,IFvalue*);
207 extern int DIOmParam(int,IFvalue*,GENmodel*);
208 extern int DIOnoise(int,int,GENmodel*,CKTcircuit*,GENERIC*,double*);
209 extern int DIOparam(CKTcircuit*,int,IFvalue*,GENinstance*,IFvalue*);
210 extern void DIOparse(int,GENERIC*,GENERIC*,GENERIC*);
211 extern int DIOpzLoad(GENmodel*,CKTcircuit*,SPcomplex*);
212 extern int DIOsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
213 extern int DIOtemp(GENmodel*,CKTcircuit*);
214 extern int DIOtrunc(GENmodel*,CKTcircuit*,double*);
215 
216 #else /* stdc */
217 
218 extern int DIOacLoad();
219 extern int DIOask();
220 extern int DIOconvTest();
221 extern int DIOdisto();
222 extern int DIOgetic();
223 extern int DIOload();
224 extern int DIOmAsk();
225 extern int DIOmParam();
226 extern int DIOnoise();
227 extern int DIOparam();
228 extern void DIOparse();
229 extern int DIOpzLoad();
230 extern int DIOsetup();
231 extern int DIOtemp();
232 extern int DIOtrunc();
233 
234 #endif /* stdc */
235 
236 
237 #endif /*DIO*/
IFuid DIOmodName
Definition: diodefs.h:123
double DIOtDepCap
Definition: diodefs.h:53
double DIOactivationEnergy
Definition: diodefs.h:149
double DIOgd
Definition: diodefs.h:61
unsigned DIOdepletionCapCoeffGiven
Definition: diodefs.h:134
double DIOtBrkdwnV
Definition: diodefs.h:58
int DIOmodType
Definition: diodefs.h:118
unsigned DIOfNcoefGiven
Definition: diodefs.h:138
double DIOfNcoef
Definition: diodefs.h:157
unsigned DIOjunctionPotGiven
Definition: diodefs.h:130
unsigned DIObreakdownVoltageGiven
Definition: diodefs.h:135
double DIOvd
Definition: diodefs.h:63
struct sDIOinstance * DIOnextInstance
Definition: diodefs.h:20
unsigned DIOgradingCoeffGiven
Definition: diodefs.h:131
unsigned DIOresistGiven
Definition: diodefs.h:126
double DIOcd
Definition: diodefs.h:60
int DIOpzLoad()
double * DIOposPosPtr
Definition: diodefs.h:35
#define DIONSRCS
Definition: diodefs.h:98
double * DIOposPosPrimePtr
Definition: diodefs.h:27
int DIOconvTest()
int DIOnoise()
double * DIOposPrimePosPrimePtr
Definition: diodefs.h:39
int DIOgetic()
int DIOsetup()
double DIOtransitTime
Definition: diodefs.h:145
double DIOdCoeffs[DIONDCOEFFS]
Definition: diodefs.h:75
double DIOjunctionCap
Definition: diodefs.h:146
struct sDIOmodel * DIOmodPtr
Definition: diodefs.h:19
double DIOtSatCur
Definition: diodefs.h:55
double DIOdepletionCapCoeff
Definition: diodefs.h:151
double * DIOposPrimePosPtr
Definition: diodefs.h:31
double DIObreakdownVoltage
Definition: diodefs.h:152
int DIOmAsk()
double DIOtemp
Definition: diodefs.h:50
double DIOconductance
Definition: diodefs.h:143
unsigned DIOsatCurGiven
Definition: diodefs.h:125
double * DIOnegPosPrimePtr
Definition: diodefs.h:29
unsigned DIOareaGiven
Definition: diodefs.h:43
DIOinstance * DIOinstances
Definition: diodefs.h:121
GENERIC * IFuid
Definition: ifsim.h:72
unsigned DIOoff
Definition: diodefs.h:42
double DIOsaturationCurrentExp
Definition: diodefs.h:150
unsigned DIOfNexpGiven
Definition: diodefs.h:139
double * DIOposPrimeNegPtr
Definition: diodefs.h:33
unsigned DIOinitCondGiven
Definition: diodefs.h:44
double DIOfNexp
Definition: diodefs.h:158
double DIOemissionCoeff
Definition: diodefs.h:144
double * DIOnegNegPtr
Definition: diodefs.h:37
int DIOposPrimeNode
Definition: diodefs.h:26
double DIOtF1
Definition: diodefs.h:57
int DIOdisto()
struct sDIOmodel * DIOnextModel
Definition: diodefs.h:119
double DIOnVar[NSTATVARS][DIONSRCS]
Definition: diodefs.h:101
int DIOtrunc()
unsigned DIOemissionCoeffGiven
Definition: diodefs.h:127
unsigned DIOsaturationCurrentExpGiven
Definition: diodefs.h:133
double DIOtVcrit
Definition: diodefs.h:56
unsigned DIOnomTempGiven
Definition: diodefs.h:137
unsigned DIOtempGiven
Definition: diodefs.h:45
struct sDIOinstance DIOinstance
double DIOcap
Definition: diodefs.h:62
unsigned DIOtransitTimeGiven
Definition: diodefs.h:128
double DIOvte
Definition: diodefs.h:59
int DIOmParam()
unsigned DIObreakdownCurrentGiven
Definition: diodefs.h:136
double DIOf2
Definition: diodefs.h:154
double DIObreakdownCurrent
Definition: diodefs.h:153
IFuid DIOname
Definition: diodefs.h:22
int DIOload()
int DIOnegNode
Definition: diodefs.h:25
int DIOstate
Definition: diodefs.h:23
double DIOnomTemp
Definition: diodefs.h:156
int DIOask()
int DIOposNode
Definition: diodefs.h:24
double DIOjunctionPot
Definition: diodefs.h:147
double DIOarea
Definition: diodefs.h:48
#define DIONDCOEFFS
Definition: diodefs.h:72
#define NSTATVARS
Definition: cktdefs.h:21
#define SMPmatrix
Definition: smpdefs.h:11
int DIOacLoad()
unsigned DIOactivationEnergyGiven
Definition: diodefs.h:132
double DIOtJctCap
Definition: diodefs.h:52
double DIOsatCur
Definition: diodefs.h:141
double DIOtJctPot
Definition: diodefs.h:51
double DIOresist
Definition: diodefs.h:142
double DIOgradingCoeff
Definition: diodefs.h:148
void DIOparse()
unsigned DIOjunctionCapGiven
Definition: diodefs.h:129
int DIOparam()
char GENERIC
Definition: ifsim.h:27
double DIOinitCond
Definition: diodefs.h:49
struct sDIOmodel DIOmodel
double DIOf3
Definition: diodefs.h:155