Debugging Techniques

When debuggingSDSoC™applications, you can use the same methods and techniques as applications used for debugging standard C/C++. MostSDSoCapplications consist of specific functions tagged for hardware acceleration and surrounded by standard C/C++ code.

When debugging anSDSoCapplication with a board attached to the debug Host machine, you can use the Assistant view and right-click theDebug[Hardware]>Debug>Launch on Hardwareoption to begin a debug session. You can also set the options through the Assistant by selectingDebug[Hardware]>Debug>Debug Configurations.

Note:As the debug environment is initialized, Xilinxrecommends that users switch to the Debugperspective when prompted by the SDx™IDE.

The debug perspective view provides the ability to debug the standard C/C++ portions of the application, by single-stepping code, setting and removing breakpoints, displaying variables, dumping registers, viewing memory, and controlling the code flow withrun untilandjump totype debugging directives. Inputs and outputs can be observed pre- and post- function call to determine correct behavior.

You can determine if a hardware accelerated application meets its real-time requirements by placing debug statements to start and stop a counter just before and just after a hardware accelerated function. TheSDxenvironment provides thesds_clock_counter()function which is typically used to calculate the elapsed time for a hardware accelerated function.

You can also perform debugging without a target board connected to the debug host by building theSDxproject for emulation. During emulation, you can control and observe the software and data just as before through the debug perspective view, but you can also view the hardware accelerated functions through aVivado®simulator waveform viewer. You can observe accelerator signaling for conditions such as Accelerator start, Accelerator done, and monitor data buses for inputs and outputs. Building a project for emulation also avoids a possibly longVivadoimplementation step to generate an FPGA bitstream.

See theSDSoC Environment Debugging Guidefor information on using the interactive debuggers in theSDxIDE.