From 7d49e4bb725438616ffffe547175e61472bca790 Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Fri, 29 Nov 2024 17:20:10 +0000 Subject: [PATCH] [ci] fix CI to select correct device for openFPGALoader --- .github/workflows/ci.yml | 2 +- nix/bitstream.nix | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bd0fee30..f3917d685 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,7 +150,7 @@ jobs: - name: Flash bitstream run: | - nix run .#bitstream-load + DEVICE=/dev/ttySONATA_JTAG_FPGA nix run .#bitstream-load - name: Run software tests run: | diff --git a/nix/bitstream.nix b/nix/bitstream.nix index 8d0595666..c781f3bcb 100644 --- a/nix/bitstream.nix +++ b/nix/bitstream.nix @@ -61,7 +61,11 @@ in { runtimeInputs = [pythonEnv pkgs.openfpgaloader]; text = '' BITSTREAM=$(find ./ -type f -name "lowrisc_sonata_system_0.bit") - openFPGALoader -c ft4232 "$BITSTREAM" + if [[ -n "''${DEVICE-}" ]]; then + openFPGALoader -c ft4232 -d "$DEVICE" "$BITSTREAM" + else + openFPGALoader -c ft4232 "$BITSTREAM" + fi ''; }; }