0% found this document useful (0 votes)
13 views38 pages

01 PYNQ Workshop Introduction

Uploaded by

Dharmesh Panchal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views38 pages

01 PYNQ Workshop Introduction

Uploaded by

Dharmesh Panchal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Python Productivity for Zynq

© Copyright 2019 Xilinx


˃ Zynq & Zynq Ultrascale+

˃ PYNQ Framework

˃ Technologies

˃ Community

Page 2
© Copyright 2019 Xilinx
ZYNQ and ZYNQ UltraSCALE+
Best-in-class, SoC and MPSoCs

ZYNQ 7000

FPGAs and tightly-integrated CPUs enable entirely new opportunities


Page 3 © Copyright 2019 Xilinx
Zynq applications

>> 4
© Copyright 2019 Xilinx
PYNQ Vision

˃ Make Zynq so easy-to-use that programmers


can access the benefits without learning
advanced digital design skills

>> 5
© Copyright 2019 Xilinx
PYNQ framework

© Copyright 2019 Xilinx


Page 6
PYNQ: Python Productivity for Zynq
Jupyter notebooks, PYNQ enables JupyterLab
browser-based interface on Zynq and ZU+

Jupyter web
server Hardware C-drivers wrapped
IPython kernel in Python packages

Ubuntu-based Overlays/designs
Linux
Most competitive, open
and advanced GUI ARM A9 / A53 ZU+ Fabric

>> 7
© Copyright 2019 Xilinx
Ubuntu-based Linux versus embedded Linux
Ubuntu-based Linux Optimized for developer productivity
All the Linux libraries and drivers you expect

Pre-built SD card image

Ubuntu/Debian ecosystem & community


145,000,000 Google hits

Embedded Linux Optimized for deployment efficiency


Selective Linux libraries and drivers
3 orders of magnitude difference
Commonly delivered in flash memory on board

PetaLinux ecosystem:
143,000 Google hits
>> 8
© Copyright 2019 Xilinx
PYNQ’s Ubuntu-based Linux

PYNQ uses Ubuntu’s: PYNQ bundles :


• Root file system (RFS) • Development tools
• Package manager (apt-get) • Cross-compilers
• Repositories • Latest Python packages

Package Ubuntu/
Dev Python
Manager/ Debian
Tools Packages
Repository Packages
PYNQ’s
Ubuntu Root File System Ubuntu-based Linux

Kernel, Bootloader

PYNQ uses the PetaLinux build flow and board support package:
• Access to all Xilinx kernel patches
• Works with any Xilinx supported board
• Configured with additional drivers for PS-PL interfaces

>> 9
© Copyright 2019 Xilinx
PYNQ provides Linux Drivers for PS-PL Interfaces …

Zynq
wrapped in Python Libraries

4
1 2 3 4 5

>> 10
© Copyright 2019 Xilinx
PYNQ provides Linux Drivers for PS-PL Interfaces …
wrapped in Python Libraries
Zynq

4
1 2 3 4 5

>> 11
© Copyright 2019 Xilinx
is a Framework

Jupyter/ PYNQ notebooks


IPython
Apps
matplotlib numpy scikit-learn opencv

PYNQ libs dma


Python APIs
XLNK
Overlay
PL GPIO Interrupt MMIO libcma.so

Linux kernel
fpga_manager sysgpio uio devmem
Drivers
xlnk
axi_intc
User designs
FPGA PYNQ overlays Bitstreams
PYNQ IPs

>> 12
© Copyright 2019 Xilinx
Vivado Design Metadata available from Python

˃ PYNQ passes the Vivado metadata file to the target platform


Initially Vivado TCL file
Now moving to Hardware Handoff (HWH) file

˃ It then parses the Vivado metadata file to:


Set Zynq clock frequencies automatically
Assign memory-map attributes for every IP
Assign default MMIO drivers to IP, when no drivers are specified

˃ Creates a Python dictionary for the IP in the bitstream from the metadata file
Enables bitstream metadata to be queried and modified in Python at runtime

>> 13
© Copyright 2019 Xilinx
Hybrid Packages
˃ New hybrid packages are created by extending Python packages with additional
files:
Design Bitstream
Design metadata file
C drivers
Jupyter notebooks

˃ Hybrid packages enable software-style packaging and distribution of designs

˃ Use the Python package installer, PIP to install a hybrid package just like any
regular Python (software only) package
Delivers package’s files to target board

˃ Uses Python standard setup.py script for installation

>> 14
© Copyright 2019 Xilinx
Software-style Packaging & Distribution of Designs
Enabled by new hybrid packages

Download a design from GitHub with a single Python command:

pip3.6
QNN, M. Blott etinstall
al git+https://github.com/Xilinx/pynqDL.git
IIoT, C. Fritsch et al xDNN, A. Sirasao et al OpenCV, K. Denolf et al

>> 15
© Copyright 2019 Xilinx
PYNQ enabling technologies

© Copyright 2019 Xilinx


Page 16
Python is increasingly the Language of Choice

Top Programming Languages,


July’17
IEEE Spectrum, July’18 Projected
To date

Python is listed as an
embedded language
for the first time

https://spectrum.ieee.org/at-work/innovation/the-2018-top-programming-languages

https://stackoverflow.blog/2017/09/06/incredible-growth-python/

Python is the fastest growing language: driven by data science, AI, ML and academia
>> 17
© Copyright 2019 Xilinx
Python is increasingly the Language of Choice

Top Programming Languages,


July’17
IEEE Spectrum, July’18 Projected

Python is listed as an
embedded language
for the first time

https://spectrum.ieee.org/at-work/innovation/the-2018-top-programming-languages

https://stackoverflow.blog/2017/09/06/incredible-growth-python/

Python is the fastest growing language: driven by data science, AI, ML and academia
>> 18
© Copyright 2019 Xilinx
Ecosystem advantage: there’s a Python library for
that…

200,00+ projects 1.6M+ releases 2.4M+ files 390,000+ users

https://pypi.org retrieved 19 Apr 2019

CPython is written in C … and most popular C/C++ frameworks have Python libraries
>> 19
© Copyright 2019 Xilinx
Jupyter Notebooks … the engine of data science

Open source browser-based, executable


documents

Live code, text, multimedia, graphics,


equations, widgets …

1.7 million notebooks on GitHub

Taught to 1,000+ Berkeley data science


students

>> 20
© Copyright 2019 Xilinx
JupyterLab: web-based IDE incl. Notebooks

Jupyter Notebook is now one of many plug-ins within


the JupyterLab integrated development environment

JupyterLab - an open-source, extensible IDE in a browser


© Copyright 2019 Xilinx
PYNQ enabled boards

© Copyright 2019 Xilinx


Page 22
PYNQ-enabled boards

˃ Python productivity for Zynq


Open source
Build image for other Zynq
boards
PYNQ-Z1 PYNQ-Z2
˃ Downloadable SD card image
Zynq 7000
‒ PYNQ-Z1 (Digilent)
‒ PYNQ-Z2 (TUL)
Zynq MPSoC Ultra96 ZCU104
‒ Ultra96 (Avnet)
‒ ZCU104 (Xilinx)
Zynq RFSoC
‒ ZCU111 RFSoC (Xilinx)

© Copyright 2019 Xilinx ZCU111


New PYNQ-Z2 Board

• New PYNQ reference platform


• New stereo audio with on-board codec
• New Raspberry Pi connector
• Open source design
• Z2 manufactured in Taiwan by TUL
• Distributed globally by Premier Farnell
• Also Newegg in US
• Academic discounts & donations
$119/€119 or equivalent
available

>> 24
© Copyright 2019 Xilinx
Benefits of PYNQ

© Copyright 2019 Xilinx


Page 25
Start using PYNQ out-of-the-box

˃ PYNQ delivered as downloadable


SD card image
Linux preconfigured
˃ Additional packages and drivers
pre-installed
USB peripheral drivers: webcams,
wifi modules …
˃ PYNQ is for Zynq
PYNQ image is portable to other
Zynq boards

Start using Zynq out of the box ✓


© Copyright 2019 Xilinx
Desktop Linux

˃ Network/Internet access
“apt-get” to install packages from Ubuntu
universe
Samba(Network drive)
Web services
˃ Git directly on board
˃ Compilers and other development
tools
Gcc,, MicroBlaze, RISC-V ….
˃ Python packages
“pip install”
PYNQ Community examples

>> 27
© Copyright 2019 Xilinx
Simplify downloading bitstreams to PL

˃ PYNQ ‘Overlay’ class


Simplifies downloading bitstream
two lines of code
No Xilinx tools required
˃ Maintain many bitstreams on the
SD card
E.g. multiple different demos
˃ Can execute Python in browser, or
from command line

Simply and fast way to configure Programmable Logic ✓


© Copyright 2019 Xilinx
Simplify IP debug and prototyping
C code – compile, debug from host
˃ Debug of IP typically uses C/C++
˃ SDK tools used to:
Compile test application
Download application to board
Step through code

˃ PYNQ MMIO class allows peek/poke Python executes directly on target


of IP registers from Python
Python executes directly on the board
No offline compilation, download loop
No SDK tools

Rapid testing and prototyping ✓


© Copyright 2019 Xilinx
Python packages for data analysis and visualisation

˃ Take advantage of Python for


data analysis and processing
NumPy
‒ Scientific computing package for
Matplotlib Python
Matplotlib
‒ Python 2D plotting library
Pandas
‒ Data analysis tools for Python
OpenCV
‒ Computer Vision and machine
learning software

Optimized open-source software libraries ✓


© Copyright 2019 Xilinx
Example

Probability object belongs to class

Car
Plane
Bird

Plot Probability object belongs to class


Page 31 © Copyright 2019 Xilinx
Take advantage of interactive widgets

http://jupyter.org/widgets.html https://blog.dominodatalab.com/interactive-dashboards-in-jupyter/

Add intuitive graphical interfaces ✓


© Copyright 2019 Xilinx
Why PYNQ is a Game-changer!

˃ PYNQ makes Zynq/ZynqU+ accessible to ˃ PYNQ powers awesome demonstrators


non-traditional customers

˃ PYNQ documentation flows are amazing


˃ PYNQ delivers open source benefits Capture your own work
Huge ecosystem Capture work you want to re-use
Extensive knowledge base
Amazing community support
˃ PYNQ designs can be …
Packaged, published and distributed
˃ PYNQ enables highly-productive …
Prototyping
just like software
Debug
Verification
Evaluation ˃ “PYNQ makes FPGAs FUN again!”,
J. Gray, Xilinx Power User

>> 33
© Copyright 2019 Xilinx
Community

© Copyright 2019 Xilinx


Page 34
Selection of projects
and notebooks

Page 35 © Copyright 2019 Xilinx


All Feedback helps
Contribute If you like it, star it!

Issues, feature requests

>> 36
© Copyright 2019 Xilinx
Summary

˃ PYNQ is Python productivity for Zynq


˃ Everything runs on Zynq, access via a
browser
˃ Support for Zynq Ultrascale+
˃ Overlays are hardware libraries and
enable software developers to use
Zynq
˃ Provides a rapid prototyping
framework for hardware developers

Page 37
© Copyright 2019 Xilinx
Adaptable.
Intelligent.

© Copyright 2019 Xilinx

You might also like