build/openfpgaloader: support jtag index-chain

* allows loading a FPGA that is not the only device in a JTAG scan chain
This commit is contained in:
Andrew Dennison 2023-05-29 14:37:12 +10:00 committed by Florent Kermarrec
parent d60f5c221c
commit 93bc2760fe
1 changed files with 3 additions and 1 deletions

View File

@ -12,7 +12,7 @@ from litex.build.generic_programmer import GenericProgrammer
class OpenFPGALoader(GenericProgrammer):
needs_bitreverse = False
def __init__(self, board="", cable="", freq=0):
def __init__(self, board="", cable="", freq=0, index_chain=None):
self.cmd = ["openFPGALoader"]
if board:
self.cmd += ["--board", board]
@ -20,6 +20,8 @@ class OpenFPGALoader(GenericProgrammer):
self.cmd += ["--cable", cable]
if freq:
self.cmd += ["--freq", str(int(float(freq)))]
if index_chain is not None:
self.cmd += ["--index-chain", str(int(index_chain))]
def load_bitstream(self, bitstream_file):
cmd = self.cmd + ["--bitstream", bitstream_file]