From: Florent Kermarrec Date: Thu, 9 Jan 2020 18:45:51 +0000 (+0100) Subject: build/altera/quartus: allow multiple call of add_period_constraint if constraint... X-Git-Tag: 24jan2021_ls180~766 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aba8fc5c9457e0bb972075187c9fb157e8d3c325;p=litex.git build/altera/quartus: allow multiple call of add_period_constraint if constraint is similar. Similar to the changes already applied to Xilinx backend. --- diff --git a/litex/build/altera/quartus.py b/litex/build/altera/quartus.py index e8d01c90..b71dfd73 100644 --- a/litex/build/altera/quartus.py +++ b/litex/build/altera/quartus.py @@ -226,9 +226,11 @@ class AlteraQuartusToolchain: 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: - raise ValueError("A period constraint already exists") - period = math.floor(period*1e3)/1e3 # Round to lowest picosecond + 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):