Generate AI Engine-only and PL-only XCLBIN - 2025.2 English - UG1076

AI Engine Tools and Flows User Guide (UG1076)

Document ID
UG1076
Release Date
2025-11-20
Version
2025.2 English

To define AI Engine partitions and link with PL region, follow the guidelines in Compiling AI Engine Graph for Independent Partitions. This process allows you to compile independent AI Engine graphs into partitions and integrate them into a fixed design.

You must use the v++ packager to generate AI Engine-only and PL-only XCLBIN files that support runtime reloading:

AI Engine-only XCLBIN
  • Contains AI Engine metadata and the AI Engine Programmable Device Image (PDI) for a single partition.
  • Enables XRT to reload AI Engine partitions at runtime.
  • You can create separate AI Engine-only XCLBIN files for each partition if multiple AI Engine partitions exist.
PL-only XCLBIN
  • Contains PL metadata, allowing XRT to reload PL components.
  • For Dynamic Function eXchange (DFX) platforms, the PL-only XCLBIN also includes the PL partial PDI. This can be reloaded at runtime.

Generating AI Engine-Only XCLBIN

To generate an AI Engine-only XCLBIN for a specific partition, use the following command:

v++ -p -s -t hw --platform <Extensible platform> \
    --package.defer_aie_run \
    --package.aie_overlay ./pr0/libadf.a \
    --output pr0.xclbin

The --package.aie_overlay option accepts libadf.a corresponding to the AI Engine partition. If multiple AI Engine partitions exist, you can generate multiple AI Engine-only XCLBIN files using the same v++ packager command.

You can reload the generatedpr0.xclbin multiple times using XRT. During a reload of an AI Engine partition, the partition is reset and reconfigured with the data corresponding to the XCLBIN.

Generating PL-Only XCLBIN

  1. Add the following constraints to a configuration file (for example., package_pl_only.cfg):
    [advanced]
    param=package.generateFlatPlVersalXclbin=1
  2. Run the v++ packager, specifying the configuration file as input:
    v++ -p -t hw --platform <Fixed xsa by v++ linker> \
       --config package_pl_only.cfg \
       --output pl_only.xclbin 
       

Generating AI Engine-Only XCLBIN for Different Graphs targeting the same Partition

If different graphs need to be reloaded at different times for the same AI Engine partition, use the AI Engine incremental compilation flow:

  1. Compile the second (or additional) graph using the previously generated XSA as the platform:
    v++ -c --mode aie --platform=<Fixed xsa by v++ linker> --config aie.cfg \
        --aie.output-archive=./pr0/libadf2.a
  2. Generate the AI Engine-only XCLBIN for the second graph (libadf2.a):
    v++ -p -s -t hw --platform <Extensible platform> \
        --package.aie_overlay ./pr0/libadf2.a \

At runtime, XRT can use pr0_2.xclbin to replace the AI Engine partition with the second AI Engine graph.

Packaging XCLBIN Files into the SD Card

After generating all PL-only and AI Engine-only XCLBIN files, package them into an SD card using the v++ packager:

v++ -p -s -t hw --platform <Extensible platform> \
		--package.rootfs ${ROOTFS} \
		--package.kernel_image ${IMAGE} \
		--package.boot_mode=sd \
		--package.image_format=ext4 \
		--package.defer_aie_run \
		--package.sd_file ${HOST_EXE} \
		--package.sd_file pl.xclbin \
		--package.sd_file pr0.xclbin \
		--package.sd_file pr0_2.xclbin \
		......
		<Fixed xsa by v++ linker> \
		./pr0/libadf.a ./pr1/libadf.a ...
Note: The v++ packager command requires a libadf.a corresponding to each partition.