build/lattice/trellis: nextpnr now handle LPF timing constraints and multiple clock...
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 6 Dec 2019 11:57:59 +0000 (12:57 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 6 Dec 2019 11:57:59 +0000 (12:57 +0100)
litex/build/lattice/trellis.py

index a02e49a9a3aab296253d1ed0805d2d414d8e45af..472aa4a5bd12ef4d5e28d23e985ea0db750ffd98 100644 (file)
@@ -104,11 +104,11 @@ def nextpnr_ecp5_package(package):
 _build_template = [
     "yosys -q -l {build_name}.rpt {build_name}.ys",
     "nextpnr-ecp5 --json {build_name}.json --lpf {build_name}.lpf --textcfg {build_name}.config  \
-    --{architecture} --package {package} --freq {freq_constraint} {timefailarg}",
+    --{architecture} --package {package} {timefailarg}",
     "ecppack {build_name}.config --svf {build_name}.svf --bit {build_name}.bit"
 ]
 
-def _build_script(source, build_template, build_name, architecture, package, freq_constraint, timingstrict):
+def _build_script(source, build_template, build_name, architecture, package, timingstrict):
     if sys.platform in ("win32", "cygwin"):
         script_ext = ".bat"
         script_contents = "@echo off\nrem Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\n\n"
@@ -124,7 +124,6 @@ def _build_script(source, build_template, build_name, architecture, package, fre
             build_name      = build_name,
             architecture    = architecture,
             package         = package,
-            freq_constraint = freq_constraint,
             timefailarg     = "--timing-allow-fail" if not timingstrict else "",
             fail_stmt       = fail_stmt)
 
@@ -163,7 +162,6 @@ class LatticeTrellisToolchain:
     def __init__(self):
         self.yosys_template   = _yosys_template
         self.build_template   = _build_template
-        self.freq_constraints = dict()
 
     def build(self, platform, fragment,
         build_dir      = "build",
@@ -206,11 +204,9 @@ class LatticeTrellisToolchain:
         architecture = nextpnr_ecp5_architectures[(family + "-" + size).lower()]
         package      = nextpnr_ecp5_package(package)
 
-        freq_constraint = str(max(self.freq_constraints.values(), default=0.0))
-
         # Generate build script
         script = _build_script(False, self.build_template, build_name, architecture, package,
-            freq_constraint, timingstrict)
+            timingstrict)
 
         # Run
         if run:
@@ -220,9 +216,6 @@ class LatticeTrellisToolchain:
 
         return v_output.ns
 
-    # Until nextpnr-ecp5 can handle multiple clock domains, use the same
-    # approach as the icestorm and use the fastest clock for timing
-    # constraints.
     def add_period_constraint(self, platform, clk, period):
         platform.add_platform_command("""FREQUENCY PORT "{clk}" {freq} MHz;""".format(
             freq=str(float(1/period)*1000), clk="{clk}"), clk=clk)