build/microsemi/libero_soc: update add_period_constraint behavior when clock is alrea...
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 31 Dec 2019 09:33:12 +0000 (10:33 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 31 Dec 2019 09:33:12 +0000 (10:33 +0100)
litex/build/microsemi/libero_soc.py

index 7ca51db381831798171f5e27e166e3fbe9a7df37..8110034d2da91aac367dbb006fcf239a9a7fc848 100644 (file)
@@ -288,7 +288,9 @@ class MicrosemiLiberoSoCPolarfireToolchain:
 
     def add_period_constraint(self, platform, clk, period):
         if clk in self.clocks:
-            raise ValueError("A period constraint already exists")
+            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):