Debugging an HLS component is only possible after, or as part of C simulation. The following figure shows the Debug view for an HLS component. You can view the values of variables and expressions directly in the Debug view. In the Variables view, you can edit the values of variables to force the variable to a specific state for instance. In the Watch view, you can monitor the value of expressions. Use the '+' command in the Watch view to add an expression to watch. Refer to Debug View as described in the Vitis Application Acceleration User Guide (UG1393) for additional details on the available features and views.
The Debug view acts like most classic C/C++ software debug tools. It includes the ability to insert breakpoints in the code, or to step over or into specific sections of the code. There are many different windows or widgets to manage the debug process. The following is a list of most with a brief descriptrion of how you might use them while debugging the HLS component.
- Control Panel
The Debug view Control Panel is displayed in the upper-left corner of the screen as shown in the image below. During debugging, you can use the control buttons such as Continue, Step Over, Step Into, Step Out, Restart, and Stop to control the debugging process.Figure 2. Debug Control Panel
- Threads shows the related debugging threads. Threads are created and destroyed during the debugging process. You can switch between multiple threads.
- Call Stack
- Call Stack shows the function call stack being updated as the application is run.
- You can view the values of variables and expressions directly in the Debug view using the Variables window which shows the current value of global and local variables. When switching threads, the variable information is updated. You can force variables to specific values by selecting a variable and selecting the Set Value command from the right-click menu.
- Shows variables and expressions you have specified to watch. Add watch points by selecting Add Expression (+).
Vitis unified IDE sets break points at the main function of the test bench. To add breakpoints, you can open the source file and click the left side of the line number when a red dot appears. You can remove breakpoints by clicking on a previously added breakpoint.
You can add conditional breakpoints by right-clicking when the red dot appears and select Add Conditional Breakpoint. You can also right-click and select Add Logpoint to insert a message to be logged when the breakpoint is reached.
- Source Code Editor
- The Source Code view is opened when Debug is launched from the Flow Navigator or Launch Configuration view.
- Debug Console
- Displays the transcript of the debug process, and any messages received from the tested application.