Step 5 - Packaging Design and Running on Board - 2023.2 English

Vitis Tutorials: AI Engine

Document ID
Release Date
2023.2 English

To run the design on hardware using an SD card, you need to package all the files created. For a Linux application, you must make sure that the generated .xclbin, libadf.a, and all Linux info from the platform are in an easy to copy directory.

  1. Open the Makefile with your editor of choice, and familiarize yourself with the contents specific to the package task.

  2. In an easier to read command-line view, here is the command:

    v++ --package --target hw --platform $PLATFORM_REPO_PATHS/xilinx_vck190_base_202310_1/xilinx_vck190_base_202310_1.xpfm \
        --package.rootfs ${ROOTFS} \
    	--package.kernel_image ${IMAGE} \
    	--package.boot_mode=sd \
    	--package.image_format=ext4 \
    	--package.defer_aie_run \
    	--package.sd_file host.exe \
        tutorial1.xsa libadf.a

    NOTE: Remember to change the ${ROOTFS} and ${IMAGE} to the proper paths.

    Here you are invoking the packaging capabilities of v++ and defining how it needs to package your design.

| Switch/Flag | Description |
| --- | --- |
| `--package.rootfs` | This specifies the root file system to be used. In the case of the tutorial it is using the pre-built one from the platform. |
| `--package.kernel_image` | This is the Linux kernel image to be used. This is also a using a pre-built one from the platform. |
| `--package.boot_mode` | Used to specify how the design is to be booted. For this tutorial, an SD card will be used, and it will create a directory with all the contents needed to boot from one. |
| `--package.image_format` | Tells the packager the format of the Kernel image and root file system. For Linux, this should be `ext4`. |
| `--package.defer_aie_run` | This tells the packager that when building the boot system to program the AI Engine, to stop execution. In some designs, you do not want the AI Engine to run until the application is fully loaded. |
| `--package.sd_file` | Specify this to tell the packager what additional files need to be copied to the `sd_card` directory and image. |
  1. Run the command: make package.

  2. When the packaging is complete, do an cd ./sw && ls and notice that several new files were created, including the sd_card directory.

  3. Format the SD card with the sd_card.img file.

When running the VCK190 board, make sure you have the right onboard switches flipped for booting from the SD card.

  1. Insert the SD card and turn ON the board.

  2. Wait for the Linux command prompt to be available on an attached monitor and keyboard.

  3. To run your application enter the command: ./host.exe a.xclbin.

  4. You should see a TEST PASSED which means that the application ran successfully!

IMPORTANT: To re-run the application, you must power cycle the board.