Subprogram Call-Stack Support - 2021.1 English

Vivado Design Suite User Guide: Logic Simulation (UG900)

Document ID
UG900
Release Date
2021-06-16
Version
2021.1 English

You can now step-through subprogram calls and access automatic (as well as static) variables inside subprogram using get_value/set_value options.

Currently, you can only access these variables if the subprogram is at the top of the call-stack.

Use the following options to support access to variables at any level of the call-stack.

Call Stacks Window

Call Stacks window shows HDL scopes for all the VHDL/Verilog processes in a design which are waiting inside a subprogram at the current simulation time. This is similar to get_stacks Tcl command.

By default, the current process in which simulation is stopped (inside a subprogram) will be selected in the Call Stacks window. However, you can select any other processes waiting in a subprogram. The effect of selecting a process on the Call Stack window is same as selecting a process scope from the Scope window or using current_scope Tcl command. When you select a process on the Call Stacks window, the updated process appears in the Scope window, Objects window, Stack Frames window and Locals tab. The process name with absolute path and its type of the selected process is shown in the Call Stacks window.

Figure 1. Call Stacks Window

Stack Frames Window

Stack Frames window shows the current HDL process that is waiting inside a subprogram and the subprograms in its call-stack. This is similar to report_frames and current_frame Tcl commands. In the Stack Frames windows, the most recent subprogram in the current hierarchy is shown at the top, followed by caller subprograms. The caller HDL process is shown the bottom. You can select other frames to be current and the effect is same as the current_frame –set <selected_frame_index> Tcl command. The Locals tab in the Objects window follows the subprogram frame selection and shows the static and automatic variables local to the selected subprogram frame. The frame number, subprogram/process name, source file and current line for the selected HDL process is shown in the Stack Frames window.

Figure 2. Stack Frames Window

Locals Tab in Objects Window

The Locals tab in Objects window shows the name, value and type of static and automatic variables local to the currently executing (or selected) subprogram. This is similar to get_objects –local Tcl command. This window follows the frame selected in the Stack Frames window. For every variable/argument, its name, value and type would be shown in the Locals tab.

Figure 3. Locals Tab in Objects Window

Debugging with Dynamic Type

In the SystemVerilog, there are dynamic types such as Class, Dynamic Array, Queue, and Associative Array etc. These dynamic types are supported in the Vivado simulator. Vivado allows you to probe the dynamic type variables. For example:

module top();
int dynamicArray[];
byte queue[$];
initial
begin
    dynamicArray = new[3];
    dynamicArray = '{10, 20, 30};
    queue.push_back(8'hab);
    queue.push_back(8'hff);
    #10;
    dynamicArray = new[5](dynamicArray);
    $display(queue.pop_front());
end
endmodule

You can probe the dynamic type variables using the following windows as shown in the following figure:

  • Objects window
  • Tcl Console window by using get_value and report_value commands.
  • Tooltip in the Sources window
    Figure 4. Probing Dynamic Type

    Note: Dynamic types are not supported for tracing waveform (add_wave) or for creating waveform data base (log_wave).