Jspice3
tradefs.h
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3e2 - 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 TRA
9 #define TRA
10 
11 #include "devdefs.h"
12 
13  /* definitions used to describe transmission liness */
14 
15 
16 /* information used to describe a single instance */
17 
18 typedef struct sTRAinstance {
19  struct sTRAmodel *TRAmodPtr; /* backpointer to model */
20  struct sTRAinstance *TRAnextInstance; /* pointer to next instance of
21  * current model*/
22  IFuid TRAname; /* pointer to character string naming this instance */
23  int TRAstate;
24  int TRAposNode1; /* number of positive node of end 1 of t. line */
25  int TRAnegNode1; /* number of negative node of end 1 of t. line */
26  int TRAposNode2; /* number of positive node of end 2 of t. line */
27  int TRAnegNode2; /* number of negative node of end 2 of t. line */
28  int TRAintNode1; /* number of internal node of end 1 of t. line */
29  int TRAintNode2; /* number of internal node of end 2 of t. line */
30  double TRAimped; /* impedance - input */
31  double TRAconduct; /* conductance - calculated */
32  double TRAtd; /* propagation delay */
33  double TRAnl; /* normalized length */
34  double TRAf; /* frequency at which nl is measured */
35  double TRAinput1; /* accumulated excitation for port 1 */
36  double TRAinput2; /* accumulated excitation for port 2 */
37  double TRAinitVolt1; /* initial condition: voltage on port 1 */
38  double TRAinitCur1; /* initial condition: current at port 1 */
39  double TRAinitVolt2; /* initial condition: voltage on port 2 */
40  double TRAinitCur2; /* initial condition: current at port 2 */
41  double TRAreltol; /* relative deriv. tol. for breakpoint setting */
42  double TRAabstol; /* absolute deriv. tol. for breakpoint setting */
43  double *TRAdelays; /* delayed values of excitation */
44  int TRAsizeDelay; /* size of active delayed table */
45  int TRAallocDelay; /* allocated size of delayed table */
46  int TRAbrEq1; /* number of branch equation for end 1 of t. line */
47  int TRAbrEq2; /* number of branch equation for end 2 of t. line */
48  double *TRAibr1Ibr2Ptr; /* pointer to sparse matrix */
49  double *TRAibr1Int1Ptr; /* pointer to sparse matrix */
50  double *TRAibr1Neg1Ptr; /* pointer to sparse matrix */
51  double *TRAibr1Neg2Ptr; /* pointer to sparse matrix */
52  double *TRAibr1Pos2Ptr; /* pointer to sparse matrix */
53  double *TRAibr2Ibr1Ptr; /* pointer to sparse matrix */
54  double *TRAibr2Int2Ptr; /* pointer to sparse matrix */
55  double *TRAibr2Neg1Ptr; /* pointer to sparse matrix */
56  double *TRAibr2Neg2Ptr; /* pointer to sparse matrix */
57  double *TRAibr2Pos1Ptr; /* pointer to sparse matrix */
58  double *TRAint1Ibr1Ptr; /* pointer to sparse matrix */
59  double *TRAint1Int1Ptr; /* pointer to sparse matrix */
60  double *TRAint1Pos1Ptr; /* pointer to sparse matrix */
61  double *TRAint2Ibr2Ptr; /* pointer to sparse matrix */
62  double *TRAint2Int2Ptr; /* pointer to sparse matrix */
63  double *TRAint2Pos2Ptr; /* pointer to sparse matrix */
64  double *TRAneg1Ibr1Ptr; /* pointer to sparse matrix */
65  double *TRAneg2Ibr2Ptr; /* pointer to sparse matrix */
66  double *TRApos1Int1Ptr; /* pointer to sparse matrix */
67  double *TRApos1Pos1Ptr; /* pointer to sparse matrix */
68  double *TRApos2Int2Ptr; /* pointer to sparse matrix */
69  double *TRApos2Pos2Ptr; /* pointer to sparse matrix */
70  unsigned TRAimpedGiven : 1; /* flag to indicate impedence was specified */
71  unsigned TRAtdGiven : 1; /* flag to indicate delay was specified */
72  unsigned TRAnlGiven : 1; /* flag to indicate norm length was specified */
73  unsigned TRAfGiven : 1; /* flag to indicate freq was specified */
74  unsigned TRAicV1Given : 1; /* flag to ind. init. voltage at port 1 given */
75  unsigned TRAicC1Given : 1; /* flag to ind. init. current at port 1 given */
76  unsigned TRAicV2Given : 1; /* flag to ind. init. voltage at port 2 given */
77  unsigned TRAicC2Given : 1; /* flag to ind. init. current at port 2 given */
78  unsigned TRAreltolGiven:1; /* flag to ind. relative deriv. tol. given */
79  unsigned TRAabstolGiven:1; /* flag to ind. absolute deriv. tol. given */
80 } TRAinstance ;
81 
82 
83 /* per model data */
84 
85 typedef struct sTRAmodel { /* model structure for a transmission lines */
86  int TRAmodType; /* type index of this device type */
87  struct sTRAmodel *TRAnextModel; /* pointer to next possible model in
88  * linked list */
89  TRAinstance * TRAinstances; /* pointer to list of instances that have this
90  * model */
91  IFuid TRAmodName; /* pointer to character string naming this model */
92 } TRAmodel;
93 
94 /* device parameters */
95 #define TRA_Z0 1
96 #define TRA_TD 2
97 #define TRA_NL 3
98 #define TRA_FREQ 4
99 #define TRA_V1 5
100 #define TRA_I1 6
101 #define TRA_V2 7
102 #define TRA_I2 8
103 #define TRA_IC 9
104 #define TRA_RELTOL 10
105 #define TRA_ABSTOL 11
106 #define TRA_POS_NODE1 12
107 #define TRA_NEG_NODE1 13
108 #define TRA_POS_NODE2 14
109 #define TRA_NEG_NODE2 15
110 #define TRA_INPUT1 16
111 #define TRA_INPUT2 17
112 #define TRA_DELAY 18
113 #define TRA_BR_EQ1 19
114 #define TRA_BR_EQ2 20
115 #define TRA_INT_NODE1 21
116 #define TRA_INT_NODE2 22
117 
118 
119 #ifdef __STDC__
120 
121 extern int TRAacLoad(GENmodel*,CKTcircuit*);
122 extern int TRAaccept(CKTcircuit*,GENmodel*);
123 extern int TRAask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*);
124 extern int TRAload(GENmodel*,CKTcircuit*);
125 extern int TRAmAsk(CKTcircuit*,GENmodel*,int,IFvalue*);
126 extern int TRAparam(CKTcircuit*,int,IFvalue*,GENinstance*,IFvalue*);
127 extern void TRAparse(int,GENERIC*,GENERIC*,GENERIC*);
128 extern int TRAsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
129 extern int TRAtemp(GENmodel*,CKTcircuit*);
130 extern int TRAtrunc(GENmodel*,CKTcircuit*,double*);
131 
132 #else /* stdc */
133 
134 extern int TRAacLoad();
135 extern int TRAaccept();
136 extern int TRAask();
137 extern int TRAload();
138 extern int TRAmAsk();
139 extern int TRAparam();
140 extern void TRAparse();
141 extern int TRAsetup();
142 extern int TRAtemp();
143 extern int TRAtrunc();
144 
145 #endif /* stdc */
146 
147 #endif /*TRA*/
148 
double * TRAibr1Neg1Ptr
Definition: tradefs.h:50
IFuid TRAmodName
Definition: tradefs.h:91
struct sTRAinstance * TRAnextInstance
Definition: tradefs.h:20
TRAinstance * TRAinstances
Definition: tradefs.h:89
struct sTRAmodel * TRAmodPtr
Definition: tradefs.h:19
int TRAallocDelay
Definition: tradefs.h:45
double * TRAint1Pos1Ptr
Definition: tradefs.h:60
int TRAmodType
Definition: tradefs.h:86
double TRAinitVolt2
Definition: tradefs.h:39
unsigned TRAtdGiven
Definition: tradefs.h:71
int TRAbrEq1
Definition: tradefs.h:46
int TRAsetup()
struct sTRAmodel * TRAnextModel
Definition: tradefs.h:87
double TRAimped
Definition: tradefs.h:30
double TRAinitCur1
Definition: tradefs.h:38
int TRAintNode1
Definition: tradefs.h:28
unsigned TRAimpedGiven
Definition: tradefs.h:70
double * TRApos2Pos2Ptr
Definition: tradefs.h:69
double TRAtd
Definition: tradefs.h:32
unsigned TRAicV1Given
Definition: tradefs.h:74
int TRAsizeDelay
Definition: tradefs.h:44
double * TRApos1Pos1Ptr
Definition: tradefs.h:67
int TRAmAsk()
double TRAnl
Definition: tradefs.h:33
int TRAnegNode1
Definition: tradefs.h:25
double * TRAint2Pos2Ptr
Definition: tradefs.h:63
int TRAposNode1
Definition: tradefs.h:24
void TRAparse()
double * TRAint1Int1Ptr
Definition: tradefs.h:59
double TRAf
Definition: tradefs.h:34
double TRAreltol
Definition: tradefs.h:41
int TRAacLoad()
double * TRAibr2Ibr1Ptr
Definition: tradefs.h:53
double * TRAibr2Neg2Ptr
Definition: tradefs.h:56
int TRAtemp()
GENERIC * IFuid
Definition: ifsim.h:72
int TRAnegNode2
Definition: tradefs.h:27
struct sTRAmodel TRAmodel
double TRAinitVolt1
Definition: tradefs.h:37
double * TRAibr1Pos2Ptr
Definition: tradefs.h:52
unsigned TRAfGiven
Definition: tradefs.h:73
double * TRAibr2Pos1Ptr
Definition: tradefs.h:57
double * TRAibr1Ibr2Ptr
Definition: tradefs.h:48
double TRAinput2
Definition: tradefs.h:36
unsigned TRAnlGiven
Definition: tradefs.h:72
unsigned TRAicV2Given
Definition: tradefs.h:76
double TRAabstol
Definition: tradefs.h:42
double * TRAibr1Int1Ptr
Definition: tradefs.h:49
unsigned TRAabstolGiven
Definition: tradefs.h:79
double * TRAibr2Neg1Ptr
Definition: tradefs.h:55
unsigned TRAreltolGiven
Definition: tradefs.h:78
int TRAparam()
double * TRAneg1Ibr1Ptr
Definition: tradefs.h:64
IFuid TRAname
Definition: tradefs.h:22
double TRAconduct
Definition: tradefs.h:31
double TRAinitCur2
Definition: tradefs.h:40
double TRAinput1
Definition: tradefs.h:35
unsigned TRAicC2Given
Definition: tradefs.h:77
double * TRAibr1Neg2Ptr
Definition: tradefs.h:51
int TRAaccept()
unsigned TRAicC1Given
Definition: tradefs.h:75
double * TRAint2Ibr2Ptr
Definition: tradefs.h:61
int TRAtrunc()
double * TRApos1Int1Ptr
Definition: tradefs.h:66
double * TRAint2Int2Ptr
Definition: tradefs.h:62
double * TRAint1Ibr1Ptr
Definition: tradefs.h:58
double * TRAneg2Ibr2Ptr
Definition: tradefs.h:65
#define SMPmatrix
Definition: smpdefs.h:11
double * TRApos2Int2Ptr
Definition: tradefs.h:68
double * TRAdelays
Definition: tradefs.h:43
struct sTRAinstance TRAinstance
int TRAbrEq2
Definition: tradefs.h:47
int TRAstate
Definition: tradefs.h:23
int TRAposNode2
Definition: tradefs.h:26
int TRAload()
double * TRAibr2Int2Ptr
Definition: tradefs.h:54
int TRAintNode2
Definition: tradefs.h:29
char GENERIC
Definition: ifsim.h:27
int TRAask()