Hardware Design Setup - 2022.2 English - XD099

Vitis Tutorials: Hardware Acceleration (XD099)

Document ID
XD099
Release Date
2022-12-01
Version
2022.2 English

This guided introduction will introduce acceleration concepts targeting the Alveo cards. While not explicitly covered in this release, the concepts, techniques, and relative performance apply equally well to embedded processors also. We’ll start with writing host code: programming the FPGA, allocating memory, and moving memory around. Our accelerators will be very simple for these early examples. In fact, we’ll likely see that the algorithms run faster on the CPU, at least at first, since our acceleration hardware is so trivial.

Building hardware designs can also be quite time-consuming - it turns out that synthesizing, placing, and routing custom logic across billions of transistors with sub-nanosecond timing is just a teeny bit more complex than compiling to machine code. Bear with us, because the results are worth it. To avoid having to needlessly rebuild the FPGA hardware, we provide a single FPGA design with many kernel instances, which we’ll mix-and-match as needed for the example designs. This guide will touch a bit on kernel optimization, but beyond basic concepts, we’ll mostly leave that for other tutorials in this repository.

This onboarding example comes with a hardware image targeting the Alveo U200 accelerator card with shell version 201830_2. You’ll need to build the hardware design before you can run. To do that, change into the directory:

Hardware_Acceleration/Introduction/design_src/hw_src

If you have a different version of the target platform installed on your board, you can skip this step. But if you are targeting a platform other than the Alveo U200, open the Makefile and change the first line to point to your platform’s .xpfm file.

Note: Line breaks may have been added to the example below for formatting, depending on your resolution. Do not add line breaks to the path in your Makefile.

PLATFORM := /opt/xilinx/platforms/xilinx_u200_gen3x16_xdma_1_202110_1/xilinx_u200_gen3x16_xdma_1_202110_1.xpfm

Once you edit the Makefile, ensure that your Vitis and XRT environments are set up properly. If you have not done so already, run the commands:

source /opt/Xilinx/Vitis/2022.2/settings.sh
source /opt/xilinx/xrt/setup.sh

If your installation path for either XRT or Vitis are different than the default locations, update the command line accordingly. Then, run the command:

make

The build process will take some time, but in the end you will have a file in this directory called alveo_examples.xclbin. This file contains all of the kernels we will use during this exercise. Once you have this file compiled for your combination of board and shell, you are ready to proceed to the next section.

Read Example 0: Loading an Alveo Image

Copyright© 2019-2021 Xilinx