Modelica.Electrical.Spice3.Internal.Mos1

Records and functions for Mosfets level 1

Information


This package Mos1 contains functions and record with data of the mosfet model level 1.

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

NameDescription
Modelica.Electrical.Spice3.Internal.Mos1.Mos1ModelLineParams Mos1ModelLineParams Record for Mosfet model line parameters (for level 1)
Modelica.Electrical.Spice3.Internal.Mos1.Mos1Calc Mos1Calc Further mosfet variables (for level 1)
Modelica.Electrical.Spice3.Internal.Mos1.mos1ModelLineParamsInitEquations mos1ModelLineParamsInitEquations Initial precalculation
Modelica.Electrical.Spice3.Internal.Mos1.drainCur drainCur Drain current calculation
Modelica.Electrical.Spice3.Internal.Mos1.mos1RenameParameters mos1RenameParameters Parameter renaming to internal names
Modelica.Electrical.Spice3.Internal.Mos1.mos1RenameParametersDev mos1RenameParametersDev Device parameter renaming to internal names


Modelica.Electrical.Spice3.Internal.Mos1.Mos1ModelLineParams

Record for Mosfet model line parameters (for level 1)

Information


This record Mos1ModelLineParams contains the model line parameters that are used for the mosfet transistors level 1 in SPICE3.

Extends from Mos.MosModelLineParams (Record for Mosfet model line parameters (for level 1, 2, 3 and 6)).

Parameters

TypeNameDefaultDescription
Initialization
Realm_jctSatCurDensity.start0.0JS, Bulk jct. sat. current density, input - use tSatCurDens
Resistancem_sheetResistance.start0.0RSH, Sheet resistance [Ohm]
Realm_bulkJctPotential.start0.8PB, Bulk junction potential, input - use tBulkPot
Realm_bulkJctBotGradingCoeff.start0.5MJ, Bottom grading coefficient
Realm_bulkJctSideGradingCoeff.start0.5MJSW, Side grading coefficient
Realm_oxideThickness.start1.0e-7TOX, Oxide thickness unit: micron
Realm_gateSourceOverlapCapFactor.start0.0CGS0, Gate-source overlap cap
Realm_gateDrainOverlapCapFactor.start0.0 CGD0, Gate-drain overlap cap
Realm_gateBulkOverlapCapFactor.start0.0CGB0, Gate-bulk overlap cap
Realm_fNcoef.start0.0KF, Flicker noise coefficient
Realm_fNexp.start1.0AF, Flicker noise exponent
Realm_oxideCapFactor.start0.0 
Voltagem_vt0.start0.0VTO, Threshold voltage [V]
Capacitancem_capBD.start0.0CBD, B-D junction capacitance [F]
Capacitancem_capBS.start0.0CBS, B-S junction capacitance [F]
CapacitancePerAream_bulkCapFactor.start0.0CJ, Bottom junction cap per area [F/m2]
Permittivitym_sideWallCapFactor.start0.0CJSW, Side grading coefficient [F/m]
Realm_fwdCapDepCoeff.start0.5FC, Forward bias jct. fit parm.
Voltagem_phi.start0.6PHI, Surface potential [V]
Voltagem_gamma.start0.0GAMMA, Bulk threshold parameter [V]
InversePotentialm_lambda.start0.0Channel-length modulation [1/V]
Realm_substrateDoping.start0.0NSUB, Substrate doping
Realm_gateType.start1.0TPG, Gate type
PerArea_cmm_surfaceStateDensity.start0.0NSS, Gate type [1/cm2]
Area_cmPerVoltageSecondm_surfaceMobility.start600.0UO, Surface mobility [cm2/(V.s)]
Lengthm_latDiff.start0.0LD, Lateral diffusion [m]
Currentm_jctSatCur.start1.0e-14IS, Bulk junction sat. current [A]
Resistancem_drainResistance.start0RD, Drain ohmic resistance [Ohm]
Resistancem_sourceResistance.start0RS, Source ohmic resistance [Ohm]
Transconductancem_transconductance.start2.0e-5input - use tTransconductance [A/V2]

Modelica definition

record Mos1ModelLineParams 
  "Record for Mosfet model line parameters (for level 1)"
  extends Mos.MosModelLineParams(
   m_lambda( start = 0.0),
   m_transconductance( start = 2.0e-5));

end Mos1ModelLineParams;

Modelica.Electrical.Spice3.Internal.Mos1.Mos1Calc

Further mosfet variables (for level 1)

Information


This record Mos1Calc contains further mosfet variables (for level 1) that are needed for the calculations.

Extends from Mos.MosCalc (Further mosfet variables (for level 1, 2, 3 and 6)).

Parameters

TypeNameDefaultDescription
Initialization
Integerm_mode.start1Mode
Transconductancem_tTransconductance.start0.[A/V2]
Realm_tSurfMob.start0. 
Voltagem_tPhi.start0.7[V]
Voltagem_tVto.start1.[V]
Realm_tSatCurDens.start0. 
Currentm_tDrainSatCur.start0.[A]
Currentm_tSourceSatCur.start0.[A]
Capacitancem_tCBDb.start0.[F]
Capacitancem_tCBDs.start0.[F]
Capacitancem_tCBSb.start0.[F]
Capacitancem_tCBSs.start0.[F]
Realm_tCj.start0. 
Realm_tCjsw.start0. 
Voltagem_tBulkPot.start0.7[V]
Realm_tDepCap.start0.35 
Voltagem_tVbi.start1.[V]
Voltagem_VBScrit.start0.7[V]
Voltagem_VBDcrit.start0.7[V]
Realm_f1b.start0. 
Realm_f2b.start0. 
Realm_f3b.start0. 
Realm_f1s.start0. 
Realm_f2s.start0. 
Realm_f3s.start0. 
Realm_dVt.start0. 
Capacitancem_capgd.start0.[F]
Capacitancem_capgs.start0.[F]
Capacitancem_capgb.start0.[F]
Chargem_qgs.start0.[C]
Chargem_qgd.start0.[C]
Chargem_qgb.start0.[C]

Modelica definition

record Mos1Calc "Further mosfet variables (for level 1)"
  extends Mos.MosCalc;

end Mos1Calc;

Modelica.Electrical.Spice3.Internal.Mos1.mos1ModelLineParamsInitEquations

Initial precalculation

Information


This function mos1ModelLineParamsInitEquation does the initial precalculation of the mosfet model line parameters for level 1.

Inputs

TypeNameDefaultDescription
Mos1ModelLineParamsin_p Input record model line parameters for MOS1
SpiceConstantsin_C Spice constants
Integerin_m_type Type of MOS transistor

Outputs

TypeNameDescription
MosModelLineVariablesout_vOutput record model line variables

Modelica definition

function mos1ModelLineParamsInitEquations "Initial precalculation"

  input Mos1ModelLineParams in_p "Input record model line parameters for MOS1";
  input SpiceConstants in_C "Spice constants";
  input Integer in_m_type "Type of MOS transistor";

  output Mos.MosModelLineVariables out_v "Output record model line variables";

protected 
  Modelica.SIunits.Voltage vtnom;
  Modelica.SIunits.Voltage fermis;
  Real fermig;
  Real wkfng;
  Real wkfngs;
  Real egfet1;
  Real vfb;

algorithm 
  out_v.m_oxideCapFactor   := in_p.m_oxideCapFactor;
  out_v.m_transconductance := in_p.m_transconductance;
  out_v.m_phi              := in_p.m_phi;
  out_v.m_gamma            := in_p.m_gamma;
  out_v.m_vt0              := in_p.m_vt0;

  vtnom  := in_p.m_tnom*SpiceConstants.CONSTKoverQ;
  egfet1 := 1.16 - (7.02e-4*in_p.m_tnom*in_p.m_tnom)/(in_p.m_tnom + 1108);

  if (not (in_p.m_oxideThicknessIsGiven > 0.5) or in_p.m_oxideThickness == 0) then
    if 
      (in_p.m_oxideThickness == 0) then
      out_v.m_oxideCapFactor := 0;
    end if;
  else
    out_v.m_oxideCapFactor := 3.9 * 8.854214871e-12 / in_p.m_oxideThickness;

    if (out_v.m_oxideCapFactor <> 0) then

      if (not (in_p.m_transconductanceIsGiven > 0.5)) then
        out_v.m_transconductance := in_p.m_surfaceMobility * out_v.m_oxideCapFactor * 1e-4; // (m**2/cm**2)
      end if;
      if (in_p.m_substrateDopingIsGiven > 0.5) then
        if (in_p.m_substrateDoping * 1e6 > 1.45e16) then // (cm**3/m**3)
          if (not (in_p.m_phiIsGiven > 0.5)) then
            out_v.m_phi := 2*vtnom*Modelica.Math.log(in_p.m_substrateDoping*1e6/1.45e16); // (cm**3/m**3)
            out_v.m_phi := max(0.1, out_v.m_phi);
          end if;
          fermis := in_m_type *0.5  * out_v.m_phi;
          wkfng  := 3.2;
          if (in_p.m_gateType <> 0) then
            fermig := in_m_type * in_p.m_gateType *0.5  * egfet1;
            wkfng  := 3.25 +0.5  * egfet1 - fermig;
          end if;
          wkfngs := wkfng - (3.25 +0.5  * egfet1 + fermis);
          if (not (in_p.m_gammaIsGiven > 0.5)) then
            out_v.m_gamma := sqrt(2 * 11.70 * 8.854214871e-12 * SpiceConstants.CHARGE *
                             in_p.m_substrateDoping * 1e6 / out_v.m_oxideCapFactor);         // (cm**3/m**3)
          end if;
          if (not (in_p.m_vtOIsGiven > 0.5)) then
            vfb         := wkfngs - in_p.m_surfaceStateDensity * 1e4 * SpiceConstants.CHARGE / out_v.m_oxideCapFactor; // (cm**2/m**2)
            out_v.m_vt0 := vfb + in_m_type * (out_v.m_gamma * sqrt(out_v.m_phi) + out_v.m_phi);
           end if;
        end if;
      end if;
    end if;
  end if;

end mos1ModelLineParamsInitEquations;

Modelica.Electrical.Spice3.Internal.Mos1.drainCur

Drain current calculation

Information


This function drainCur calculates the main currents that flows from drain node to source node (level 1).

Inputs

TypeNameDefaultDescription
Voltagevb [V]
Voltagevg [V]
Voltagevds [V]
Mos1Calcin_c Input record Mos1Calc
Mos1ModelLineParamsin_p Input record model line parameters for MOS1
SpiceConstantsin_C Spice constants
MosModelLineVariablesin_vp Input record model line variables
Integerin_m_type Type of Mos transistor

Outputs

TypeNameDescription
Mos1Calcout_cOutput record Mos1Calc

Modelica definition

function drainCur "Drain current calculation"

  input Modelica.SIunits.Voltage vb;
  input Modelica.SIunits.Voltage vg;
  input Modelica.SIunits.Voltage vds;

  input Mos1Calc in_c "Input record Mos1Calc";
  input Mos1ModelLineParams in_p "Input record model line parameters for MOS1";
  input SpiceConstants in_C "Spice constants";
  input Mos.MosModelLineVariables in_vp "Input record model line variables";
  input Integer in_m_type "Type of Mos transistor";

  output Mos1Calc out_c "Output record Mos1Calc";

protected 
  Real arg;
  Real betap;
  Real sarg;
  Modelica.SIunits.Voltage vgst;

algorithm 
  out_c := in_c;

   if (vb <= 0) then
      sarg := sqrt( out_c.m_tPhi - vb);
   else
      sarg := sqrt( out_c.m_tPhi);
      sarg := sarg - vb / (sarg + sarg);
      sarg := max( 0., sarg);
   end if;

   out_c.m_von   := (out_c.m_tVbi * in_m_type) + in_vp.m_gamma * sarg;
   vgst          := vg - out_c.m_von;
   out_c.m_vdsat := max( vgst, 0.);
   arg           := if (sarg <= 0) then 0 else in_vp.m_gamma / (sarg + sarg);

   if (vgst <= 0) then
      /* cutoff region */
      out_c.m_cdrain := 0;
      out_c.m_gm     := 0;
      out_c.m_gds    := 0;
      out_c.m_gmbs   := 0;

   else
      betap := out_c.m_Beta*(1 + in_p.m_lambda*vds);

      if (vgst <= vds) then
         /* saturation region */
         out_c.m_cdrain := betap * vgst * vgst * 0.5;
         out_c.m_gm     := betap * vgst;
         out_c.m_gds    := in_p.m_lambda * out_c.m_Beta * vgst * vgst * 0.5;
         out_c.m_gmbs   := out_c.m_gm * arg;
      else
         /* linear region */
         out_c.m_cdrain := betap * vds * (vgst - 0.5 * vds);
         out_c.m_gm     := betap * vds;
         out_c.m_gds    := betap * (vgst - vds) + in_p.m_lambda * out_c.m_Beta * vds * (vgst - 0.5  * vds);
         out_c.m_gmbs   := out_c.m_gm * arg;
      end if;
   end if;

end drainCur;

Modelica.Electrical.Spice3.Internal.Mos1.mos1RenameParameters

Parameter renaming to internal names

Information


This function mos1RenameParameters assigns the external (given by the user, e.g., RD) technology parameters to the internal parameters (e.g., m_drainResistance). It also does the analysis of the IsGiven values (level 1).

Inputs

TypeNameDefaultDescription
ModelcardMOSex Modelcard with technologieparameters
SpiceConstantscon Spice constants

Outputs

TypeNameDescription
MosModelLineParamsinternOutput record model line parameters

Modelica definition

function mos1RenameParameters "Parameter renaming to internal names"

  input ModelcardMOS ex "Modelcard with technologieparameters";
  input SpiceConstants con "Spice constants";

  output Mos.MosModelLineParams intern "Output record model line parameters";

algorithm 
    intern.m_oxideCapFactor := 0;

    intern.m_vtOIsGiven := if          (ex.VTO > -1e40) then 1 else 0;
    intern.m_vt0 := if         (ex.VTO > -1e40) then ex.VTO else 0;

    intern.m_capBDIsGiven := if          (ex.CBD > -1e40) then 1 else 0;
    intern.m_capBD := if         (ex.CBD > -1e40) then ex.CBD else 0;

    intern.m_capBSIsGiven := if          (ex.CBS > -1e40) then 1 else 0;
    intern.m_capBS := if         (ex.CBS > -1e40) then ex.CBS else 0;

      intern.m_bulkCapFactorIsGiven := if          (ex.CJ > -1e40) then 1 else 0;
    intern.m_bulkCapFactor := if         (ex.CJ > -1e40) then ex.CJ else 0;

    intern.m_sideWallCapFactor := ex.CJSW 
    "F/m zero-bias junction sidewall cap. per meter of junction perimeter (default 0)";
    intern.m_fwdCapDepCoeff := ex.FC 
    "Coefficient for forward-bias depletion capacitance formula (default 0.5)";

    intern.m_phiIsGiven := if          (ex.PHI > -1e40) then 1 else 0;
    intern.m_phi := if         (ex.PHI > -1e40) then ex.PHI else 0.6;

     intern.m_gammaIsGiven := if          (ex.GAMMA > -1e40) then 1 else 0;
    intern.m_gamma := if         (ex.GAMMA > -1e40) then ex.GAMMA else 0;

    intern.m_lambda := ex.LAMBDA "1/V channel-length modulation (default 0)";

    intern.m_substrateDopingIsGiven := if          (ex.NSUB > -1e40) then 1 else 0;
    intern.m_substrateDoping := if         (ex.NSUB > -1e40) then ex.NSUB else 0;

    intern.m_gateType := ex.TPG 
    "Type of gate material: +1 opp. to substrate, -1 same as substrate, 0 Al gate (default 1)";
    intern.m_surfaceStateDensity := ex.NSS 
    "IN 1/(cm*cm) surface state density (default 0)";
    intern.m_surfaceMobility := ex.UO 
    "In (cm*cm)/(Vs) surface mobility (default 600)";
    intern.m_latDiff := ex.LD "In m lateral diffusion (default 0)";
    intern.m_jctSatCur := ex.IS 
    "A bulk junction saturation current (defaul 1e-14)";

    intern.m_drainResistanceIsGiven := if 
                                         (ex.RD > -1e40) then 1 else 0;
    intern.m_drainResistance := if 
                                 (ex.RD > -1e40) then ex.RD else 0;

    intern.m_sourceResistanceIsGiven := if 
                                         (ex.RS > -1e40) then 1 else 0;
    intern.m_sourceResistance := if 
                                 (ex.RS > -1e40) then ex.RS else 0;

    intern.m_transconductanceIsGiven := if          (ex.KP > -1e40) then 1 else 0;
    intern.m_transconductance := if         (ex.KP > -1e40) then ex.KP else 2e-5;

    intern.m_tnom := if (ex.TNOM > -1e40) then ex.TNOM + SpiceConstants.CONSTCtoK else 300.15 
    "parameter measurement temperature (default 27 deg C)";

   intern.m_jctSatCurDensity := ex.JS 
    "A/(m*m) bulk junction saturation current per sq-meter of junction area (default 0)";
   intern.m_sheetResistance := ex.RSH 
    "Ohm drain and source diffusion sheet resistance (default 0)";
   intern.m_bulkJctPotential := ex.PB "V bulk junction potential (default 0.8)";
   intern.m_bulkJctBotGradingCoeff := ex.MJ 
    "bulk junction bottom grading coeff. (default 0.5)";
   intern.m_bulkJctSideGradingCoeff := ex.MJSW 
    "bulk junction sidewall grading coeff. (default 0.5)";

   intern.m_oxideThicknessIsGiven := if          (ex.TOX > -1e40) then 1 else 0;
    intern.m_oxideThickness := if         (ex.TOX > -1e40) then ex.TOX else 0;

   intern.m_gateSourceOverlapCapFactor := ex.CGSO 
    " F/m gate-source overlap capacitance per meter channel width (default 0)";
   intern.m_gateDrainOverlapCapFactor := ex.CGDO 
    "F/m gate-drain overlap capacitance per meter channel width (default 0)";
   intern.m_gateBulkOverlapCapFactor := ex.CGBO 
    "F/m gate-bulk overlap capacitance per meter channel width (default 0)";
   intern.m_fNcoef := ex.KF "Flicker-noise coefficient (default 0)";
   intern.m_fNexp := ex.AF "Flicker-noise exponent (default 1)";

end mos1RenameParameters;

Modelica.Electrical.Spice3.Internal.Mos1.mos1RenameParametersDev

Device parameter renaming to internal names

Information


This function mos1RenameParametersDev assigns the external (given by the user) device parameters to the internal parameters. It also does the analysis of the IsGiven values (level 1).

Inputs

TypeNameDefaultDescription
ModelcardMOSex  
Integermtype  
LengthW Channel Width [m]
LengthL Channel Length [m]
AreaAD Area of the drain diffusion [m2]
AreaAS Area of the source diffusion [m2]
LengthPD Perimeter of the drain junction [m]
LengthPS Perimeter of the source junction [m]
RealNRD Number of squares of the drain diffusions
RealNRS Number of squares of the source diffusions
IntegerOFF Optional initial condition: 0 - IC not used, 1 - IC used, not implemented yet
RealIC Initial condition values, not implemented yet
Temp_CTEMP Temperature [degC]

Outputs

TypeNameDescription
MosfetdevOutput record Mosfet

Modelica definition

function mos1RenameParametersDev 
  "Device parameter renaming to internal names"
  input ModelcardMOS ex;
  input Integer mtype;
  input Modelica.SIunits.Length W "Channel Width";
  input Modelica.SIunits.Length L "Channel Length";
  input Modelica.SIunits.Area AD "Area of the drain diffusion";
  input Modelica.SIunits.Area AS "Area of the source diffusion";
  input Modelica.SIunits.Length PD "Perimeter of the drain junction";
  input Modelica.SIunits.Length PS "Perimeter of the source junction";
  input Real NRD "Number of squares of the drain diffusions";
  input Real NRS "Number of squares of the source diffusions";
  input Integer OFF 
    "Optional initial condition: 0 - IC not used, 1 - IC used, not implemented yet";
  input Real IC "Initial condition values, not implemented yet";
  input Modelica.SIunits.Temp_C TEMP "Temperature";

  output Mosfet.Mosfet dev "Output record Mosfet";

algorithm 
/*device parameters*/
  dev.m_len := L "L, length of channel region";
  dev.m_width := W "W, width of channel region";
  dev.m_drainArea := AD "AD, area of drain diffusion";
  dev.m_sourceArea := AS "AS, area of source diffusion";
  dev.m_drainSquares := NRD "NRD, length of drain in squares";
  dev.m_sourceSquares := NRS "NRS, length of source in squares";
  dev.m_drainPerimiter := PD "PD, Drain perimeter";
  dev.m_sourcePerimiter := PS "PS, Source perimeter";

    dev.m_dICVDSIsGiven := if          (IC > -1e40) then 1 else 0 
    "ICVDS IsGivenValue";
    dev.m_dICVDS := if         (IC > -1e40) then IC else 0 
    "Initial condition of VDS";

    dev.m_dICVGSIsGiven := if          (IC > -1e40) then 1 else 0 
    "ICVGS IsGivenValue";
    dev.m_dICVGS := if         (IC > -1e40) then IC else 0 
    "Initial condition of VGS";

    dev.m_dICVBSIsGiven := if          (IC > -1e40) then 1 else 0 
    "ICVBS IsGivenValue";
    dev.m_dICVBS := if         (IC > -1e40) then IC else 0 
    "Initial condition of VBS";

  dev.m_off := OFF "Non-zero to indicate device is off for dc analysis";
  dev.m_bPMOS := mtype "P type MOSfet model";
  dev.m_nLevel := ex.LEVEL "Level";
  assert(ex.LEVEL== 1, "only MOS Level1 implemented");
  dev.m_dTemp :=TEMP + SpiceConstants.CONSTCtoK "Device temperature";

end mos1RenameParametersDev;

Automatically generated Fri Nov 12 16:29:47 2010.