From 8425e817ea7ca8792a81dfa1ef6390e1801f349b Mon Sep 17 00:00:00 2001 From: Martin Spinler Date: Thu, 22 Feb 2024 14:58:21 +0100 Subject: [PATCH] [MAINTENANCE] add script for easy cocotb environment preparation --- tests/cocotb/Makefile | 3 ++- tests/cocotb/prepare.sh | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 tests/cocotb/prepare.sh diff --git a/tests/cocotb/Makefile b/tests/cocotb/Makefile index ca4e30923..d1f394ef6 100644 --- a/tests/cocotb/Makefile +++ b/tests/cocotb/Makefile @@ -6,10 +6,11 @@ CARD = fb2cghh +SIM = cocotb CARD_DIR=../../build/$(CARD)/ ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) all: - make TARGET=cocotb -C $(CARD_DIR) PYTHONPATH=$$PYTHONPATH:$(ROOT_DIR) + make TARGET=$(SIM) -C $(CARD_DIR) PYTHONPATH=$$PYTHONPATH:$(ROOT_DIR) TOP_LEVEL_ENT=fpga diff --git a/tests/cocotb/prepare.sh b/tests/cocotb/prepare.sh new file mode 100755 index 000000000..f4e9ce5e6 --- /dev/null +++ b/tests/cocotb/prepare.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +OFM_PATH=../../ndk/ofm + +#swbase=../../../swbase/ +swbase=git+https://github.com/CESNET/ndk-sw.git#subdirectory= + +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 +python -m pip install pylibfdt fdt +python -m pip install $PKG_PYNFB +python -m pip install $PKG_LIBNFBEXT_PYTHON +python -m pip install $PKG_COCOTBEXT_OFM + +echo "" +echo "Now activate environment with:" +echo "source venv-cocotb/bin/activate"