From 3022f02b3fb473618ff057d10133f10bf875f009 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 31 Dec 2019 10:32:09 +0100 Subject: [PATCH] build/xilinx/vivado: update add_period_constraint behavior when clock is already constrainted. --- litex/build/xilinx/vivado.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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): -- 2.30.2