Xyce  6.1
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-2015 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.28.2.1 $
42 //
43 // Revision Date : $Date: 2015/04/02 18:20:09 $
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 // noise constants:
56 #define N_MINLOG 1E-38 // the smallest number we can take the log of
57 
58 namespace Xyce {
59 namespace Device {
60 
62 
64 {
65 public:
66 
67  void lambertw (double x, double &w, int &ierr, double &xi);
68 
69  double limvds ( double vnew, double vold);
70 
71  double pnjlim ( double vnew, double vold, double vt, double vcrit,
72  int *icheck);
73 
74  double pnjlim_new ( double vnew, double vold, double vt, double vcrit,
75  int *icheck);
76 
77  double fetlim ( double vnew, double vold, double vto);
78 
79  void cmeyer
80  (
81  double vgs0, // initial voltage gate-source
82  double vgd0, // initial voltage gate-drain
83  double vgb0, // initial voltage gate-bulk
84  double von0,
85  double vdsat0,
86  double vgs1, // final voltage gate-source
87  double vgd1, // final voltage gate-drain
88  double vgb1, // final voltage gate-bulk
89  double covlgs, // overlap capacitance gate-source
90  double covlgd, // overlap capacitance gate-drain
91  double covlgb, // overlap capacitance gate-bulk
92  register double *cgs,
93  register double *cgd,
94  register double *cgb,
95  double phi,
96  double cox,
97  double von,
98  double vdsat
99  );
100 
101  void qmeyer
102  (
103  double vgs, // initial voltage gate-source
104  double vgd, // initial voltage gate-drain
105  double vgb, // initial voltage gate-bulk
106  double von,
107  double vdsat,
108  double & capgs, // non-constant portion of g-s overlap capacitance
109  double & capgd, // non-constant portion of g-d overlap capacitance
110  double & capgb, // non-constant portion of g-b overlap capacitance
111  double phi,
112  double cox // oxide capactiance
113  );
114 
115 
116  //KRS, 2/8/08: Adding this new function to compute the partial
117  //derivatives of the Meyer capacitances as a function of various
118  //voltages.
119 
120  void qmeyerderivs
121  (
122  double vgs, // initial voltage gate-source
123  double vgd, // initial voltage gate-drain
124  double vgb, // initial voltage gate-bulk
125  double von,
126  double vdsat,
127  double & dcapgsdvgs, //partial deriv. of capgs with respect to vgs
128  double & dcapgsdvgb, //partial deriv. of capgs with respect to vgb
129  double & dcapgsdvgd, //partial deriv. of capgs with respect to vgd
130  double & dcapgddvgs, //partial deriv. of capgd with respect to vgs
131  double & dcapgddvgb, //partial deriv. of capgd with respect to vgb
132  double & dcapgddvgd, //partial deriv. of capgd with respect to vgd
133  double & dcapgbdvgs, //partial deriv. of capgb with respect to vgs
134  double & dcapgbdvgb, //partial deriv. of capgb with respect to vgb
135  double & dcapgbdvgd, //partial deriv. of capgb with respect to vgd
136  double phi,
137  double cox, // oxide capactiance
138  int Dtype //transistor type
139  );
140 
141  void noiseSupport (
142  double & noise,
143  double & lnNoise,
144  const int type,
145  const double param,
146  const double temp);
147 
148 #ifdef notdef
149  void cap (
150  register CKTcircuit *ckt,
151  double vgd,
152  double vgs,
153  double vgb,
154  double covlgd,
155  double covlgs,
156  double covlgb,
157  double capbd,
158  double capbs,
159  double cggb,
160  double cgdb,
161  double cgsb,
162  double cbgb,
163  double cbdb,
164  double cbsb,
165  double *gcggb,
166  double *gcgdb,
167  double *gcgsb,
168  double *gcbgb,
169  double *gcbdb,
170  double *gcbsb,
171  double *gcdgb,
172  double *gcddb,
173  double *gcdsb,
174  double *gcsgb,
175  double *gcsdb,
176  double *gcssb,
177  double qgate,
178  double qchan,
179  double qbulk,
180  double *qdrn,
181  double *qsrc,
182  double xqc);
183 
184 #endif
185 
186  double contVds (double vds, double alpha, double min = 0.3);
187 
188  double contVgst (double vgst, double alpha, double vgstConst = 3.0);
189 
190  int getGainScaleBlockID(int numBlocks); // For homotopy
191 
192  double getRandomPerturbation(); // For homotopy
193  int SetSeed(unsigned int seedIn); // to set the random seed for getRandomPerturbation().
194 
195  double Xexp(double, double &,double);
196 
197  int finiteNumberTest(const double x);
198 
199  void spline( std::vector<double> & x, std::vector<double> & y, std::vector<double> & y2);
200  void splint ( std::vector<double> & xa, std::vector<double> & ya, std::vector<double> & y2a,
201  double x_position, double & y_spline);
202 
203 #if 0
204  double pred ( CKTcircuit *ckt, int loct);
205 #endif
206 
207 protected:
208  // For block gainscale homotopy
209  Epetra_Util u;
210 };
211 
212 } // namespace Device
213 } // namespace Xyce
214 
215 #endif
216 
double pnjlim_new(double vnew, double vold, double vt, double vcrit, int *icheck)
double pnjlim(double vnew, double vold, double vt, double vcrit, int *icheck)
void qmeyer(double vgs, double vgd, double vgb, double von, double vdsat, double &capgs, double &capgd, double &capgb, double phi, double cox)
Pure virtual class to augment a linear system.
double fetlim(double vnew, double vold, double vto)
int SetSeed(unsigned int seedIn)
double contVgst(double vgst, double alpha, double vgstConst=3.0)
void splint(std::vector< double > &xa, std::vector< double > &ya, std::vector< double > &y2a, double x_position, double &y_spline)
void spline(std::vector< double > &x, std::vector< double > &y, std::vector< double > &y2)
double Xexp(double, double &, double)
int finiteNumberTest(const double x)
void qmeyerderivs(double vgs, double vgd, double vgb, double von, double vdsat, double &dcapgsdvgs, double &dcapgsdvgb, double &dcapgsdvgd, double &dcapgddvgs, double &dcapgddvgb, double &dcapgddvgd, double &dcapgbdvgs, double &dcapgbdvgb, double &dcapgbdvgd, double phi, double cox, int Dtype)
double limvds(double vnew, double vold)
int getGainScaleBlockID(int numBlocks)
void lambertw(double x, double &w, int &ierr, double &xi)
void noiseSupport(double &noise, double &lnNoise, const int type, const double param, const double temp)
double contVds(double vds, double alpha, double min=0.3)
void cmeyer(double vgs0, double vgd0, double vgb0, double von0, double vdsat0, double vgs1, double vgd1, double vgb1, double covlgs, double covlgd, double covlgb, register double *cgs, register double *cgd, register double *cgb, double phi, double cox, double von, double vdsat)