diff --git a/litex/build/generic_toolchain.py b/litex/build/generic_toolchain.py index f7b832ad8..987268744 100644 --- a/litex/build/generic_toolchain.py +++ b/litex/build/generic_toolchain.py @@ -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]: diff --git a/litex/build/xilinx/platform.py b/litex/build/xilinx/platform.py index 14f6092bb..b3bfb1029 100644 --- a/litex/build/xilinx/platform.py +++ b/litex/build/xilinx/platform.py @@ -72,11 +72,11 @@ class XilinxPlatform(GenericPlatform): def 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 hasattr(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): if hasattr(from_, "p"): diff --git a/litex/build/xilinx/vivado.py b/litex/build/xilinx/vivado.py index 8535d2948..21400e7b4 100644 --- a/litex/build/xilinx/vivado.py +++ b/litex/build/xilinx/vivado.py @@ -384,7 +384,6 @@ class XilinxVivadoToolchain(GenericToolchain): if tools.subprocess_call_filtered(shell + [script], common.colors) != 0: raise OSError("Error occured during Vivado's script execution.") - def vivado_build_args(parser): toolchain_group = parser.add_argument_group(title="Toolchain options") toolchain_group.add_argument("--synth-mode", default="vivado", help="Synthesis mode (vivado or yosys).")