Resetting and Reloading Flow of the AI Engine Array - 2023.2 English

AI Engine Tools and Flows User Guide (UG1076)

Document ID
UG1076
Release Date
2023-12-04
Version
2023.2 English

The AI Engine reset and reload flow enables you to run the application on hardware multiple times without rebooting the board and the Linux operating system. This flow supports resetting and reloading the AI Engine array and all PL logic within the platform dynamic region block design under control of the RST_PL RESET0 register. The RST_PL register is described in the Versal Adaptive SoC Register Reference (AM012). This reset and reload flow does as follows:

  • Resets the AI Engine array that is configured with an AI Engine graph application, such as, kernels programmed in specific tiles, DMAs, and FIFOs between tiles and memories.
  • Resets the AI Engine array on a non-DFx platform.
  • Resets the AI Engine array without rebooting the board.
  • Reloads the AI Engine array with the same graph or a different graph without rebooting the board.

The flow is supported on Linux XRT.

Consecutive resets and reloads of the application must use the same AI Engine-PL interfaces. You can reload the AI Engine array with the same graphs, or using different graphs.

Use this flow to:

  • Avoid resetting the system and rebooting the board to run the AI Engine application multiple times.
  • Avoid long reboot times, in case the system runs into abnormal situation running on the board, and the application must be rerun again.
  • Avoid resetting the system and rebooting the board to run a modified AI Engine kernel(s).

The reset and reload flow requires that you compile the AI Engine graphs and PL kernels into separate XCLBIN files. The host application will need to use these XCLBIN files. You will then use the xbutil utility to reset the PL and AI Engine Kernels between consecutive application runs.

Event trace and profile of AI Engine design in hardware is not supported when the design is reset and reloaded in hardware.

Prerequisites to the Reset and Reload Flow

Run through these steps to prepare the application to supports the reset and reload flow:
  1. Compile AI Engine graphs.
  2. Compile PL kernels.
  3. Use v++ linker to target the HW flow and generate the XSA file.
  4. Use v++ packager to generate the PL-only XCLBIN. Refer to Generate AI Engine-only and PL-only XCLBIN.
  5. Use v++ packager to generate the AI Engine-only XCLBIN. Refer to Generate AI Engine-only and PL-only XCLBIN.
  6. Use v++ packager to include the above generated AI Engine-only XCLBIN and PL-only XCLBIN into sd_card image using the --package.sd_file <> option.
  7. Ensure the host code loads the AI Engine-only XCLBIN, and the PL-only XCLBIN that was generated in the previous step. Refer to Host Application for Reset and Reload Flow.

Reset and Reload Flow Steps

  1. Run the application on the board. Refer to Performance Analysis of AI Engine Graph Application on Hardware.
  2. Reset the application using the xbutil reset command. Refer to Reset Before Consecutive Application Runs.
  3. Rerun the application on the board.
Figure 1. AI Engine Reset and Reload Flow
If different kernels are used in the AI Engine array in consecutive runs, the incremental flow of the AI Engine compiler can be used to ensure that the sameAI Engine-PL interfaces are used. You will need to:
  1. Recompile the newer kernels using the aiecompiler with the platform XSA-generated in step 3 of the prerequisite section above.
  2. Use v++ packager to generate the newer AI Engine-only XCLBIN.
  3. Use v++ packager to include the newer AI Engine-only XCLBIN into sd_card image using the --package.sd_file <> option.