build/generic_toolchain/add_period_constraint: Integrated rounding to lowest picosecond and remove add_period_constraint from altera/quartus.
This commit is contained in:
parent
08a3b0ae4a
commit
6b59eb5cfe
|
@ -214,15 +214,6 @@ 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_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):
|
def add_false_path_constraint(self, platform, from_, to):
|
||||||
from_.attr.add("keep")
|
from_.attr.add("keep")
|
||||||
to.attr.add("keep")
|
to.attr.add("keep")
|
||||||
|
|
|
@ -90,8 +90,9 @@ class GenericToolchain:
|
||||||
|
|
||||||
def add_period_constraint(self, platform, clk, period):
|
def add_period_constraint(self, platform, clk, period):
|
||||||
clk.attr.add("keep")
|
clk.attr.add("keep")
|
||||||
|
period = math.floor(period*1e3)/1e3 # Round to lowest picosecond.
|
||||||
if clk in self.clocks:
|
if clk in self.clocks:
|
||||||
if period != self.clocks[clk]:
|
if period != self.clocks[clk]:
|
||||||
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
|
Loading…
Reference in New Issue