TestBencher Pro and Reactive Test Bench Help

3.6 Storing Sample Values in User Defined Variables

3.6 Storing Sample Values in User Defined Variables

Previous topic Next topic  

3.6 Storing Sample Values in User Defined Variables

Previous topic Next topic  

In addition to the automatically created sample variables, a sampled value can be stored in a user-defined variable. The stored sample value can be used in complex data structures. In TestBencher, the sampled value can also be used to drive another signal or stored in a file. By enabling and selecting a variable, the sampled value will be stored each time the sample completes. File Output variables write the sampled value to the specified file when the transaction completes.

To store a sample value in a user defined variable:

Create a diagram level variable as shown in Section 6.1: Variables. You must do this first before you can make the sample store its value in the variable.

Open the Sample Properties dialog by double-clicking the name of the sample.

Click the HDL Code button to open the Code Generation Options dialog.

variables_dlgs

Select the desired enable option from the Enable Variable dropdown, to specify the condition under which the sampled value should be stored in the variable. Always, Never, Then, and Else are the possible options. The Then and Else options specify that the data will be stored only if the Then Action or Else Action is executed, respectively.

dataTargetControls

Press the Select Variable button to open the Select Variable dialog.

Select a variable from the list and press the Insert Into Equation button to copy the variable into the Code Generation Options dialog.

variables_select