Step 2. Build the Baremetal AI Engine Control Application - 2023.1 English

Vitis Tutorials: AI Engine Development

Document ID
Release Date
2023.1 English
  1. Create a new application by clicking New → Application Project.

  2. Select AIE_A-to-Z_pfm_vck190 as the platform.

  3. Set the name for the application (for example, A-to-Z_app), select the A72_0 processor domain (CIPS_0_pspmc_0_psv_cortexa72_0), and click Next.

  4. On the next page, select standalone for the domain.

  5. Finally, select the Empty Application (C++) template, and click Finish.

  6. Right-click the src folder under the A-to-Z_app project, and click Import Sources.

  7. Import the aie_control.cpp file from the AI Engine application project (simple_application/Emulation-AIE/Work/ps/c_rts/aie_control.cpp).

  8. 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");
    printf("Done \n");
    printf("- \n");
    printf("Running Graph for 4 iterations\n");;

    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.

  9. Right-click A72 PS application (A-to-Z_app), and select C/C++ Build Settings.

    missing image

  10. In the directories section under the Arm® v8 g++ compiler, add the directory for the AI Engine application:

    • The sources folder for the AI Engine application (${workspace_loc:/simple_application/src}).

    missing image

    And make sure the ${env_var:XILINX_VITIS}/aietools/include is already added in the directory settings.

  11. Modify the Linker Script to increase the heap size for AIE library.

    • In the Project Explorer, expand the A-to-z_app.

    • In the src directory, double-click lscript.ld to open the linker script for this project.

    • In the linker script modify the Heap size to 0x100000 (1MB).

    missing image

  12. Build the A72 PS application (A-to-Z_app).