Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 1 | DESCRIPTION = "Recipe to install BNN notebooks and PYNQ dependencies for ultra96" |
| 2 | SUMMARY = "BNN example jupyter notebooks with PYNQ" |
| 3 | |
| 4 | LICENSE = "BSD" |
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=8f625d3c898c18035639b6d6943b6a9c" |
| 6 | |
| 7 | SRC_URI = "git://github.com/Xilinx/BNN-PYNQ.git;protocol=https \ |
| 8 | file://0001-BNN-Notebooks-changed-default-picture-location.patch \ |
| 9 | file://0001-Update-default-notebooks-path-from-home-xilinx-to-us.patch \ |
| 10 | " |
| 11 | |
| 12 | SRCREV = "32eed91994228d1042a16c692047dfe81e47d498" |
| 13 | |
| 14 | inherit xilinx-pynq |
| 15 | |
| 16 | RDEPENDS_${PN}-notebooks += "\ |
| 17 | python3-pynq \ |
| 18 | python3-pillow \ |
| 19 | libstdc++ \ |
| 20 | libcma \ |
| 21 | bash \ |
| 22 | " |
| 23 | |
| 24 | COMPATIBLE_MACHINE = "^$" |
| 25 | COMPATIBLE_MACHINE_ultra96-zynqmp = "ultra96-zynqmp" |
| 26 | |
| 27 | S = "${WORKDIR}/git" |
| 28 | |
| 29 | do_configure[noexec]="1" |
| 30 | do_compile[noexec]="1" |
| 31 | |
| 32 | def get_board(d): |
| 33 | x = str(d.getVar("BOARD_NAME", "True")) |
| 34 | return x.lower() |
| 35 | |
| 36 | do_install () { |
| 37 | JUPYTER_NOTEBOOKS=${D}${PYNQ_NOTEBOOK_DIR} |
| 38 | install -d ${JUPYTER_NOTEBOOKS}/bnn_examples |
| 39 | |
| 40 | install -d ${JUPYTER_NOTEBOOKS}/bnn_examples/bitstreams |
| 41 | install -d ${JUPYTER_NOTEBOOKS}/bnn_examples/bitstreams/${@get_board(d)} |
| 42 | cp -r ${S}/bnn/bitstreams/${@get_board(d)}/* ${JUPYTER_NOTEBOOKS}/bnn_examples/bitstreams/${@get_board(d)}/ |
| 43 | |
| 44 | install -d ${JUPYTER_NOTEBOOKS}/bnn_examples/libraries |
| 45 | install -d ${JUPYTER_NOTEBOOKS}/bnn_examples/libraries/${@get_board(d)} |
| 46 | cp -r ${S}/bnn/libraries/${@get_board(d)}/* ${JUPYTER_NOTEBOOKS}/bnn_examples/libraries/${@get_board(d)}/ |
| 47 | |
| 48 | cp -r ${S}/bnn/params ${JUPYTER_NOTEBOOKS}/bnn_examples/ |
| 49 | cp -r ${S}/bnn/src ${JUPYTER_NOTEBOOKS}/bnn_examples/ |
| 50 | cp -r ${S}/bnn/__init__.py ${JUPYTER_NOTEBOOKS}/bnn_examples/ |
| 51 | cp -r ${S}/bnn/bnn.py ${JUPYTER_NOTEBOOKS}/bnn_examples/ |
| 52 | cp -r ${S}/MANIFEST.in ${JUPYTER_NOTEBOOKS}/bnn_examples/ |
| 53 | cp -r ${S}/setup.py ${JUPYTER_NOTEBOOKS}/bnn_examples/ |
| 54 | |
| 55 | cp -r ${S}/notebooks/* ${JUPYTER_NOTEBOOKS}/bnn_examples/ |
| 56 | } |
| 57 | |