Make keep attribute for add_period_constraint optional. Vivado 2019 barfs upon IDELAYCTRL automatically replicated and it's refclk set to dont_touch.

This commit is contained in:
Vamsi Vytla 2022-11-03 21:26:28 -07:00
parent eb2e9a371d
commit b107d4a6fe
3 changed files with 5 additions and 5 deletions

View File

@ -157,8 +157,9 @@ class GenericToolchain:
return v_output.ns return v_output.ns
def add_period_constraint(self, platform, clk, period): def add_period_constraint(self, platform, clk, period, keep=True):
clk.attr.add("keep") if keep:
clk.attr.add("keep")
period = math.floor(period*1e3)/1e3 # Round to lowest picosecond. 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]:

View File

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

View File

@ -384,7 +384,6 @@ class XilinxVivadoToolchain(GenericToolchain):
if tools.subprocess_call_filtered(shell + [script], common.colors) != 0: if tools.subprocess_call_filtered(shell + [script], common.colors) != 0:
raise OSError("Error occured during Vivado's script execution.") raise OSError("Error occured during Vivado's script execution.")
def vivado_build_args(parser): def vivado_build_args(parser):
toolchain_group = parser.add_argument_group(title="Toolchain options") toolchain_group = parser.add_argument_group(title="Toolchain options")
toolchain_group.add_argument("--synth-mode", default="vivado", help="Synthesis mode (vivado or yosys).") toolchain_group.add_argument("--synth-mode", default="vivado", help="Synthesis mode (vivado or yosys).")