This post provides a clear, step-by-step guide for generating a Vitis 2023.2 platform specifically for the Ultra96-V2 FPGA board.

What do we need for this post

Hardware

Software

This post assumes you have installed Ubuntu Linux 2022.2, AMD Vitis 2023.2, and AMD Petalinux 2023.2.

The following steps will be taken to generate the Ultra96-V2 Vitis 2023.2 Platform for Acceleration Applications.

  1. Download the BSP file from the Avnet website.
  2. Create Petalinux project
  3. Create the Vitis platform
  4. Test the platform

Download the BSP file

  • Click on the 2023.2 folder on the SharePoint site, then click on BSP.
  • Finally, download the u96v2_sbc_base_2023_2.bsp file.
    This BSP includes reference designs for the Ultra96-V2 board. It provides all the necessary design and configuration files, as well as pre-built and tested hardware and software images. These resources are ready for download onto your board or can be customized for your own project.

Create Petalinux Project

  1. On Ubuntu Linux, create a folder named ultra96v2, then inside it, create another folder named 2023.2.
    • mkdir ultra96v2
      cd ultra96v2
      mkdir 2023.2
      cd 2023.2
  2. Copy the downloaded file named u96v2_sbc_base_2023_2.bsp into the folder you created.

  3. To create a Petalinux project based on the BSP file, run petalinux-create the command on the command console. Before running this command, ensure you run the settings.sh file under the install Petalinux folder.

    source /tools/Xilinx/PetaLinux/2023.2/settings.sh
    petalinux-create -t project -s ./u96v2_sbc_base_2023_2.bsp

    After running these commands, you should see the folder u96v2_sbc_base_2023_2, which contains the Petalinux project files.


  4. Change the current folder to u96v2_sbc_base_2023_2

    cd u96v2_sbc_base_2023_2
  5. Then run the following command.

    petalinux-config

    This command brings the PetaLinux System Configuration windows. Accept the current configuration by choosing the Exit button.

  6. If you want to configure the kernel, you can run petalinux-config -c kernel command.
    Run the command, then accept the default configuration and click the “Exit" button. Note that this step may take some time.

  7. To enable the package group for Vitis acceleration flow, the following steps should be done.
    1. Run the following command.
      petalinux-config -c rootfs
    2. Go to Petalinux Package Groups -> packagegroup-petalinux-vitis-acceleration-essential and enable packagegroup-petalinux-vitis-acceleration-essential.
      Also, enable packagegroup-petalinux-vitis-acceleration-essential-dev that enables the sysroot support. Then press “Exit” twice to get to the rootfs configuration window.
    3. To install additional packages later, we need to enable Package Management. In the root filesystem (rootfs) configuration window, navigate to the “Image Features” section and enable the options for “package-management” and “debug_tweaks.” After making these changes, click “Exit” twice and select “Yes” to save your modifications.
  8. Now, after finishing the configuration, we should build the Petalinux project. So, run the following command.
    petalinux-build
    Compiling the entire project may take a long time, and you may see several warning messages.

  9. After finishing the build process, run the following command to create a sysroot self-installer for the target Linux system.

    petalinux-build --sdk

    Note that this process also takes some time.
    This command generates sysroot package sdk.sh located in /images/linux directory.
    You can extract this file later when the Vitis platform is created.


Vitis Platform

We now have all the necessary hardware and software components to build the Vitis Platform. Before we start, organising the components into a folder is a good idea.  
First, navigate to the designated folder and create a new folder named “components.” Inside the “components” folder, create two additional folders: one called “software” and the other named “hardware.”

  1. Copy the following file from the ..../ultra96v2/2023.2/u96v2_sbc_base_2023_2/images/linux folder into the created linux folder.
    fsbl.elf, pmufw.elf, bl31.elf, u-boot.elf, system.dtb, boot.scr, Image, rootfs.ext4
  2. Run the generated sdk.sh to extract the SDK files into the sysroot folder inside the linux directory.
    From the linux folder, this would be the command
    ../../u96v2_sbc_base_2023_2/images/linux/sdk.sh -d ./


  3. Copy the hardware u96v2_sbc_base.xsa file into the created hardware folder. The file is located in ..../u96v2_sbc_base_2023_2/hardware/u96v2_sbc_base_2023_2 folder.

Now, we can run the Vitis to create the platform.

  1. Create the folder named vitis-platform under the 2023 directory. Then, go to the created folder and run the vitis -w . command. Before that, ensure you have already run the settings64.sh file under the /tools/Xilinx/Vitis/2023.2 folder.

    mkdir vitis-platform
    cd vitis-platform/
    source /tools/Xilinx/Vitis/2023.2/settings64.sh
    vitis -w .


  2. After running Vitis, select the Platform option under File->New Component.

  3. In the “Create Platform Component” window, type u96v2_sbc_base_2023_2-vitis-platform as the component name. Then press “Next”.
  4. On the next page, select the xsa file that we copied into the hardware folder. Then press “Next”.


  5. In the next window, select Linux as the Operating System. Then press “Next”. Finally, press “Finish”. It takes a few seconds to create the platform files.


  6. Click on the Linux On psu_cortex53 link. Then, generate the Bif file by clicking on the icon next to Browse under the “Bit File” option. After that, click on the browse link in the Pre-Built image Directory line and choose the linx folder we created earlier.


  7. Finally, build the project by clicking the Build link on the left side window.


  8. After building the platform project, we are ready to implement an application.

Test the platform

We use one of the example applications provided by Vitis to test our generated platform. For this purpose, follow the steps below.

  1. Under the View menu, click on the “Examples” option. Then select the “Simple Vector Addition” example and click on “Create Application from Template” on the right.


  2. Accept the default value on the first page of the “Create System Project” window. Then press “Next”.


  3. Select the u96v2_sbc_base_2023_2-vitis-platfrom option and press “Next”.


  4. In the next window, select the Image file as the “Kernel Image”. The file is located in the linux folder we created earlier. Also, select the rootfs.ext4 as the “Root FS” from the same folder. Finally, point the “Sysroot folder” to the cortexa72-cortexa53-xilinx-linux folder under sysroots in the linux folder we created earlier. Then, press “Next”. After that, press “Finish”.


  5. In the generated application project, click “Build All” under “Hardwar” in the “FLOW” tab on the left. And press OK. Building the project and generating the files takes a while.


  6. After building the project successfully, in a terminal, go to the vadd/build/hw/package/package path under the project location. And flash the sd_card.img file into an SD card. You can use balenaEtcher software for that.


  7. Connect the board to your computer using a USB cable. Then, boot the board with the programmed SD card.
    After booting, log in using the root username. The password is root.
    Go to the /run/media/mmcblk0p1 folder. Then, run this command.

    ./vadd_host binary_container_1.xclbin

    You should get the TEST PASSED message. This finishes our test process.