xilinx_7series: add grade platform property.
authorwhitequark <cz@m-labs.hk>
Thu, 10 Oct 2019 16:25:10 +0000 (16:25 +0000)
committerwhitequark <cz@m-labs.hk>
Thu, 10 Oct 2019 16:33:00 +0000 (16:33 +0000)
For some devices grade has to be omitted, so it is optional.

nmigen/vendor/xilinx_7series.py

index d26c438a1bfc5fda7f416bf3e5cc1ff76174e01b..e94f8d2f53524ac7dd6a43ec6e64aeef4189f96b 100644 (file)
@@ -50,12 +50,12 @@ class Xilinx7SeriesPlatform(TemplatedPlatform):
     device  = abstractproperty()
     package = abstractproperty()
     speed   = abstractproperty()
+    grade   = None
 
     required_tools = [
         "yosys",
         "vivado"
     ]
-
     file_templates = {
         **TemplatedPlatform.build_script_templates,
         "build_{{name}}.sh": r"""
@@ -75,7 +75,7 @@ class Xilinx7SeriesPlatform(TemplatedPlatform):
         """,
         "{{name}}.tcl": r"""
             # {{autogenerated}}
-            create_project -force -name {{name}} -part {{platform.device}}{{platform.package}}-{{platform.speed}}
+            create_project -force -name {{name}} -part {{platform.device}}{{platform.package}}-{{platform.speed}}{{"-" + platform.grade if platform.grade else ""}}
             {% for file in platform.iter_extra_files(".v", ".sv", ".vhd", ".vhdl") -%}
                 add_files {{file}}
             {% endfor %}