Coder Social home page Coder Social logo

xilinx / pynq Goto Github PK

View Code? Open in Web Editor NEW
1.9K 130.0 808.0 179.71 MB

Python Productivity for ZYNQ

Home Page: http://www.pynq.io/

License: BSD 3-Clause "New" or "Revised" License

Python 6.13% Shell 0.30% Jupyter Notebook 75.67% C 4.69% C++ 0.33% Makefile 0.73% Tcl 6.31% VHDL 3.26% Verilog 1.26% JavaScript 1.06% Batchfile 0.01% SystemVerilog 0.24% BitBake 0.03% CMake 0.01%
pynq

pynq's Introduction

pynq_logo

python

PYNQ is an open-source project from Xilinx that makes it easy to design embedded systems with Zynq All Programmable Systems on Chips (APSoCs). Using the Python language and libraries, designers can exploit the benefits of programmable logic and microprocessors in Zynq to build more capable and exciting embedded systems. PYNQ users can now create high performance embedded applications with

  • parallel hardware execution
  • high frame-rate video processing
  • hardware accelerated algorithms
  • real-time signal processing
  • high bandwidth IO
  • low latency control

See the PYNQ webpage for an overview of the project, and find documentation on ReadTheDocs to get started.

Precompiled Image

The project currently supports multiple boards.

You can download a precompiled image, write the image to a micro SD card, and boot the board from the micro SD card.

Quick Start

See the Quickstart guide for details on writing the image to an SD card, and getting started with a PYNQ-enabled board.

Python Source Code

All Python code for the pynq package can be found in the /pynq folder. This folder can be found on the board after the board boots with the precompiled image.

To update your PYNQ SD card to the latest pynq package, you can run the following command from a terminal connected to your board:

sudo pip3 install --upgrade --upgrade-strategy only-if-needed pynq

The --upgrade-strategy only-if-needed option will upgrade dependencies only in case they do not satisfy the requirements, which will speed-up the installation process and also avoid possible upgrade errors.

SDK software projects and Python-C source codes are also stored along with the Python source code. After installing the pynq package, the compiled target files will be saved automatically into the pynq package.

Board Files and Overlays

All board related files including Vivado projects, bitstreams, and example notebooks, can be found in the /boards folder.

In Linux, you can rebuild the overlay by running make in the corresponding overlay folder (e.g. /boards/Pynq-Z1/base). In Windows, you need to source the appropriate tcl files in the corresponding overlay folder.

Alveo support

Starting from PYNQ version 2.5.1, Alveo support has also been introduced. It is now possible to use PYNQ to tap into the potential of hardware acceleration in the data center space.

To get PYNQ on an Alveo-enabled system, simply install it through PIP:

pip install pynq

For Alveo cards, PYNQ currently requires a Xilinx Runtime (XRT) version above or equal to 2.3 to be installed in the system. In terms of Operating System, any XRT-supported version of either RedHat/CentOS or Ubuntu can be used.

For more information, please see the Alveo getting started guide.

Contribute

Contributions to this repository are welcomed. Please refer to CONTRIBUTING.md for how to improve PYNQ.

Support

Please ask questions on the PYNQ support forum.

Licenses

PYNQ License: BSD 3-Clause License

Xilinx Embedded SW License: Multiple License File

Digilent IP License: MIT License

SDBuild Open Source Components

License and Copyrights Info TAR/GZIP

Open Components Source Code TAR/GZIP

pynq's People

Contributors

cathalmccabe avatar conorp12 avatar cramsay avatar fredkellerman avatar gaskint avatar giunatale avatar hackwa avatar jancumps avatar jorisbolsens avatar kevanderson avatar lbrown65 avatar lucacerina avatar mariodruiz avatar mr-yamraj avatar nocxy avatar npurusho avatar pcotret avatar peterogden avatar plysaght avatar rdxr10 avatar rpatel3001 avatar ryanman1 avatar schelleg avatar sfox14 avatar skalade avatar sonnyhcl avatar speachy avatar stephenneuendorffer avatar stfleming avatar vikhyatg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pynq's Issues

pmod_init() in every application

This is just a reminder. We need to add pmod_init() to every pmod and grove devices that use timers, delay_ms, or delay_us.

This should be done before the main while(1) loop, before any initialization of grove/pmod devices.

Otherwise the microblaze program hangs.

pmod.tcl has zybo_mipy names

There are a lot of names from MiPy that we need to remove.

I am working on it and trying to see if I can build using the tcl.

delay()

we may want to keep delay() function call as part of board. It can simply wrap time.sleep() but will keep us portable / backwards-compatible to documentation and anything we do with micropython in the future.

CPU frequency at 325MHz

Checking the "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq", we will find the current frequency of the CPUs has been set to 325MHz, while the cpuinfo_max_freq is 650MHz and cpuinfo_min_freq is 325MHz.

That might be the reason why time.sleep() suspends the program for 2x longer time.

I was not able to change the parameters there.

bsp\ps7_cortexa9_0\include

is the bsp folder used for anything?
Pynq\zybo\bsp
It contains : ps7_cortexa9_0\include\

If it is required, it should probbaly be in sdk. If not, it should be deleted.

Not able to get network access

In the new release (Feb11), my ZYBO won't be able to get network access. I guess this is because of a difference between my board and the default settings.

The jupyter_config script was also removed; so I was not able to change network settings (?) Some help?

capture

bsp build broken

bsp makefile broken - processor name in Makefile does not match folder structure.

I am cleaning Tcl-->bsp flow today. I will close once fixed.

Different versions of Grove peripherals

There are different versions of Grove modules. We should include something in the header of the .py & .c driver files to indicated which peripheral we are targeting. Preferably version number and a reference to webpage/datasheet

e.g. Temperature sensor has V1,1.1,1.2.
V1.1, and 1.2 can use the same code. V1 needs a different offset to calculate temperature.

e.g. We have code for a Grove IMU. It is unclear which one this is for as there is a 9DOF, 10DOF ( and different versions).

To future proof, We should probably do this for the Pmods too. Even though Digilent seem to be more consistent.

Inconsistent index for pins

We have a definition for configureSwitch, where pin starts from 1.

void configureSwitch(char pin1, char pin2, char pin3, char pin4, char pin5, char pin6, char pin7, char pin8);

We have another set of definition, where GPIO pin starts from 0.

define GPIO_0 0x0

define GPIO_1 0x1

define GPIO_2 0x2

define GPIO_3 0x3

define GPIO_4 0x4

define GPIO_5 0x5

define GPIO_6 0x6

define GPIO_7 0x7

I think the second one is preferred?

Copy Paste in terminal

From Giuseppe's searches:

I’ve also looked at the Copy/Paste feature. It is still a work in progress, there is a Pull Request with the addition but has yet to be added to the master branch. We need to wait a little more for this feature I am afraid.

Issue #1 jupyter/notebook#104
Issue #2 chjj/term.js#37

Pull Request that should address and fix the issue (not yet included in mainline): chjj/term.js#37

delay_ms()

The current implementation in pmod.c has the following definition:

void delay_ms(u32 ms_count)
{
u32 count;
for (count = 0; count < ((ms_count * 2500) + 1); count++)
{
asm("nop");
}
}

Is this the right function for delaying a few milliseconds in microblaze?

Documentation compilation on remote machine

We need to be able to compile documentation away from Zybo.

This requirement will require no global substantiations in modules that leads to executing code requiring root access or Zybo specific file paths.

<board ip>.read()

Can we add back in switch and button read() method? I like the pythonic call but .read()/.write() for simple IP is what I would expect.

grove_oled.py - wait loop needed for command completion

Each method needs a wait loop before considering a command completed.

this code without wait in clear method will cause garbled write of 2nd string
oled.write('should be cleared.')
oled.clear()
oled.write('Hi, Grove OLED.')

video and audio tests disappeared

During the switch of our test suite over Pytest, audio and video tests simply got deleted.

Since the interface from the python side will be the same as MicroPython, I think porting these tests over Pytest was still part of the porting process.

Can't log in with Internet explorer

I usually use chrome, so hadn't noticed this.

Using IE 11
At the log in prompt, I enter the password, but it redirects to the password page (no error, but doesn't bring me to the next page)
Still doesn't work when trying with redirect on the url: http://pynq:9090/login?next=%2Ftree

If I enter the password incorrectly, it redirects with the message "Invalid password ", so it is not a password issue. I can also click to reveal the password in IE, so I know it is being entered correctly.

Can someone else check this?

Grove_buzzer

A bin file exists in Pynq\python\pynq\pmods, but no Python. Should there be a corresponding .py file?

Getting Started notebooks

Note:
Getting started notebooks in the home area (xpp/jupyter_notebooks/Getting_started) also need a subset of images from the docs /images directory. Need to check this before building next image.

new pmod.bit needed in boot.bin

Will checkin on next image release. For workaround , make sure any code testing does the following first:

will download latest pmod.bit onto bitstream

from pynq.pl import Overlay
Overlay("pmod.bit").download()

Latest release still has wrong bitstreams

I downloaded the latest image, but we still have wrong bitstreams in:

/home/xpp/src/pyxi/bitstream

We should have pmod.bit and audiovideo.bit there. The pyxi package on github is showing the correct one, but we need to update them in the new release of image.

Remaining grove devices

  1. The grove buzzer from Parimal still needs some work because it does not use the current pmod.c file we have on github. I have changed the make files for this project, but it won't compile since we are missing some functions (e.g. delay_us) in the current pmod.c/pmod.h.
  2. I need help with the grove IMU. Right now I can get values, but if you try it, you can see the values are quite unstable. Sometimes you read extremely large values. I have tried to enlarge the delay, but it does not help.

Vivado/SDK version

Which version of Vivado/SK will we base the release code on?
We currently use 2015.3.

frame.py hardcoded width of 1920

Can we remove hardcoded 1920 for widths and use self.width? I want to support other widths as we add other input devices - raising issue here in case any ramifications for AV overlay.

Testing new build; errors on board with IOP

I have rebuilt the bitstream, and the SDK projects.
I copied the new pmod.bit to the board, and the new SDK bin projects.

When trying the notebooks to test I get the error at the bottom. This is for the ALS, but I get the same error for all the other peripherals.

Has something changes with the IOP .py? I don't understand what is happening with this code, or what it is trying to do.

ValueError Traceback (most recent call last)
in ()
6
7 # ALS sensor is on 1st PMOD labeled JB
----> 8 my_als = PMOD_ALS(1)
9 my_als.read()

/usr/local/lib/python3.4/dist-packages/pynq/pmods/pmod_als.py in init(self, pmod_id)
64
65 """
---> 66 self.iop = _iop.request_iop(pmod_id, ALS_PROGRAM)
67 self.mmio = self.iop.mmio
68 self.log_interval_ms = 1000

/usr/local/lib/python3.4/dist-packages/pynq/pmods/_iop.py in request_iop(pmod_id, mb_program)
191 if (iop_name not in ip_names):
192 raise ValueError("No such IOP for PMOD ID {}."
--> 193 .format(pmod_id))
194
195 gpio_names = PL.get_gpio_names()

ValueError: No such IOP for PMOD ID 1.

Examples to be updated

I have uploaded our MiPy examples into /Pyxi/python/examples

However, those tests should be changed accordingly for the new Pyxi package. They also have to follow a naming convention. My suggestion is to use "demo_" in the beginning of the game and use lower-case letters.

There are also duplicated tests for DAC-ADC. I suggest we keep the larger one.

Maybe it is also okay to remove helloIDE, DAC_ADC_OLED, and LEDs_switches_buttons. If those are really needed, we can also put them into the same notebook script.

Maybe it is also okay to completely get rid of all .py files and keep only .ipynb files.

Renaming of .bin files

The current naming convention will give us duplicated entries for adc.bin. We have to use pmodadc.bin and groveadc.bin for the two adc bin files (or similar naming conventions).

Note that in /zybo/sdk/ we have folders following another naming convention.

Also, need to change "grove_adc" -> "groveadc" in /zybo/sdk/ and the name of the .bin file. Or the other way around to make them consistent.

notebooks/Examples/pmod_grove_oled.ipynb

notebooks/Examples/pmod_grove_oled.ipynb

  1. The code in the files cell is out of sync with the Grove_OLED.py (OLED only supported on GR4)
    clear() instead of clear_screen()
  2. The code supports the OLED on GR3/4 only, but the instantiation uses GR1.
    oled = Grove_OLED(1,1)

update _iop switch config constants

Putting this here, so I don't forget :)

_iop switch config constants do not match current pmod overlay (e.g. 2nd IIC is no longer exists per iop subsystem). We just need to verify constants in _iop match up to current state of switch IP.

OVERLAY time resolution

The current implementation of time stamp has a resolution of seconds, which may not be sufficient for bitstream switching (which can take only a few ms). I will fix this in the update.

Overlay IP

Can the overlay IP/sources be made external to the projects, and put in a shared repository?

e.g. We currently have 2 places for PMOD_IO_Switch_IP_1.0 (in srcs in each overlay). i.e. two places to update/maintain the same IP

Need license headers for MB code

We need to add the license header for the microblaze code. I also want to add the author information, modified date, etc. into the header.

I will use the one in Python classes, if no one raises a flag. I will change the formatting as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.