Subprogram Call-Stack Support - 2023.2 English

Vivado Design Suite User Guide: Logic Simulation (UG900)

Document ID
Release Date
2023.2 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 that 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) is 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 the 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 at the bottom. You can select other frames to be current and the effect is the 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 are 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, and so on. 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[$];
    dynamicArray = new[3];
    dynamicArray = '{10, 20, 30};
    dynamicArray = new[5](dynamicArray);

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 database (log_wave).