build/generic_toolchain: Make adding keep attribute to clk signals optionals in add_period_constraint/add_false_path_constraint.
Keep it enabled by default.
This commit is contained in:
parent
1a66f4a6ad
commit
62e869296f
|
@ -157,8 +157,9 @@ class GenericToolchain:
|
|||
|
||||
return v_output.ns
|
||||
|
||||
def add_period_constraint(self, platform, clk, period):
|
||||
clk.attr.add("keep")
|
||||
def add_period_constraint(self, platform, clk, period, keep=True):
|
||||
if keep:
|
||||
clk.attr.add("keep")
|
||||
period = math.floor(period*1e3)/1e3 # Round to lowest picosecond.
|
||||
if clk in self.clocks:
|
||||
if period != self.clocks[clk]:
|
||||
|
@ -166,8 +167,9 @@ class GenericToolchain:
|
|||
.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")
|
||||
def add_false_path_constraint(self, platform, from_, to, keep=True):
|
||||
if keep:
|
||||
from_.attr.add("keep")
|
||||
to.attr.add("keep")
|
||||
if (to, from_) not in self.false_paths:
|
||||
self.false_paths.add((from_, to))
|
||||
|
|
Loading…
Reference in New Issue