Depending on the type of processor and software stack used in the design, software debug can require enabling specific hardware interfaces in the design. Before bringing up the entire software stack, you must make sure the processor, hardware peripherals, and interconnects are functional. You can run basic bring-up tests using the JTAG interface to ensure hardware blocks are functional.
The next step is to bring up the operating system (OS) framework. Specific debug can require looking at the boot log and checking if the OS load was successful. After the OS is loaded, you can run the specific application. You can debug the application using debug tools provided by AMD or using open source debug tools. Add built-in timers in the application processing unit (APU) to profile specific function calls.
Following are details about specific software debug methods:
- XSDB-based debug
- The Software Debugger tool (XSDB) provides a set of commands to enable
hardware debug. You can also use the Vitis
Python API to run Python XSDB-based commands and procedures to check specific
hardware status. For more information, refer to this link in the
Vitis
Unified Software Platform Documentation: Embedded Software
Development (UG1400). Before bringing up
the entire software stack, check that the hardware is functional. Run XSDB
commands to perform this check, as described in the
Software Debugger Reference Guide (UG1725).
If the design includes DDR memory, you can run read/write tests to verify that the DDR memory is functional. To debug bare-metal applications, use the XSDB debugger. You can download the application using XSDB, and use the Vitis debugger to enable single-step breakpoint insertion to debug specific functions. The Vitis debugger allows you to look at the memory and processor register content to help analyze the failing code. For more information, refer to this link in the Vitis Reference Guide (UG1702).
- Debug using software tools
- You can debug Linux-based applications using the GNU Debugger (GDB), including inserting breakpoints and resuming the program. You can also use the Valgrind Linux-based tool to help analyze memory leak issues in a program. When building the Linux image, enable GDB and Valgrind tools to enable application-specific debugging.
- Special processor debug
- To debug code running on a special processor, like the AI Engine or MicroBlaze™ processor, you must enable specific hardware interfaces in the design. The AI Engine processor array has an event/trace capability that helps to view the PC event or execution trace. You must enable this hardware interface during the AI Engine compilation stage. The MicroBlaze processor has MicroBlaze Debug Module (MDM) interface that can connect to the system JTAG chain. For more information, refer to the MicroBlaze Processor Reference Guide (UG984) and AI Engine Tools and Flows User Guide (UG1076).
For more information, refer to the following documents: