Creating the Application Component - 2024.1 English

Vitis Tutorials: Getting Started

Document ID
Release Date
2024.1 English

The Application component is an application that runs on the processor, Arm or x86, that loads and runs the device binary (.xclbin) which you will build later. The Vitis unified IDE automatically detects whether the Application component uses XRT native API or OpenCL and compiles the code as needed. Create the Application component using the following steps:

  1. From the main menu select File > New Component > Application

This opens the Create Application Component wizard on the Name and Location page.

  1. Enter the Component name as host, enter the Component location as the workspace (default), and click Next.

This opens the Select Platform page.

  1. On the Select Platform page select the xilinx_zcu102_base_202320_1 platform and click Next to open the Select Domain page.

On the Select Domain page you will select from the available processor domains and OS. In this case there is only one choice.

  1. Select the xrt domain and click Next to open the Sysroot page.

On the Sysroot page you will provide a path to the sysroot as part of the common images for the selected platform. You can find more information on this at Installing Embedded Platforms.

Enter the path to the Sysroot for the selected platform and click Next to open the Summary page.

  1. Review the Summary page and click Finish to create the defined Application component.

The Application component vitis-comp.json file is opened in the center editor, and the component is added to the Component Explorer. When creating the Application component you do not specify source files so you must add the required source files after the component is created.

In the Vitis Components Explorer view expand the host component, right-click the Sources folder and Import > Files to import the following source file: <tutorial_path>/Getting_Started/Vitis/example/src/host.cpp

After adding it, you can select the host.cpp file in the Vitis Components Explorer to open it in the Code Editor in the central editor window. This example shows the simplest way of using XRT API to interact with the hardware accelerator.

Having added the source code to the component, you are now ready to compile the code. Looking at the Flow Navigator with the Application component the active component, you can see there are Build commands under X86 Simulation and Hardware. For Data Center applications, these two are essentially the same as the Application component runs on the X86 processor for both Hardware and Emulation. However, for Embedded Processor-based platforms, these are two different build configurations. For software emulation, even though the platform uses an embedded processor, emulation is run on the x86 processor as described in Embedded Processor Emulation Using PS on x86. For hardware emulation, or to run on hardware, the Application component must be compiled for the embedded processor domain. These Build choices reflect that requirement.

  1. After the host.cpp is imported, click the Build command to build the application for X86 Simulation or for Hardware.