Using the Debug Environment - 2020.2 English

Versal ACAP AI Engine Programming Environment User Guide (UG1076)

Document ID
Release Date
2020.2 English

The Vitis IDE debug environment has many features found in traditional GUI-based debug environments, such as GDB. You can add break points to the code, step over or step into specific lines of codes, loops, or functions, and examine the state of variables and force them to specific values. These are just a few of the features in the Vitis IDE debug environment.

After you have launched Debug, you will see several windows or views displayed, such as the Debug Configurations view in the upper left of the display, as shown in the following figure. During the debug process, several windows show the debug state that include code at break point, step over states, break-points view, variables view, registers view, disassemble view, and pipeline view (single kernel only).

The Debug view shows states of cores that are under debug. It shows where (which file and which line of source code of the file) debugger stops at and with what action it is taking (breakpoint/step over/…) as shown in the following figure.

Figure 1. Debug View

The following figure shows the Breakpoints information with current setup breakpoints. The square with a check mark indicates the breakpoint is enabled. Click on the check mark to clear the check mark and disable breakpoint during debugging. This lets you manage breakpoints without having to remove them or add them back into the code.

Figure 2. Breakpoints View
Important: Each AI Engine tile supports four breakpoints, however only three breakpoints are available while debugging on the AI Engine simulator, or co-sim. This is because the TCF framework attaches a breakpoint at the AI Engine kernel main() by default. However, breakpoints attached to a while statement consume two breakpoint resources, A workaround is to attach the breakpoint inside the while loop; this only consumes one break point.

Variable values show the kernel variables values. Depending on variable type, clicking on a variable shows its type, value, and the address of the variable. For array/structure variables, click on the arrow of the variable expands array/structure content of the array.

Figure 3. Variables View

Click on Variable to obtain address information and then click on the + from the Memory window and enter the memory address of the variable. The value of that variable shows up along with other memory content. Variable values can be change by click on variable’s value field, enter new value and enter again to set the value of the variable.

You can specify the format of the data presented in the Memory window by clicking on the New Renderings tab, specifying the format of the data to present, and click Add Rendering(s).

Tip: You can export the contents of the Memory window by selecting the Copy to Clipboard command from the right-click menu to copy and paste the contents into a text editor and save to a file.
Figure 4. Registers

In the Registers view, the values are updated during the debug process and are highlighted in the Vitis IDE.

Figure 5. Disassembly View