Create the Vitis Platform - Create the Vitis Platform - 2025.2 English - XD101

Vitis Tutorials: Platform Creation (XD101)

Document ID
XD101
Release Date
2025-12-11
Version
2025.2 English
  1. Install the sysroot

    • Go to common image extracted directory <WorkSpace/xilinx-versal-common-v2025.2/>.

    • Type ./sdk.sh -d <Install Target Dir> to install the PetaLinux SDK. Use the -d option to provide a full pathname to the output directory. (This is an example. . means current directory) and confirm.

    Note: The environment variable LD_LIBRARY_PATH must not be set when running this command.

    Note: Sysroot is not mandatory components for the platform itself. It is the cross compile tool

  2. Create the Vitis platform.

    For this example, you will use the Vitis Unifeid IDE to create the Vitis Platform. Go to WorkSpace directory and follow steps below to create the platform

    • Run Vitis by typing vitis -w . in the console. -w is to specify the workspace. . means the current workspace.

    • In the Vitis IDE, select File > New Component > Platform to create a platform component.

    • Enter the Component name. For this example, type custom_platform, click Next.

    • In the XSA selecting page, click Browse button, select the XSA file generated by the Vivado. In this case, it is Your Vivado Project Directory>/custom_hardware_platform_hw.xsa.

      Note: If you want to create a platform with emulation support please click Emulation and select the emulation XSA file. In this case, it is custom_hardware_platform_hwemu.xsa.

    • Expand the Advanced Options and set the items as following:

    Created Vitis Platform

    • SDT Source Repo: This is used to replace the built-in SDT tool. For this tutorial, leave it empty.

    • Board DTSI: Specify the board machine name, which is used to retrieve the board-level DTSI file. For this tutorial, leave it empty. To check the board machine name, refer to UG1144 Machine Name Checking

    • User DTSI: Allows you to specify a custom DTSI file. Click Browse and select the the system-suer.dtsi file located in the ref_files/step2_pfm folder.

    • DT ZOCL: Enables Zocl node generation for the XRT driver. Ensure this option is enabled, then click Next.

    • Set the Operating System to Linux and the Processor to psv_cortexa72. Enable the Generate Device Tree Blob (DTB) option, then click Next.

      Note: Enabling this option allows the tool to automatically generate a DTB file using the provided DTSI and XSA files. The DTB file is located in <platform component>/hw/sdt/ folder.

    • Review the summary and click Finish.

    Created Vitis Platform

    • Click the linux On psv_cortexa72 domain.

    • Set Bif file: Click the button as shown in the following diagram and generate BIF file. The BIF file is generated in the resource directory.

      vitis_platform_config

    • Pre-Built Image Directory: Browse to extracted common image path directory: xilinx-versal-common-v2025.2/ and click OK. Bootgen looks for boot components referred by BIF in this directory to generate BOOT.BIN.

    • DTB file: DTB will be generated automatically and populated in this area.

    • FAT32 Partition Directory: if you have additional file to be stored in FAT32 partition diretory you can browse to the file. If not please omit this.

    • QEMU Data: This Directory is used to add additional file for emulation. User can set it according to your requirement.

    • In the flow navigator, click the drop-down button to select the component. In this case, select vck190_custom component and click the Build button to build the platform.

    Note: If there are additional QEMU settings, update qemu_args.txt accordingly.

  3. Add the AI Engine domain.

    • Click + button to add a domain.

      Vitis add domain to the platform

    • Set Name to aiengine.

    • Change OS to aie_runtime.

    • Keep other settings to default and click OK.

      Vitis add AIE domain

  4. Select custom_platform platform component in the flow navigator, then click the Build button to build the platform.

    missing image

    Note: The generated platform is placed in the custom_platform directory. The platform is ready to be used for application development

    missing image

    Note: Users can locate the XPFM file by expanding the Output directory. This provides a logical view of the output. The actual path of platform file is under WorkSpace/custom_platform/export/custom_platform/ directory. Users can also view the complete path of the platform file by simply hovering the mouse pointer over the XPFM file.

    Note: The Vitis Unified IDE will find the boot-related files menntioned in the software components in begin of this step and place them in the boot folder of the platform.

    If you create a Vitis application component in the same workspace as this platform component, you can find this platform available in the platform selection page in the application Creation wizard. If you want to reuse this platform in another workspace, add its path to the PLATFORM_REPO_PATHS environment variable before launching the Vitis GUI, or use the “Add” button on the platform selection page of the Vitis GUI to add its path.

    User could also use Vitis Python command to create the platform component.

    Click here to see how to use Vitis python command to create a Vitis platform. Create a python script. For example, here is the parts of [platform_creation.py](https://github.com/Xilinx/Vitis-Tutorials/blob/2025.2/Vitis_Platform_Creation/Design_Tutorials/03_Edge_VCK190/ref_files/step2_pfm/platform_creation.py).
    import vitis
    import argparse
    import os
    print("Platform generation")
    parser = argparse.ArgumentParser()
    parser.add_argument("--platform_name", type=str, dest="platform_name")
    parser.add_argument("--xsa_path", type=str, dest="xsa_path")
    parser.add_argument("--xsa-emu_path", type=str, dest="emuxsa_path")
    parser.add_argument("--boot", type=str, dest="boot")
    parser.add_argument("--user_dtsi", type=str, dest="user_dtsi")
    args = parser.parse_args()
    platform_name=args.platform_name
    xsa_path=args.xsa_path
    emuxsa_path=args.emuxsa_path
    user_dtsi=args.user_dtsi
    boot=args.boot
    print('args',args)
    client = vitis.create_client()
    workspace_path = os.getcwd() + "/ws" 
    client.set_workspace(path=workspace_path)
    print(workspace_path)
    advanced_options = client.create_advanced_options_dict(dt_zocl="1",dt_overlay="0", user_dtsi=user_dtsi)
    platform = client.create_platform_component(name =platform_name ,hw_design = xsa_path,emu_design = emuxsa_path,os = "linux",cpu = "psv_cortexa72",domain_name = "linux_psv_cortexa72",generate_dtb = True,advanced_options = advanced_options)
    platform = client.get_component(name=platform_name)
    domain = platform.add_domain(cpu = "ai_engine",os = "aie_runtime",name = "ai_eingine",display_name = "ai_eingine")
    domain = platform.get_domain(name="linux_psv_cortexa72")
    status = domain.update_name(new_name="xrt")
    status = domain.generate_bif()
    status = domain.set_boot_dir(path=boot)
    status = platform.build()
    

    This python script is for user to create a platform. It needs the following input values.

    • name: Platform name.

    • hw: Hardware XSA file location.

    • emulation_xsa_path: Hardware emulation XSA file location.

    • boot: pre-built image path.

    • user_dtsi: user dtsi file path.

    The following is the command brief explanation.

    • client.create_platform_component is used to create a platform with standalone domain or the Linux domain.

    • domain.add_boot_dir is used to set the pre-built image path.

    You can pass the values to the script directly by replacing the variable with the actual value, or pass the value to python script. Here is an example of calling python script.

    vitis -s platform_creation.py --platform_name <> --xsa_path <> --xsa-emu_path <> --boot <> --dtb <>
    

    Now you have completed the platform creation. Next, we will validate the output of this step.