Platform Component Command Line Flow - 2023.1 English

Vitis Unified IDE and Common Command-Line Reference Manual (UG1553)

Document ID
UG1553
Release Date
2023-07-17
Version
2023.1 English

You can also use the command-line flow in the interactive mode to create a Platform component using the steps outlined below.

  1. Use the following command to start the Vitis tool in interactive mode:
    vitis --new -i
  2. Import the Vitis tool library:
    import vitis
  3. Create a client:
    client = vitis.create_client()

    This takes a few seconds, and the tool returns with a Vitis Server started message.

  4. Specify the workspace to add the Platform component to:

    client.set_workspace(path="<workspace>")
  5. Create a platform, specifying the Name, the XSA file, the Operating System, and Processor:
    platform = client.create_platform(name="Platform1",hw="<path_to_xsa>",os="<Operating System>",cpu="<processor>") 
    • The XSA file can be specified from one of the supported base platforms found in $XILINX_VITIS/base_platforms, or can be specified from $PLATFORM_REPO_PATHS or custom designs

    • The supported OS are linux, standalone, freertos
    • The processors are dependent on the XSA, and can include psv_cortexa72, psv_cortexr5, psv_pmc, psv_psm for example.
  6. Add domain to a platform:
    platform = client.get_platform_component(name="<platform name>")
    domain = platform.add_domain(cpu = "processor",os = "Operating System",name = "domain name",display_name = "displayed domain name")
    • The supported OS are linux, standalone, freertos
    • The processors are dependent on the XSA, and can include psv_cortexa72, psv_cortexr5, psv_pmc, psv_psm for example.
  7. For a standalone or freertos domain user could modify the BSP.
    platform = client.get_platform_component(name="<platform name>")
    domain = platform.get_domain(name="< >")
    status = domain.set_lib(lib_name="<>") 
    status = domain.remove_lib(lib_name="< >") 
    • User should get the corresponding platform and domain and then select the module you need or want to delete.
  8. For a Linux system, add the boot component directory, BIF file, and the SD card directory. First user should get the OS Domain that was created from the concatenation of OS and Processor.
    platform = client.get_platform_component(name="<platform name>")
    domain = platform.get_domain(name="<os_processor>")
    status = domain.add_boot_dir(boot_dir="<boot component directory>")
    status = domain.add_bif(file_name="<bif file location>")
    status = domain.set_sd_dir(path="<sd component directory>")
  9. Build the Platform component. User need to get the corresponding platform and then build it.
    platform = client.get_platform_component(name="<platform name>")
    status = platform.build()

After building, the platform is located in the workspace directory. You can also put these commands into a python script (.py) and use the batch mode to source the script as follows.

vitis -new -s <script>.py
Tip: You can use vitis_journal.py, the log of the commands that have been executed in interactive mode, as a source for your script.

Example 1

Example to create a Platform component with a Linux domain:

import vitis
client = vitis.create_client()
client.set_workspace(path="new_platform")
platform = client.create_platform(name = "platform1",hw="./src/vck190_custom_hw.xsa",os="linux",cpu="psv_cortexa72")
platform = client.get_platform_component(name="platform1")
domain = platform.get_domain(name="linux_psv_cortexa72")
status = domain.add_boot_dir(boot_dir="./src/boot")
status = domain.set_sd_dir(path="./src/sd_dir")
status = domain.add_bif(file_name="./src/linux.bif")
platform = client.get_platform_component(name="platform1")
domain = platform.add_domain(cpu = "psv_cortexr5_0",os = "freertos",name = "freetos_domain",display_name = "freetos_domain")
domain = platform.get_domain(name="freetos_domain")
status = domain.set_lib(lib_name="xilmailbox")
status = domain.remove_lib(lib_name="xilmailbox
platform = client.get_platform_component(name="platform1")
status = platform.build()

Example 2

Example to create a Platform component with a standalone domain:

import vitis
client = vitis.create_client()
client.set_workspace(path="new_platform")
platform = client.create_platform(name="platform2",hw="./src/vck190_custom_hw.xsa",os="standalone",cpu="psv_cortexa72_0")
platform = client.get_platform_component(name="platform2")
status = platform.build()