build/add_period_constraint: Simplify by using new integrated cases in generic add_period_constraint.

This commit is contained in:
Florent Kermarrec 2023-05-17 16:45:45 +02:00
parent 53a0bc92e4
commit fb0c9e846d
9 changed files with 0 additions and 28 deletions

View file

@ -45,9 +45,6 @@ class AlteraPlatform(GenericPlatform):
return self.toolchain.build(self, *args, **kwargs)
def add_period_constraint(self, clk, period):
if clk is None: return
if hasattr(clk, "p"):
clk = clk.p
self.toolchain.add_period_constraint(self, clk, period, keep=False)
def add_false_path_constraint(self, from_, to):

View file

@ -204,12 +204,3 @@ class TangDinastyToolchain(GenericToolchain):
(architecture, family, package) = devices[device]
return (architecture, family, package)
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

View file

@ -36,5 +36,4 @@ class AnlogicPlatform(GenericPlatform):
return self.toolchain.build(self, *args, **kwargs)
def add_period_constraint(self, clk, period):
if clk is None: return
self.toolchain.add_period_constraint(self, clk, period)

View file

@ -63,9 +63,6 @@ class EfinixPlatform(GenericPlatform):
return self.toolchain.build(self, *args, **kwargs)
def add_period_constraint(self, clk, period):
if clk is None: return
if hasattr(clk, "p"):
clk = clk.p
self.toolchain.add_period_constraint(self, clk, period)
def add_false_path_constraint(self, from_, to):

View file

@ -43,5 +43,4 @@ class GowinPlatform(GenericPlatform):
return self.toolchain.build(self, *args, **kwargs)
def add_period_constraint(self, clk, period):
if clk is None: return
self.toolchain.add_period_constraint(self, clk, period)

View file

@ -48,9 +48,6 @@ class LatticePlatform(GenericPlatform):
return self.toolchain.build(self, *args, **kwargs)
def add_period_constraint(self, clk, period):
if clk is None: return
if hasattr(clk, "p"):
clk = clk.p
self.toolchain.add_period_constraint(self, clk, period)
def add_false_path_constraint(self, from_, to):

View file

@ -34,10 +34,6 @@ class MicrosemiPlatform(GenericPlatform):
return self.toolchain.build(self, *args, **kwargs)
def add_period_constraint(self, clk, period):
if clk is None: return
clk.attr.add("keep")
if hasattr(clk, "p"):
clk = clk.p
self.toolchain.add_period_constraint(self, clk, period)
def add_false_path_constraint(self, from_, to):

View file

@ -36,7 +36,6 @@ class OSFPGAPlatform(GenericPlatform):
return self.toolchain.build(self, *args, **kwargs)
def add_period_constraint(self, clk, period):
if clk is None: return
self.toolchain.add_period_constraint(self, clk, period)
def add_false_path_constraint(self, from_, to):

View file

@ -85,9 +85,6 @@ class XilinxPlatform(GenericPlatform):
return self.toolchain.build(self, *args, **kwargs)
def add_period_constraint(self, clk, period, keep=True):
if clk is None: return
if hasattr(clk, "p"):
clk = clk.p
self.toolchain.add_period_constraint(self, clk, period, keep=keep)
def add_false_path_constraint(self, from_, to):