RTL / AI Engine Interfacing Examples - 2024.1 English

Vitis Tutorials: AI Engine

Document ID
XD100
Release Date
2024-10-30
Version
2024.1 English

Version: Vivado / Vitis 2024.2

Introduction

The AI Engine can be connected to the Programmable Logic (PL) using AXI compliant AXI4-Stream interfaces. In most availabe examples, the connectivity between the PL and the AI Engine is shown using HLS kernels connected to the DDR as the default VCK190 base platform does not include any other blocks than the infrastructure blocks. To accelerate part of an application, connecting the AI Engine to a user’s existing RTL requires knowledge of the AXI-Stream protocol and how it can be used to connect with the AI Engines using the AMD Vitis™ Acceleration flow. It might require some modification or bridging from the existing RTL. This tutorial shows multiple examples on how to connect RTL blocks with AXI4-Stream present in a custom platform to the AI Engine using the Vitis Acceleration flow.


Part 1 - Connecting RTL AXI4-Stream Interfaces (included in Block Design) to the AI Engine

Platform

This example is creating a custom platform, including RTL blocks with AXI4-Stream master and slave interfaces to be connected to the AI Engine.

Hardware Platform creation

The platform is created using the AMD Versal™ Extensible Platform Configurable Example Design (CED) included in AMD Vivado™.

Versal Extensible Platform CED

In this example, custom IPs are added to the block design. The first one AXI4S_Counter is a counter, which generates data on a 64-bit AXI4-Stream interface. The second one, dummy Sink, is an AXI4-Stream slave that accepts any data and drop it (tready always high). The AXI4-Stream interfaces of these two IPs are not connected to any Slave or Master interfaces. They are connected to the AI Engine using the V++ linker.

Custom IPs

Note: The AI Engine expects AXI4-Stream compliant interfaces to be connected to its AXI4-Stream interfaces. While the following user guide focuses on designing Video IPs, it might contain useful consideration when designing any AXI4-Stream IP.

UG934 - AXI4-Stream Video IP and System Design

For the V++ linker to be aware that the two AXI4-Stream interfaces are available, add two interfaces as part of the platform properties. They need to have a unique SP tag.

This is done using the following TCL commands:

set_property PFM.AXIS_PORT {M00_AXIS {type "M_AXIS" sptag "master_axi_1" is_range "false"}} [get_bd_cells /AXI4S_Counter_0]
set_property PFM.AXIS_PORT {S00_AXIS {type "S_AXIS" sptag "slave_axi_1" is_range "false"}} [get_bd_cells /dummy_sink_0]

Or this can be done through the Vivado GUI using the Platform Tab.

Platform settings

Note: The preceding flow assumes that the RTL AXI4-Stream interfaces are part of the block design (BD). In some designs, the RTL might be outside of the BD. In this case, it is possible to simply add an interface port to the BD set as AXI4-Stream (xilinx.com:interface:axis_rtl:1.0) and add an IP in the BD, which would only wire all the interface nets as a pass-through. The option is shown in the Part 2.

The Vivado Platorm can be generated using the following make command:

make vivado_platform

Hardware Emulation

Another way to verify the good behaviour of the design is to run through Hardware emulation and looking at the waveforms. To run the Hardware Emulation and visualize the waveforms of the AXI4-Stream interfaces, go through the following steps:

  1. Open the workspace_1 in Vitis IDE.

vitis -w Vitis/workspace_1/
  1. In the flow navigator, make sure the component system project is selected and click on Start Emulator under Harware Emulation.

Start Emulator

  1. In the pop-up window, enable Show Waveform and click Start. This starts the emulator and launch the Vivado tool to visualize the simulation waveforms.

Enable waveforms

  1. Add the M00_AXIS interface from the AXI4S_Counter_0 IP and the S00_AXIS from the dummy_sink_0 IP to the waveform window and run the simulation for 30us.

Waveforms

  1. After ~10us of simulation time, you see transactions on the AXI4-Stream interfaces from and to the AI Engine demonstrating the good behaviour of the design.