You can also use the command-line flow in the interactive mode to create a Platform component using the steps outlined below.
- Use the following command to start the Vitis tool in interactive mode:
vitis --new -i
- Import the Vitis tool library:
import vitis
- Create a client:
client = vitis.create_client()
This takes a few seconds, and the tool returns with a
Vitis Server started
message. -
Specify the workspace to add the Platform component to:
client.set_workspace(path="<workspace>")
- 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.
-
- 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.
- The supported OS are
- 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.
- 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>")
- 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
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()