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.
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
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.
the_ROM_image: { [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> }
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
This passes the name of the platform to the XRT. The name here should match the platform name given in Vivado:
zcu104_base
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
-M microblaze-fdt -device loader,file=<pmufw.elf> -machine-path . -display none
We also need to pass the PSU machine details, via qemu_args.txt:
-M arm-generic-fdt -serial mon:stdio -global xlnx,zynqmp-boot.cpu-num=0 -global xlnx,zynqmp-boot.use-pmufw=true -net nic -net nic -net nic -net nic -net user -m 4G -device loader,file=<bl31.elf>,cpu-num=0 -device loader,file=<u-boot.elf> -boot mode=5
Note: Here, I am using boot mode 5 (0101). This is SD1.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.