1 /********** 2 Copyright 1990 Regents of the University of California. All rights reserved. 3 **********/ 4 /* 5 * SENdefs.h - structures for sensitivity package 6 */ 7 8 #ifndef ngspice_SEN2DEFS_H 9 #define ngspice_SEN2DEFS_H 10 11 12 #include "ngspice/smpdefs.h" 13 #include "ngspice/jobdefs.h" 14 #include "ngspice/typedefs.h" 15 16 struct SENstruct { 17 int JOBtype; 18 JOB *JOBnextJob; /* pointer to next thing to do */ 19 char *JOBname; /* name of this job */ 20 21 int SENnumVal; /* length of the next two arrays */ 22 char **SENdevices; /* names of the devices to do sensetivity analysis of */ 23 char **SENparmNames;/* parameters of the above devices to do analysis wrt */ 24 25 unsigned int SENinitflag :1 ; /* indicates whether sensitivity structure*/ 26 /* is to be initialized */ 27 unsigned int SENicflag :1 ; /* indicates whether initial conditions 28 are specified for transient analysis */ 29 30 unsigned int SENstatus :1; /* indicates whether perturbation 31 is in progress*/ 32 unsigned int SENacpertflag :1; /* indictes whether the perturbation 33 is to be carried out in ac analysis 34 (is done only for first frequency )*/ 35 int SENmode; /* indicates the type of sensitivity analysis 36 reqired: DC, Transient, or AC */ 37 int SENparms; /* # of design parameters */ 38 double SENpertfac; /* perturbation factor (for active 39 devices )*/ 40 double **SEN_Sap; /* sensitivity matrix (DC and transient )*/ 41 double **SEN_RHS; /* RHS matrix (real part) 42 contains the sensitivity values after SMPsolve*/ 43 double **SEN_iRHS; /* RHS matrix (imag part ) 44 contains the sensitivity values after SMPsolve*/ 45 int SENsize; /* stores the number of rows of each of the above 46 three matrices */ 47 SMPmatrix *SEN_Jacmat; /* sensitivity Jacobian matrix, */ 48 double *SEN_parmVal; /* table containing values of design parameters */ 49 char **SEN_parmName; /* table containing names of design parameters */ 50 51 }; 52 53 /* SENmode */ 54 #define DCSEN 0x1 55 #define TRANSEN 0x2 56 #define ACSEN 0x4 57 58 #define NORMAL 0 59 #define PERTURBATION 1 60 #define OFF 0 61 #define ON 1 62 63 64 enum { 65 SEN_AC = 1, 66 SEN_DC, 67 SEN_TRAN, 68 SEN_DEV, 69 SEN_PARM, 70 }; 71 72 #endif 73