XSDB Flow - XSDB Flow - 2023.1 English - UG1076

AI Engine Tools and Flows User Guide (UG1076)

Document_ID
UG1076
Release_Date
2023-06-23
Version
2023.1 English
Set up xsdb as described in the following steps to connect to the device hardware.
  1. When running the application, the profile data is captured in counters that can be retrieved by the debugging and profiling IP. To capture and evaluate this data, you must connect to the hardware device using xsdb. This command is typically used to program the device and debug applications. Connect your system to the hardware platform or device over JTAG, launch the xsdb command in a command shell, and run the following sequence of commands:
    xsdb% connect
    xsdb% ta 1
    xsdb% source $::env(XILINX_VITIS)/scripts/vitis/util/aie_profile.tcl
    xsdb% aieprofile start -graphs myGraph -work-dir ./Work \
          -graph-based-aie-metrics "dut:kernel1:heat_map" \
          -tile-based-aie-metrics "all:stalls" \
          -graph-based-aie-memory-metrics "dut:all:write_throughputs" \
          -tile-based-aie-memory-metrics "{4,1}:{6,2}:conflicts; {8,3}:dma_locks" \
          -tile-based-interface-tile-metrics "2:10:input_throughputs:3" \
          -interval 20  -samples 100
    

    where:

    • connect: Launches the hw_server and connects xsdb to the device.
    • source $::env(XILINX_VITIS)/scripts/vitis/util/aie_profile.tcl: Sources the Tcl trace command to set up the xsdb environment.
    • aieprofile start: Instructs the DPA IP to begin capturing profile data based on configuration.
      • -graph: The graph profile data to be captured.
      • -work-dir: the path to aiecompiler Work directory
      • -graph-based-aie-metrics: The metrics to be captured for the selected AI Engines. This selection is based on the graph name and kernel name.
      • -tile-based-aie-metrics: The metrics to be captured for the tile-based selected AI Engines.
      • -graph-based-aie-memory-metrics: The metrics to be captured for the selected AI Engine memories. This selection is based on the graph name and the kernel name.
      • -tile-based-aie-memory-metrics: The metrics to be captured for the tile-based selected AI Engine memories.
      • -tile-based-interface-tile-metrics: The metrics to be captured for the tile-based selected AI Engine array interfaces and channel.
      • -interval: The sample interval in milliseconds (default 20).
      • -samples: The number of counter samples (default 100).
  2. Run the design on hardware to generate hardware profile data. The XSDB aieprofile script should still be running and sampling while the design application runs and until application finishes in order to capture valid statistics. The -samples and -interval switches can be adjusted accordingly to ensure this.
  3. Use vitis_analyzer to import and analyze the data, as described Viewing Profiling Results Using Vitis Analyzer.

aieprofile Command Synopsis

aieprofile start [options] -tiles <tile-list>
aieprofile start [options] -graphs <graph-list>
Table 1. aieprofile Options
Option Name Description
-config-file <json-file> JSON file generated by the AI Engine compiler at Work/ps/c_rts/aie_control_config.json with profile configuration data. This file can also be created for custom profile configuration. You can alternatively specify the -work-dir option instead of config-file.
-graph-based-aie-metrics <graph name|all>:<kernel name|all>:<metric_set> This option allows you to set the AI Engine counter metrics set for specified graphs and kernels. Valid values are off, heat_map, stalls, execution, floating-point, write_throughputs, read_throughputs and aie_trace.
-tile_based_aie_metrics <{<column>,<row>}|all>:<metric_set> Sets the AI Engine counter metrics set for specified tiles. Valid metrics as above.
-tile_based_aie_metrics {<mincolumn,<minrow>}:{<maxcolumn>,<maxrow>}:<metric_set> Sets the AI Engine counter metrics set for specified tiles in a range. Valid metrics as above.
-graph_based_aie_memory_metrics <graph name|all>:<kernel name|all>:<metric_set> This option allows you to set the AI Engine memory module counter metrics set for specified graphs and kernels. Valid values are off, conflicts, dma_locks, dma_stalls_s2mm, dma_stalls_mm2s, write_throughputs and read_throughputs.
-tile_based_aie_memory_metrics = <{<column>,<row>}|all>:<metric_set> This option allows you to set the AI Engine memory module counter metrics set for specified tiles. Valid metrics as above.
-tile_based_aie_memory_metrics = {<mincolumn,<minrow>}:{<maxcolumn>,<maxrow>}:<metric_set> Sets the AI Engine memory module counter metrics set for specified tiles in a range. Valid metrics as above.
-tile_based_interface_tile_metrics <column|all>:<metric_set>[:<channel>] Sets the AI Engine Array Interface counter metrics set for the specified columns and channel. Valid metrics are off, input_throughputs, output_throughputs and packets
-tile_based_interface_tile_metrics <mincolumn>:<maxcolumn>:<metric_set>[:<channel>] Sets the AI Engine Array Interface counter metrics set for the specified columns in a range and channel. Valid metrics as above.
-graphs <graph-list> This option allows you to set one or more graphs used in the AI Engine application.
-tiles <tile-list> This option allows you to select one or more tiles to profile. Tiles can be in the format of col, row (for example, 0,1 or 2,5). All the tiles in a row or column can be specified using wildcard '*' (for example, 0,* to select all tiles in column 0).
# This example profiles tile (10,2) and all tiles in column 5
xsdb% aieprofile start [options] -tiles 10,2;5,*
Note: The column index starts at 0. The row index starts at 1 and not at 0.
-work-dir <dir-path> This option lets you set project Work directory.
-interval This option lets you set the number of sample interval in milliseconds (default 20).
-samples This option lets you set the exact number of counter samples (default 100) used in profiling the application.