Skip to content

Commit 152f314

Browse files
committed
Add test runner script with auto venv activation
1 parent 6b932f3 commit 152f314

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ test/sim_build
1111
test/__pycache__/
1212
test/results.xml
1313
test/gate_level_netlist.v
14+
test/.venv/

test/run.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# Run tt-lfsr32 cocotb tests. Activates the Python 3.13 venv automatically.
3+
# Usage: ./run.sh (RTL sim)
4+
# ./run.sh GATES=yes (gate-level sim)
5+
cd "$(dirname "$0")" || exit 1
6+
7+
if [ ! -d .venv ]; then
8+
echo "venv missing — creating it with python3.13 ..."
9+
python3.13 -m venv .venv && .venv/bin/pip install -r requirements.txt || exit 1
10+
fi
11+
12+
source .venv/bin/activate
13+
make "$@"

0 commit comments

Comments
 (0)