Design Overview

This module combines all the previous modules by:
  • adding the heartbeat component running on RPU0
  • adding the perfapm-server component running on RPU1
  • adding the perfapm-client library integrated into the video_qt2 application

The perfapm-client and perfapm-server components communicate via RPMsg on the master side and OpenAMP on the remote side.
The remoteproc framework is used by the master to download the perfapm-server firmware on the remote.
Instead of printing the throughput numbers on the serial console as done in module 4, the numbers are now plotted as graph in the Qt GUI.
The perfapm-server and heartbeat applications demonstrate simultaneous, independent execution on both RPU cores configured in split mode.


Design Components

This module requires the following components:
  • zcu102_base_trd (SDSoC)
  • petalinux_bsp
    • zynqmp_fsbl
    • pmufw
    • bl31
    • u-boot
    • kernel
    • device tree
    • rootfs
  • filter2d_optflow (HW)
  • video_lib
  • video_qt2
  • perfapm-client
  • perfapm-server
  • heartbeat

Build Flow Tutorials

2D Filter and Optical Flow Combined Sample

There is no need to rebuild the filter2d_optflow library if you have already built it in module 9, otherwise follow the instructions from module 9.

  • Copy the content of the generated sd_card folder to the dm10 SD card directory.
    % mkdir -p $TRD_HOME/images/dm10-new
    % cd $TRD_HOME/apu/video_app
    % cp -r filter2d_optflow/Release/sd_card/* $TRD_HOME/images/dm10-new
  • Copy the generated bitstream to the PetaLinux directory.
    % cp filter2d_optflow/Release/ $TRD_HOME/apu/petalinux_bsp/images/linux

Perfapm-client Library

This tutorial shows how to build the performance monitor client library.

  • Open the existing SDx workspace from design module 9 using the SDx tool.
    % cd $TRD_HOME/apu/video_app
    % sdx -workspace . &
  • From the menu bar, select File -> Import Project, then select General -> Existing Projects into Workspace. Click Next.
  • Browse to the $TRD_HOME/apu/perfapm-client directory, confirm and only check the perfapm-client project. Click Finish.
  • Right-click the perfapm-client project and select 'Build Project'

Video Qt Application

This tutorial shows how to build the video library and the video Qt application.

  • Set the SYSROOT environment variable. This requires that you have previously completed the PetaLinux build step.
    Note 1 : Make sure you set the env variable in the same shell that is used to launch SDx. Also make sure the env variable is set before starting SDx, otherwise close and re-start SDx.
    Note 2: The below command assumes you are using the default yocto tmp directory. If you are using a custom yocto tmp directory, you need to modify the path accordingly.
    % export SYSROOT=$TRD_HOME/apu/petalinux_bsp/tmp/sysroots/plnx_aarch64
  • Source the Qt setup script and generate the Qt Makefile.
    % cd $TRD_HOME/apu/video_app/video_qt2
    % source
    % qmake -r -spec linux-oe-g++
  • Close SDx and reopen the same workspace so the Qt environment gets picked up correctly by eclipse. If you have sourced the script in the same shell before opening SDx, you can skip this step.
  • Right-click the video_qt2 project and click 'Build Project'.
  • Copy the generated video_qt2 executable to the dm10 SD card directory.
    % cp video_qt2 $TRD_HOME/images/dm10-new/

Heartbeat Application

Please refer to design module 2 Heartbeat Application for instructions or skip this step if you have built the heartbeat application in a previous module.

Perfapm-Server Application

Please refer to design module 4 Perfapm-server Application for instructions or skip this step if you have built the perfapm-server application in a previous module.

  • Copy the perfapm-server firmware to the DM10 SD card directory.
    % cd $TRD_HOME/rpu1/perfapm-server
    % cp perfapm-server/Debug/perfapm-server.elf $TRD_HOME/images/dm10-new/

PetaLinux BSP

This tutorial shows how to build the Linux image and boot image using the PetaLinux build tool.

  • The petalinux-config step can be skipped if this was already done in a previous module.
    % cd $TRD_HOME/apu/petalinux_bsp
    % petalinux-config --oldconfig
  • Select the device-tree matching design module 9 and build all Linux image components. If you have run petalinux-build in a previous module, the build step will be incremental.
    % cd project-spec/meta-user/recipes-bsp/device-tree/files
    % cp zcu102-base-dm10.dtsi system-user.dtsi
    % petalinux-build
    % cd -
  • Create a boot image.
    % cd images/linux
    % petalinux-package --boot --bif=dm10.bif --force
  • Copy the generated boot image and Linux image to the dm10 SD card directory.
    % cp BOOT.BIN image.ub $TRD_HOME/images/dm10-new/

Run Flow Tutorial

  • See here for board setup instructions.
  • Copy all the files from the $TRD_HOME/images/dm10 SD card directory to a FAT formatted SD card.
  • Power on the board to boot the image; make sure INIT_B, done and all power rail LEDs are lit green.
  • After ~30 seconds, the display will turn on and the application will start automatically, targeting the max supported resolution of the monitor (one of 3840x2160 or 1920x1080 or 1280x720).The application will detect whether DP Tx or HDMI Tx is connected and output on the corresponding display device.
  • To re-start the TRD application with the max supported resolution, run
  • To re-start the TRD application with a specific supported resolution use the -r switch e.g. for 1920x1080, run
    % -r 1920x1080
  • The user can now control the application from the GUI's control bar (bottom) displayed on the monitor.
  • The user can select from the following video source options:
    • TPG (SW): virtual video device that emulates a USB webcam purely in software
    • USB: USB Webcam using the universal video class (UVC) driver
    • TPG (PL): Test Pattern Generator implemented in the PL
    • HDMI: HDMI input implemented in the PL
  • The user can select from the following accelerator options:
    • 2D convolution filter with configurable coefficients
    • Dense optical flow algorithm
  • The supported accelerator modes depend on the selected filter:
    • OFF - accelerator is disabled/bypassed
    • SW - accelerator is run on A53
    • HW - accelerator is run on PL
  • The video info panel (top left) shows essential settings/statistics.
  • The CPU utilization graph (top right) shows CPU load for each of the four A53 cores.
  • The memory throughput graph (bottom right) shows memory traffic generated by video source, accelerator and display.
  • The TPG settings panel gives access to advanced TPG controls:
  • The CSI settings panel gives access to advanced CSI controls:
  • The 2D filter settings panel gives access to advanced filter controls:
  • The demo mode settings panel allows the user to create a demo sequence combining video sources, accelerators, and modes:

Return to the Design Tutorials Overview.