Skip to content

Commit

Permalink
[MAINTENANCE] add script for easy cocotb environment preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinspinler committed Feb 22, 2024
1 parent 9e7c041 commit 8425e81
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/cocotb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 24 additions & 0 deletions tests/cocotb/prepare.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 8425e81

Please sign in to comment.