Vitis AI Tutorial – Part 3

Published On: November, 15, 2023 By: Eshtaartha Basu

This tutorial will walk you through the steps required to generate an Acceleration Ready Vitis Platform. We will be using the OSDZU3-REF Petalinux BSP as an example starting point.

This tutorial can be used standalone or as Part 3 of a 4-part Acceleration tutorial series that will help you run Vitis-AI DPU-TRD based Face Detection demo, ADAS Detection demo (and other AI demos) on the OSDZU3-REF board. An overview of the flow is shown below:

Pre-requisites

This tutorial assumes the user has already gone through:

  1. Tutorial 1 and generated OSDZU3-REF_Accl_Platform.xsa file.
  2. Tutorial 2 and generated an Acceleration Ready Petalinux Software Components

Objectives

Create an Acceleration Ready Vitis Platform using Vivado Hardware Platform file (OSDZU3-REF_Accl_Platform.xsa) and Petalinux Software Components already created as part of Tutorials 1 and 2 respectively.

Tutorial Requirements

This tutorial will require the following software setup.

Note: All the steps in this tutorial have been validated using Petalinux 2021.2 running on Ubuntu 20.04.LTS. However, the overall design flow should be similar for other Petalinux and host OS versions as well.

Set Directory Structure

In this section we set a good directory structure for all the Petalinux software components to ease the process of Acceleration Ready Vitis Platform creation.

  1. Create a directory named “osdzu3-ref-accl-vitis-pkg”
  2. Under osdzu3-ref-accl-vitis-pkg directory, create a directory named “platform”. Under platform directory, create 2 other directories named “sd” and “boot” as shown below.
  3. Navigate to Petalinux software components directory from tutorial 2, and install Petalinux SDK
    1. cd <your_petalinux-project-root>/images/linux
    2. Launch Petalinux SDK installer and point the installation directory to osdzu3-ref-accl-vitis-pkg
      ./sdk.sh -d <path_to_your_ osdzu3-ref-accl-vitis-pkg_directory>
      A successful SDK installation should output something similar to what is shown below
    3. Once petalinux SDK finishes installing, your osdzu3-ref-accl-vitis-pkg hierarchy should look as shown below.
  4. Copy the following boot components from <your_petalinux-project-root> /images/linux directory to the <path_to_your_ osdzu3-ref-accl-vitis-pkg_directory>/platform/boot.
    1. zynqmp_fsbl.elf
    2. pmufw.elf
    3. bl31.elf
    4. u-boot-dtb.elf
    5. system.dtb
  5. Rename u-boot-dtb.elf to u-boot.elf
  6. Copy the following sd components from <your_petalinux-project-root> /images/linux directory to the <path_to_your_ osdzu3-ref-accl-vitis-pkg_directory>/platform/sd
    1. boot.scr
    2. system.dtb
  7. At this point, the file directory structure should be as shown below:

Create Vitis Platform

  1. Open Vitis 2021.2
  2. Set osdzu3-ref-accl-vitis-pkg as your workspace directory
  3. Create a new platform project:
    1. File > New > Platform Project
    2. Name the project as osdzu3-ref-accl-vitis-platform
    3. Click Next
    4. Under platform page, browse and select your OSDZU3-REF_Accl_Platform.xsa file from Tutorial 1
    5. Set processor, architecture and operating system as shown in below picture
    6. Uncheck Generate boot components option since we have already generated boot components as part of Tutorial 2.
    7. Press Finish
  4. Configure Platform Settings
    1. Under Vitis Explorer on the left > Double click and open platform.spr > Click on linux on psu_cortexa53
    2. Browse and set the appropriate directories for each of the following items:
      1. Bif file
        1. Click on the little down arrow next to Browse button > Generate Bif
      2. Boot components directory
        1. Browse and point to <path_to_your_ osdzu3-ref-accl-vitis-pkg _directory>/platform/boot
      3. FAT32 Partition Directory
        1. Browse and point to <path_to_your_ osdzu3-ref-accl-vitis-pkg _directory>/platform/sd
  5. Right click on osdzu3-ref-accl-vitis-platform under Explorer > Build Project
  6. You should see a message similar to the one shown below under Vitis Build Console, once the build completes:
  7. The newly created Acceleration Ready Vitis Platform will be available under, “export” as shown below:
  8. Check the Platform Information to see if everything looks similar to what is shown below:
    1. Click on Xilinx > XSCT Console
    2. In the XSCT Console:
      1. platforminfo <full_path_to_your_vitis_platform_directory>/osdzu3-ref-accl-vitis-platform.xpfm

Further Reading

Continue the OSDZU3 Acceleration journey and run Vitis-AI DPU-TRD based Face Detection demo, ADAS Detection demo (and other AI demos) on the OSDZU3-REF board by reading Part 4 of the 4-part Acceleration Tutorial series.

Revision History

Get notified of updates to this Application Note and all of our Technical Documentation.

"*" indicates required fields

Name*
Hidden
Hidden
Hidden

Revision NumberRevision DateChangesAuthor
111/13/2023Initial RevisionEshtaartha Basu