build/xilinx/vivado: round period constraints to lowest picosecond

Vivado will do the opposite if we don't do it, with this change we ensure the applied period constraints will always be >= to the requested constraint.
This commit is contained in:
Florent Kermarrec 2019-04-15 10:51:17 +02:00
parent 66a74b1579
commit 538ca59ab6
1 changed files with 2 additions and 0 deletions

View File

@ -4,6 +4,7 @@
import os import os
import subprocess import subprocess
import sys import sys
import math
from migen.fhdl.structure import _Fragment from migen.fhdl.structure import _Fragment
@ -250,6 +251,7 @@ class XilinxVivadoToolchain:
def add_period_constraint(self, platform, clk, period): def add_period_constraint(self, platform, clk, period):
if clk in self.clocks: if clk in self.clocks:
raise ValueError("A period constraint already exists") raise ValueError("A period constraint already exists")
period = math.floor(period*1e3)/1e3 # round to lowest picosecond
self.clocks[clk] = period self.clocks[clk] = period
def add_false_path_constraint(self, platform, from_, to): def add_false_path_constraint(self, platform, from_, to):