In this example, Star-Hspice simulates the electrical measurements used to characterize devices for data sheet information. The demonstration file for this example is $installdir/demo/hspice/ddl /t2n2222.sp. The example automatically includes DDL models by reference using the DDLPATH environment variable, or through the .OPTION SEARCH='path'. It also combines an AC circuit and measurement with a transient circuit and measurement.
The AC circuit measures the maximum Hfe, the small signal common emitter gain. The WHEN option of the .MEASURE statement allows calculation of the unity gain frequency and the phase at the frequency specified with WHEN. In the "Transient Measurements" section of the input file, a segmented transient statement is used to speed up the simulation and compress the output graph. Measurements include:
TURN ON from 90% of input rising to 90% of output falling
OUTPUT FALL from 90% to 10% of output falling
TURN OFF from 10% of input falling to 10% of output rising
OUTPUT RISE from 10% to 90% of output rising
* FILE: T2N2222.SP
** assume beta=200 ft250meg at ic=20ma and vce=20v for 2n2222
.OPTION nopage autostop search=' '
*** ft measurement
* the net command is automatically reversing the sign of the
* power supply current for the network calculations
.NET I(vce) IBASE ROUT=50 RIN=50
VCE C 0 vce
IBASE 0 b AC=1 DC=ibase
xqft c b 0 t2n2222
.ac dec 10 1 1000meg
.graph s21(m) h21(m)
.measure 'phase @h21=0db' WHEN h21(db)=0
.measure 'h21_max' max h21(m)
.measure 'phase @h21=0deg' FIND h21(p) WHEN h21(db)=0
.param ibase=1e-4 vce=20 tauf=5.5e-10
** vccf power supply for forward reverse step recovery time
** vccr power supply for inverse reverse step recovery time
** VPLUSF positive voltage for forward pulse generator
** VPLUSr positive voltage for reverse pulse generator
** Vminusf positive voltage for forward pulse generator
** Vminusr positive voltage for reverse pulse generator
** rloadf load resistor for forward
** rloadr load resistor for reverse
.param vccf=30v
.param VPLUSF=9.9v
.param VMINUSF=-0.5v
.param rloadf=200
.TRAN 1N 75N 25N 200N 1N 300N 25N 1200N
.measure 'turn-on time 'trig par('v(inf)-0.9*vplusf') val=0
+ rise=1 targ par('v(outf)-0.9*vccf') val=0 fall=1
.measure 'fall time 'trig par('v(outf)-0.9*vccf') val=0
+ fall=1 targ par('v(outf)-0.1*vccf') val=0 fall=1
.measure 'turn-off time' trig par('v(inf)-0.1*vplusf') val=0
+ fall=1 targ par('v(outf)-0.1*vccf') val=0 rise=1
.measure 'rise time 'trig par('v(outf)-0.1*vccf') val=0
+ rise=1 targ par('v(outf)-0.9*vccf') val=0 rise=1
.graph V(INF) V(OUTF)
VCCF VCCF 0 vccf
RLOADF VCCF OUTF RLOADF
RINF INF VBASEF 1000
RPARF INF 0 58
XSCOPf OUTF 0 SCOPE
VINF INF 0 PL VMINUSF 0S VMINUSF 5NS
+ VPLUSF 7NS VPLUSF 207NS VMINUSF 209NS
* CCX0F VBASEF OUTF CCX0F
* CEX0F VBASEF 0 CEX0F
XQF OUTF VBASEF 0 t2n2222
.MACRO SCOPE VLOAD VREF
RIN VLOAD VREF 100K
CIN VLOAD VREF 12P
.EOM
.ENDStar-Hspice Manual - Release 2001.2 - June 2001