build/generic_toolchain/add_period_constraint: Integrated rounding to lowest picosecond and remove add_period_constraint from altera/quartus.

This commit is contained in:
Florent Kermarrec 2022-06-24 10:19:59 +02:00
parent 08a3b0ae4a
commit 6b59eb5cfe
2 changed files with 2 additions and 10 deletions

View File

@ -214,15 +214,6 @@ fi
if subprocess.call(shell + [script]) != 0:
raise OSError("Error occured during Quartus's script execution.")
def add_period_constraint(self, platform, clk, period):
clk.attr.add("keep")
period = math.floor(period*1e3)/1e3 # round to lowest picosecond
if clk in self.clocks:
if period != self.clocks[clk]:
raise ValueError("Clock already constrained to {:.2f}ns, new constraint to {:.2f}ns"
.format(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")

View File

@ -90,8 +90,9 @@ class GenericToolchain:
def add_period_constraint(self, platform, clk, period):
clk.attr.add("keep")
period = math.floor(period*1e3)/1e3 # Round to lowest picosecond.
if clk in self.clocks:
if period != self.clocks[clk]:
raise ValueError("Clock already constrained to {:.2f}ns, new constraint to {:.2f}ns"
.format(self.clocks[clk], period))
self.clocks[clk] = period
self.clocks[clk] = period