-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'spinler-feat-cocotb_pyproject' into 'devel'
Spinler feat cocotb pyproject See merge request ndk/ndk-fpga!96
- Loading branch information
Showing
9 changed files
with
76 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,9 @@ | ||
#!/bin/sh | ||
|
||
OFM_PATH=../../../../ | ||
NDK_FPGA_PATH=../../../.. | ||
source $NDK_FPGA_PATH/env.sh | ||
|
||
#swbase=../../../swbase/ | ||
swbase=git+https://github.com/CESNET/ndk-sw.git#subdirectory= | ||
ndk_fpga_venv_prepare "venv-cocotb" | ||
|
||
PKG_PYNFB=${swbase}pynfb/ | ||
PKG_LIBNFBEXT_PYTHON=${swbase}ext/libnfb_ext_python/ | ||
PKG_COCOTBEXT_OFM=$OFM_PATH/python/cocotbext/ | ||
|
||
# Python virtual environment | ||
python -m venv venv-cocotb | ||
source venv-cocotb/bin/activate | ||
|
||
python -m pip install cython wheel setuptools | ||
python -m pip install pylibfdt fdt | ||
python -m pip install scapy | ||
python -m pip wheel -w ./cocotbwheels $PKG_PYNFB | ||
python -m pip install --find-links ./cocotbwheels nfb | ||
python -m pip install --find-links ./cocotbwheels $PKG_LIBNFBEXT_PYTHON | ||
python -m pip install $PKG_COCOTBEXT_OFM | ||
|
||
echo "" | ||
echo "Now activate environment with:" | ||
echo "source venv-cocotb/bin/activate" | ||
pip install . | ||
#pip install "cocotbext-ofm[nfb]@$NDK_FPGA_COCOTBEXT_OFM_URL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[project] | ||
name = "cocotb-ndk-minimal-test-toplevel" | ||
version = "0.1.0" | ||
dependencies = [ | ||
"cocotbext-ofm[nfb] @ ${NDK_FPGA_COCOTBEXT_OFM_URL}", | ||
] | ||
|
||
[build-system] | ||
requires = ["pdm-backend"] | ||
build-backend = "pdm.backend" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Common functions | ||
function ndk_fpga_venv_prepare { | ||
if [ -z "$1" ]; then | ||
VENV_NAME="venv-cocotb" | ||
else | ||
VENV_NAME="$1" | ||
fi | ||
|
||
echo "Creating virtual environment '$VENV_NAME'" | ||
python -m venv $VENV_NAME | ||
source $VENV_NAME/bin/activate | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
if [ -z "${NDK_FPGA_PATH}" ]; then | ||
NDK_FPGA_PATH=$(dirname "${BASH_SOURCE[0]}") | ||
fi | ||
|
||
source $NDK_FPGA_PATH/build/common.sh | ||
|
||
|
||
# REALPATHs are necessary for local Python packages based on PDM | ||
NDK_FPGA_REALPATH=$(realpath $NDK_FPGA_PATH) | ||
|
||
# #################################################################### | ||
# Default package paths | ||
|
||
# OFM extension for cocotb | ||
export NDK_FPGA_COCOTBEXT_OFM_URL="file://${NDK_FPGA_REALPATH}/python/cocotbext/" | ||
|
||
# NDK software Python packages are dependencies of cocotbext-ofm[nfb] | ||
export NDK_SW_PYTHON_URL="git+https://github.com/CESNET/ndk-sw.git#subdirectory=" | ||
# NDK software alternative path for local ndk-sw repository | ||
#NDK_SW_REALPATH=$(realpath $NDK_FPGA_PATH/../swbase) | ||
#NDK_SW_PYTHON_URL="file:///$(realpath $NDK_SW_PATH)/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[project] | ||
name = "cocotbext-ofm" | ||
version = "0.1.0" | ||
dependencies = [ | ||
"cocotb", | ||
"cocotb-bus", | ||
] | ||
|
||
[project.optional-dependencies] | ||
nfb = [ | ||
"pylibfdt", | ||
"nfb @ ${NDK_SW_PYTHON_URL}pynfb", | ||
"libnfb-ext-python @ ${NDK_SW_PYTHON_URL}ext/libnfb_ext_python", | ||
] | ||
|
||
[build-system] | ||
requires = [ | ||
"pdm-backend", | ||
] | ||
build-backend = "pdm.backend" | ||
|
||
[tool.pdm.build] | ||
includes = ["cocotbext"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters