Skip to main content

Utilities for PYNQ

Project description

pynq_logo

version 0.1.1

PYNQ-Utils is a repository containing utilities used in various other repos and projects across the PYNQ ecosystem. The tools are categorized into three sections:

  • /runtime for utilities that are used in the PYNQ runtime, such as ReprDict which is used to pretty print dictionaries in Jupyter.
  • /setup_utils for utilities that are used in the construction of python packages and to help in managing the PYNQ environment.
  • /build_utils for utilities that are mainly used at build time when constructing Overlays. However, there are some utilities here that overlap with other sections, such as the XSAParser, which is also used by the PYNQ runtime for parsing the design metadata and bitstream.

QuickStart

To install PYNQ-Utils use the following command:

python3 -m pip install pynqutils 

setup.py example

One place where PYNQ-Utils is frequently used is in the setup.py of projects that build upon PYNQ.

from pynqutils.setup_utils import build_py, find_version, extend_package, get_platform

data_files = []
extend_package(path=os.path.join(module_name, "notebooks"), data_files=data_files)

setup(
    name="pynq_helloworld",
    version=find_version('{}/__init__.py'.format("pynq_helloworld")),
    description="PYNQ example design supporting edge and PCIE boards",
    long_description="PYNQ HelloWorld example design",
    long_description_content_type='text/markdown',
    author='Xilinx PYNQ Development Team',
    author_email="pynq_support@xilinx.com",
    url='https://github.com/Xilinx/PYNQ-HelloWorld.git',
    license='BSD 3-Clause License',
    packages=find_packages(),
    package_data={
        "": data_files,
    },
    python_requires=">=3.6.0",
    install_requires=[
        "pynqutils",
        "matplotlib",
        "ipython"
    ],
    entry_points={
        "pynq.notebooks": [
            "pynq-helloworld = {}.notebooks.{}".format( "pynq_helloworld", get_platform())
        ]
    },
    cmdclass={"build_py": build_py}
)

As can be seen from the above snippet PYNQ-Utils contains lots of handy utilities for creating a setup.py script. Some examples from above are:

  • find_version - used to find the verstion of the current project from the source
  • extend_package - used to search directories to find files and directories to add to the package.
  • get_platform - used to determine the current platform that the project is being installed onto, for instance, edge or pcie.

A complete example of a setup.py using PYNQ-Utils can be found here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pynqutils_git-0.1.1-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file pynqutils_git-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pynqutils_git-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pynqutils_git-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eeaae8ed52d56cb4992e0f681e1b38fb85e9bd8c824ab4ef52f7d0a6a660ded6
MD5 b0f1c11a3fe814342b6b5c2de926b33c
BLAKE2b-256 ead9fa6bc317f4cf1ba2afac46408aee27d076c73a5224a85b7a3cb371d5f0c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page