Test 2: Run Vector Addition Application - 2025.2 English - XD101

Vitis Tutorials: Platform Creation (XD101)

Document ID
XD101
Release Date
2025-12-11
Version
2025.2 English

Vector addition is the simplest acceleration PL kernel. The Vitis Unified IDE can create this application automatically. Running this test can check the AXI control bus, memory interface, and interrupt setting in platform are working properly.

  1. Creating Vector Addition Application

    • Go to WorkSpace directory created in step1

    • Run Vitis by typing vitis -w . in the console. -w is to specify the workspace. . means the current workspace directory. Close the welcome tab after Vitis launches.

    • Go to example view by clicking the example button and select and click Simple Vector Addition. example.PNG

    • Click Create Application from Template. The project creation wizard would pop up.

      • Input the System project name as vadd and use the default location for System project location. Then click Next.

      • Select zcu104_custom platform, click Next.

        Note: If the platform component is not in the current workspace user could click + button to add the platform component.

      • Set Kernel Image to xilinx-zynqmp-common-v2025.1/Image.

      • Set Root FS to xilinx-zynqmp-common-v2025.1/rootfs.ext4.

      • Set Sysroot to zcu104_software_platform/xilinx-zynqmp-common-v2025.1/sysroots/cortexa72-cortexa53-amd-linux. Then click Next.

      • Review the summary of your vadd system project and click Finish.

    After seconds the vadd system project, vadd host component and vadd kernel component will be ready in the component view.

  2. Building Vector Addition Application

    Vadd system project supports three targets: Software emulation, Hardware emulation and Hardware. User could select the target accordingly following steps below.

    • Go to flow navigator and select vadd system project.

      build_application.PNG

    • Click Build All under the target

    • In the Build Component setup dialog please enable all the components. Then click OK.

      build_application.PNG

    After compilation is finished. Users can locate the sd_card.img by expanding the Output directory. This provides a logical view of the output. The actual path of sd_card.img file is located in WrokSpace/vadd/build/<TARGET>/package/package/ directory. For example, if user targets hardware emulation, the sd_card.img file is in located in WrokSpace/vadd/build/hw_emu/package/package/. Users can also view the complete path of the sd_card.img file by simply hovering the mouse pointer over the image file.

  3. Running Hardware Emulation

    After the compilation for hardware emulation is finished, please follow steps below to run hardware emulation.

    • Click Start Emulator under HARDWARE EMULATION target. The Start Emulator setup page would pop up. Then click Start.

      build_application.PNG

    • Click Run after the emulator boots up to terminal

      build_application.PNG

    • Click Stop emulator to stop emulation after emulation is finished.

      build_application.PNG

  4. Running Vector Addition Application on the Board

    After the compilation for hardware is finished, please follow steps below to run on board.

    1. Copy vadd/build/hw/package/package/sd_card.img to local if the Vitis IDE is running on a remote server.

    2. Write sd_card.img onto the SD Card with SD Card image writer applications like Etcher on Windows or dd on Linux.

    3. Boot ZCU104 board with the SD card in SD boot mode.

      Steps to run the application:

      First, login with user petalinux and set up a new password (it is then also the sudo password):

      1. Log into the system

        petalinux login:petalinux
        You are required to change your password immediately (administrator enforced).
        New password:
        Retype new password:
        petalinux:~$ sudo su
        We trust you have received the usual lecture from the local System
        Administrator. It usually boils down to these three things:
              #1) Respect the privacy of others.
              #2) Think before you type.
              #3) With great power comes great responsibility.
        Password:
        petalinux:/home/petalinux#
        
      2. Go to auto mounted FAT32 partition

        petalinux:/home/petalinux# cd /run/media/mmcblk0p1/
        
      3. Run vadd application

        ./simple_vadd krnl_vadd.xclbin
        

      It should show program prints and XRT debug information.

      TEST PASSED