kx705: add programmer parameter
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 28 Feb 2015 22:34:57 +0000 (23:34 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 28 Feb 2015 22:34:57 +0000 (23:34 +0100)
mibuild/platforms/kc705.py

index d47c627b243e300f2448c61058c94ae7cc7471ac..1a3f7b51437c542d618f7348e584bffcb6f7b107 100644 (file)
@@ -378,7 +378,7 @@ _connectors = [
        )
 ]
 
-def Platform(*args, toolchain="vivado", **kwargs):
+def Platform(*args, toolchain="vivado", programmer="xc3sprog", **kwargs):
        if toolchain == "ise":
                xilinx_platform = XilinxISEPlatform
        elif toolchain == "vivado":
@@ -396,7 +396,12 @@ def Platform(*args, toolchain="vivado", **kwargs):
                        xilinx_platform.__init__(self, "xc7k325t-ffg900-2", _io, crg_factory, _connectors)
 
                def create_programmer(self):
-                       return XC3SProg("jtaghs1_fast", "bscan_spi_kc705.bit")
+                       if programmer == "xc3sprog":
+                               return XC3SProg("jtaghs1_fast", "bscan_spi_kc705.bit")
+                       elif programmer == "vivado":
+                               return VivadoProgrammer()
+                       else:
+                               raise ValueError("{} programmer is not supported".format(programmer))
 
                def do_finalize(self, fragment):
                        try:
@@ -415,4 +420,5 @@ def Platform(*args, toolchain="vivado", **kwargs):
                                self.add_platform_command("CONFIG DCI_CASCADE = \"33 32 34\";")
                        else:
                                self.add_platform_command("set_property DCI_CASCADE {{32 34}} [get_iobanks 33]")
+
        return RealPlatform(*args, **kwargs)