使用FIND 和 WHEN 函数,可以在某些特定事件发生时,测量任何自变量(时间、频率、参数)、任何因变量(例如电压或电流)或任何因变量的导数。这些测量语句在单位增益频率或相位测量中很有用,也可用于测量两个信号相互交叉时或信号与恒定值交叉时的时间、频率或任何参数值。测量将在指定的时间延迟 TD 后开始。可以通过将 RISE、FALL 或 CROSS 设置为值(或参数)或将 LAST 设置为最后一个事件来查找特定事件。
.MEASURE <DC|TRAN| AC> result WHEN out_var = val <TD = val>
+ < RISE = r | LAST > < FALL = f | LAST > < CROSS = c | LAST >
+ <GOAL = val> <MINVAL = val> <WEIGHT = val>
.MEASURE <DC|TRAN|AC> result WHEN out_var1 = out_var2 < TD = val >
+ < RISE = r | LAST > < FALL = f | LAST > < CROSS = c| LAST >
+ <GOAL = val> <MINVAL = val> <WEIGHT = val>
.MEASURE <DC|TRAN|AC> result FIND out_var1 WHEN out_var2 = val < TD = val >
+ < RISE = r | LAST > < FALL = f | LAST >
+ < CROSS = c| LAST > <GOAL = val> <MINVAL = val> <WEIGHT = val>
.MEASURE <DC|TRAN|AC> result FIND out_var1 WHEN out_var2 = out_var3
+ <TD = val > < RISE = r | LAST > < FALL = f | LAST >
+ <CROSS = c | LAST> <GOAL = val> <MINVAL = val> <WEIGHT = val>
.MEASURE <DC|TRAN|AC> result FIND out_var1 AT = val <GOAL = val>
参数
含义
CROSS = cRISE = rFALL = f
The numbers indicate which occurrence of a CROSS, FALL, or RISE event causes a measurement to be performed. For RISE = r, the WHEN condition is met and measurement is performed when the designated signal has risen r rise times. For FALL = f, measurement is performed when the designated signal has fallen f fall times. A crossing is either a rise or a fall, so for CROSS = c, measurement is performed when the designated signal has achieved a total of c crossing times, as a result of either rising or falling.
\
Specifies the analysis type of the measurement. If omitted, the last analysis type requested is assumed.
FIND
Selects the FIND function
GOAL
Specifies the desired .MEASURE value. It is used in optimization.
LAST
Measurement is performed when the last CROSS, FALL, or RISE event occurs. For CROSS = LAST, measurement is performed the last time the WHEN condition is true for either a rising or falling signal. For FALL = LAST, measurement is performed the last time the WHEN condition is true for a falling signal. For RISE = LAST, measurement is performed the last time the WHEN condition is true for a rising signal. LAST is a reserved word and cannot be chosen as a parameter name in the above .MEASURE statements.
MINVAL
If the absolute value of GOAL is less than MINVAL, the GOAL value is replaced by MINVAL in the denominator of the ERRfun expression. Default = 1.0e-12.
out_var(1,2,3)
Variables used to establish conditions at which measurement is to take place
result
Name associated with the measured value in the Star-Hspice output
TD
Identifies the time at which measurement is to start
WEIGHT
Calculated error is multiplied by the weight value. Default = 1.0.
Specifies the analysis type of the measurement. If omitted, the last analysis mode requested is assumed.
FROM
Specifies the initial value for the "func" calculation. For transient analysis, value is in units of time.
TO
Specifies the end of the "func" calculation.
GOAL
Specifies the desired .MEASURE value. It is used in optimization.
MINVAL
If the absolute value of GOAL is less than MINVAL, the GOAL value is replaced by MINVAL in the denominator of the ERRfun expression. Default = 1.0e-12.
func
Indicates the type of the measure statement, one of the following:* AVG (average):Calculates the area under the out_var divided by the periods of interest* MAX (maximum):Reports the maximum value of the out_var over the specified interval* MIN (minimum):Reports the minimum value of the out_var over the specified interval* PP (peak-to-peak):Reports the maximum value minus the minimum value of the out_var over the specified interval* RMS (root mean squared):Calculates the square root of the area under the out_var 2 curve divided by the period of interest
result
Name that is associated with the measured value in the Star-Hspice output. The value is a function of the variable specified (out_var) and func.
out_var
Name of any output variable whose function ("func") is to be measured in the simulation.
WEIGHT
The calculated error is multiplied by the weight value. Default = 1.0.
.MEASURE <DC|AC|TRAN> result DERIVATIVE out_var AT = val <GOAL = val>
+ <MINVAL = val> <WEIGHT = val>
.MEASURE <DC|AC|TRAN> result DERIVATIVE out_var WHEN var2 = val
+ <RISE = r | LAST> <FALL = f | LAST> <CROSS = c | LAST>
+ <TD = tdval> <GOAL = goalval> <MINVAL = minval> <WEIGHT = weightval>
.MEASURE <DC|AC|TRAN> result DERIVATIVE out_var WHEN var2 = var3
+ <RISE = r | LAST> <FALL = f | LAST> <CROSS = c | LAST>
+ <TD = tdval> <GOAL = goalval> <MINVAL = minval> <WEIGHT = weightval>
参数
含义
AT = val
Value of out_var at which the derivative is to be found
CROSS = cRISE = rFALL = f
The numbers indicate which occurrence of a CROSS, FALL, or RISE event causes a measurement to be performed. For RISE = r, the WHEN condition is met and measurement is performed when the designated signal has risen r rise times. For FALL = f, measurement is performed when the designated signal has fallen f fall times. A crossing is either a rise or a fall, so for CROSS = c, measurement is performed when the designated signal has achieved a total of c crossing times, as a result of either rising or falling.
\
Specifies the analysis type measured. If omitted, the last analysis mode requested is assumed.
DERIVATIVE
Selects the derivative function. May be abbreviated to DERIV.
GOAL
Specifies the desired .MEASURE value. It is used in optimization.
LAST
Measurement is performed when the last CROSS, FALL, or RISE event occurs. For CROSS = LAST, measurement is performed the last time the WHEN condition is true for either a rising or falling signal. For FALL = LAST, measurement is performed that last time the WHEN condition is true for a falling signal. For RISE = LAST, measurement is performed the last time the WHEN condition is true for a rising signal. LAST is a reserved word and cannot be chosen as a parameter name in the above .MEASURE statements.
MINVAL
If the absolute value of GOAL is less than MINVAL, the GOAL value is replaced by MINVAL in the denominator of the ERRfun expression. Default = 1.0e-12.
out_var
Variable for which the derivative is to be found
result
Name associated with the measured value in the Star-Hspice output
TD
Identifies the time at which measurement is to start
var(2,3)
Variables used to establish conditions at which measurement is to take place
WEIGHT
The calculated error between result and GOAL is multiplied by the weight value. Default = 1.0.
Specifies the analysis type of the measurement. If omitted, the last analysis mode requested is assumed.
result
Name associated with the measured result in the output
ERRfun
ERRfun indicates which error function to use: ERR, ERR1, ERR2, or ERR3.
meas_var
Name of any output variable or parameter in the data statement. M denotes the meas_var in the error equation.
calc_var
Name of the simulated output variable or parameter in the .MEASURE statement to be compared with meas_var. C denotes the calc_var in the error equation.
IGNOR|YMIN
If the absolute value of meas_var is less than IGNOR value, then this point is not considered in the ERRfun calculation. Default = 1.0e-15.
FROM
Specifies the beginning of the ERRfun calculation. For transient analysis, the from value is in units of time. Defaults to the first value of the sweep variable.
WEIGHT
The calculated error is multiplied by the weight value. Default = 1.0.
YMAX
If the absolute value of meas_var is greater than the YMAX value, then this point is not considered in the ERRfun calculation. Default = 1.0e+15.
TO
Specifies the end of the ERRfun calculation. Defaults to the last value of the sweep variable.
MINVAL
If the absolute value of meas_var is less than MINVAL, the meas_var value is replaced by MINVAL in the denominator of the ERRfun expression. Default = 1.0e-12.
.AC type np fstart fstop
.AC type np fstart fstop <SWEEP var start stop incr>
.AC type np fstart fstop <SWEEP var type np start stop>
.AC type np fstart fstop <SWEEP DATA=datanam>
评论区