Creating the Platform

Once the hardware and software components have been created, the Vitis tools are used to create a Vitis platform, which integrates the two components to offer a specific solution. A platform that does not use acceleration kernels can still be created for supporting embedded software development, as was previously done with the Xilinx Software Development Kit (SDK). However, a primary feature of the Vitis tool set is that it creates and uses platforms that support acceleration kernels. Platforms with kernel and Linux XRT support provide developers an OpenCL execution model, as well as traditional C/C++ compilation through the Vitis tools.

In this platform creation example (zcu102_min), a single Linux domain for the Cortex™-A53 processor cores is provided in the platform. This platform allows developers to create Linux applications that can use acceleration kernels and run on any of the four Cortex-A53 cores available to the SMP Linux system generated by PetaLinux.

Additional domains can be added to a platform and provided to application developers. Platforms can be defined with multiple domains where each domain specifies a processor core and the OS/BSP that runs on it. Although an unlimited number of domains can be defined for a platform, when applications run on a platform they must use domains that do not conflict with each other. In other words, the domains chosen for running a set of applications on an embedded board must be able to run simultaneously.

The set of domains that can run simultaneously is encapsulated by the Vitis concept of a system project. In the following figure, four domains are defined in the platform and each system project contains applications that use a set of domains that can run simultaneously. System project 1 runs two baremetal applications on two different A53 cores. System project 2 runs multiple Linux applications across all four A53 cores. We could add an R5 processor domain from the platform to either system project and still meet the requirement that applications within the system project must be able to run simultaneously.

Figure 1: Platforms, Domains, and System Projects

Characteristics of the Vitis platform creation tools are:

  • A system project is a container for multiple applications that run on different domains of a platform at the same time.
  • A domain is the BSP/OS that controls one or more processors of the same type.
  • A platform contains one or more domains.
  • A Vitis workspace can contain an unlimited number of platforms and an unlimited number of system projects.

Creating Platforms with XRT and Kernel Support

In the Vitis IDE, you can create a platform as described below. The hardware and software components must have been previously generated as described in Creating the Hardware Component and Creating the Software Component respectively.

  1. Use the Vitis workspace directory you created earlier to store the platform project:
    cd zcu102_min_pkg/pfm
    vitis -workspace wksp1
  2. In the Vitis IDE, select File > New > Platform Project to create a platform project.
  3. In the Create New Platform Project dialog box, do the following:
    1. Enter the project name. For this example, type zcu102_min.
    2. Leave the checkbox for the default location selected.
    3. Click Next.
  4. In the Platform Project dialog box, do the following:
    1. Select Create from hardware specification (XSA).
    2. Click Next.
  5. In the Platform Project Specification dialog box, do the following:
    1. Browse to the XSA file generated by the Vivado® Design Suite. In this case, it is located in zcu102_min_pkg/vivado/zcu102_min.xsa.
    2. Set the operating system to linux.
    3. Set the processor to psu_cortexa53.
    4. Leave the checkmark selected to generate boot components.
    5. Click Finish.
  6. In the Platform Settings view, observe the following:
    • The name of the Platform Settings view matches the platform project name of zcu102_min.
    • A psu_cortexa53 device icon is shown, containing a Linux on psu_cortexa53 domain.
    • A psu_cortexa53 device icon is shown, containing a zynqmp_fsbl BSP.
    • A psu_pmu_0 device icon is shown, containing a zynqmp_pmu BSP.
  7. Click the linux on psu_cortexa53 domain to set paths to the generated Linux software products. Although you are creating a platform with a single Linux domain, you can add domains to the platform in the Platform Settings dialog box.
  8. Browse to the locations and select the directory or file needed to complete the dialog box for the following:
    Linux Build Output
    Browse to zcu102_min_pkg/pfm/boot and click OK.
    Bif file
    Browse to zcu102_min_pkg/pfm/boot/linux.bif file and click OK.
    Image
    Browse to zcu102_min_pkg/pfm/boot and click OK.
    Sysroot
    Browse to zcu102_min_pkg/pfm/sysroots/aarch64-xilinx-linux and click OK.
  9. To optionally enable emulation on your platform perform the following steps:

    To support emulation, the platform needs a QEMU argument file, a PMU argument file, and a directory containing the necessary ELF files when the emulator is launched. Obtain and modify the QEMU and PMU argument files from the zcu102_base platform for use with your zcu102_min platform example.

    1. Locate the zcu102_base platform link:
      https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-platforms.html
    2. Create a directory named ./emulation within the existing zcu102_min_pkg/pfm directory and add the qemu_args.txt and pmu_args.txt files from the zcu102_base Zip file:
      cd zcu102_min_pkg/pfm
      mkdir emulation
    3. Edit and save the qemu_args.txt file and pmu_args.txt file to replace any instances of the platform name zcu102_base with zcu102_min.
    4. In the Platform Settings dialog box specify the following settings:
      • QEMU Data: Browse to the zcu102_min_pkg/pfm/boot directory and click OK.
      • QEMU Arguments: Browse to the zcu102_min_pkg/pfm/emulation/qemu_args.txt file and click OK.
      • PMU QEMU Arguments: Browse to the zcu102_min_pkg/pfm/emulation/pmu_args.txt file and click OK.
  10. With the zcu102_min project selected in the Vitis Explorer view, click the Build button to generate the platform.
The generated platform is placed in the export directory. BSP and source files are also provided for re-building the FSBL and PMU if desired and are associated with the platform. The platform is ready to be used for application development.
Figure 2: Generated Platform Shown in the Export Directory