// Copyright (c) 2000-2007, NXP Semiconductor
// Copyright (c) 2007-2014, Delft University of Technology
// Copyright (c) 2015-2017, Auburn University
// All rights reserved, see IP_disclaimer_license.txt for further information.

Mextram 505.00 Source Code

Additions and changes compared to 504.12.1 are:

- CB junction tunneling current model added.

- vdcs are decoupled for quasi-saturation and C-V. 
  vdc is dedicated for quasi-saturation. 
  vdcctc and pc are dedicated for CV.
  vdcctc is used for CB tunneling.

- Added temperature dependent non-ideality factors in main current, nff and nfr.
- Diffusion charge and diffusion capacitance expressions are modified accordingly to maintain the same transit time.

- Nonideality factors in ideal base current IB1 and IB1S are added.
- Side-wall non-ideal base current IB2S are added.
- Side-wall base current for reliability modeling IBrel is added.
- Current gains (bf, bri) are no longer used. All base current components have their own saturation current and non-ideality factors where needed.

- Nonideal reverse base current is now formulated the same way as forward non-ideal base current.

- 1/f noise of all ideal base currents is now calculated from kf and af, and placed between B2 and E1.
- 1/f noise of all non-ideal base currents is now calculated from kfn and afn, and placed between B1 and E1.

- New avalanche current implementation using main current (In) as opposed to Ic1c2 as initiating current, and corresponding changes in Iavl limits.
- New avalanche factor (Gem) model.
- swavl, a switch parameter for avalanche factor.
     swavl = 0, no avalanche current,
     swavl = 1 (default), a new avalanche model,
     swavl = 2, Mextram 504 avalanche model. exavl is meaningful only when swavl=2.

- Add vdcctc, diffusion voltage dedicated for CB depletion capacitance.    

- Add switch for Vjunc calculation, swvjunc, swvjunc = 0 (default), 1, and 2 (504). 
    // Effective collector-base junction capacitance bias switch  
    if (swvjunc == 0)
        Vjunc = Vb2c2; 
    else if (swvjunc == 1)
        Vjunc = Vb2c1;
    else if (swvjunc == 2)
        Vjunc = Vb2c1 + Vxi0;
        
- Add switch for transition voltage width Vch in CB capacitance-voltage curve smoothing, swvchc, swvchc=0 (default) and 1 (504).
    if (swvchc == 0)
        Vch = vdc_t * 0.1;
    else    
        Vch = vdc_t * (0.1 + 2.0 * Ic1c2 / (Ic1c2 + Iqs));     
    
- Iex is now corrected to describe extrinsic BC junction current as hole injection into collector (in 504, it was described as electron injection current from collector to extrinsic base - which is not the case for real devices)    
     
- iks means now true substrate current's knee.

- Change default value of parameter exsub from 0 to 1.

- Change default range of parameter icss from (-inf, inf) to [0.0, inf) and Isf is directly calculated from icss. 

- p0star and pW clipping restored to solve convergence problems at high VCB.

- Improvement of xext coding to allow xext = 0.

- Types of numerical constants cleaned up.

- Code reformatted to have asymetric begin / end format.

- Macros are rewritten for consistency. No trailing ";" should be used in macro calling.

- gmin now can take value from both model card and simulator. 
  gmin explicitly specified on model card has higher priority over gmin from simulator options. 

