From 935326e66cef72381862c66241a7cb88a3f397b5 Mon Sep 17 00:00:00 2001 From: Long Pham Date: Wed, 6 Nov 2024 11:25:54 -0800 Subject: [PATCH] Add FTDI serial number option to openfpgaloader, useful when multiple similar boards are connected for CI/CD --- litex/build/openfpgaloader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litex/build/openfpgaloader.py b/litex/build/openfpgaloader.py index 431035559..25a0f0e1f 100644 --- a/litex/build/openfpgaloader.py +++ b/litex/build/openfpgaloader.py @@ -12,7 +12,7 @@ from litex.build.generic_programmer import GenericProgrammer class OpenFPGALoader(GenericProgrammer): needs_bitreverse = False - def __init__(self, board="", cable="", freq=0, fpga_part="", index_chain=None): + def __init__(self, board="", cable="", freq=0, fpga_part="", index_chain=None, ftdi_serial=None): # openFPGALoader base command. self.cmd = ["openFPGALoader"] @@ -36,6 +36,9 @@ class OpenFPGALoader(GenericProgrammer): if index_chain is not None: self.cmd += ["--index-chain", str(int(index_chain))] + if ftdi_serial is not None: + self.cmd += ["--ftdi-serial", str(ftdi_serial)] + def load_bitstream(self, bitstream_file): # Load base command. cmd = self.cmd + ["--bitstream", bitstream_file]