From: Florent Kermarrec Date: Tue, 31 Dec 2019 09:32:09 +0000 (+0100) Subject: build/xilinx/vivado: update add_period_constraint behavior when clock is already... X-Git-Tag: 24jan2021_ls180~783 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3022f02b3fb473618ff057d10133f10bf875f009;p=litex.git build/xilinx/vivado: update add_period_constraint behavior when clock is already constrainted. --- diff --git a/litex/build/xilinx/vivado.py b/litex/build/xilinx/vivado.py index 01e1aca5..ef722d4d 100644 --- a/litex/build/xilinx/vivado.py +++ b/litex/build/xilinx/vivado.py @@ -311,9 +311,11 @@ class XilinxVivadoToolchain: def add_period_constraint(self, platform, clk, period): clk.attr.add("keep") - if clk in self.clocks: - raise ValueError("A period constraint already exists") 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):