testing
[gnucap-felix.git] / src / d_mos3.h
blob80d0403a776c8ca88aee4555dcf0b26700626c75
1 /* $Id: d_mos3.h,v 1.2 2010-04-15 07:42:56 felix Exp $ -*- C++ -*-
2 * Copyright (C) 2001 Albert Davis
3 * Author: Albert Davis <aldavis@gnu.org>
5 * This file is part of "Gnucap", the Gnu Circuit Analysis Package
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
10 * any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
21 *------------------------------------------------------------------
22 * mos model equations: spice level 3 equivalent
24 /* This file is automatically generated. DO NOT EDIT */
25 #ifndef D_MOS3_H_INCLUDED
26 #define D_MOS3_H_INCLUDED
28 #include "d_mos123.h"
29 #include "u_sdp.h"
30 #include "e_node.h"
31 #include "e_subckt.h"
32 #include "e_model.h"
33 /*--------------------------------------------------------------------------*/
34 class SDP_BUILT_IN_MOS3
35 :public SDP_BUILT_IN_MOS123{
36 public:
37 explicit SDP_BUILT_IN_MOS3(const COMMON_COMPONENT* c) : SDP_BUILT_IN_MOS123(c) {init(c);}
38 void init(const COMMON_COMPONENT*);
39 public:
41 /*--------------------------------------------------------------------------*/
42 class DEV_BUILT_IN_MOS;
43 class TDP_BUILT_IN_MOS3
44 :public TDP_BUILT_IN_MOS123{
45 public:
46 explicit TDP_BUILT_IN_MOS3(const DEV_BUILT_IN_MOS*);
47 public:
48 double vt; //
49 double phi; //
50 double sqrt_phi; //
51 double beta; //
52 double uo; //
53 double vbi; //
55 /*--------------------------------------------------------------------------*/
56 //class ADP_BUILT_IN_MOS3
57 // :public ADP_BUILT_IN_MOS123{
58 //public:
59 // explicit ADP_BUILT_IN_MOS3(const COMMON_COMPONENT* c) : ADP_BUILT_IN_MOS123(c) {init(c);}
60 // void init(const COMMON_COMPONENT*);
61 //public:
62 // double vto; // replace m->vto
64 // double ids_stress; // base
66 //};
67 /*--------------------------------------------------------------------------*/
68 class ADP_BUILT_IN_MOS3 :public ADP_BUILT_IN_MOS123{
69 public:
70 explicit ADP_BUILT_IN_MOS3( COMPONENT* c, const std::string n) :
71 ADP_BUILT_IN_MOS123(c,n) { init(c);}
72 void init(const COMPONENT* );
73 public:
74 // double vto; // replace m->vto
75 // double ids_stress;
76 // double ids_Stress;
78 /*--------------------------------------------------------------------------*/
79 class MODEL_BUILT_IN_MOS3
80 :public MODEL_BUILT_IN_MOS123{
81 protected:
82 explicit MODEL_BUILT_IN_MOS3(const MODEL_BUILT_IN_MOS3& p);
83 public:
84 explicit MODEL_BUILT_IN_MOS3(const BASE_SUBCKT*);
85 ~MODEL_BUILT_IN_MOS3() {--_count;}
86 public: // override virtual
87 std::string dev_type()const;
88 void set_dev_type(const std::string& nt);
89 CARD* clone()const {return new MODEL_BUILT_IN_MOS3(*this);}
90 void precalc_first();
91 void precalc_last();
92 SDP_CARD* new_sdp(COMMON_COMPONENT* c)const; //y !const COMMON_COMPONENT*?
93 virtual ADP_CARD* new_adp(COMPONENT* c)const;
94 void set_param_by_index(int, std::string&, int);
95 bool param_is_printable(int)const;
96 std::string param_name(int)const;
97 std::string param_name(int,int)const;
98 std::string param_value(int)const;
99 int param_count()const {return (15 + MODEL_BUILT_IN_MOS123::param_count());}
100 bool is_valid(const COMPONENT*)const;
101 void tr_eval(COMPONENT*)const;
103 public: // stress and tt
104 virtual void do_stress_apply( COMPONENT* ) const;
105 virtual void do_tt_prepare( COMPONENT* ) const;
106 public: // not virtual
107 static int count() {return _count;}
108 private: // strictly internal
109 static int _count;
110 public: // input parameters
111 PARAMETER<double> kp; // transconductance parameter
112 PARAMETER<double> nfs_cm; // fast surface state density
113 PARAMETER<double> vmax; // max drift velocity of carriers
114 PARAMETER<double> theta; // mobility modulation
115 PARAMETER<double> eta; // static feedback
116 PARAMETER<double> kappa; // saturation field vector
117 PARAMETER<double> delta; // width effect on threshold voltage
118 public: // calculated parameters
119 double nfs; //
120 bool calc_kp; //
121 double alpha; //
122 double xd; // coeffDepLayWidth
123 double cfsox; //
124 double delta3; // narrow factor
126 /*--------------------------------------------------------------------------*/
127 /*--------------------------------------------------------------------------*/
128 /*--------------------------------------------------------------------------*/
129 #endif