vendor.xilinx_7series: add `_part` property getter
authorMariusz Glebocki <mglebocki@antmicro.com>
Mon, 24 Aug 2020 11:03:59 +0000 (13:03 +0200)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 31 Dec 2021 14:57:14 +0000 (14:57 +0000)
nmigen/vendor/xilinx_7series.py

index 1716b91a2daeb855b1646dbfb72c51bbe6f73cdd..e923e03ea54af00b519f2216d05e759a3437faa5 100644 (file)
@@ -52,6 +52,10 @@ class Xilinx7SeriesPlatform(TemplatedPlatform):
     package = abstractproperty()
     speed   = abstractproperty()
 
+    @property
+    def _part(self):
+        return "{}{}-{}".format(self.device, self.package, self.speed)
+
     required_tools = ["vivado"]
     file_templates = {
         **TemplatedPlatform.build_script_templates,
@@ -72,7 +76,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._part}}
             {% for file in platform.iter_extra_files(".v", ".sv", ".vhd", ".vhdl") -%}
                 add_files {{file|tcl_escape}}
             {% endfor %}