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: UCB CAD Group
5          1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #ifndef SENS_DEFS
9 #define SENS_DEFS
10 
11 #include "analysis.h"
12 
13     /* structures used to describe an Adjoint Sensitivity analysis */
14 
15 
16 /* internal data */
17 struct sSENSint {
18     SMPmatrix *dY;
19     double *dIr, *dIi, *dIdYr, *dIdYi;
20     int size;
21     IFcomplex *o_cvalues;
22     double *o_values;
23 };
24 
25 
26 typedef struct st_output Output;
27 typedef struct st_nodes Nodes;
28 typedef struct st_paramsenlist ParamSenList;
29 typedef struct st_modsenlist ModSenList;
30 typedef struct st_devsenlist DevSenList;
31 
32 typedef struct {
33     int     JOBtype;
34     JOB     *JOBnextJob;   /* pointer to next thing to do */
35     char    *JOBname;      /* name of this job */
36 
37     DevSenList *first;
38 
39     CKTnode *SENSoutPos;   /* output positive node */
40     CKTnode *SENSoutNeg;   /* output reference node */
41     IFuid   SENSoutSrc;    /* output source UID */
42     GENERIC *SENSoutSrcDev;/* pointer to output device */
43     char    *SENSoutName;  /* name of output, e.g. v(1,2) */
44     double  SENSdefTol;    /* default tolerance */
45     double  SENSdefPert;   /* default perturbation */
46     unsigned SENSpct :1;   /* flag to indicate pct change */
47     GENERIC *SENSplot;     /* pointer to plot */
48     struct sSENSint ST;    /* internal variables, pass to subroutines */
49     struct sACprms AC;     /* AC parameter storage */
50     struct sDCTprms DC;    /* DC parameter storage */
51 
52 } SENSAN;
53 
54 struct st_output {
55     int     type;
56     int     pos, neg;
57 };
58 
59 struct st_nodes {
60     int     pos, neg;
61 };
62 
63 struct st_paramsenlist {
64     ParamSenList *next;
65     int     param_no;
66     double  delta, tol;
67 };
68 
69 struct st_modsenlist {
70     ModSenList *next;
71     int     mod_no;
72     ParamSenList *first;
73 };
74 
75 struct st_devsenlist {
76     DevSenList *next;
77     int     dev_no;
78     ModSenList *first;
79 };
80 
81 
82 #define    SENS_POS         2
83 #define    SENS_NEG         3
84 #define    SENS_SRC         4
85 #define    SENS_NAME        5
86 #define    SENS_DEFTOL      6
87 #define    SENS_DEFPERT     7
88 #define    SENS_DEFPERTURB  8
89 #define    SENS_DEVDEFTOL   9
90 #define    SENS_DEVDEFPERT  10
91 #define    SENS_TYPE        11
92 #define    SENS_DEVICE      12
93 #define    SENS_PARAM       13
94 #define    SENS_TOL         14
95 #define    SENS_PERT        15
96 
97 
98 #ifdef __STDC__
99 extern int SENSan(GENERIC*,int);
100 extern int SENSaskQuest(GENERIC*,GENERIC*,int,IFvalue*);
101 extern int SENSparse(GENERIC*,GENERIC*,int,GENERIC*,char**,GENERIC*,GENERIC*);
102 extern int SENSsetParm(GENERIC*,GENERIC*,int,IFvalue*);
103 #else
104 extern int SENSan();
105 extern int SENSaskQuest();
106 extern int SENSparse();
107 extern int SENSsetParm();
108 #endif
109 
110 
111 #endif /* DEFS */
112 
113