Zynq-7000 AP SoC Spectrum Analyzer part 3 - Accelerating Sfotware - Running ARM Library Tests Tech Tip
Zynq-7000 AP SoC Spectrum Analyzer part 3 - Accelerating Sfotware - Running ARM Library Tests Tech Tip
Document History
Table of Contents
Running from Remote System Explorer
==============================================
Date | Version | Author | Description of Revisions | ||
5 September 2013 | 1.0 | Faster Technology | Initial posting | ||
26 February 2014 | 1.1 | Faster Technology | Update to 2013.4 release |
|
|
7 August 2014 | 1.2 | Faster Technology | Update to latest library revision |
|
|
Date | Author | Comment | |||
|---|---|---|---|---|---|
|
|
|
Description/Summary
In Tech Tip "Zynq Ne10 Library Tech Tip" a library of complex signal processing functions was obtained and built. This Tech Tip describes the process to build and execute on the ZC702 the tests that are supplied with the NE10 library and the subsequent results. This will demonstrate the ease with which externally sourced software can be built using Xilinx SDK and run on the ZC702. In addition, multiple methods for accessing and controlling the ZC702 will be shown, demonstrating the flexibility of the ZC702, the simple process of system debug and the speed of system development. A subset of the supplied tests will be used to indicate the level of performance improvement that might be possible using the NEON SIMD extension to the ARM processor in Zynq-7000 AP SoC Processing System (PS).
Implementation
Implementation Details | |
Design Type | PS Only |
SW Type | OSL Linux |
CPUs | 1 CPU - standard ZC702 frequency |
PS Features | ARM processor and NEON SIMD engine |
PL Cores | None |
Boards/Tools | ZC702 |
Xilinx Tools Version | Vivado / SDK 2013.4 |
Other Details | Standard ZC702 setup for console terminal and Ethernet required |
Files Provided | |
Saved workspace file set | |
Step by Step Instructions
This Tech Tip uses the workspace that resulted from building the Ne10 library in the Tech Tip "Zynq Ne10Library Tech Tip". If that workspace is available, skip the instructions below to start SDK with the workspace already in place at the Workspace in Place heading below.
If the workspace is not available or if there is a question if it was completed properly, the referenced file "Ne10LibraryBuild.zip" can be used to create a known good starting point for this Tech Tip.
Restoring the Workspace
Download the zip file from the Ne10LibraryBuild.zip link.
Create an empty directory where you will be implementing this Tech Tip. To be consistent with the balance of these step by step instructions, the directory could be:
G:\ZC702fft\zc702-zvik-base-trd-rdf0286\sw
However, these steps to import a known workspace will work with any new folder of the user's choosing.
Start -> All Programs -> Xilinx Design Tools -> Vivado 2013.4 -> SDK -> Xilinx SDK 2013.4
In the Workspace Launcher, browse to and select ZC702fft\\zc702-zvik-base-trd-rdf0286\sw or the empty directory that you have created.
Click OK to continue.
When presented with the Welcome screen, click the x in the Welcome tab to close that screen
SDK will start with a blank Project Explorer pane
We can now import the saved workspace into SDK.
Select File -> Import or Right Click on the white space in the Project Explorer pane and select Import
The Import dialogue box will appear. Expand the General line and select Existing Projects into Workspace
Click Next
Click the Select archive file button. Then click Browse to navigate to the saved workspace that you want to import and click Open. In our case, this is Ne10LibraryBuild.zip.
Click Finish
SDK will build the workspace automatically. Because SDK is already started and the workspace is in place, you can skip the following instructions to start SDK and go directly to
Workspace in Place
If you have not yet started SDK, do so by:
Start -> All Programs -> Xilinx Design Tools -> Vivado 2013.4 -> SDK -> Xilinx SDK 2013.4
In the Workspace Launcher, browse to and select ZC702fft\\zc702-zvik-base-trd-rdf0286\sw.
Click OK to continue.
When presented with the Welcome screen, click the x in the Welcome tab to close that screen
With SDK now running with the existing or re-loaded workspace, continue from here.
Because this is an existing built project, you should see something similar to the following. The key is to have the Ne10 project with the directories shown. If these are not present, return to the Zynq Building the Ne10 Library Tech Tip and build the library again, or use the instructions above to load the known workspace file set.
With the library in place, we build the standard test program that was supplied as part of the repository. A new project for the test program is created, the appropriate files from the repository are imported and then it is compiled into an executable program.
Select File -> New ->Project; expand the C/C++ group and select C Project.
Shortcut:
Right click on the white space in the Project Explorer pane. Then select New -> C Project.
In the Project name: box, give the project the name Ne10-test. Select the Project type: as Xilinx ARM Linux Executable by clicking on that option in the left column.
Click Next
Verify that both the Debug and Release Configurations: options are checked.
Click Advanced Settings.
We are now going to add the proper paths to library include files.
Expand the C/C++ General line in the left column and select the Paths and Symbols item. Be sure the Configuration: option is set to Release because we want to have the best performance. If desired, these settings can be applied to both debug and release configurations by selecting the All Configurations options as shown.
These steps are referred to as the Adding Paths steps and will be used several times
With the Includes tab selected, click Add in the right column
Check both of the options and then Click Workspace to select the directory to be added
Select Ne10-master -> common and then click OK
Click OK again to add this path to the Includes with the result as shown below
Using these same Adding Paths steps, add the following paths:
- Ne10-master / inc
- Ne10-master / modules / math
- Ne10-master / test / include
When completed you should have the following include directories set.
We now need to add some library paths for tools to find all of the required components.
In the left column of the Properties for Ne10-test, expand C/C++ build options, and select Settings. In the left portion of the right side of the window, under ARM Linux gcc linker, select Libraries.
At the top of the Libraries (-l) area, click on the add icon (looks like a sheet of paper with a plus sign on it).
In the text entry box, type Ne10 and click OK. Then do the same steps for Linux libraries "m" and "rt" resulting in the following
In the Library search path pane, click the add icon (the paper with the plus sign as before) to get a pop up window:
Click Workspace and then select Ne10/Release.
Click OK to return to the Settings window.
NOTE:
These same library paths should be added to the Release configuration also. If the Configuration: option box is not displayed at the top of the Settings window, expand the C/C++ General line and select the Paths and Symbols item. At the top of the window, the Configuration: option box should appear. From the drop down select Release. Then in the left column select the C/C++ Build / Settings item. In the list of Tool Settings, select the Libraries item under the ARM Linux gcc linker.
Using the Add steps used immediately prior for adding to the Debug configuration, add the following Libraries:
- Ne10
- m
- rt
Then add the Library search path (-L) Ne10/Release. You should then have the following:
NOTE:
If the original Configuration: box is set to All Configurations, this will force the Debug and Release build options to be identical. This is a simpler approach that can be changed later if different options are desired for the release build versus the debug build. In general, a release build will invoke a higher degree of compiler optimization for more efficient code while a debug release includes additional hooks to simplify analysis and debug of the code. This causes Release build code to usually operate faster than Debug build code.
Click Apply
Click OK to return to the Select Configurations screen.
Click Finish to complete this portion of the setup.
We now need to import the actual code for the tests. This follows a set of steps similar to the import of the code into the Ne10 library in the "Zynq Ne10 Library Tech Tip".
Right click on Ne10-test in the Project Explorer window, and select Import.
In the Select window that pops up, expand General and select File System then click Next.
Browse to the Ne10-master directory that is under "zc702-zvik-base-trd-rdf0286/sw.
WARNING:
Do NOT use the original file that was unzipped or copied into a higher level directory.
Select the modules/dsp/test and test/src directories to import.
CAUTION:
If the original source Ne10-master is selected, subsequent build steps will fail. If that occurs, delete the Ne10-master in the workspace and perform the import again, being sure to point to the Ne10-master under the /sw directory of the TRD.
Click Finish to perform the import.
The test software is now ready to be built.
NOTE:
To obtain the best execution performance, the compiler default options must be set to Release.
Right click on Ne10-test in the Project Explorer pane.
Select Build Configurations . Set Active > Release
Right click Ne10-test and select Build Project.
As before, there are a number of warnings. These can be ignored for now.
The test software can now be run on the ZC702.
There are several methods that can be used to run the test software on the ZC702. Among them are:
- Use the Remote System Explorer capability in SDK
- Copy the binary file to the SD card containing the TRD Linux system and execute from a remote terminal or from the local console
Since there are two tests that will be run, we will demonstrate each of the methods.
Running from Remote System Explorer
We will access the ZC702 over an Ethernet connection from the PC where SDK is running. The ZC702 has a default IP address of 192.168.1.10 so be sure your computer can reach that sub-net. Connect your ZC702 to your computer or network with an Ethernet cable.
The ZC702 must be set to boot from the SD-MMC card supplied with it. This contains the base TRD Linux system required to run this test software.
Set the boot select switches as shown below, then power on your ZC702.
With the ZC702 running, we will set up a Remote System Explorer connection to the ZC702 board to allow us to download and run our program. Right click in the Project Explorer window, select New -> Other. In the pop up window, expand Remote System Explorer, highlight Connection.
Click Next.
In the next window, select SSH Only, and click Next.
Use the IP address of the ZC702 (192.168.1.10) as the Host name and Connection name. Fill in the description field if you wish - it is not required.
Click Finish.
NOTE:
Although the connection has been established, there is nothing showing. To view the connection, a new perspective must be started, replacing the current perspective. To do this,
Click Window -> Open Perspective -> Other
Then select Remote System Explorer and click OK.
The Remote System Explorer connection will be displayed.
Close this perspective by clicking
Window -> Close Perspective
With the connection established and the standard Project Explorer perspective displayed, we can now download and run the test program directly to the ZC702.
In the Project Explorer, right click on Ne10-test, then select Run As -> Run Configurations.
A new window will open to create, manage and run configurations.
Create a new Remote ARM Linux Application by double clicking on "Remote ARM Linux Application" in the left column. (This can also be done by following the instructions in the main window for using the "New" button.)
Select the IP address of the ZC702 in the pull down Connection menu.
Then click on the Browse button next to the Remote Absolute File Path for C/C++ Application field .
Expand the Root directory. Under the root directory select the tmp directory. If prompted for the User ID and Password, use root for both.
Click OK
Append /Ne10-test.elf to /tmp in the Remote Absolute File Path for C/C++ Applications field.