1 /**********
2 Copyright 1991 Regents of the University of California. All rights reserved.
3 Authors: 1987 Karti Mayaram, 1991 David Gates
4 **********/
5 
6 /* Member of CIDER device simulator
7  * Version: 1b1
8  */
9 
10 /*
11  * Two-Dimensional Numerical Device Data Structures
12  */
13 
14 #ifndef ngspice_TWODEV_H
15 #define ngspice_TWODEV_H
16 
17 #include "ngspice/gendev.h"
18 #include "ngspice/smpdefs.h"
19 
20 typedef struct sTWOdevice
21 {
22     double *dcSolution;                /* solution vector for device */
23     double *dcDeltaSolution;           /* delta solution vector */
24     double *copiedSolution;            /* copy of the solution vector */
25     double *rhs;                       /* rhs vector */
26     double *rhsImag;                   /* imaginary part of rhs vector */
27     SMPmatrix *matrix;                 /* matrix for device equations */
28     int solverType;                    /* what is matrix set up to do */
29     int dimEquil;                      /* dimension in equilibrium */
30     int numOrigEquil;                  /* orig number of nz's in equilibrium */
31     int numFillEquil;                  /* fill number of nz's in equilibrium */
32     int dimBias;                       /* dimension under bias */
33     int numOrigBias;                   /* orig number of nz's under bias */
34     int numFillBias;                   /* fill number of nz's under bias */
35     int numEqns;                       /* number of equations */
36     int poissonOnly;                   /* flag for Poisson eqn solution */
37     struct sTWOelem **elements;        /* 1D list of elements */
38     struct sTWOelem ***elemArray;      /* 2D list of elements for printing */
39     double **devStates;                /* device states */
40     double *xScale;                    /* array of X node locations */
41     double *yScale;                    /* array of Y node locations */
42     int numXNodes;                     /* number of X nodes */
43     int numYNodes;                     /* number of Y nodes */
44     int numNodes;                      /* total number of nodes */
45     int numEdges;                      /* total number of edges */
46     int numElems;                      /* total number of elements */
47     struct sTWOcontact *pFirstContact; /* first contact */
48     struct sTWOcontact *pLastContact;  /* last contact */
49     struct sTWOchannel *pChannel;      /* surface mobility channel */
50     struct sMaterialInfo *pMaterials;  /* temp-dep material information */
51     struct sStatInfo *pStats;          /* run-time statistics */
52     int converged;                     /* flag for device convergence */
53     int iterationNumber;               /* device iteration counter */
54     double width;                      /* device width in CM */
55     double rhsNorm;                    /* norm of rhs vector */
56     double abstol;                     /* absolute tolerance for device */
57     double reltol;                     /* relative tolerance for device */
58     char *name;	                       /* name of device */
59 } TWOdevice;
60 
61 #define devState0 devStates[0]
62 #define devState1 devStates[1]
63 #define devState2 devStates[2]
64 #define devState3 devStates[3]
65 #define devState4 devStates[4]
66 #define devState5 devStates[5]
67 #define devState6 devStates[6]
68 #define devState7 devStates[7]
69 
70 typedef struct sTWOcontact
71 {
72     struct sTWOcontact *next;       /* pointer to next contact */
73     struct sTWOnode **pNodes;	    /* pointer to the contact nodes */
74     int numNodes;                   /* number of nodes in contact */
75     int id;                         /* unique contact identifier */
76     double workf;                   /* metal work function */
77 } TWOcontact;
78 
79 /* Structure for channels.
80  * A channel is divided into 'columns' that are perpendicular to the
81  * channel's insulator/semiconductor interface.  Each column begins
82  * at its 'seed', the closest semiconductor element to the interface.
83  * It is assumed that the current flows parallel to the interface.
84  */
85 typedef struct sTWOchannel
86 {
87     struct sTWOchannel *next;      /* pointer to next channel */
88     struct sTWOelem *pSeed;        /* pointer to the seed element */
89     struct sTWOelem *pNElem;       /* pointer to the insulator element */
90     int id;                        /* unique channel identifier */
91     int type;                      /* ID of direction to interface */
92 } TWOchannel;
93 
94 struct mosConductances
95 {
96     double dIdDVdb;
97     double dIdDVsb;
98     double dIdDVgb;
99     double dIsDVdb;
100     double dIsDVsb;
101     double dIsDVgb;
102     double dIgDVdb;
103     double dIgDVsb;
104     double dIgDVgb;
105 };
106 
107 #endif
108