testing
[gnucap-felix.git] / modules / d_mos1.h
blob48f1b4d5138389af53e7bed761e048c55f161455
1 /* $Id: d_mos1.h,v 1.1 2009-12-14 10:15:01 felix Exp $ -*- C++ -*-
2 * vim:sw=2:ts=8:et:
3 * Copyright (C) 2001 Albert Davis
4 * Author: Albert Davis <aldavis@gnu.org>
6 * This file is part of "Gnucap", the Gnu Circuit Analysis Package
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3, or (at your option)
11 * any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 * 02110-1301, USA.
22 *------------------------------------------------------------------
23 * mos model equations: spice level 1 equivalent
25 /* This file is automatically generated. DO NOT EDIT */
26 #ifndef D_MOS1_H_INCLUDED
27 #define D_MOS1_H_INCLUDED
29 #include "d_mos123.h"
30 #include "u_sdp.h"
31 #include "e_node.h"
32 #include "e_subckt.h"
33 #include "e_model.h"
34 /*--------------------------------------------------------------------------*/
35 namespace UF{
36 class SDP_BUILT_IN_MOS1
37 :public SDP_BUILT_IN_MOS123{
38 public:
39 explicit SDP_BUILT_IN_MOS1(const COMMON_COMPONENT* c) : SDP_BUILT_IN_MOS123(c) {init(c);}
40 void init(const COMMON_COMPONENT*);
41 public:
43 /*--------------------------------------------------------------------------*/
44 class DEV_BUILT_IN_MOS;
45 class TDP_BUILT_IN_MOS1
46 :public TDP_BUILT_IN_MOS123{
47 public:
48 explicit TDP_BUILT_IN_MOS1(const DEV_BUILT_IN_MOS*);
49 public:
50 double phi; //
51 double beta; //
52 double sqrt_phi; //
53 double egap; //
54 double dbetadw_eff;
55 double dbetadl_eff;
57 /*--------------------------------------------------------------------------*/
58 class MODEL_BUILT_IN_MOS1
59 :public MODEL_BUILT_IN_MOS123{
60 protected:
61 explicit MODEL_BUILT_IN_MOS1(const MODEL_BUILT_IN_MOS1& p);
62 public:
63 explicit MODEL_BUILT_IN_MOS1(const BASE_SUBCKT*);
64 ~MODEL_BUILT_IN_MOS1() {--_count;}
65 public: // override virtual
66 std::string dev_type()const;
67 void set_dev_type(const std::string& nt);
68 CARD* clone()const {return new MODEL_BUILT_IN_MOS1(*this);}
69 void precalc_first();
70 void precalc_last();
71 SDP_CARD* new_sdp(COMMON_COMPONENT* c)const;
72 void set_param_by_index(int, std::string&, int);
73 bool param_is_printable(int)const;
74 std::string param_name(int)const;
75 std::string param_name(int,int)const;
76 std::string param_value(int)const;
77 int param_count()const {return (8 + MODEL_BUILT_IN_MOS123::param_count());}
78 bool is_valid(const COMPONENT*)const;
79 void tr_eval(COMPONENT*)const;
80 public: // not virtual
81 static int count() {return _count;}
82 private: // strictly internal
83 static int _count;
84 public: // input parameters
85 PARAMETER<double> kp; // transconductance parameter
86 public: // calculated parameters
87 bool calc_kp; //
89 private:
90 double dgmdl_eff(const DEV_BUILT_IN_MOS*) const;
91 double dgmdw_eff(const DEV_BUILT_IN_MOS*) const;
93 /*--------------------------------------------------------------------------*/
94 /*--------------------------------------------------------------------------*/
95 /*--------------------------------------------------------------------------*/
97 #endif