vendor.quicklogic: write OpenOCD scripts as part of build process.
authorwhitequark <whitequark@whitequark.org>
Fri, 13 Nov 2020 05:44:16 +0000 (05:44 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 31 Dec 2021 15:23:05 +0000 (15:23 +0000)
The OpenOCD scripts for EOS-S3 are roughly equivalent to SVF files
for a more traditional FPGA, which we also produce, for some common
"default" configuration, as a part of the build process.

nmigen/vendor/quicklogic.py

index 6e9c63cee4865d06f1ccdec722ee84b5f35d7238..bc7f9a206f08e2c8a127bfc3e2fe45d9d6f723e2 100644 (file)
@@ -42,7 +42,8 @@ class QuicklogicPlatform(TemplatedPlatform):
         "symbiflow_place",
         "symbiflow_route",
         "symbiflow_write_fasm",
-        "symbiflow_write_bitstream"
+        "symbiflow_write_bitstream",
+        "symbiflow_write_openocd",
     ]
     file_templates = {
         **TemplatedPlatform.build_script_templates,
@@ -121,14 +122,18 @@ class QuicklogicPlatform(TemplatedPlatform):
             -d {{platform.device}}
             -P {{platform.package}}
             -b {{name}}.bit
-        """
+        """,
+        # This should be `invoke_tool("symbiflow_write_openocd")`, but isn't because of a bug in
+        # the QLSymbiflow v1.3.0 toolchain release.
+        r"""
+        python3 -m quicklogic_fasm.bitstream_to_openocd
+            {{name}}.bit
+            {{name}}.openocd
+        """,
     ]
 
     # Common logic
 
-    def __init__(self):
-        super().__init__()
-
     def add_clock_constraint(self, clock, frequency):
         super().add_clock_constraint(clock, frequency)
         clock.attrs["keep"] = "TRUE"