- Create a bare-metal platform. Building bare-metal applications
requires a platform with a bare-metal domain. Because the
xilinx_vck190_base_202210_1base platform does not have one, you must create a custom platform with a bare-metal domain using the fixed-XSA file.
- Select the Vitis
IDE. This opens the New Platform
Project wizard as shown.
command in the
- Specify a Platform
project name and click Next to proceed. This displays the
page of the wizard where you specify an XSA to create the new platform.
Use the binary_container_1.xsa.
- After you select the XSA, the Vitis IDE reads the file, determines the
system and Processor for the domain defined by the XSA,
and populates it in the dialog box. Click Finish to create the platform project.Tip: The bare-metal platform is valid for either hardware emulation or hardware builds depending on the fixed-XSA selected for the platform.
- Click the Build
command to build the platform. A copy of the completed platform is
written to the export folder of the project, and shows in the
view for the project. As shown in the following figure, the exported
platform has the platform.xpfm
meta-data file, as well as the ./hw and ./sw
folders for the different elements of the platform.
The Vitis IDE automatically adds the new platform to your platform repository making it available to use in new projects. You can also add the file location to your
$PLATFORM_REPO_PATHSenvironment variable. This makes the platform accessible to the Vitis IDE, or allows you to specify the platform in command-lines by referring to the platform name rather than the whole path.Important: The generated platform will be used only for building the bare-metal PS application and is not used any other places in the flow.
- Select the Vitis IDE. This opens the New Platform Project wizard as shown.
- Create a new PS application project.
- Select the Vitis IDE. This opens the New Application Project wizard. command in the
- Click Next to skip past the first page, and display the Platform page as shown.
- Select the baremetal_platform you created in the last step, and
click Next to proceed.
- Provide an Application project name and click Next.
- Review the Domain page and click Next to proceed.
- On the Templates page, select Empty Application and click Finish to create the project. The project is opened in the Vitis IDE.
- Add the source code for the PS application, main.cpp, platform.cpp, and associated files written specifically
for the bare-metal project. Select the project in the
view, expand the folders, right-click the src folder, and click the Import Sources command () to open the dialog box
shown in the following figure. Select the files to add and click
- You must also add the bare-metal AI Engine control file (aie_control.cpp), which is created by
aiecompilercommand, and can be found in the ./Work/ps/c_rts folder. Select the src folder again, and click the Import Sources icon () to open the dialog box and add the aie_control.cpp file to the project.
- Finally, you must add to the Include paths for your
project. Right-click the bare-metal application project and select
C/C++ Build Settings as
This selection opens the Build Settings dialog box, as shown in the following figure. Select the Directories option as shown, and select the Add command () to add the new include paths. You will need to add an entry for the source files for your original AI Engine graph application. This is the src folder for the project described in Creating the AI Engine Graph Project and Top-Level System Project. This should point to a folder containing your AI Engine graph source files. Click Apply and Close to finish defining the include path.
Building a bare-metal system requires a deviation from the standard application flow previously described. The branch in the process occurs after the Configuring the HW-Link Project step, with the bare-metal system requiring an addition to that step and then following a new process. The specific steps required are detailed below.