Mastering AI Engine Creation

Mastering AI Engine Creation

Table of Contents:

  1. Introduction
  2. Setting up the Vitis Environment 2.1. Installing Vitis 2.2. Installing XRT
  3. Launching the Vitis IDE 3.1. Creating a Workspace 3.2. Creating an Application Project
  4. Building the AI Engine Application 4.1. Selecting the Platform 4.2. Configuring the Project 4.3. Choosing the Domain 4.4. Selecting a Template 4.5. Building the Application Project
  5. Exploring the Application Project 5.1. Navigating the Explorer Window 5.2. Understanding the Source Code
  6. Building the AI Engine Project 6.1. Configuring the Active Build 6.2. Compiling the Project
  7. Running the Emulation 7.1. Launching the Emulator 7.2. Comparing the Output 7.3. Removing the Time Step
  8. Conclusion
  9. FAQs

How to Run a Bare Metal Application on AI Engine in Vitis

The AI Engine provides a powerful solution for running bare metal applications on the Whitis platform. In this tutorial, we will guide You through the step-by-step process of setting up the Vitis environment, creating an AI Engine application project, building the project, and running the emulation. By the end of this tutorial, you will have a clear understanding of how to run a bare metal application on the AI Engine in Whitis.

1. Introduction

Running bare metal applications on the AI Engine can offer significant advantages in terms of performance and flexibility. With the right tools and knowledge, developers can harness the full potential of the AI Engine to achieve optimal results.

2. Setting up the Vitis Environment

Before we dive into creating the AI Engine application project, it is essential to set up the Vitis environment properly. This involves installing Vitis and XRT, which are necessary for developing and running AI Engine applications.

2.1. Installing Vitis

To install Vitis, follow the official Xilinx documentation, which provides step-by-step instructions. Make sure to choose the correct version of Vitis for your specific requirements.

2.2. Installing XRT

Xilinx Runtime (XRT) is a prerequisite for running applications on the AI Engine. Install XRT according to the guidelines provided by Xilinx. Ensure that the installation is successful before proceeding further.

3. Launching the Vitis IDE

Once you have set up the Vitis environment, you can launch the Vitis IDE to begin creating the AI Engine application project.

3.1. Creating a Workspace

Before creating an application project, you need to set up a workspace for your projects. Launch the Vitis IDE and select a folder to serve as your workspace. This folder will contain all the project files and configurations.

3.2. Creating an Application Project

To Create an AI Engine application project, click on the "Create Application Project" option in the welcome page of the Vitis IDE. This will open a wizard that guides you through the project creation process.

4. Building the AI Engine Application

Building the AI Engine application involves several steps, including selecting the platform, configuring the project, choosing the domain, selecting a template, and finally building the application project.

4.1. Selecting the Platform

In the project creation wizard, you will be prompted to select a platform. The available platforms will be listed, and you can choose the appropriate one for your project. If your desired platform is not listed, you can add it manually by clicking the "Add" button and selecting the platform folder.

4.2. Configuring the Project

Provide a name for your new application project and let the wizard automatically create a system project for you. Additionally, select the target processor as the AI Engine. In this Scenario, the target processor will be the AI Engine.

4.3. Choosing the Domain

For an AI Engine processor, the suitable domain is the AIE runtime. Keep the default selection and proceed to the next step.

4.4. Selecting a Template

The Vitis IDE offers pre-built templates that can be used for application development. Choose the template that suits your requirements. In this tutorial, we will use the simple template, which features a two-kernel graph with window-Based data communication.

4.5. Building the Application Project

Once you have finished configuring the project, click on the "Finish" button to create the application project. The Vitis IDE will automatically generate the necessary files and folder structure.

5. Exploring the Application Project

The Explorer window in the Vitis IDE provides a comprehensive view of the application project's structure. Take some time to familiarize yourself with the folder hierarchy and the files contained within each sub-project.

5.1. Navigating the Explorer Window

The Explorer window lists all the folders and files within your application project. In particular, pay Attention to the "data" folder and the "src" folder. The "src" folder contains the kernel and graph source code, while the "data" folder contains the input and golden files.

5.2. Understanding the Source Code

Open the graph code within the "src" folder to get a closer look at the main function and the graph definition. The kernel source code is stored in subfolders within the "kernels" folder.

6. Building the AI Engine Project

Before running the emulation, it is necessary to build the AI Engine project. This ensures that the code is compiled correctly and ready for execution.

6.1. Configuring the Active Build

Ensure that the active build is set to "emulation-aie." This can be done by selecting the appropriate build configuration from the build options.

6.2. Compiling the Project

Right-click on the "emulation-aie" build configuration in the Assistant window and select "Build." This will initiate the compilation process. Pay attention to the console window for any warnings or errors that may occur during the build.

7. Running the Emulation

Running the emulation allows you to test your AI Engine application in a simulated environment. It provides a way to verify if The Simulation result is correct or not.

7.1. Launching the Emulator

To run the emulation, right-click on the "emulation-aie" build configuration and select "Run". Then, choose "Launch AIE Emulator" to start the emulation process. Depending on your server's status, the emulation may take a few minutes to complete.

7.2. Comparing the Output

After the emulation process is finished, you can compare the output result with the golden result. The output file can be found under the "ai_simulator_outputs" folder, named "output.txt." Use the "Compare" option to verify if the simulation result is correct.

7.3. Removing the Time Step

To remove the time step in the output file, use the predefined filters in the Vitis IDE. Add the "Remove Time Step" command and Apply it to the output file. This will remove unnecessary information and facilitate the comparison process.

8. Conclusion

In this tutorial, we covered the essential steps to run a bare metal application on the AI Engine in Vitis. By following the instructions provided, you should now have a clear understanding of how to set up the Vitis environment, create an AI Engine application project, build the project, and run the emulation. These skills will enable you to utilize the full potential of the AI Engine for your applications efficiently.

9. FAQs

Q: Can I run a bare metal application without setting up the Vitis environment? A: No, the Vitis environment is essential for developing and running AI Engine applications. It provides the necessary tools and libraries for efficient development.

Q: Is it possible to use a different template for the AI Engine application? A: Yes, the Vitis IDE offers various templates that cater to different application requirements. Choose the template that best suits your needs.

Q: What if I encounter errors during the build or emulation process? A: When errors occur, it is crucial to analyze the console window for detailed error messages. These messages will guide you in identifying and resolving the issues you encountered.

Most people like

Find AI tools in Toolify

Join TOOLIFY to find the ai tools

Get started

Sign Up
App rating
4.9
AI Tools
20k+
Trusted Users
5000+
No complicated
No difficulty
Free forever
Browse More Content