RoadTest: PYNQ-Z2 Dev Board: Python Productivity for Zynq®
Author: Attila Tőkés
Creation date:
Evaluation Type: Development Boards & Tools
Did you receive all parts the manufacturer stated would be included in the package?: True
What other parts do you consider comparable to this product?: the Avnet Ultra96 board
What were the biggest problems encountered?: Figuring out the Ethernet based networking setup; WiFi please in the next version.
Detailed Review:
Within the Element14 Road Test program, I got the TUL PYNQ-Z2 board for a review.
FPGA developent is not exactly easy, and also tends too be a little bit time (and nerve) consuming (Vivado builds can easily take 1+ hour).
Because of this engineers with mainly software background were usually reluctant to get into hardware accelerated / FPGA development.
Xilinx want's to solve this problem with PYNQ framework, which is supposed to ease the development for programmable logic enabled Zynq SoC-s.
The PYNQ Framework achieves this by proving pre-built hardware overlays and software libraries, which allows accelerating different tasks using the programmable logic from the Zynq SoC-s
The PYNQ-Z2 from TUL is one of the official demo boards for the PYNQ framework.
Note: Although, I have a little bit of experience with FPGA development, especially with Computer Vision applications (see my Stereo Vision and LiDAR Powered Donkey Car project), I thought to not to dig too deep into what this board capable of. The PYNQ-Z2 is a demo board for the PYNQ framework, which supposed to be used for rapid prototyping. For this reason, I decided to focus on what we can achieve with the built-in overlays and libraries, and respectively with pre-built readily available overlays available from the Internet. So, no Vivado builds, SDSoC and things like that.
The Road Test kit was a TUL PYNQ-Z2 Basic kit.
The content of the kit was as follows:
{gallery} Kit contents |
---|
PYNQ Z2: Box |
PYNQ Z2: Box content |
PYNQ Z2: Board, top side |
PYNQ Z2: Board, bottom side |
PYNQ Z2: Accessories, AC / DC Power adapter (12V / 2.5A) |
PYNQ Z2: Accessories, USB-MicroUSB cable |
PYNQ Z2: Accessories, Ethernet Cable |
PYNQ Z2: Accessories, SD Card with pre-loaded image |
The Pynq-Z2 board comes with a nicely built pink PCB. The accessories are also good quality ones.
The heart of the PYNQ-Z2 board is a Xilinx Zynq7020 SoC with the following specs:
Along this, the PYNQ-Z2 has the following components / features:
The board comes at a price of 104 EUR, without accessories.
An another popular board supporting Pynq is the Avnet Ultra 96 (V2).
Priced much higher, at ~221 EUR, it comes with a more powerful hardware:
40-pin 96Boards Low-speed expansion header
60-pin 96Boards High speed expansion header
At the connectivity side, the Ultra96 uses the 96Boards connectors with 1.8V I/O.
This means that working with 3.3V peripherals designed for Arduino / Raspberry Pi requires an mezzanine (extension board). On the other hand the PYNQ-Z2 supports these out of the box.
The hardware setup is relatively simple.
For the first examples, we need to connect the board to network and power it through USB.
For the some examples the following additional hardware devices may be required:
After the microSD card is inserted, we can power on the board with the switch alongside the power connector.
After about ~1 minute, the two RGB LED-s should blink blue a couple of times, indicating the the board booted successfully.
If DHCP is available, the PYNQ Z2 should automatically connect to the network.
A Jupyter notebook server should be accessible from a Web browser on http://pynq:9090/ or http://ip-address:9090/.
Note: PYNQ uses Jupyter notebooks for its documentation and examples. These are interactive pages / documents that allows, along other features, running code, plotting graphs, showing images directly in-lined in the page.
Note2: I decided to follow the instruction from the documentation, then take a look on the rest. Each page can be covered in ~1-5 minutes. I generally did no modified the code snippets from the pages.
The home page looks like this:
The Welcome to PYNQ page is the start page for the documentation.
Lets start with the getting_started and common folders indicated by this page
The getting_started folder looks like bellow:
It contains the following pages:
The common folder contains an another set of examples:
After the common and getting_started folders, I also took a look on the base folder:
It contains a set of sub-folders each covering a different set of features:
Along the build-in overlays, there are some other overlays that can be downloaded and used with the PynqZ2.
The PYNQ-ComputerVision package from Xilinx, offers overlays for hardware accelerating computer vision applications.
These overlays are based on the Xilinx's xfOpenCV library, and they allow accelerating OpenCV components in the Programmable logic.
The package comes with pre-built overlays for the PYNQ-Z2. These contains along the HDMI In an Out blocks, cvBlock-s to accelerate different OpenCV functions.
To install PYNQ-ComputerVision we need to SSH into the Pynq-Z2 and run the following command:
$ sudo pip3 install --upgrade git+https://github.com/Xilinx/PYNQ-ComputerVision.git
After this a new pynqOpenCV folder should appear in the Jupyter home page:
with the following content:
Filter 2D
This page demonstrates the use of 2D Filters in OpenCV
2D Filters are general purpose building blocks in computer vision, the can be used to implement functionality like:
The page contains the following steps:
Filter 2D + Dilate
This page along with the 2D Filters also show the use of Dilate operations.
A Dilate operation can be used for:
The functionality from this page is:
Here is a video showing a hardware accelerated 2D filter + dilate applied to the HDMI stream in real-time:
Filter 2D + Remap
This page along with the 2D Filters also show the use of Remap functionality from OpenCV.
The steps from this page are:
The performance of the software only and hardware accelerated implementations were as follow:
Binary (or Quantized) Neural Networks are Deep Neural Networks, that instead of traditional real-number weights uses binary (or quantized) weights
Although, using binary weights may reduce the accuracy of a neural network, it should also makes them more suitable to be implemented on a FPGA-s.
FINN, an experimental framework from Xilinx Research Labs, allows implementing binary neural networks on FPGA-s.
The framework is also provided as a Pynq overlay: BNN-PYNQ
Unfortunately, I didn't had the time yet to try it out, but ralphjy and sambit1991 did a very good job explaining in their Road Tests:
PYNQ-Z2 Dev Board: Python Productivity for Zynq® - Reviewsambit1991
PYNQ-Z2 Dev Board: Python Productivity for Zynq® - Review - ralphjy
As they results show, these networks can have a remarkable performance given that they are run on an embedded system.
In my opinion, the PYNQ-Z2 is a really fun to use board. It allows building some interesting hardware accelerated applications pretty easy.
The documentation, at least the Getting Started part, looks well build and easy to follow. The Common and Base pages could be a little bit better organized.
The the hardware side, the Zynq7020 SoC is relatively powerful. It is powerful enough to run basic real-time video processing applications in the PL, but an entry level Zynq UltraScale+ may be better.
A built-in WiFi module (costs ~ $3) could be useful. I imagine some people having trouble doing the wired setup, if their router is not located near the desk.
I see the PYNQ-Z2 most suitable for real-time video processing (HDMI to HDMI, or USB to HDMI), maybe combined with some artificial intelligence (BNN-s).
Cheers,
Attila