Using performance analysis and measurements
Using Performance Analysis
Performance Analysis allows you to add traces that show how a derived value changes between simulation runs. The derived value is calculated for each run based on the measurement expression you specify when you add each trace.
To prepare for using Performance Analysis
- Have multiple sections of data in the Probe data file. Enabling a parametric analysis, a temperature analysis with multiple temperatures, or a Monte Carlo analysis causes the simulator to do multiple simulations of the circuit. Each simulation creates one section of data.
-
Create measurement definitions you want to use and bring them into PSpice. Do one of the following:
- Use the predefined measurement definitions in the file PSpice.PRB.
- Create measurement definitions in a .PRB file, using an ASCII text editor like Notepad. Save the file with a .PRB extension. Load the file into PSpice as a global file.
- Create new or edit existing measurement definitions while running Probe: from the Trace menu, select Measurements, then select New or Edit.
Using Measurement Expressions
Measurement expressions evaluate the characteristics of a waveform. A measurement expression is made by choosing the waveform and the waveform calculation you want to evaluate.
The waveform calculation is defined by a measurement definition such as rise time, bandpass bandwidth, minimum value, and maximum value.
For example, if you want to measure the risetime of your circuit output voltage, use the following expression:
Risetime_NoOvershoot(v(out))
- Start with a circuit created in Capture and a working PSpice simulation.
- Decide what you want to measure.
- Select the measurement definition that matches the waveform characteristics you want to measure.
- Insert the output variable (whose waveform you want to measure) into the measurement definition, to form a measurement expression.
- Test the measurement expression.
Composing Measurement Expressions
These steps show you how to create a measurement expression in PSpice. Measurement expressions created in PSpice can be imported into Advanced Analysis.
-
Work in the Simulation Results view in PSpice. In the side toolbar, click
.
-
From the Trace menu in PSpice, select Measurements.
The Measurements dialog box appears. - Select the measurement definition you want to evaluate.
-
Click Eval (evaluate).
The Arguments for Measurement Evaluation dialog box appears. -
Click the Name of trace to search button.
The Traces for Measurement Arguments dialog box appears. - Uncheck the output types you don’t need (if you want to simplify the list).
-
Click the output variable you want to evaluate.
The output variable appears in the Trace Expression field. -
Click OK.
The Arguments for Measurement Evaluation dialog box reappears with the output variable you chose in the Name of trace to search field. -
Click OK.
Your new measurement expression is evaluated and displayed graphically in the PSpice window. -
Click OK in the Display Measurement Evaluation pop-up box to continue working in PSpice.
Your new measurement expression is saved, but it no longer displays in the window. The only way to get another graphical display is to redo these steps.
You can see the numerical evaluation of your measurement expression by following the steps in the topic Viewing Measurement Results.
See the topic Measurement Expression Example for an example.
Measurement Expression Example
These steps show you an example of creating a measurement expression in PSpice.
Work in the Simulation Results view in PSpice. In the side toolbar, click .
-
Choose Trace – Measurements.
The Measurements dialog box appears. - Select the measurement definition you want to evaluate.
-
Click Eval (evaluate).
The Arguments for Measurement Evaluation dialog box appears. -
Click the Name of trace to search button.
The Traces for Measurement Arguments dialog box appears. - Uncheck the output types you don’t need (if you want to simplify the list).
-
Click the output variable you want to evaluate.
The output variable appears in the Trace Expression field. -
Click OK.
The Arguments for Measurement Evaluation dialog box reappears with the output variable you chose in the Name of trace to search field. -
Click OK.
Your new measurement expression is evaluated and displayed graphically in the PSpice window. - Click OK in the Display Measurement Evaluation pop-up box to continue working in PSpice.
Your new measurement expression is saved, but it no longer displays in the window. The only way to get another graphical display is to redo these steps.
You can see the numerical evaluation of your measurement expression by following the steps in the topic Viewing Measurement Results.
Viewing Measurement Results
To view the results of measurement expressions you have previously composed:
-
From the View menu in PSpice, select Measurement Results.
The Measurement Results table displays below the plot window. -
Click the box in the Evaluate column.
The PSpice calculation for your measurement expression appears in the Value column.
See the topic Measurement Results Example for an example.
Evaluating a measurement
After simulating a circuit, you can add new measurements in the Measurement Results window, and evaluate them. To add a measurement for evaluation:
-
From the Trace menu in PSpice, choose Evaluate Measurement.
The Evaluate Measurement dialog box displays, with Measurements selected in the Functions or Macros drop-down list box. - Select the measurement that you want to evaluate by clicking one of the entries in the Measurements list.
-
From the Simulation Output Variables list, click the variable to be passed as a parameter to the selected measurement, and click OK.
The new measurement gets added in the Measurement Results table displayed below the plot window.
The PSpice calculation for your measurement expression appears in the Value column.
To view information on how to create new measurements, see Composing Measurement Expressions.
Measurement Results Example
-
Choose View - Measurement Results.
The Measurement Results table displays below the plot window. -
Click the box in the Evaluate column.
A check mark appears in the Evaluate column check box and the PSpice calculation for your measurement expression appears in the Value column.
Measurement Definitions Included with PSpice
Creating Custom Measurement Definitions
Measurement definitions establish rules to locate interesting points and compute values for a waveform. In order to do this, a measurement definition needs:
These are the calculations that computer the final point on the waveform.
These commands specify how to search for the interesting points.
- Decide what you want to measure.
- Examine the waveforms you have and choose which points on the waveform are needed to calculate the measured value.
- Compose the search commands to find and mark the desired points.
- Use the marked points in the Marked Point Expressions to calculate the final value for the waveforms.
- Test the search commands and measurements.
Choose Trace- Measurements to open the Measurements dialog box, then:
- Select the definition most similar to your needs
- Click Copy and follow the prompts to rename and edit.
Composing a New Measurement Definition
These steps show you how to create a measurement definition in PSpice. Measurement definitions can be directly evaluated or used as part of measurement expressions.
Work in the Simulation Results view in PSpice. In the side toolbar, click .
-
From the PSpice Trace menu, choose Measurements.
The Measurements dialog box appears. -
Click New to start with the basic template definition, or click Copy to start your new measurement definition using an existing definition.
The New Measurement dialog box or the Copy Measurement dialog box appears. - Type a name for the new measurement in the New Measurement name field. All measurement definitions must have unique names.
-
Make sure local file is selected.
This stores the new measurement in a .PRB file local to the design. -
Click OK.
The Edit New Measurement dialog box appears. If you have copied a measurement definition, you will need to click Edit on the Measurements dialog box. - Type in the marked point expression.
- Type in any comments you want.
- Type in the search command function.
Your new measurement definition is now listed in the Measurements dialog box.
See the topic Measurement Definition Example for an example.
Managing Measurements
You can use this dialog to evaluate measurement expressions or to create, edit, or delete existing measurements definitions.
- New allows you to compose a new measurement definition.
- Copy allows you to copy an existing measurement definition. This is a good way to start when you want to create a new measurement definition.
- View allows you to see the marked point expression, search function, and comments of the selected measurement definition.
- Edit allows you to modify the selected measurement definition.
- Delete allows you to remove the selected measurement definition. Once it has been deleted, you cannot undelete it.
- Eval allows you to evaluate a measurement expression using the selected measurement definition.
- Load allows you to load a different .PRB file with different measurement definitions. The load command on this Measurements dialog box will only load the measurement definitions from the .PRB file. Macros and displays will not be included.
Copying a Measurement Definition
Copying a measurement definition allows you to modify an existing measurement definition without losing the original definition.
Work in the Simulation Results view in PSpice. In the side toolbar, click .
-
Choose Trace - Measurements.
The Measurements dialog box appears. -
Select a measurement from the list and click Copy.
The Copy Measurement dialog box appears. - Type a name for the new measurement definition in the New Measurement name field. All measurement definitions must have unique names.
-
Make sure local file is selected.
This stores the new measurement in a .PRB file local to the design. - Click OK.
To edit your new measurement definition, click Edit on the Measurements dialog box. See Editing a Measurement Definition for more information.
Editing a Measurement Definition
Editing a measurement definition allows you to change the result it will evaluate.
Work in the Simulation Results view in PSpice. In the side toolbar, click .
-
Choose Trace - Measurements.
The Measurements dialog box appears. -
Select a measurement from the list and click Edit.
The Edit Measurement dialog box appears. - Edit the marked point expression as needed.
- Edit the comments as needed.
- Edit the search command function as needed.
Measurement Definition Example
-
From the PSpice Trace menu, choose Measurements.
The Measurements dialog box appears. -
Click New.
The New Measurement dialog box appears. - Type a name for the new measurement in the New Measurement name field.
-
Make sure local file is selected.
This stores the new measurement in a .prb file local to the design. -
Click OK.
The Edit New Measurement dialog box appears. -
Type in the marked point expression.
Point707(1) = y1
-
Type in any comments you want.
*
#Desc# Find the .707 value of the trace.
*
#Arg1# Name of trace to search
*
-
Type in the search function.
{
1|Search forward level(70.7%, p) !1;
}
Always place a semi-colon at the end of the last search function.
You now have your edited measurement definition. - Click OK to save your edits.
Your new measurement definition is now listed in the Measurements dialog box.
Measurement Definition Syntax
Measurement definitions have the following structure and syntax:
Measurement_name (1, [2, …., n][, subarg1, subarg2, …, subargm]) = Marked_point_expression
{
1| search_commands_and_marked_points_for_expression_1;
2| search_commands_and_marked_points_for_expression_2;
n| search_commands_and_marked_points_for_expression_n;
}
For examples of syntax, check out the existing measurement definitions in PSpice.
-
From the Trace menu in PSpice, choose Measurements.
The Measurement dialog box appears. -
Highlight an existing measurement definition, for example Risetime_NoOvershoot, and select View to examine the syntax.
The View Measurement dialog box appears.
The name of the measurement is Risetime_NoOvershoot. Risetime_NoOvershoot takes 1 argument, a trace name (as seen from the comments).
The first search function searches forward (positive x direction) from the point on the trace where the waveform crosses the 10% point in a positive direction. That point’s X and Y coordinates will be marked and saved as point 1.
The second search function searches forward in the positive direction for the point on the trace where the waveform crosses the 90% mark. That point’s X and Y coordinates will be marked and saved as point 2.
The marked point expression is x2-x1. This means the measurement calculates the X value of point 2 minus the X value of point 1 and returns that number.
Measurement Name Syntax
Names can contain any alphanumeric character (A-Z, 0-9) or an underscore _, up to 50 characters in length. The first character should be an upper or lower case letter.
Examples of valid function names: Bandwidth, CenterFreq, delay_time, DBLevel1.
Marked Point Expression Syntax
A marked point expression calculates a single value, which is the value of the measurement, based on the X and Y coordinates of one or more marked points on a curve. The marked points are found by the search command.
- All the arithmetic operators (+, -, *, /, () ) and all the functions that apply to a single point (for example, ABS(), SGN(), SIN(), SQRT() ) can be used in marked point expressions.
- The result of the expression is one number (a real value).
- Marked point expression differ from a regular expression in the following ways:
- Marked point coordinate values (for example, x1, y3), are used instead of simulation output variables (v(4), ic(Q1) ).
- Multiple-point functions such as d(), s(), AVG(), RMS(), MIN(), and MAX() cannot be used.
- Complex functions such as M(), P(), R(), IMG(), and G() cannot be used.
- One additional function called MPAVG can also be used. It is used to find the average Y value between 2 marked points. The format is:
MPAVG(p1, p2,[<.fraction>])
where p1 and p2 are marked X points and fraction (expressed in decimal form) specifies the range. The range specified by [<.fraction>] is centered on the midpoint of the total range. The default value is 1.
MPAVG(x1, x5, .2)
Will find the halfway point between x1 and x5 and will calculate the average Y value based on the 20 percent of the range that is centered on the halfway point.
Comments Syntax
A comment line always starts with an asterisk. Special comment lines include the following examples:
*#Desc#* The measurement description.
*#Arg1#* The first argument used in the measurement definition.
These comment lines will be used in dialog boxes, such as the Arguments for Measurement Evaluation box.
Search Command Syntax
Search commands can be used to find a particular point along a trace based on characteristics of that trace. Search commands can be used for two purposes:
- To position the cursor at a specific place along a trace.
- As part of a measurement definition<definition>, where the point found by the search can be used as a marked point.
Search [direction] [/start_point/] [#consecutive_points#] [(range_x[,range_y])]
[for] [repeat:] <condition>
Brackets indicate optional arguments.
You can use uppercase or lowercase characters, because searches are case independent.
[direction]
The direction of the search. The search begins at the origin of the curve.
[Forward]
searches in the normal X expression direction, which may appear as backwards on the plot if the X axis has been reversed with a user-defined range.
Forward is the default direction.
The starting point to begin a search. The current point is the default.
Defines the number of consecutive points required for a condition to be met. Usage varies for individual conditions; the default is 1.
A peak is a data point with one neighboring data point on both sides that has a lower Y value than the data point.
If [#consecutive_point#]
is 2 and <condition> is PEak, then the peak searched for is a data point with two neighboring data points on both sides with lower Y values than the marked data point.
Specifies the range of values to confine the search.
The range can be specified as floating-point values, as a percent of the full range, as marked points, or as an expression of marked points. The default range is all points available.
X range limited from 1e-9 to 200e-9, Y range defaults to full range |
|
Specifies which occurrence of <condition> to find.
If repeat is greater than the number of found instances of <condition>
, then the last <condition>
found is used.
would find the second level crossing.
The <condition>
must be exactly one of the following:
Each <condition>
requires just the first 2
characters of the word. For example, you can shorten LEvel
to LE
.
If a <condition>
is not found, then either the cursor is not moved or the measurement definition is not evaluated.
<value>
can take any of the following forms:
Decimal point ( . )
A decimal point ( . ) represents the Y value of the last point found using a search on the current trace expression of the measurement definition. If this is the first search command, then it represents the Y value of the start point of the search.
[,posneg]
Finds the next Y value crossing at the specified level. This can be between real data points, in which case an interpolated artificial point is created.
At least [#consecutive_points#]-1 points following the level crossing point must be on the same side of the level crossing for the first point to count as the level crossing.
[,posneg] can be Positive (P), Negative (P), or Both (B). The default is Both.
SLope[(posneg)]
Finds the next maximum slope (positive or negative as specified) in the specified direction.
[(posneg)] refers to the slope going Positive (P), Negative (N), or Both (B). If more than the next [#consecutive_points#] points have zero or opposite slope, the Slope function does not look any further for the maximum slope.
Positive slope means increasing Y value for increasing indices of the X expression.
The point found is an artificial point halfway between the two data points defining the maximum slope.
The default [(posneg)] is Positive.
PEak
Finds the nearest peak. At least [#consecutive_points#] points on each side of the peak must have Y values less than the peak Y value.
TRough
Finds nearest negative peak. At least [#consecutive_points#] points on each side of the trough must have Y values greater than the trough Y value.
MAx
Finds the greatest Y value for all points in the specified X range. If more than one maximum exists (same Y values), then the nearest one is found.
MAx is not affected by [direction], [#consecutive_points#], or [repeat:].
MIn
Finds the minimum Y value for all points in the specified X range.
MIn is not affected by [direction], [#consecutive_points#], or [repeat:].
POint
Finds the next data point in the given direction.
XValue(value)
Finds the first point on the curve that has the specified X axis value.
The <(value)> is a floating-point value or percent of full range
XValue is not affected by [direction], [#consecutive_points#], [(range_x [,range_y])], or [repeat:].
<(value)> can take any of the following forms:
ForceDBArg1
Converts a non-DB trace to a dB trace. Used in measurement functions such as Bandwidth_Bandpass_3dB and Cutoff_Highpass_3dB.
Limiting a Measurement Expression to a Specific Range of Data
You can restrict the data that measurement expressions apply to.
- From the Plot menu, select Axis Settings.
- Click the X Axis tab
- Select User Defined in the Data Range frame and enter the desired start and finish values.
- Click OK.
All measurement expressions used are applied to the data range you specified.
Control Elements in Dialog Boxes
Help
Close
Click to close the measurement dialog box.
Measurement Function Expression
Type the measurement function argument.
Name of Trace to Search Frame
Type any other measurement arguments needed to complete the expression.
Box
Type your changes in this box.
This Measurement Function is Saved in the File
The location of the measurement function on your system.
New Measurement Function Name
Type the new name of the copied measurement function.
File to Keep Measurement Function in
Click to select the location of the copied measurement function.
List
The available sections are listed. Click to select.
All
Click to select all of the listed sections.
None
Click to select none of the listed sections.
expression arguments (1, 2, …, n )
These are placeholders for the Probe trace expressions that search commands are applied to. The number that identifies the expression argument (e.g., 1) corresponds to the search command labeled with the same number below.
When a measurement definition is used in the Add Trace dialog box, expression arguments are replaced with regular Probe trace expressions. For example, for the measurement definition
GainMargin (1,2)
You need to specify two trace expressions in the Trace Expression text box, e.g.,
GainMargin (Vp(Out), VdB(Out)).
substitution arguments (subarg1, subarg2, …, subargm)
These are optional arguments that follow the expression arguments.
In a measurement definition, these arguments are text strings, which can have any alphanumeric character or underscore (_) but cannot start with a number.
For example, in the measurement definition
bandwidth (1, db_level) = x2 -x1
db_level
is the substitution argument. This measurement definition finds the db_level bandwidth of a signal.
When a measurement definition is used in the Add Trace dialog box, the values of these arguments are specified by replacing them with numbers, which are substituted into any of the measurement definition's search commands that contain the subargument text.
Introducing the Performance Analysis Wizard
The Performance Analysis wizard helps you complete the information necessary to generate a Performance Analysis trace. Just type or select the information as you go.
To start the Performance Analysis wizard, choose Performance Analysis from the Trace menu.
While you are in the wizard, a button bar is displayed at the bottom of every screen.

The following table describes the buttons.
The Performance Analysis wizard has four steps:
-
Introducing the Performance Analysis wizard
Contains information about the wizard process -
Selecting a measurement
Helps you select from the available, defined, measurements. -
Selecting measurement arguments
Allows you to specify the arguments for the measurement. -
Testing the measurement
Shows you the results of your measurement with the current arguments. You can redefine the arguments if the results are not what you expected.
When you are done with the Performance Analysis wizard, your trace is shown in Performance Analysis mode.
The Performance Analysis wizard creates simple Performance Analysis traces. If you need a Performance Analysis trace that is an expression of several measurements, you can add that trace manually.
Selecting a Measurement
The second step of the wizard helps you select a measurement definition.
To create a Performance Analysis trace, select the measurement definition you want. This measurement definition determines the characteristic that is extracted from each PSpice run and is plotted versus the variable that changes between simulation runs.
To find more information about each measurement definition listed, click a name in the list on the left side of the dialog box. If included in the .PRB file, an explanation about the selected measurement definition appears on the right side of the dialog box.
If the measurement definition you want is not listed, you can edit an existing measurement definition or create a new one to meet your needs.
To edit or create a new measurement definition, click the Measurements button.
Selecting Measurement Arguments
The third step of the wizard helps you fill in the measurement expression arguments.
Measurement expressions can have 2 types of arguments:
-
Expression arguments
Every measurement expression must have at least one expression argument, but can have more. -
Substitution arguments
A measurement expression can have 0 or more substitution arguments.
To specify the Measurement Expression argument
-
Do one of the following:
- Click the toolbar button{bmc BM18.SHG}. To change the listed traces, check or uncheck the output types. To select a trace, double-click a name in the Simulation Output Variables list. The name is copied to the appropriate argument box in the wizard.
or - Depending on the measurement definition selected in the previous step, type the rest of the information in the boxes, or click the toolbar buttons to select the information.
- When you are done, click Next.
Testing the Measurement
The final step of the wizard views the plotted measurement. If the value of this measurement is not correct, or if the marked points are not on the right places on the trace, do one of the following:
Return to top