/* $Id: d_mos123.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_base.h" enum gate_t {gtSAME = -1, gtMETAL = 0, gtOPP = 1}; const double NI = 1.45e16; /* intrinsic carrier concentration */ } cc_headers { } /*--------------------------------------------------------------------------*/ model MOS123 { dev_type MOS; inherit MOS_BASE; independent { override { double cjo "" default=0.; double pb "" default=0.8; double pbsw "" final_default=pb; int cmodel "CMODEL" print_test="cmodel!=3" calculate="((!cmodel)?3:cmodel)"; } raw_parameters { double vto_raw "zero-bias threshold voltage" name=VTO default=NA print_test="!calc_vto"; double gamma "bulk threshold parameter" name=GAmma default=NA print_test="!calc_gamma" calc_print_test="calc_gamma"; double phi "surface potential" name=PHI default=NA positive print_test="!calc_phi" calc_print_test="calc_phi"; double lambda "channel-length modulation" name=LAmbda default=NA; double tox "oxide thickness" name=TOX default=NA positive; double nsub_cm "substrate doping" name=NSUb default=NA; double nss_cm "surface state density" name=NSS default=0.0 print_test="nss_cm != 0.0 || has_hard_value(nsub_cm)"; double xj "metallurgical junction depth" name=XJ default=NA positive; double uo_cm "surface mobility" name=UO alt_name=U0 default="600."; int tpg "type of gate material - really gate_t" name=TPG default="int(gtOPP)"; } calculated_parameters { double nsub "" calculate="((nsub_cm.has_value()) ? nsub_cm*ICM2M3 : NA)"; double nss "" calculate="nss_cm*ICM2M2"; double uo "" calculate="uo_cm*CM2M2"; double vto "" name=VTO calculate="((vto_raw.has_value()) ? vto_raw * polarity : NA)" calc_print_test="calc_vto"; double cox "oxide capacitance (E_OX / tox)" name=COX calc_print_test=true default=NA; bool calc_vto "" default=false; bool calc_gamma "" default=false; bool calc_phi "" default=false; } code_post { if (tpg < 0) { // coerce tpg to a proper value tpg = gtSAME; }else if (tpg > 0) { tpg = gtOPP; }else{ assert(tpg == gtMETAL); } if (has_hard_value(tox) && tox <= 0) { untested(); set_default(&tox, NA); error(bWARNING, long_label()+": tox <= 0, treating as if not input\n"); } if (has_hard_value(nsub_cm) && nsub < NI) { untested(); nsub = NA; error(bWARNING,long_label()+": nsub < ni, treating as if not input\n"); } } } size_dependent { override { double cgate "" calculate="m->cox * w_eff * l_eff"; double phi "" calculate="m->phi"; } } } /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/