Conventions

Bias Polarity Conventions for N- and P-channel Devices

The input biases vds , vgs , and vbs in CMI_VAR are defined as:

vds = vd - vs

vgs = vg - vs

vbs = vb - vs

Negation of these biases for the P-channel device is required if your model code does not distinguish between n-channel and p-channel bias. In the example routines, the biases are multiplied by the model parameter "type", which is 1 for N-device and -1 for P-device. See for example the MOS3 model code:

if (model->MOS3type < 0) { /* P-channel */

vgs = -VgsExt;

vds = -VdsExt;

vbs = -VbsExt;

}

else { /* N-channel */

vgs = VgsExt;

vds = VdsExt;

vbs = VbsExt;

}

This code should be used in both the CMI_Evaluate() and CMI_DiodeEval() functions.

The convention for outputting current components is shown in MOSFET (node1, node2, node3, node4) - N-channel. For channel current, drain-to-source is considered the positive direction. For substrate diodes, bulk-to-source/drain are considered the positive directions. The conventions are the same for both N-channel and P-channel devices.

 

Figure 23-3: MOSFET (node1, node2, node3, node4) - N-channel

The conventions for von are:

Derivatives (conductances and capacitances) should be provided based on the polarity conventions of the bias and current. The following code demonstrates the required polarity reversal for currents and Von, Vdsat for PMOS devices.


if (model->type < 0)

{

pslot->ids = -pslot->ids;

pslot->ibs = -pslot->ibs;

pslot->ibd = -pslot->ibd;

pslot->von = -pslot->von;

pslot->vdsat = -pslot->vdsat;

}

Source-Drain Reversal Conventions

Star-Hspice performs the appropriate computations when the MOSFET is operated in the reverse mode (i.e., when Vds < 0 for N-channel, Vds > 0 for P-channel). This includes a variable transformation (Vds -> -Vds, Vgs -> Vgd, Vbs->Vbd) and interchange of the source and drain terminals. This transformation is transparent to the model developer and simplifies the model coding task.

Thread-Safe Model Code

Star-Hspice uses shared-memory, multithreading algorithms during model evaluation. To ensure thread-safe model code, the following rules must be strictly adhered to:

 

Star-Hspice Manual - Release 2001.2 - June 2001