Table of Contents

Introduction
About the TRD
Download the TRD
TRD Directory structure and package contents
Known Issues
Running the demo
Hardware Setup Requirements
Requirements for theTRD demo setup
Board Setup
Steps for setting the board
Powering on the Qt-based GUI application demo
Running the Qt-based GUI application demo
Test Start/Pause
Input Source
FFT Length
FFT Window
Frequency Zoom
FFT Scale
Sample Rate
Time and Frequency domain plots
FFT Computation time plot
CPU Utilization plot
PS-PL Interface Performance plot
PL Die temperature
Block Diagram view
Building the Hardware design using Vivado
Steps for building the FPGA hardware bitstream
Building the Software components
Building RPU firmware using XSDK
Build Linux and Boot images using Petalinux
Setup PetaLinux Working Environment
Build FSBL, ATF, u-boot, Linux Kernel, Device tree and rootfs images
Creating BOOT.BIN image
Building QT GUI application

Introduction

This wiki page contains information on how to build various components of the Zynq UltraScale+ MPSoC Software Acceleration reference design (TRD). The page also has information on how to setup the hardware and software platforms and run the design on ZCU102 kit. The part used on ZCU102 board is xczu9eg-ffvb1156-1-e-es1.

About the TRD

The Software acceleration TRD is an embedded signal processing application designed to showcase various features and capabilities of the Zynq UltrScale+ MPSoC ZU9EG device for the embedded domain. The TRD consists of two elements: The Zynq UltraScale+ MPSoC Processing System (PS) and a signal processing application (FFT) implemented in Programmable Logic (PL). The MPSoC allows the user to implement a signal processing algorithm that performs FFT on samples (coming from TPG in PL or SYSMON through external channel) either as a software program running on the Zynq UltraScale+ MP SoC based PS or as a hardware accelerator inside the PL. The TRD demonstrates how the user can seamlessly switch between a software or a hardware implementation and evaluate the cost and benefit of each implementation. The TRD also demonstrates the value of offloading computation-intensive tasks onto PL, thereby freeing the CPU resources to be available for user-specific applications.
For detailed information on complete feature set, hardware and software architecture of the design, please refer to the TRD user guide here.

Download the TRD

The TRD archive (rdf0376-zcu102-swaccel-trd-2016-1.zip) can be downloaded from here.

TRD Directory structure and package contents

The Software acceleration TRD package is released with the source code, Tcl scripts to build the hardware design through Xilinx Vivado, SDK projects, and an SD card image that enables the user to run the demonstration and software application. It also includes the binaries necessary to configure and boot the ZCU102 board. Prior to running the steps mentioned in this wiki page, user has to download the TRD package and extract its contents to a directory referred to as ‘TRD_HOME' which is the home directory.





The below table describes the content of each directory in detail.
Folder/fileDescription
hardwareContains hardware design files
SourcesContains HDL sources, constraints and local IP repository
Vivado/scriptsContains the scripts to build the hardware design
SoftwareContains the software source files
PetalinuxContains the Petalinux project's configuration
XsdkContains the SDK project sources
Qt_guiContains GUI sources
Ready_to_testContains ready to test binaries
BOOT.BINBIN file containing FSBL, PL bitstream, U-boot and ARM trusted firmware
Image.ubKernel Image
Autostart.shScript to launch the demo
BinThis directory contains the Qt GUI application.
README.txtContains design version history, steps to implement the design, Vivado and Petalinux versions to be used to build the design.
THIRD_PARTY_NOTICES.zipContains the Copyright text for third party libraries
IMPORTANT_NOTICE_CONCERNING_THIRD_PARTY-CONTENT.txtContains information about the third party licences


Pre-requisites
  1. Xilinx Vivado 2016.1
  2. Xilinx SDK 2016.1
  3. Petalinux 2016.1
  4. Distributed version control system Git installed. For information, refer to the Xilinx Git wiki.
  5. GNU make utility version 3.81 or higher.

Known Issues

The mouse response is observed to be slow when the demonstration/test is running.

Running the demo

This section provides step by step instructions on bringing up the ZCU102 board for demonstration of the TRD and running different options from the Graphical User Interface (referred to as GUI).

The binaries required to run the design are in $TRD_HOME/ready_to_test folder. It also includes the binaries necessary to configure and boot the ZCU102 board.

Things to know before running the demo:
a) The SD-MMC card has to be formatted as FAT32 using a SD-MMC card reader. Copy the entire folder content from $TRD_HOME/ready_to_test onto the primary partition of the SD-MMC.

b) Petalinux console login details
User : root
Password : root

Hardware Setup Requirements

Requirements for theTRD demo setup


Note: It is recommended to use ZCU102 Rev-C/D board. TRD binaries have been tested with ViewSonic, Acer display monitors. However, the binaries should work well with any Display Port-compatible output device provided it supports 4K resolution in its EDID database.

Board Setup

Steps for setting the board

Connect various cables to the ZCU102 board as shown in the below figure.







1. Connect a 4K monitor to the DP port on ZCU102 using DP 1.2 cable.
2. Connect an USB mouse to the Micro-B USB connector (Jumper J96 on ZCU102 board).
3. Optional: Connect an USB Micro-B cable into the micro USB port (J83) labeled USB UART on the ZCU102 board and the USB Type-A cable end into an open USB port on the host PC for UART communication.
4. Connect the power supply to the ZCU102 board. Do not switch the power ON.
5. Optional: Plug the XA3 Adapter card into the Sysmon Header on ZCU102 board (J3). Connect Jumpers J5 and J4 on XA3 card as shown in below figure.



6. Optional: Connect the 3.5mm auxiliary cable to XA3 card and audio source. One end connects to audio source and the other end connects to 3.5mm female connector on XA3 card.
7. Insert a SD-MMC memory card, which contains the TRD binaries, into the SD receptacle on the ZCU102 board
8. Make sure the DIP switches (SW6) are set as shown in figure below, which allows the ZCU102 board to boot from the SD-MMC card.
9. Optional: Open a serial communication terminal software like TeraTerm, and set up a new serial communicaiton as shown in below figure.
Click on "New Connection" and select Interface 0 and click OK (as shown in below figure).
Click on Setup -> Serial Port and make sure to setup as shown in below figure
User can see the following on the serial terminal
After linux boot is complete, you see the Petalinux login prompt, as shown in below figure

Run Qt GUI application
A Linux application with Qt-based GUI is provided with the package included on the SD-MMC memory card. This application provides options to user to exercise different modes of the demonstration. User can select Test Pattern Generator (TPG) samples or External audio source (requires the XA3 adapter card, aux cable and audio source for testing).

User can select to perform FFT computation in APU (run as software code on the PS) or in PL (run in the FPGA fabric as a hardware IP core).

User can also apply various windowing techniques on input samples before performing FFT.

Powering on the Qt-based GUI application demo


Note: The Linux image and Qt based GUI application will be loaded from the SD-MMC memory card.

Running the Qt-based GUI application demo



Exercise different options by pressing the buttons available in the GUI to evaluate the different use cases mentioned below.

Test Start/Pause

Demonstration can be paused at any instant by clicking on Pause button, as shown in figure below.


Input Source

There are two sources of data samples.
Use caseInput source
1Hardware Test Pattern Generator (TPG in PL). This is the default option.
2External audio input(through XA3 SYSMON Headphone Adapter card)
Note : To test the external audio (assuming that setup is made as per procedure mentioned above), play an audio from the MP3 player/Phone. The peak voltage of the audio source depends on the manufacturer. The voltage levels of the samples depend on the volume. If the output voltage of the audio signal goes beyond 1V, the waveform will be clipped. Adjust the volume on the audio source so that the voltage of the samples lies within 1V peak-to-peak.



FFT Computation Engine

For the two input sources mentioned in above table, user can select one of the following compute engines for FFT computation.
FFT Compute EngineDescription
APU (default)FFT computation is done by software running on APU
NEONFFT computation is done by software running on APU. Neon intrinsic APIs are used for FFT computation to make
sure that the instructions are executed on NEON.
APU controlled PL AcceleratorFFT computation is done by the FFT core in Programmable Logic(PL)
RPU as Co-processorFFT computation is done by software running on RPU. APU is involved in moving samples from TPG in PL to PS DDR.
Samples from PS DDR are copied to OCM by APU software and that information is passed to RPU through OpenAMP channel.
RPU controlled PL AcceleratorFFT computation is done by PL FFT IP. RPU controls the AXI DMA transfers to/from PL FFT core from/to PS DDR.
APU is involved in moving samples from TPG in PL to PS DDR. Samples from PS DDR are copied to OCM by APU
software and that information is passed to RPU through OpenAMP channel. PL FFT core fetches samples from OCM
and computes FFT on the samples and writes samples back to OCM.
AllRuns FFT on all engines one at a time. This mode is useful for comparing computation times for various engines.





FFT Length

FFT length determines the number of samples on which FFT computation is performed. User can run the following FFT sizes.
FFT Size
4096 (default)
8192




FFT Window

User can apply one of the window function on the input samples before FFT computation.
Window function
None (Default, No windowing)
Hann
Hamming
Blackman
Blackman Harris


Frequency Zoom

User can select the following Frequency Zoom options
FFT Zoom optionDescription
ZOOM (default)This is the default option. Selecting this option fixes the units on frequency axis in the Frequency domain plot to 512.
This enables users to closely observe the values on frequency axis. This is 4X zoom for 4096 and 8X for 8192 point FFT.
NONENone is No Zoom. Selecting this option will plot all points on frequency axis (Number of points equal to half of the FFT size)


FFT Scale

User can select the different scales on Voltage/Amplitude axis. This option is important when using external audio source as input. The voltage of the samples is dependent on the volume of the audio signal. Depending on the amplitude of the audio samples, the scale can be selected. Available options are:
FFT Scale
1V (Default)
0.5V
0.25V
0.1V




Sample Rate

The sampling rate of the SYSMON in PL can be changed on run time. Supported sampling rates are:
Sampling Rate
200 kSPS (default)
100 kSPS
50 kSPS


Note: The sampling rate option is applicable for SYSMON and is visible on the GUI only when Input source is selected as External Audio input.

Time and Frequency domain plots

The time domain plot plots the samples corresponding to data generated by either TPG or by external audio source. The number of points in the plot depends on the FFT size.
The frequency domain plot plots the power spectral density (not in logarithm scale). It is a function of voltage vs frequency bins. The value “Fp” on the extreme right corner of frequency domain plot depicts the frequency bin with highest energy. The number of frequency bins plotted is half of FFT size (half because of symmetry for real valued samples) when “NONE” is selected in Frequency Zoom control and 512 by default (ZOOM enabled).

FFT Computation time plot

The time taken for FFT computation by each engine is plotted on the “FFT computation plot”. The average computation times for 4096 point FFT are captured for reference in below table:
Computation Engine~Average computation time (us)
APU500
APU with Neon as Co-processor350
APU controlled PL120
RPU1270*
RPU controlled PL240*

CPU Utilization plot

The APU cluster (A53 cores) utilization is plotted in “CPU Utilization Plot”.

PS-PL Interface Performance plot

The bandwidth utilization of Full Power domain and Low power domain high performance ports is plotted by “PS-PL performance plot”. The write and read throughput is plotted.

PL Die temperature

The PL Die temperature is read from the SYSMON and displayed on the GUI.

Block Diagram view

The top-level block diagram and the blocks involved in data path for each of the modes in Input source and FFT computation engines is displayed in the bottom right corner of the GUI.


Building the Hardware design using Vivado

This section explains how to generate the FPGA hardware bitstream using the Xilinx Vivado tool and how to export the hardware platform to Xilinx Software Development Kit (XSDK) for software application development.

Steps for building the FPGA hardware bitstream


Launch Vivado

On Windows 7, select Start > All Programs > Xilinx Design Tools > Vivado 2016.1 > Vivado 2016.1 Tcl shell
On Linux, enter Vivado at the command prompt.
NOTE for Windows users: Copy directory 'hardware' that is at '$TRD_HOME/' to a drive directly because of windows file path limit (255 characters) before following the next steps for building hardware bitstream. If the design errors out due to the path length limitation, please follow steps mentioned in the Answer Record.

From the Vivado welcome screen, in TCL console, run following commands

1. cd $TRD_HOME/hardware/vivado/scripts
 
2. source ./create_project.tcl
The above step creates a project ‘swaccel_design’ as shown in below Figure.



In the Flow Navigator pane on the left-hand side under Program and Debug, click Generate Bitstream > Yes (shown in below figure).


After the bitstream generation is successful, the user will see a screen as shown in below figure. The bitstream will be generated at $TRD_HOME/hardware/vivado/runs/swaccel_design.runs/impl_1/swaccel_top.bit


Before exporting the hardware design the implemented design has to be opened. Select Open Implemented design > OK.
After the implemented design is opened, export the Hardware design by clicking on File > Export > Export Hardware as shown in below Figure.


Select the option, Include bitstream as shown in below Figure.


The SDK hardware platform will be exported to $TRD_HOME/hardware/vivado/runs/swaccel_design.sdk/swaccel_top.hdf
To exit Vivado, click on button X on the top right corner of Vivado IDE. Click on OK to exit.


Building the Software components


Building RPU firmware using XSDK





























Build Linux and Boot images using Petalinux


Setup PetaLinux Working Environment



bash> source <path to PetaLinux installation>/settings.sh
The first time the setup script is sourced, it will perform some post installation tasks to check system dependencies and initialize the Linux kernel source tree.
Below is an example of the output from sourcing the setup script for the first time:
PetaLinux environment set to ’/home/user/petalinux-v2016.1-final

INFO: Checking free disk space
INFO: Checking installed tools
INFO: Checking installed development libraries
INFO: Checking network and other services

WARNING: No tftp server found - please refer to "PetaLinux SDK Installation Guide" for its impact and solution
The post-install step only occurs once. Subsequent runs of the settings script should be much quicker, and simply output a confirmation message such as that shown below:

PetaLinux environment set to ’/opt/petalinux-v2016.1-final'

Note: After this step the petalinux installation path is set in $PETALINUX envirnoment variable.

Build FSBL, ATF, u-boot, Linux Kernel, Device tree and rootfs images


bash> cd $TRD_HOME/software/petalinux
bash> petalinux-config --get-hw-description=$TRD_HOME/hardware/vivado/runs/swaccel_design.sdk --oldconfig
Note: pre-built hdf file can also be used in --get-hw-descrition=./hw-description
bash> petalinux-build
This will generate the images including image.ub at $TRD_HOME/software/petalinux/images/linux/ directory
Copy image.ub in to the root directory of the SD card.

Creating BOOT.BIN image


To create BOOT.BIN image run following command
bash > petalinux-package --boot --fpga subsystems/linux/hw-description/swaccel_top.bit --uboot

This will generate the BOOT.BIN at $TRD_HOME/software/petalinux/images/linux/ directory.
Copy BOOT.BIN in to the root directory of the SD card.

Building QT GUI application


QT application can be built using petalinux build environment.

This should return the path of petalinux installation.

User can now follow the above Board Setup steps to start the demo.



Related Links

B123