vendor.lattice_machxo2: generate binary bitstreams.
authorGwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
Fri, 8 May 2020 04:42:21 +0000 (06:42 +0200)
committerGitHub <noreply@github.com>
Fri, 8 May 2020 04:42:21 +0000 (04:42 +0000)
nmigen/vendor/lattice_machxo2.py

index 3ce9962852b116fa3b2b131695665fb55c727ac5..979b2cbcc616da91d14bb6e53e06be92acc65cad 100644 (file)
@@ -25,6 +25,7 @@ class LatticeMachXO2Platform(TemplatedPlatform):
     Build products:
         * ``{{name}}_impl/{{name}}_impl.htm``: consolidated log.
         * ``{{name}}.jed``: JEDEC fuse file.
+        * ``{{name}}.bit``: binary bitstream.
         * ``{{name}}.svf``: JTAG programming vector.
     """
 
@@ -77,6 +78,7 @@ class LatticeMachXO2Platform(TemplatedPlatform):
             prj_run Translate -impl impl -forceAll
             prj_run Map -impl impl -forceAll
             prj_run PAR -impl impl -forceAll
+            prj_run Export -impl impl -forceAll -task Bitgen
             prj_run Export -impl impl -forceAll -task Jedecgen
             {{get_override("script_after_export")|default("# (script_after_export placeholder)")}}
         """,
@@ -111,6 +113,11 @@ class LatticeMachXO2Platform(TemplatedPlatform):
             {{name}}.tcl
         """,
         r"""
+        {{invoke_tool("ddtcmd")}}
+            -oft -bit
+            -if {{name}}_impl/{{name}}_impl.bit -of {{name}}.bit
+        """,
+        r"""
         {{invoke_tool("ddtcmd")}}
             -oft -jed
             -dev {{platform.device}}-{{platform.speed}}{{platform.package}}{{platform.grade}}