%$Id: m.tex,v 25.95 2006/08/26 01:26:53 al Exp $ -*- LaTeX -*-
% man circuit m .
% Copyright (C) 2001 Albert Davis
% Author: Albert Davis <aldavis@ieee.org>
%
% This file is part of "Gnucap", the Gnu Circuit Analysis Package
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2, or (at your option)
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
% 02110-1301, USA.
%------------------------------------------------------------------------
\section{{\tt M}: MOSFET}
%------------------------------------------------------------------------
\subsection{Syntax}
\subsubsection{Device}
\begin{verse}
{\tt M}{\it xxxxxxx nd ng ns nb mname} \{{\it args}\}\\
{\tt M}{\it xxxxxxx nd ng ns nb mname}
	\{{\it width}{\tt /}{\it length}\} \{{\it args}\}\\
{\tt .mosfet} {\it label nd ng ns nb mname} \{{\it args}\}\\
{\tt .mosfet} {\it label nd ng ns nb mname}
	\{{\it width}{\tt /}{\it length}\} \{{\it args}\}
\end{verse}
\subsubsection{Model (required)}
\begin{verse}
{\tt .model} {\it mname} {\tt NMOS} \{{\it args}\}
{\tt .model} {\it mname} {\tt PMOS} \{{\it args}\}
\end{verse}
%------------------------------------------------------------------------
\subsection{Purpose}

MOSFET.
%------------------------------------------------------------------------
\subsection{Comments}

{\it Nd}, {\it ng}, {\it ns}, and {\it nb} are the drain, gate,
source, and bulk (substrate) nodes, respectively.  {\it Mname} is the
model name.

{\it Length} and {\it width} are the drawn channel length and width, in
microns.  Note that the notation W/L has units of microns, but the same
parameters, in the argument list ({\tt W} and {\tt L}) have units of meters.
All other dimensions are in meters.

The option ({\tt .options} command) {\tt rstray} determines whether or
not series resistances are included.  {\tt rstray} (on) is the
default.  Experience has shown that the effect of series resistance is
often not significant, it can significantly degrade the simulation
time, and it often increases roundoff errors.  {\tt rstray} is the
default for Spice compatibility, and because it usually is significant
for the BJT model.  {\tt Norstray} (off) is the equivalent of setting
the model parameters {\tt rd}, {\tt rs}, and {\tt rsh} all to zero.

Entering a parameter value of 0 is not the same as not specifying
it.  This behavior is not compatible with SPICE.  In SPICE, a value
of 0 is often interpreted as not specified, with the result being
to calculate it some other way.  If you want it to be calculated,
don't specify it.

Another subtle difference from SPICE is that Gnucap may omit some
unnecessary parts of the model, which may affect some reported
values.  It should not affect any voltages or currents.  For example,
if the gate and drain are tied, Cgs will be omitted from the model,
so the printed value for Cgdovl and Cgd will be 0, which will
disagree with SPICE.  It doesn't matter because a shorted capacitor
can store no charge.

Levels 1, 2, 3, 4, 5, 6, 7, 8, 49 are implemented.
%------------------------------------------------------------------------
\subsection{Element Parameters}

\subsubsection{Basic Spice compatible parameters}

\begin{description}

\item[{\tt M} = {\it x}]
Device multiplier.  (Default = 1.)  Equivalent number of devices in parallel.

\item[{\tt L} = {\it x}]
Drawn channel length.  (Default = {\tt DEFL} parameter from {\tt
options}. {\tt DEFL default = 100$\mu$})

\item[{\tt W} = {\it x}]
Drawn channel width.  (Default = {\tt DEFW} parameter from {\tt
options}. {\tt DEFW default = 100$\mu$})

\item[{\tt AD} = {\it x}]
Area of drain diffusion.  (Default = {\tt DEFAD} parameter from {\tt
options}. {\tt DEFAD default = 0})

\item[{\tt AS} = {\it x}]
Area of source diffusion.  (Default = {\tt DEFAS} parameter from {\tt
options}. {\tt DEFAS default = 0})

\item[{\tt PD} = {\it x}]
Perimeter of drain junction.  (Default = 0.)

\item[{\tt PS} = {\it x}]
Perimeter of source junction.  (Default = 0.)

\item[{\tt NRD} = {\it x}]
Number of squares of drain diffusion.  (Default = 1.)

\item[{\tt NRS} = {\it x}]
Number of squares of source diffusion.  (Default = 1.)

\end{description}
%------------------------------------------------------------------------
\subsection{Model Parameters}

\subsubsection{Basic selection -- required for all models}
\begin{description}

\item[{\tt LEVEL} = {\it x}]
Model index. (Default = 1) Selects which of several models to use.
The choices supported are 1-8, corresponding to Spice 3f5.

\end{description}
\subsubsection{Extended control (not in Spice) -- all models}
\begin{description}

\item[{\tt CMODEL} = {\it x}]
Capacitance model selector (Default = 1 for level 4,5,7.  Default = 2
for level 1,2,3.  Default = 3 for level 6.)  The only valid values are
1, 2 and 3.  2 selects Meyer capacitance calculations compatible with
Spice 2.  3 selects Meyer's model compatible with Spice 3.  1 selects
not to use Meyer's model.

\end{description}
\subsubsection{Binning (not in Spice) -- all models}

Gnucap supports ``binning''.  You can specify any number of models as
a family.  These models must have the selection parameters {\tt WMAX},
{\tt WMIN}, {\tt LMAX}, and {\tt LMIN}.

To use ``binning'', define a set of models with the same name, except
for a numeric extension, beginning at 1.  The models must be numbered
consecutively.  For example, you might have a set of models: {\tt
NM3U.1}, {\tt NM3U.2}, {\tt NM3U.3}, {\tt NM3U.4}, {\tt NM3U.5}, {\tt
NM3U.6}.  For the device, you would specify the model {\tt NM3U}.  The
first model meeting the requirements that length is between {\tt LMIN}
and {\tt LMAX}, and width is between {\tt WMIN} and {\tt WMAX} will be
used.  They will be tried in numerical order.

If there is a gap in the numbering, only those below the gap will be
used.  If you want a specific model from a set, disabling binning, you
can specify its full name.

\begin{description}

\item[{\tt WMAX} = {\it x}]
Maximum width. (Default = Infinity.)  The maximum device width that
may be used with this model.

\item[{\tt WMIN} = {\it x}]
Maximum width. (Default = 0.)  The minimum device width that may be
used with this model.

\item[{\tt LMAX} = {\it x}]
Maximum length. (Default = Infinity.)  The maximum device length that
may be used with this model.

\item[{\tt LMIN} = {\it x}]
Maximum length. (Default = 0.)  The minimum device length that may be
used with this model.

\end{description}
\subsubsection{Substrate coupling -- all models}
\begin{description}

\item[{\tt IS} = {\it x}]
Bulk junction saturation current.  If not input, it is calculated from
{\tt JS}.  If both are input, a warning is issued, and the calculated
value (from {\tt JS}) is used, if {\tt AD} and {\tt AS} are also
input.  If neither {\tt IS} or {\tt JS} is input, a default value of
1e-14 is used.

\item[{\tt JS} = {\it x}]
Bulk junction saturation current per square-meter of junction area.  May
be used to calculate {\tt IS}.  If a conflict exists, a warning is
issued.

\item[{\tt FC} = {\it x}]
Coefficient for forward bias depletion capacitance formula. (Default =
0.5)

\item[{\tt PB} = {\it x}]
Bulk junction potential. (Default = 0.8)

\item[{\tt CJ} = {\it x}]
Zero bias bulk junction bottom capacitance per square-meter of junction
area.  If not input, but {\tt NSUB} is, it is calculated, otherwise a
default value of 0 is used.

\item[{\tt MJ} = {\it x}]
Bulk junction bottom grading coefficient.  (Default = 0.5)

\item[{\tt PBSW} = {\it x}]
Sidewall Bulk junction potential. (Default = PB)

\item[{\tt CJSW} = {\it x}]
Zero bias bulk junction sidewall capacitance per meter of junction
perimeter. (Default = 0.)

\item[{\tt MJSW} = {\it x}]
Bulk junction sidewall grading coefficient.  (Default = 0.33)

\end{description}
\subsubsection{Strays -- all models}
\begin{description}

\item[{\tt RSH} = {\it x}]
Drain and source diffusion sheet resistance.  If not input, use {\tt
RS} and {\tt RD} directly.  If a conflict exists, a warning is issued.
The resistance is only used if the option {\tt rstray} is set.

\item[{\tt RD} = {\it x}]
Drain ohmic resistance (unscaled).  If {\tt RS} is input, the default
value of {\tt RD} is 0.  If {\tt RD} and {\tt RS} are both not input,
and {\tt RSH} is input, they are calculated from {\tt RSH}.  If any
conflict exists, a warning is issued, indicating the action taken,
which is believed to be compatible with SPICE.  The resistance is only
used if the option {\tt rstray} is set.

\item[{\tt RS} = {\it x}]
Source ohmic resistance (unscaled).  If {\tt RD} is input, the default
value of {\tt RS} is 0.  If {\tt RD} and {\tt RS} are both not input,
and {\tt RSH} is input, they are calculated from {\tt RSH}.  If any
conflict exists, a warning is issued, indicating the action taken,
which is believed to be compatible with SPICE.  The resistance is only
used if the option {\tt rstray} is set.

\item[{\tt CBD} = {\it x}]
Zero bias B-D junction capacitance (unscaled).  If {\tt CBD} is not
specified, it is calculated from {\tt CJ}.

\item[{\tt CBS} = {\it x}]
Zero bias B-S junction capacitance (unscaled).  If {\tt CBS} is not
specified, it is calculated from {\tt CJ}.

\item[{\tt CGSO} = {\it x}]
Gate-source overlap capacitance, per channel width. (Default = 0.)

\item[{\tt CGDO} = {\it x}]
Gate-drain overlap capacitance, per channel width. (Default = 0.)

\item[{\tt CGBO} = {\it x}]
Gate-bulk overlap capacitance, per channel length. (Default = 0.)

\end{description}
\subsubsection{Length and width adjustment-- all models}

These parameters adjust the effective dimensions of the device.  They
are calculated as follows:

\begin{verse}
L\_eff = L\_drawn * LMLT + XL - 2 * (LD + DEL) \\
W\_eff = W\_drawn * WMLT + XW - 2 * WD
\end{verse}

\begin{description}

\item[{\tt XL} = {\it x}]
Length bias accounts for masking and etching effects.
Alternate names: {\tt DL}, {\tt LDEL}.
(Default = 0.)

\item[{\tt XW} = {\it x}]
Width bias accounts for masking and etching effects.
Alternate names: {\tt DW}, {\tt WDEL}.
(Default = 0.)

\item[{\tt LMLT} = {\it x}]
Length shrink factor. (Default = 1.0)

\item[{\tt WMLT} = {\it x}]
Width shrink factor. (Default = 1.0)

\item[{\tt DEL} = {\it x}]
Channel length reduction each side. (Default = 0.)

\item[{\tt LD} = {\it x}]
Lateral length diffusion.
Alternate names: {\tt DLAT}, {\tt LADT}.
(Default = 0.)

\item[{\tt WD} = {\it x}]
Width diffusion.  (Default = 0.)

\end{description}
\subsubsection{Accepted and ignored -- all models}
\begin{description}

\item[{\tt KF} = {\it x}]
Flicker noise coefficient.  SPICE parameter accepted but not
implemented.

\item[{\tt AF} = {\it x}]
Flicker noise exponent.  SPICE parameter accepted but not implemented.

\end{description}
\subsubsection{Level 1,2,3,6 shared parameters}
\begin{description}

\item[{\tt VTO} = {\it x}]
Zero bias threshold voltage.  If not input, but {\tt NSUB} is, it is
calculated, otherwise a default value of 0 is used.

\item[{\tt KP} = {\it x}]
Transconductance parameter.  If not input, it is calculated by {\tt
UO} * {\tt COX}.

\item[{\tt GAMMA} = {\it x}]
Bulk threshold parameter.  If not input, but {\tt NSUB} is, it is
calculated, otherwise a default value of 0 is used.

\item[{\tt PHI} = {\it x}]
Surface potential.  If not input, but {\tt NSUB} is, it is calculated,
otherwise a default value of 0.6 is used.  A warning is issued if the
calculated value is less than 0.1, in which case 0.1 is used.

\item[{\tt LAMBDA} = {\it x}]
Channel length modulation.  If not input, it is calculated dynamically
during simulation.  If the value input is larger than 0.2, a warning
is issued, but no correction is made.  (accepted but ignored for level
3)

\item[{\tt TOX} = {\it x}]
Oxide thickness. (meters) (Default = 1e-7)

\item[{\tt NSUB} = {\it x}]
Substrate doping.  (atoms / cm$^3$) Used in calculation of {\tt VTO},
{\tt GAMMA}, {\tt PHI}, and {\tt CJ}.  If not input, default values
are used.

\item[{\tt NSS} = {\it x}]
Surface state density.  (atoms / cm$^2$) (Default = 0.) Used, with
{\tt NSUB} in calculation of {\tt VTO}.

\item[{\tt XJ} = {\it x}]
Metallurgical junction depth. (meters) Used to calculate short channel
effects.  If not input, do not model short channel effects,
effectively defaults to 0.

\item[{\tt UO} = {\it x}]
Surface mobility. (cm$^2$/V-s) (Default = 600.)

\item[{\tt DELTA} = {\it x}]
Width effect on threshold voltage.  (Default = 0.)  (Level 2 and 3
only.)

\item[{\tt TPG} = {\it x}]
Type of gate material. (Default = 1.)
\begin{verse}
+1 opposite to substrate\\
--1 same as substrate\\
0 Aluminum
\end{verse}

\end{description}
\subsubsection{Level 1}

The Level 1 model has no additional parameters.

\subsubsection{Level 2}
\begin{description}

\item[{\tt NFS} = {\it x}]
Fast surface state density.  (atoms / cm$^2$) Used in modeling
sub-threshold effects.  If not input, do not model sub-threshold
effects.

\item[{\tt VMAX} = {\it x}]
Maximum drift velocity of carriers. (m/s) Used in calculating vdsat,
and lambda.  If not input, use a different method.  {\tt VMAX} does
not always work, if the method fails, the alternate method is used and
the warning ``Baum's theory rejected'' is issued if the error
threshold is set to {\tt debug} or worse.

\item[{\tt NEFF} = {\it x}]
Total channel charge (fixed and mobile) coefficient. (Default = 1.)
Used in internal calculation of lambda.

\item[{\tt UCRIT} = {\it x}]
Critical field for mobility degradation.  (V/cm) (Default = 1e4)

\item[{\tt UEXP} = {\it x}]
Critical field exponent in mobility degradation.  If not input, do not
model mobility degradation, effectively defaulting to 0.

\item[{\tt UTRA} = {\it x}]
Transverse field coefficient.  SPICE parameter accepted but not
implemented.  It is also not implemented in most versions of SPICE.

\end{description}
\subsubsection{Level 3}
\begin{description}

\item[{\tt NFS} = {\it x}]
Fast surface state density.  (atoms / cm$^2$) Same as Level 2.

\item[{\tt VMAX} = {\it x}]
Maximum drift velocity of carriers. (m/s) Used in calculating vdsat.
If not input, use a different method.

\item[{\tt THETA} = {\it x}]
Mobility modulation.

\item[{\tt ETA} = {\it x}]
Static feedback.

\item[{\tt KAPPA} = {\it x}]
Saturation field vector.

\end{description}
\subsubsection{Level 6}
\begin{description}

\item[{\tt KV} = {\it x}]
Saturation voltage factor.

\item[{\tt NV} = {\it x}]
Saturation voltage coefficient.

\item[{\tt KC} = {\it x}]
Saturation current factor.

\item[{\tt NC} = {\it x}]
Saturation current coefficient.

\item[{\tt NVTH} = {\it x}]
Threshold voltage coefficient.

\item[{\tt PS} = {\it x}]
Sat. current modification  par.

\item[{\tt GAMMA1} = {\it x}]
Bulk threshold parameter 1.

\item[{\tt SIGMA} = {\it x}]
Static feedback effect par.

\item[{\tt LAMBDA1} = {\it x}]
Channel length modulation parameter. 1.

\end{description}
\subsubsection{Level 4, 5, 7, 8 (BSIM models) general comments}

The BSIM models have additional parameters for length, width, and
product (length * width) dependency.  To get the name, prefix the
listed parameter with L, W, or P, respectively.  Spice supports the
``P'' parameter only for BSIM3, but Gnucap supports it for all 3
models.  For example, VFB is the basic parameter with units of Volts,
and LVFB, WVFB, and PVFB also exist.  The units of LVFB and WVFB are
Volts * micron.  The units of PVFB are Volts * micron * micron.  The
real parameter is calculated by $P = P_0 + P_L / L + P_W / W + P_P /
(L*W)$, where L and W are the effective length and width in microns.

The parameters are not listed here, but they comply with the industry
standard, with the same defaults.

The ``levels'' are the same as Spice.

\begin{description}
\item[{\tt 4}] BSIM 1.
\item[{\tt 5}] BSIM 2.
\item[{\tt 7}] BSIM 3v3.1.
\item[{\tt 8}] BSIM 3v3.3.
\item[{\tt 49}] BSIM 3v3.3.
\end{description}

The following are reserved for future use:
\begin{description}
\item[{\tt 9}] BSIM-SOI.
\item[{\tt 10}] BSIM 4.
\end{description}
%------------------------------------------------------------------------
\subsection{Probes}

These probes are available for all MOSFETs, but some are not
meaningful with all models.

This is not a complete list.  All ``calculated parameters'' can be
probed.  See the source file {\tt d\_mos.model} for a list.

All parameters of the internal elements (Ids, Gmr, Gmf, Yds, Gmbr,
Gmbf, Cgb, Cgd, Cgs, Dsb, Ddb, Rd, Rs) are available.  To access them,
concatenate the labels for the internal element with this device,
separated by a dot.  Cgd.M6 is the gate to drain capacitance of M6.

There are no probes available in AC analysis except for the internal
elements.
 
\begin{description}

\item[{\tt VDS}] Drain-source voltage.

\item[{\tt VGS}] Gate-source voltage.

\item[{\tt VBS}] Bulk-source voltage.

\item[{\tt VDSINT}] Drain-source internal voltage.

\item[{\tt VGSINT}] Gate-source internal voltage.

\item[{\tt VBSINT}] Bulk-source internal voltage.

\item[{\tt VGD}] Gate-drain voltage.

\item[{\tt VBD}] Bulk-drain voltage.

\item[{\tt VSD}] Source-drain voltage.

\item[{\tt VDM}] Drain-midpoint voltage.

\item[{\tt VGM}] Gate-midpoint voltage.

\item[{\tt VBM}] Bulk-midpoint voltage.

\item[{\tt VSM}] Source-midpoint voltage.

\item[{\tt VDG}] Drain-gate voltage.

\item[{\tt VBG}] Bulk-gate voltage.

\item[{\tt VSG}] Source-gate voltage.

\item[{\tt VDB}] Drain-bulk voltage.

\item[{\tt VGB}] Gate-bulk voltage.

\item[{\tt VSB}] Source-bulk voltage.

\item[{\tt VD}] Drain-ground voltage.

\item[{\tt VG}] Gate-ground voltage.

\item[{\tt VB}] Bulk-ground voltage.

\item[{\tt VS}] Source-ground voltage.

\item[{\tt ID}] Drain current.

\item[{\tt IS}] Source current.

\item[{\tt IG}] Gate current.

\item[{\tt IB}] Bulk current.

\item[{\tt CGSO}] Gate-source overlap capacitance.

\item[{\tt CGDO}] Gate-drain overlap capacitance.

\item[{\tt CGBO}] Gate-bulk overlap capacitance.

\item[{\tt CGSM}] Gate-source Meyer capacitance.

\item[{\tt CGDM}] Gate-drain Meyer capacitance.

\item[{\tt CGBM}] Gate-bulk Meyer capacitance.

\item[{\tt CGST}] Gate-source total capacitance.

\item[{\tt CGDT}] Gate-drain total capacitance.

\item[{\tt CGBT}] Gate-bulk total capacitance.

\item[{\tt CBD}] Bulk-drain junction capacitance.

\item[{\tt CBS}] Bulk-source junction capacitance.

\item[{\tt CGATE}] Nominal gate capacitance.

\item[{\tt GM}] Transconductance.

\item[{\tt GDS}] Drain-source conductance.

\item[{\tt GMB}] Body effect transconductance.

\item[{\tt VDSAT}] Saturation voltage.

\item[{\tt VTH}] Threshold voltage.

\item[{\tt VGST}] VGS - VTH.

\item[{\tt IDS}] Drain-source current, not including strays.

\item[{\tt IDSTray}] Drain current due to strays.

\item[{\tt P}] Power.

\item[{\tt PD}]
Power dissipated.  The power dissipated as heat.  It is always
positive and does not include power sourced.  It should be the same as
P because the mosfet cannot generate energy.

\item[{\tt PS}]
Power sourced.  The power sourced by the part.  It is always positive
and does not consider its own dissipation.  It should be 0 because the
mosfet cannot generate energy.

\item[{\tt REGION}]
Region code.  A numeric code that represents the region it is
operating in.  The number is the sum of several factors.  A negative
code indicates the source and drain are reversed.

\begin{description}

\item{1} Active.  (Not cut off.)

\item{2} Not sub-threshold.

\item{4} Saturated.

\item{10} Source to bulk is forward biased.

\item{20} Drain to bulk is forward biased.

\item{40} Punch through.

\end{description}

\item[{\tt SUBTHRESHOLD}]
1 if the device is in subthreshold region, else 0.  Subthreshold means
Vgs is below the threshold.  Some models calculate a small amount of
subthreshold current, so the current may not be zero.

\item[{\tt CUTOFF}]
1 if the device is cut off, else 0.  Cutoff means the current is zero.
Cutoff implies subthreshold, but subthreshold does not imply cutoff.

\item[{\tt SATURATED}]
1 if the device is in saturation region, else 0.

\item[{\tt TRIODE}]
1 if the device is in triode region, else 0. 

\item[{\tt SBFWD}]
1 if the SB junction is forward biased, else 0.

\item[{\tt DBFWD}]
1 if the DB junction is forward biased, else 0.

\item[{\tt REVERSED}]
1 if the device is reversed (drain and source effectively
interchanged), else 0.

\end{description}
%------------------------------------------------------------------------
%------------------------------------------------------------------------
