Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_DeviceSupport.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // Copyright Notice
3 //
4 // Copyright 2002 Sandia Corporation. Under the terms
5 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
6 // Government retains certain rights in this software.
7 //
8 // Xyce(TM) Parallel Electrical Simulator
9 // Copyright (C) 2002-2014 Sandia Corporation
10 //
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //-----------------------------------------------------------------------------
24 
25 //-------------------------------------------------------------------------
26 // Filename : $RCSfile: N_DEV_DeviceSupport.h,v $
27 //
28 // Purpose : This file contains the device support class. Most of the
29 // functions of this class are similar to those of devsup.c
30 // in 3f5.
31 //
32 // Special Notes :
33 //
34 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
35 //
36 // Creation Date : 01/17/01
37 //
38 // Revision Information:
39 // ---------------------
40 //
41 // Revision Number: $Revision: 1.26 $
42 //
43 // Revision Date : $Date: 2014/03/19 17:23:27 $
44 //
45 // Current Owner : $Author: tvrusso $
46 //-------------------------------------------------------------------------
47 
48 #ifndef Xyce_N_DEV_Device_Support_h
49 #define Xyce_N_DEV_Device_Support_h
50 
51 #include <Epetra_Util.h>
52 
53 #include <vector>
54 
55 namespace Xyce {
56 namespace Device {
57 
59 {
60 public:
61 
62  void lambertw (double x, double &w, int &ierr, double &xi);
63 
64  double limvds ( double vnew, double vold);
65 
66  double pnjlim ( double vnew, double vold, double vt, double vcrit,
67  int *icheck);
68 
69  double pnjlim_new ( double vnew, double vold, double vt, double vcrit,
70  int *icheck);
71 
72  double fetlim ( double vnew, double vold, double vto);
73 
74  void cmeyer
75  (
76  double vgs0, // initial voltage gate-source
77  double vgd0, // initial voltage gate-drain
78  double vgb0, // initial voltage gate-bulk
79  double von0,
80  double vdsat0,
81  double vgs1, // final voltage gate-source
82  double vgd1, // final voltage gate-drain
83  double vgb1, // final voltage gate-bulk
84  double covlgs, // overlap capacitance gate-source
85  double covlgd, // overlap capacitance gate-drain
86  double covlgb, // overlap capacitance gate-bulk
87  register double *cgs,
88  register double *cgd,
89  register double *cgb,
90  double phi,
91  double cox,
92  double von,
93  double vdsat
94  );
95 
96  void qmeyer
97  (
98  double vgs, // initial voltage gate-source
99  double vgd, // initial voltage gate-drain
100  double vgb, // initial voltage gate-bulk
101  double von,
102  double vdsat,
103  double & capgs, // non-constant portion of g-s overlap capacitance
104  double & capgd, // non-constant portion of g-d overlap capacitance
105  double & capgb, // non-constant portion of g-b overlap capacitance
106  double phi,
107  double cox // oxide capactiance
108  );
109 
110 
111  //KRS, 2/8/08: Adding this new function to compute the partial
112  //derivatives of the Meyer capacitances as a function of various
113  //voltages.
114 
115  void qmeyerderivs
116  (
117  double vgs, // initial voltage gate-source
118  double vgd, // initial voltage gate-drain
119  double vgb, // initial voltage gate-bulk
120  double von,
121  double vdsat,
122  double & dcapgsdvgs, //partial deriv. of capgs with respect to vgs
123  double & dcapgsdvgb, //partial deriv. of capgs with respect to vgb
124  double & dcapgsdvgd, //partial deriv. of capgs with respect to vgd
125  double & dcapgddvgs, //partial deriv. of capgd with respect to vgs
126  double & dcapgddvgb, //partial deriv. of capgd with respect to vgb
127  double & dcapgddvgd, //partial deriv. of capgd with respect to vgd
128  double & dcapgbdvgs, //partial deriv. of capgb with respect to vgs
129  double & dcapgbdvgb, //partial deriv. of capgb with respect to vgb
130  double & dcapgbdvgd, //partial deriv. of capgb with respect to vgd
131  double phi,
132  double cox, // oxide capactiance
133  int Dtype //transistor type
134  );
135 
136 
137 #ifdef notdef
138  void cap (
139  register CKTcircuit *ckt,
140  double vgd,
141  double vgs,
142  double vgb,
143  double covlgd,
144  double covlgs,
145  double covlgb,
146  double capbd,
147  double capbs,
148  double cggb,
149  double cgdb,
150  double cgsb,
151  double cbgb,
152  double cbdb,
153  double cbsb,
154  double *gcggb,
155  double *gcgdb,
156  double *gcgsb,
157  double *gcbgb,
158  double *gcbdb,
159  double *gcbsb,
160  double *gcdgb,
161  double *gcddb,
162  double *gcdsb,
163  double *gcsgb,
164  double *gcsdb,
165  double *gcssb,
166  double qgate,
167  double qchan,
168  double qbulk,
169  double *qdrn,
170  double *qsrc,
171  double xqc);
172 
173 #endif
174 
175  double contVds (double vds, double alpha, double min = 0.3);
176 
177  double contVgst (double vgst, double alpha, double vgstConst = 3.0);
178 
179  int getGainScaleBlockID(int numBlocks); // For homotopy
180 
181  double getRandomPerturbation(); // For homotopy
182  int SetSeed(unsigned int seedIn); // to set the random seed for getRandomPerturbation().
183 
184  double Xexp(double, double &,double);
185 
186  int finiteNumberTest(const double x);
187 
188  void spline( std::vector<double> & x, std::vector<double> & y, std::vector<double> & y2);
189  void splint ( std::vector<double> & xa, std::vector<double> & ya, std::vector<double> & y2a,
190  double x_position, double & y_spline);
191 
192 #if 0
193  double pred ( CKTcircuit *ckt, int loct);
194 #endif
195 
196 protected:
197  // For block gainscale homotopy
198  Epetra_Util u;
199 };
200 
201 } // namespace Device
202 } // namespace Xyce
203 
205 
206 #endif
207