From 22e6f5ac1da45756911f12fba413680f1ff920f2 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 6 Dec 2019 12:57:59 +0100 Subject: [PATCH] build/lattice/trellis: nextpnr now handle LPF timing constraints and multiple clock domains, freq_constraint is no longer needed. --- litex/build/lattice/trellis.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/litex/build/lattice/trellis.py b/litex/build/lattice/trellis.py index a02e49a9..472aa4a5 100644 --- a/litex/build/lattice/trellis.py +++ b/litex/build/lattice/trellis.py @@ -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) -- 2.30.2