Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating an Acceleration Platform for Vitis Part Three: Packaging an Accelerated Platform in Vitis

1 0 2,777

This is the third blog entry in the Acceleration series. Previously, we discussed how to create the hardware and software projects. In this blog we will discuss how this is all packaged together in Vitis™.

You can find the other parts at the links below:

Part One: Creating the hardware project for the Acceleration Platform in Vivado

Part Two:  Creating the software project for the Acceleration Platform in PetaLinux 

Part Four: Testing the Custom Acceleration Platform in Vitis 


When we accelerate a software function in Vitis (create a kernel), we are creating a Hardware IP core and the resulting infrastructure to connect this to the existing platform.

To do this, Vitis needs to rebuild your platform. Vitis uses the XSA to rebuild the Vivado project. It will then append the updated hardware and then re-spin the Vivado project.

Everything else will remain static, except for the bitstream and the generated kernel application of course. So our boot image cannot be static. Instead we provide a BIF that has placeholders for the images that will be created in Vitis. 

Also, In order for the kernel to be able to execute, we need to cross-compile for our target hardware. Here, we use the sysroot created in PetaLinux. 

Preparing the Images:

This step is not really needed, but I have organized the platform files for ease of use. The important thing to remember is the boot images location when creating the BIF file, as we are using placeholders. 

mkdir -p sw_comp/src/a53/xrt/image
mkdir sw_comp/src/boot
  • Copy the image.ub, boot.scr and rootfs.cpio.gz from the PetaLinux image/linux folder to sw_comp/src/a53/xrt/image 
  • Copy the bl31.elf, uboot.elf, zynqmp_fsbl (renamed fsbl.elf), pmufw.elf from the PetaLinux image/linux folder to sw_comp/src/boot
Create the BIF:

The BIF file is used in bootgen to create the SD boot image.

This contains the location of all of the partitions in the BOOT.BIN file. A template can be seen below.

It is important to note that here we are just providing placeholder file names, not the actual file name. The tools will add the path to the files. This is why I recommend having all of these files in the same boot folder. The zcu104_base will be the name of our platform.

  [fsbl_config] a53_x64
  [bootloader] <zcu104_base/boot/fsbl.elf>
  [pmufw_image] <zcu104_base/boot/pmufw.elf>
  [destination_device=pl] <bitstream>
  [destination_cpu=a53-0, exception_level=el-3, trustzone] <zcu104_base/boot/bl31.elf>
  [destination_cpu=a53-0, exception_level=el-2] <zcu104_base/boot/u-boot.elf>
  • Copy the linux.bif to sw_comp/src/boot
Create the script

This is the script that will be run when booting to set up the XRT, and pass the name of the platform to the ZOCL.

cp ./platform_desc.txt /etc/xocl.txt
export XILINX_XRT=/usr
  • Copy the to sw_comp/src/a53/xrt/image 
Create the platform_desc.txt

This passes the name of the platform to the XRT. The name here should match the platform name given in Vivado:

  • Copy the platform_desc.txt to sw_comp/src/a53/xrt/image 
Create the QEMU files:

The Vitis IDE supports both software and hardware emulation. The QEMU is used to do this. However, we need to pass the QEMU machine details.

We need to do this for the PMU, using pmu_args.txt

  • Copy the pmu_args.txt to sw_comp/src/boot

We also need to pass the PSU machine details, via qemu_args.txt:


Note: Here, I am using boot mode 5 (0101). This is SD1. 

  • Copy the qemu_args.txt to sw_comp/src/boot

Package the Platform in Vitis:

Launch Vitis, and Select Create Platform Project:


Use the same name as is given in the BIF:


Select Create from hardware specification (XSA):


Select the OS and Linux, then deselect generate boot components (we have these created already from PetaLinux):


Note: The warning here is just stating that the sysroots will need to be added. 

Populate the software images created in the previous blog entry:


Then Build:


Once this is competed, the platform will be placed in export\zcu104_base.... and that's it.

For the next part of this guide, see part four: Testing a Custom Acceleration Platform in Vitis