From 7f1fa155d30b198b9cdae5e06d120302b1d77824 Mon Sep 17 00:00:00 2001 From: Josef Gajdusek Date: Fri, 24 Apr 2026 23:31:16 +0200 Subject: [PATCH] generic: Fix Python path not including the examples/ directory in the example It seems that at some point, the embedded Python stopped including the directory that nextpnr-generic was executed in inside of its sys.path. This likely happened by de3d5be8 specifying an explicit argv to the interpreter init function. --- generic/examples/simple.sh | 1 + generic/examples/simtest.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/generic/examples/simple.sh b/generic/examples/simple.sh index 76bc6168..f23dd02a 100755 --- a/generic/examples/simple.sh +++ b/generic/examples/simple.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -ex +export PYTHONPATH=$(dirname $0) yosys -p "tcl ../synth/synth_generic.tcl 4 blinky.json" blinky.v ${NEXTPNR:-../../nextpnr-generic} --pre-pack simple.py --pre-place simple_timing.py --json blinky.json --post-route bitstream.py --write pnrblinky.json yosys -p "read_verilog -lib ../synth/prims.v; read_json pnrblinky.json; dump -o blinky.il; show -format png -prefix blinky" diff --git a/generic/examples/simtest.sh b/generic/examples/simtest.sh index ef328914..be271902 100755 --- a/generic/examples/simtest.sh +++ b/generic/examples/simtest.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -ex +export PYTHONPATH=$(dirname $0) yosys -p "tcl ../synth/synth_generic.tcl 4 blinky.json" blinky.v ${NEXTPNR:-../../nextpnr-generic} --no-iobs --pre-pack simple.py --pre-place simple_timing.py --json blinky.json --post-route bitstream.py --write pnrblinky.json yosys -p "read_json pnrblinky.json; write_verilog -noattr -norename pnrblinky.v"