build/lattice/icestorm: add timingstrict parameter and default to False. (similar...
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 9 Mar 2020 18:02:23 +0000 (19:02 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 9 Mar 2020 18:02:23 +0000 (19:02 +0100)
litex/build/lattice/icestorm.py

index 3555a1398fd530b1d2b3d73d0302c25125456b74..a084a9980080d235782779e99f59336760e04bc8 100644 (file)
@@ -90,11 +90,11 @@ def parse_device(device):
 _build_template = [
     "yosys -l {build_name}.rpt {build_name}.ys",
     "nextpnr-ice40 --json {build_name}.json --pcf {build_name}.pcf --asc {build_name}.txt \
-    --pre-pack {build_name}_pre_pack.py --{architecture} --package {package}",
+    --pre-pack {build_name}_pre_pack.py --{architecture} --package {package} {timefailarg}",
     "icepack -s {build_name}.txt {build_name}.bin"
 ]
 
-def _build_script(build_template, build_name, architecture, package):
+def _build_script(build_template, build_name, architecture, package, timingstrict):
     if sys.platform in ("win32", "cygwin"):
         script_ext = ".bat"
         build_script_contents = "@echo off\nrem Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\n\n"
@@ -110,6 +110,7 @@ def _build_script(build_template, build_name, architecture, package):
             build_name   = build_name,
             architecture = architecture,
             package      = package,
+            timefailarg  = "--timing-allow-fail" if not timingstrict else "",
             fail_stmt    = fail_stmt)
 
     build_script_file = "build_" + build_name + script_ext
@@ -153,6 +154,7 @@ class LatticeIceStormToolchain:
         build_name     = "top",
         synth_opts     = "",
         run            = True,
+        timingstrict   = False,
         **kwargs):
 
         # Create build directory
@@ -185,7 +187,7 @@ class LatticeIceStormToolchain:
         (family, architecture, package) = parse_device(platform.device)
 
         # Generate build script
-        script = _build_script(self.build_template, build_name, architecture, package)
+        script = _build_script(self.build_template, build_name, architecture, package, timingstrict)
 
         # Run
         if run: