Users have the functionality to utilize expressions in the waveform and watch windows. An expression is a formula that combines operands and operators and produces the computation of a formula value. A number of operators are supported as well as the possibility of grouping elements of a formula. This allows users to build composite expressions. An expression can use different operators and operate on different types of operands. For more information about all possible operands and functions, please go to User’s Guide | HDL Debugging | Modifying Signal and Variable Values | Expressions under the Help menu.
Note: Virtual Signal Expression is available in Riviera-PRO only.
The benefits of using expressions in the waveform are:
The ability to combine multiple signals and observe the result directly on the waveform without changing the source code
The ability to browse the relationship between signals i.e. recurring values on a changing bus
Users can create expressions in the waveform using the GUI or a script file. Users that are creating a large amount of expressions between different signals will find using a script much simpler than the GUI. Creating logical expressions using the GUI requires manual inputs from the user.
Run the simulation
In the Waveform Viewer, right-click in the signal Name column
Select Create and then Expression
Manually type the expression using the signal name and desired operator
After hitting the Enter key, the value will be displayed in the Value column
If an incorrect syntax is used, the Value column will display an error message:
The value will change with the cursor position
Users creating a script file will need to add the -expr switch to the wave command. For example:
wave -expr "in & out" wave -expr "in ~& out" wave -expr "in | out" wave -expr "in ~| out" wave -expr "in ^ out" wave -expr "in ~^ out" wave -expr ~in
This will create signals in the waveform as shown below:
The standard signal properties also apply to the expression signals.
Right-click the expression signal and select Properties
The Object Properties window will pop up
Users can modify the settings, e.g. changing the Representation to Binary
After selecting Apply and OK, the value for the expression signal should now be displayed in binary