Step 2: Create Vitis Platform - 2022.2 English

Vitis Tutorials: Getting Started

Document ID
XD098
Release Date
2022-11-07
Version
2022.2 English
  1. Download Versal common image from Xilinx website download page., place it under your WorkSpace directory and extract the common image.

    tar xvf ../xilinx-versal-common-v2022.2.tar.gz .
    
  2. Create the device tree file Device tree describes the hardware components of the system. createdts command can generate the device tree file according to the hardware configurations from XSA file. If there are any settings not available in XSA, for example, any driver nodes that don’t have corresponding hardware, or user have their own design hardware, User needs to add customization settings in system-user.dtsi.

    Besides uboot in common image does not have default environment variables. So updating the bootargs manually is needed. A pre-prepared system-user.dtsi file which adds pre-defined bootargs is under ref_files directory. Please copy system-user.dtsi to WorkSpace directory and follow below steps to generate the DTB file.

    cd WorkSpace
    source <Vitis_Install_Directory>/settings64.sh
    xsct 
    

    Then execute createdts command in XSCT console like the following:

    createdts -hw <full path>/vck190_custom_hw.xsa -out . -zocl \
    -platform-name mydevice -git-branch xlnx_rel_v2022.2 -board versal-vck190-reva-x-ebm-02-reva -dtsi system-user.dtsi -compile   
    

    Notice -hw option is your XSA file generated in step1 located in your Vivado Project directory named vck190_custom_hw.xsa . Besides below information would show in XSCT console. Please ignore the the following warning and that means you succeed to get system.dtb file which is located in <mydevice/psv_cortexa72_0/device_tree_domain/bsp/>.

    pl.dtsi:9.21-46.4: Warning (unit_address_vs_reg): /amba_pl@0: node has a unit name, but no reg property
    pl.dtsi:41.26-45.5: Warning (simple_bus_reg): /amba_pl@0/misc_clk_0: missing or empty reg/ranges property
    

    Type exit in console to exit XSCT console.

  3. Create Vitis platform

    • Create two directories under WorkSpace directory for FAT32 partition and boot components. Then prepare images like the following:

      cd WorkSpace
      mkdir sd_dir
      mkdir boot
      cp xilinx-versal-common-v2022.2/boot.scr sd_dir/
      cp xilinx-versal-common-v2022.2/bl31.elf boot/
      cp xilinx-versal-common-v2022.2/u-boot.elf boot/
      cp mydevice/psv_cortexa72_0/device_tree_domain/bsp/system.dtb boot/
      
    • install SDK tool by typing sh xilinx-versal-common-v2022.2/sdk.sh -d xilinx-versal-common-v2022.2/ -y in console. Option of -d is to specify the directory where to install. Option of -y means confirmation. So it will be installed in xilinx-versal-common-v2022.2/ folder.

    • Run Vitis by typing vitis in the console.

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

    • Enter the project name. For this example, type vck190_custom, click Next.

    • In the Platform page, click Browse button, select the XSA file generated by the Vivado. In this case, it is located in <Your Vivado Project Directory>/vck190_custom_hw.xsa. Click Next.

    • Set the operating system to linux.

    • Set the processor to psv_cortexa72.

    • Click Finish.

    Created Vitis Platform

    • Click the linux on psv_cortexa72 domain

    • Update the Display Name to xrt by clicking the edit button on the right of this line and input the name. We’d like to indicate this is a Linux domain has XRT installed and is capable of running acceleration applications.

    • Set Bif file: Click the drop down-button like the following diagram and select Generate BIF. The generated BIF file is generated in the resource directory.

      vitis_platform_config

    • Boot Components Directory: Browse to boot and click OK. Bootgen will look for boot components referred by BIF in this directory to generate BOOT.BIN

    • FAT32 Partition Directory: Browse to sd_dir and click OK. Files in this directory will be copied to FAT32 partition of SD card.

    • QEMU Data: Browse to step3_pfm/boot/ and click OK. Emulator will use boot components from this directory.

    • Click vck190_custom project in the Vitis Explorer view, click the Build button to generate the platform.

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

    After this step2 we have completed the platform creation process and next, we will run an application to validate this platform.