PS Application Creation - 2024.1 English

Vitis Tutorials: AI Engine

Document ID
XD100
Release Date
2024-06-19
Version
2024.1 English

In this section of the tutorial, you will learn how to build a PS bare-metal application using the XSA created in the previous step, and then build, as well as run the complete system.

Step 1: Create a New Platform in the Bare-metal Domain

  1. In the Vitis Unified IDE with the same workspace directory as the previous step. Click File → New Component → Platform.

  2. Set the Platform Project Name to AIE_A-to-Z_pfm_vck190, and click Next.

  3. Use the XSA generated in the previous step that you can find in simple_aie_application_system_project/build/hw/hw_link/binary_container_1.xsa

missing image

  1. Set standalone as the Operating system and psv_cortexa72_0 as the Processor, and click Finish.

missing image

  1. Build the platform.

Step 2. Build the Baremetal AI Engine Control Application

  1. Create a new application by clicking File → New Component → Application.

  2. Set the name for the application to A-to-Z_app and click Next.

  3. Select AIE_A-to-Z_pfm_vck190 as the platform and click Next.

  4. Select the A72_0 processor domain (standalone_psv_cortexa72_0), and click Next and then Finish.

  5. Right-click the src folder under the A-to-Z_app project, and click Import → Files.

  6. Import the aie_control.cpp file from the AI Engine application project (simple_application/build/hw/Work/ps/c_rts/aie_control.cpp).

  7. Import main.cpp from the src folder from the git repository.

    Go through the main.cpp file. You can see that the code is initializing the input data and the memory space for the output data. One thing to note is the use of the .init() and .run() APIs to control the AI Engine.

    printf("Starting AIE Graph\n");
    printf("Graph Initialization\n");
    mygraph.init();
    printf("Done \n");
    printf("- \n");
    
    printf("Running Graph for 4 iterations\n");
    mygraph.run(4);
    

    There are two options to enable an AI Engine graph from a system:

    • Enable the graph in the PDI. This means that the graph will be started during BOOT and will run forever.

    • Enable the AI Engine graph from the PS program using the <graph>.init() and <graph>.run() APIs. This is what you are using in this case.

  8. Under the A-to-Z_app component open UserConfig.cmake under Settings. In the Directories section add the following directories under Include Paths (-I).

    • <workspace>/simple_aie_application/src

    • $ENV{XILINX_VITIS}/aietools/include

missing image

  1. Still in the UserConfig.cmake file, in the Libraries section add

    • adf_api under Libraries (-l)

    • $ENV{XILINX_VITIS}/aietools/lib/aarchnone64.o under Library search path (-L)