mibuild/xilinx: Adding programming with the Digilent Adept tools
authorTim 'mithro' Ansell <mithro@mithis.com>
Thu, 2 Jul 2015 14:03:44 +0000 (16:03 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 2 Jul 2015 14:03:44 +0000 (16:03 +0200)
mibuild/xilinx/__init__.py
mibuild/xilinx/programmer.py

index af787b30075bdec105c633c58665a0784f79b790..0594435c4e9196792e2d344f5a534f17d5a4479f 100644 (file)
@@ -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
index ac3d0cfffbe595be0a58bf7bcb8d838630a93f3d..36667a936085c1b1bfce6d53ae26da807c14a5de 100644 (file)
@@ -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")