diff --git a/mibuild/xilinx/__init__.py b/mibuild/xilinx/__init__.py index af787b300..0594435c4 100644 --- a/mibuild/xilinx/__init__.py +++ b/mibuild/xilinx/__init__.py @@ -1,2 +1,2 @@ from mibuild.xilinx.platform import XilinxPlatform -from mibuild.xilinx.programmer import UrJTAG, XC3SProg, FpgaProg, VivadoProgrammer, iMPACT +from mibuild.xilinx.programmer import UrJTAG, XC3SProg, FpgaProg, VivadoProgrammer, iMPACT, Adept diff --git a/mibuild/xilinx/programmer.py b/mibuild/xilinx/programmer.py index ac3d0cfff..36667a936 100644 --- a/mibuild/xilinx/programmer.py +++ b/mibuild/xilinx/programmer.py @@ -150,3 +150,30 @@ endgroup quit """.format(data=data_file) _run_vivado(self.vivado_path, self.vivado_ver, cmds) + + +class Adept(GenericProgrammer): + """Using the Adept tool with an onboard Digilent "USB JTAG" cable. + + You need to install Adept Utilities V2 from + http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,66,828&Prod=ADEPT2 + """ + + needs_bitreverse = False + + def __init__(self, board, index, flash_proxy_basename=None): + GenericProgrammer.__init__(self, flash_proxy_basename) + self.board = board + self.index = index + + def load_bitstream(self, bitstream_file): + subprocess.call([ + "djtgcfg", + "--verbose", + "prog", "-d", self.board, + "-i", str(self.index), + "-f", bitstream_file, + ]) + + def flash(self, address, data_file): + raise ValueError("Flashing unsupported with DigilentAdept tools")