1
/***************************************************************************
2
* Copyright (C) 2005 by David Saxton *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
9
***************************************************************************/
15
#include "nonlinear.h"
23
MOSFETState operator-( const MOSFETState & s ) const;
35
double I_S; ///< bulk junction saturation current
36
double N; ///< bulk junction emission coefficient
37
double K_P; ///< transconductance coeffecient
38
double W; ///< channel width
39
double L; ///< channel length
41
double beta() const { return K_P * W / L; }
44
double phi; ///< surface potential
45
double T_OX; ///< oxide thickness
46
double P_b; ///< bulk junction potential
47
double M_J; ///< bulk junction bottom grading coefficient
48
double F_C; ///< bulk junction forward-bbias depletion capacitance coefficient
49
double M_JSW; ///< bulk junction periphery grading coefficient
50
double U_0; ///< surface mobility
51
int N_RD; ///< number of equivalent drain squares
52
int N_RS; ///< number of equivalent source squares
60
class MOSFET : public NonLinear
63
enum MOSFET_type { neMOSFET, peMOSFET/*, ndMOSFET, pdMOSFET*/ };
65
MOSFET( MOSFET_type type );
68
virtual Type type() const { return Element_MOSFET; }
69
virtual void update_dc();
70
virtual void add_initial_dc();
71
MOSFETSettings settings() const { return m_mosfetSettings; }
72
void setMOSFETSettings( const MOSFETSettings & settings );
75
void calcIg( double V_BS, double V_BD, double V_DS, double V_GS, double V_GD,
76
double * I_BS, double * I_BD, double * I_DS,
77
double * g_BS, double * g_BD, double * g_DS,
81
virtual void updateCurrents();
83
* Calculates the new MOSFETState from the voltages on the nodes.
91
double V_GS_prev, V_GD_prev, V_BD_prev, V_DS_prev, V_BS_prev;
92
MOSFETSettings m_mosfetSettings;
94
static const uint PinD, PinG, PinS, PinB;