Zynq-7000 AP SoC Spectrum Analyzer part 3 - Accelerating Software - Running ARM Library Tests Tech Tip 2014.3
Zynq-7000 AP SoC Spectrum Analyzer part 3 - Accelerating Software - Running ARM Library Tests Tech Tip 2014.3
Table of Contents
Running from Remote System Explorer
Document History
Date | Version | Author | Description of Revisions |
23 October 2014 | 1.0 | Faster Technology | Initial Posting - updated to 2014.3 |
|
|
|
|
Date | Author | Comment | |
|---|---|---|---|
More Revisions | |||
|
|
| |
|
|
| |
Description/Summary
In Tech Tip "Zynq-7000 AP SoC Spectrum Analyzer part 2 - Accelerating Software - Building ARM Neon Library Tech Tip 2014.3" 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 | PetaLinux |
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 2014.3 |
Other Details | Standard ZC702 setup for console terminal and Ethernet required; HDMI display with Base TRD |
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-7000 AP SoC Spectrum Analyzer part 2 - Building ARM NEON Library Tech Tip 2014.3". 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 "PetaLinuxNe10LibraryBuild.zip" can be used to create a known good starting point for this Tech Tip.
Restoring the Workspace
Download the zip file from the Ne10LibraryBuild2014dt3.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:\Projects\ZC702_Ne10
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 2014.3 -> Xilinx SDK 2014.3
In the Workspace Launcher, browse to and select \Projects\ZC702_Ne10 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 Ne10LibraryBuild2014dt3.zip.
Be sure that both Ne10 and Ne10-master projects are selected.
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 SDK running.
Workspace in Place
If you have not yet started SDK, do so by:
Start -> All Programs -> Xilinx Design Tools -> Vivado 2014.3 -> Xilinx SDK 2014.3
In the Workspace Launcher, browse to and select Projects\ZC702_Ne10.
Click OK to continue.
When presented with the Welcome screen, click the x in the Welcome tab to close that screen
SDK Running
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-7000 AP SoC Spectrum Analyzer part 2 - Accelerating Software - Building ARM Neon Library Tech Tip 2014.3 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 to get the following dialogue box
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-7000 AP SoC Spectrum Analyzer part 2 - Accelerating Software - Building ARM Neon Library Tech Tip 2014.3
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 "Projects\ZC702_Ne10".
WARNING:
Do NOT use the original file that was unzipped or copied into a higher level directory.
Expand Ne10-master in the left pane and 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 in workspace directory
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.
CAUTION!!
The default IP address of the ZC702 is different for PetaLinux than for the OSL Linux used in prior versions of this series of Tech Tips. The default IP address is now 192.168.0.10 so be sure your computer can reach that sub-net.
Connect your ZC702 to your computer or network with an Ethernet cable.
If you are unable to directly reach the .0 subnet from your computer, it is possible to change the IP address of the ZC702 after PetaLinux has booted. To make this change, do the following:
- Connect the console serial over USB port to your PC with the supplied mini-usb adapter and appropriate cable
- Start TeraTerm or similar terminal emulator
- Boot the ZC702 as described below
- Once PetaLinux has booted, log in using the username root and password root
- Use the ifconfig command to change the IP address using - "ifconfig eth0 192.168.1.65" where the IP address is one that you can reach from your PC
The ZC702 must be set to boot from the SD-MMC card that has been updated with the 2014.2 TRD as described in the TRD Technical Article Zynq Base TRD 2014.2. As a caution before proceeding, be sure that the ZC702 will properly run the 2014.2 TRD.
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.
NOTE:
The balance of these instructions assume that the IP address of the ZC702 has been changed to 192.168.1.65. If you have set the IP address differently, use that IP address.
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.65) 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 (As an alternative, click on the C/C++ tab in the upper right corner of the overall window. This returns to the build perspective with the RSE perspective still available.)
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.
NOTE:
If SDK has been used for other Tech Tips or development work, there may be items listed under "Remote ARM Linux Application" in the left panel of the RSE screen above. These can be ignored. For example, in the screen above the item "fft-zynq Release" is from work on another Tech Tip.
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.