/* $Id: d_mos_base.model,v 26.5 2006/11/05 07:19:19 al Exp $ -*- C++ -*- * Copyright (C) 2001 Albert Davis * Author: Albert Davis * * 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. *------------------------------------------------------------------ * MOS model - base for levels 1,2,3,6 */ h_headers { #include "d_mos.h" } cc_headers { const double mDEFAULT_is = 1e-14; } /*--------------------------------------------------------------------------*/ model MOS_BASE { dev_type MOS; hide_base; inherit DIODE; private_keys { NMOS polarity=pN; PMOS polarity=pP; } validate { return c->l_in >= m->lmin && c->l_in <= m->lmax && c->w_in >= m->wmin && c->w_in <= m->wmax; } independent { override { double _tnom_c "" name=TNOM default=OPT::tnom_c; double fc "coef for fwd bias depl cap formula" name=FC; double pb "junction potential" name=PB positive; double cjo "zero-bias jct capacitance (per area)" name=CJ; double mj "grading coefficient" name=MJ; double cjsw "zero bias sidewall cap (per perim.)" name=CJSW; double pbsw "sidewall junction potential" name=PBSW print_test="pbsw != pb"; double mjsw "sidewall grading coefficient" name=MJSW; double kf "flicker noise coefficient" name=KF print_test="has_good_value(kf)"; double af "flicker noise exponent" name=AF print_test="has_good_value(af)"; } raw_parameters { int level "dummy" name=LEVEL default=1 print_test=false; double wmax "max width" name=WMAX positive default=INF print_test="wmaxrd) || has_hard_value(m->rs)) { rd = m->rd; rs = m->rs; }else{ rd = m->rsh * c->nrd; rs = m->rsh * c->nrs; } if (!has_hard_value(m->js) || ad == 0. || as == 0.) { idsat = issat = m->is; /* this convoluted logic */ }else{ /* is for Spice compatibility */ idsat = m->js * ad; issat = m->js * as; } } } } /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/