%$Id: addmodel-base.tex,v 25.95 2006/08/26 01:26:53 al Exp $ -*- LaTeX -*-
% man Tech addmodel-base .
% 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.
%------------------------------------------------------------------------
Gnucap has three distinct styles of adding models:

\begin{description}
\item[Model Compiler] is the easiest way to add models, but the least
  flexible.  The model compiler generates .cc and .h files using the
  {\em enhanced subcircuit} mode.  It is possible to develop models
  with almost no knowledge of the simulator internals.  In most cases,
  this is the preferred way.  The standard MOSFET and diode models are
  done this way.
\item[Enhanced subcircuit] is less efficient than {\em primitive} but
  has other advantages that make it preferable to {\em primitive} when
  you can use it.  The model is defined as a combination of equations
  and topology.  The AC and pole-zero code is inherited from a base
  class, so you don't need to to it.  You need to understand the
  simulator's internals, and it is not likely to be portable to other
  simulators.
\item[Primitive] should be used only when absolutely necessary.  If it
  is done correctly, it will result in the fastest execution, but you
  need to do everything.  It requires thorough knowledge of the
  simulator internals, including how Gnucap is different from other
  simulators.  If you miss some of the details, it is possible that
  your model will work but slow down the simulator significantly.
  Most of the primitive devices (resistors, sources) are done this
  way.  A few device types that have special considerations, like
  gates and transmission lines, are also done this way.
\end{description}
%------------------------------------------------------------------------
%------------------------------------------------------------------------
