Skip to content

Commit

Permalink
[FEATURE]: add Jenkinsfile for cocotb top-level tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martinspinler committed Oct 19, 2023
1 parent 2c9960e commit a6c0973
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
38 changes: 38 additions & 0 deletions tests/cocotb/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
node("preklad") {
cleanWs()
def swbase = "ndk-sw"
checkout scm

stage("Checkout development branches") {
sh "git clone https://github.com/CESNET/ndk-sw.git"

sh "(cd ndk/ofm; git checkout devel)"
sh "(cd ndk/core; git checkout main)"
}

sh "python3.9 -m venv venv-cocotb"

stage("Prepare environment") {
sh """
source venv-cocotb/bin/activate
python3.9 -m pip install cython wheel
python3.9 -m pip install pylibfdt fdt
python3.9 -m pip install ${swbase}/pynfb/
python3.9 -m pip install ${swbase}/ext/libnfb_ext_python/
python3.9 -m pip install ndk/ofm/python/cocotbext/
"""
}

stage("Run test") {
sh """
source venv-cocotb/bin/activate
. /usr/local/bin/fpga_version.sh;
fpga_sim 2020.4;
make -C tests/cocotb SIM_FLAGS=\"-c -do quit\"
"""
junit testResults: "build/fb2cghh/results.xml"
}

sh "rm -rf venv-cocotb"
}
4 changes: 3 additions & 1 deletion tests/cocotb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ CARD = fb2cghh

CARD_DIR=../../build/$(CARD)/

ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))

all:
make TARGET=cocotb -C $(CARD_DIR) PYTHONPATH=$$PYTHONPATH:$(PWD)
make TARGET=cocotb -C $(CARD_DIR) PYTHONPATH=$$PYTHONPATH:$(ROOT_DIR)

0 comments on commit a6c0973

Please sign in to comment.