Professional Documents
Culture Documents
n n n
MEASURE
n
.MEASURE
q
q
(Vol. 1, p. 3-13+)
q q
Used extensively for optimization and curve fitting Seven fundamental measurement modes:
Rise, Fall, Delay Average, RMS, Min, Max, and Peak-to-Peak Find-When Equation Evaluation Derivative Evaluation Integral Evaluation Relative Error
result - name given the measured value in the HSPICE output. TRIG trig_var VAL=trig_val <TD=timedelay> <CROSS=#of> <RISE=#of> + <FALL=#of> TRIG AT=value TARG targ_var VAL=targ_val <TD=timedelay> <CROSS=#of | LAST><RISE=#of | LAST> + <FALLS=#of | LAST>
Example
+ TARG V(2) VAL=2.5
(Vol. 1, pg 3-14)
Delay 10ns TDLAY
...
V(2)
...
2.5v
func: AVG, RMS, MIN, MAX, PP result: name given the measured value in the HSPICE output out_var: name of the output variable to be measured.
Examples
q
Print out average nodal voltage of node 10 during tran time 10 to 55ns. Print as avgval.
Find the maximum voltage difference between nodes 1 and 2 from time 15ns to 100ns. Print as maxval.
FIND-WHEN
q
(Vol. 1, p. 3-18)
Allows any independent variables (time, freq, parameter), by using WHEN syntax, or any dependent variables (voltage, current, etc), by using FIND-WHEN syntax, to be measured when some specific event occurs.
.MEASURE <DC | TRAN | AC> result WHEN out_var=val <TD=val> + <RISE=#of> | LAST> <FALL=#of | LAST> <CROSS=#of | LAST> <optimization options>
result - name given the measured value in the HSPICE output file.
n
Example - WHEN
.MEAS TRAN fifth WHEN V(osc_out)=2.5v RISE=5
measure the time of the 5th rise of node osc_out at 2.5v. Report as fifth in listing.
Example - FIND-WHEN
.MEAS TRAN result FIND v(out) WHEN v(in)=40m
measure v(out) when v(in)=40m - store in variable result
Equation Evaluation
q
(Vol. 1, p. 3-19)
Use this statement to evaluate an equation that can be a function of the results of previous .MEASURE statements. The equation MUST NOT be a function of node voltages or branch currents.
Example
.MEAS TRAN Tmid PARAM=(T_from+T_to)/2
Derivative Function
q
(Vol. 1, p. 3-19)
Provides the derivative of an output variable at a given time or frequency or for any sweep variable. Also provides the derivative of a specified output variable when some specific event occurs. .MEASURE <DC | TRAN | AC> result DERIVATIVE out_var WHEN +var2=val <TD=val> <RISE=#of> | LAST> <FALL=#of | LAST> +<CROSS=#of | LAST> <optimization options>
result - name given the measured value in the HSPICE output file.
Example
.MEAS TRAN slewrate DERIV v(1) WHEN V(osc_out)=2.5v RISE=5
Integral Function
q
(Vol. 1, p. 3-21)
.MEASURE <DC | TRAN | AC> result INTEGRAL out_var <FROM=val1> + <TO=val2> <optimization options>
result - name given the measured value in the HSPICE output file.
n
Example
.MEAS TRAN charge INTEG I(cload) FROM=10ns TO=100ns
LAB 6
.ALTER: Description
n
.ALTER
q
Circuit topology Models Library components Elements Parameter values Options Source stimulus Analysis variables Print/plot commands (must be parameterized)
.ALTER
Sequence for Worst Case Corner Analysis Removes previous library selection Add new library case
q q q
1st Run - Star-Hspice reads input netlist file up to the first .ALTER Subsequent - Reads input netlist to next .ALTER, etc
.option alt9999 - Can use up to 9999 alters in one run. With .ALTER statement only, default is 36. D3, Session 2: Intro to Statistical Simulation
Star-Hspice Basic Training 2000
10
.ALTER: Limitations
n
Limitations:
Main Program q
$Alternative Main Program 1 ... ... .END Main Program 2 ... ... .END etc
CAN include
Element Statements (except source) .DATA, .LIB, .DEL LIB, .INCLUDE, .MODEL statements .IC, .NODESET statements .OP, .OPTIONS, .PARAM, .TEMP, .TF, .TRAN, .DC, .AC
CANNOT include
AVOID adding analysis statements under each .ALTER block. ( Will cause huge penalty in simulation time and confusion in result outputting!)
.ALTER: Example
(Vol. 1, pp 2-23)
ALTER Test - CMOS Inverter .OPTIONS ACCT LIST .OP .DC VIN 0 5 0.1 .PRINT DC v(3) v(2) .PRINT tran v(3) .PARAM VDD=5 .LIB MOS.LIB NORMAL VDD 1 0 VDD VIN 2 0 M1 3 2 1 1 P 6U 15U M2 3 2 0 0 N 6U 15U .ALTER Change Supply .PARAM VDD=10 .ALTER Fast Process .DEL LIB MOS.LIB NORMAL .LIB MOS.LIB FAST .ALTER Add Transient .TRAN .1 2 .END
.OP DC Sweep
... change VDD to 10v .OP DC Sweep ... alter change to fast library (MUST delete first) (VDD=10v still in effect) .OP DC Sweep ... alter to add transient (VDD=10v still in effect) (.lib mos.lib FAST still in effect) .OP DC Sweep Transient
.ALTER: Example
n
Statistical Methods
n
Perform multiple analyses to modify DC operating points, sweeps, AC, and transient analyses. Types of Analysis
q
(Vol. 1, p. 9-19)
Component value limits are known, measured, and implemented as skew parameters. (Vol. 1, p. 9-25)
Statistical standard deviations of component values are known. Automated over a random range of values.
(Vol. 1, P. 9-19)
Switch to different process corner libraries and repeat simulation. .ALTER, .DEL LIB, .LIB (you MUST delete a lib before calling a new lib)
.LIB CMOS.lib SLOW .Tran ... .ALTER Run Fast Corner Library .DEL LIB CMOS.lib SLOW
e.g. poly CD, active CD, tox, diffusion resistivity, threshold voltage variation, etc. Incorporated into models as skew variables.
.PARAM sigma=0 toxcd=200 tox=toxcd - sigma * 10 .TRAN 20p 1n SWEEP sigma -3 3 .5 ... .model ... tox=tox ...
Setup
q q q
.PARAM statement. (Set element/model parameter to function distribution). Set .DC, .AC, .TRAN to MONTE .MEASURE to calculate mean, variance, sigma, std. deviation.
.PARAM tox = agauss ( 200 , 10 , 1 ) .TRAN 20p 1n sweep MONTE=20 ... .model ... tox=tox ...
(Vol. 1, P. 9-27)
WARNING - if you misspell GAUSS (or uniform or limit) there is no warning, but no distribution will occur.
.AC dec 10 100 10meg sweep monte=val .TRAN 1n 10n sweep monte=val
A .MEASURE statement can be used to calculate the mean, variance, and sigma of any output desired.
R1 1 0 Res R2 2 0 Res 2 .tran 2 ns 100ns sweep monte=30 .param Res=gauss(10k, 1k, 1) + Res2=gauss (Res+1, 1k, 1) .measure tran name find v(3) at 50ns
LAB 7