UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Adam Taylor’s MicroZed Chronicles, Part 152: ZynqBerry Hardware Acceleration, Local SDSoC Projects, & Linux

by Xilinx Employee on ‎10-17-2016 10:12 AM (5,876 Views)

 

By Adam Taylor

 

Having gotten the Trenz Electronic ZynqBerry to say “hello world” in my previous blog post, our next step is to make the ZynqBerry board run a demo example and to see the acceleration we can get from using the programmable hardware in the on-board Zynq Z-7000 SoC. We will target Linux for our example because many of you will be using this OS WITH the ZynqBerry board.

 

The first thing we want to do is create a new project. Unlike last week where we created a default platform, we will use a local project so that we can access the example files with greater ease.

 

To do this within my working area I have created a new directory called ZynqBerry and copied the SDSoC platform definition we created last week underneath it.

 

 

Image1.jpg 

 

This is what we would do if we have created our own, custom logic platform. Under this directory we will see a sample directory that contains a number of examples. We can use these examples to demonstrate the power of SDSoC and the hardware acceleration we can achieve.

 

To create a new project again we click file -> new -> SDSoC Application

 

 

Image2.jpg 

 

 

This will open the dialog box as we saw last week when we created the “hello world” program. However, this time we are going to use the local project option, not a predefined platform. As such, after we have entered the project name and selected the operating system, we select “other” instead of selecting one of the pre-defined platforms and then navigate to the location of the local project.

 

 

Image3.jpg

 

 

You will see the platform name. Update this to show the path and the name. In this example, it becomes te0726_m_sdsoc. (Note: TE0726 is the model number for the Trenz Electronic ZynqBerry board.) SDSoC will then create the project for you and you’ll see it in the SDSoC project overview. Under the Hardware Functions, you will see a pre-selected C Function to be accelerated with the name of mmult_accel.

 

When the project is built, this function will moved into the Zynq SoC’s programmable logic instead of being run as a subroutine in the ARM cores. This is achieved using the connectivity framework within SDSoC that seamlessly integrates accelerated functions into the application. This is shown on the overview tab of the project overview.

 

If we want to see more about the platform and the resources we have available, we can click on the platform tab at the bottom:

 

 

Image4.jpg

 

 

To generate the example, we click on project -> build project, which will compile the application and build the necessary hardware. It may take a little time to perform the high-level synthesis and generate the bit file in Vivado.

 

Once this is complete we need to flash the Boot.bin file to the on-board QSPI Flash memory and copy the kernel image and the elf of the application to the SD card as we did last week.

 

After doing all of that and powering up the board, we can connect to the ZynqBerry using a terminal program like PuTTY over a serial link. Configure the link as 8, n, 1, and 115200 bps. At the log on prompt, log on as root. Now we can run the executable file generated by SDSoC.

 

However, to run the example we first need to mount the SD card because it is not mounted automatically. We can do this using the command below in the terminal window to mount the SD card into the mnt directory:

 

 

mount /dev/mmcblk0p1 /mnt/

 

 

With that completed, we can execute the program and see how much hardware acceleration we get using the command:

 

 

/mnt/<project_name>.elf

 

 

When I ran this on the ZynqBerry sitting on my desk, I achieved the following results showing a 33x speed improvement, which is not bad at all.

 

 

Image5.jpg

 

 

 

Note: We have looked at SDSoC before. For more SDSoC examples and usage information, please see the MicroZed Chronicles parts 85 to 103 at www.microzedchronciles.com

 

 

 

 

Code is available on Github as always.

 

If you want E book or hardback versions of previous MicroZed chronicle blogs, you can get them below.

 

 

 

  • First Year E Book here
  • First Year Hardback here.

 

 

MicroZed Chronicles hardcopy.jpg 

 

 

 

 

  • Second Year E Book here
  • Second Year Hardback here

 

 

 

 MicroZed Chronicles Second Year.jpg

 

 

 

All of Adam Taylor’s MicroZed Chronicles are cataloged here.

 

 

 

 

 

 

 

Labels
About the Author
  • Be sure to join the Xilinx LinkedIn group to get an update for every new Xcell Daily post! ******************** Steve Leibson is the Director of Strategic Marketing and Business Planning at Xilinx. He started as a system design engineer at HP in the early days of desktop computing, then switched to EDA at Cadnetix, and subsequently became a technical editor for EDN Magazine. He's served as Editor in Chief of EDN Magazine, Embedded Developers Journal, and Microprocessor Report. He has extensive experience in computing, microprocessors, microcontrollers, embedded systems design, design IP, EDA, and programmable logic.