build/generic_toolchain: Add add_false_path_constraint and remove it from altera/quartus, lattice/trellis.

This commit is contained in:
Florent Kermarrec 2022-06-24 10:24:01 +02:00
parent 6b59eb5cfe
commit 4c978bf463
3 changed files with 8 additions and 13 deletions

View File

@ -213,9 +213,3 @@ fi
if subprocess.call(shell + [script]) != 0: if subprocess.call(shell + [script]) != 0:
raise OSError("Error occured during Quartus's script execution.") raise OSError("Error occured during Quartus's script execution.")
def add_false_path_constraint(self, platform, from_, to):
from_.attr.add("keep")
to.attr.add("keep")
if (to, from_) not in self.false_paths:
self.false_paths.add((from_, to))

View File

@ -6,6 +6,7 @@
# SPDX-License-Identifier: BSD-2-Clause # SPDX-License-Identifier: BSD-2-Clause
import os import os
import math
from migen.fhdl.structure import _Fragment from migen.fhdl.structure import _Fragment
@ -96,3 +97,9 @@ class GenericToolchain:
raise ValueError("Clock already constrained to {:.2f}ns, new constraint to {:.2f}ns" raise ValueError("Clock already constrained to {:.2f}ns, new constraint to {:.2f}ns"
.format(self.clocks[clk], period)) .format(self.clocks[clk], period))
self.clocks[clk] = period self.clocks[clk] = period
def add_false_path_constraint(self, platform, from_, to):
from_.attr.add("keep")
to.attr.add("keep")
if (to, from_) not in self.false_paths:
self.false_paths.add((from_, to))

View File

@ -220,12 +220,6 @@ class LatticeTrellisToolchain(GenericToolchain):
platform.add_platform_command("""FREQUENCY PORT "{clk}" {freq} MHz;""".format( platform.add_platform_command("""FREQUENCY PORT "{clk}" {freq} MHz;""".format(
freq=str(float(1/period)*1000), clk="{clk}"), clk=clk) freq=str(float(1/period)*1000), clk="{clk}"), clk=clk)
def add_false_path_constraint(self, platform, from_, to):
from_.attr.add("keep")
to.attr.add("keep")
if (to, from_) not in self.false_paths:
self.false_paths.add((from_, to))
def trellis_args(parser): def trellis_args(parser):
toolchain_group = parser.add_argument_group(title="Toolchain options") toolchain_group = parser.add_argument_group(title="Toolchain options")
toolchain_group.add_argument("--yosys-nowidelut", action="store_true", help="Use Yosys's nowidelut mode.") toolchain_group.add_argument("--yosys-nowidelut", action="store_true", help="Use Yosys's nowidelut mode.")