3 Star 0 Fork 0

mirrors_Xilinx / PYNQ-Utils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

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.

BSD 3-Clause License Copyright (c) 2022, Xilinx All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

暂无描述 展开 收起
Python
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/mirrors_Xilinx/PYNQ-Utils.git
git@gitee.com:mirrors_Xilinx/PYNQ-Utils.git
mirrors_Xilinx
PYNQ-Utils
PYNQ-Utils
main

搜索帮助