propose patch to not break litex for python 3.5
authorbunnie <bunnie@kosagi.com>
Tue, 28 Apr 2020 16:34:19 +0000 (00:34 +0800)
committerbunnie <bunnie@kosagi.com>
Tue, 28 Apr 2020 16:34:19 +0000 (00:34 +0800)
litex/build/lattice/programmer.py

index addc51dcffe06d54f006012a6f1bd88700919e56..c97bb07b0a6dd983aabe3c49c77d9e54cde01f54 100644 (file)
@@ -32,7 +32,7 @@ class OpenOCDJTAGProgrammer(GenericProgrammer):
     def load_bitstream(self, bitstream_file):
         svf_file = bitstream_file.replace(".bit", ".svf")
 
-        subprocess.call(["openocd", "-f", self.openocd_config , "-c", f"transport select jtag; init; svf \"{svf_file}\"; exit"])
+        subprocess.call(["openocd", "-f", self.openocd_config , "-c", "transport select jtag; init; svf \"{}\"; exit".format(svf_file)])
 
     def flash(self, address, data, erase=False, verify=True):
         if self.flash_proxy_basename is None:
@@ -50,11 +50,11 @@ class OpenOCDJTAGProgrammer(GenericProgrammer):
             "target create ecp5.spi0.proxy testee -chain-position ecp5.tap",
             "flash bank spi0 jtagspi 0 0 0 0 ecp5.spi0.proxy 0x32",
             "init",
-            f"svf \"{flash_proxy}\"" if flash_proxy is not None else "",
+            "svf \"{}\"" if flash_proxy is not None else "".format(flash_proxy),
             "reset halt",
             "flash probe spi0",
-            f"flash write_image {erase} \"{data}\" 0x{address:x}",
-            f"flash verify_bank spi0 \"{data}\" 0x{address:x}" if verify else "",
+            "flash write_image {0} \"{1}\" 0x{2:x}".format(erase, data, address),
+            "flash verify_bank spi0 \"{0}\" 0x{1:x}" if verify else "".format(data, address),
             "exit"
         ])
         subprocess.call(["openocd", "-f", self.openocd_config, "-c", script])