build/xilinx/vivado: only generate constraints that are not empty

This commit is contained in:
Florent Kermarrec 2018-01-08 17:03:19 +01:00
parent 5681a3c1a9
commit 10000eb607
1 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,7 @@ def _format_constraint(c):
elif isinstance(c, Misc): elif isinstance(c, Misc):
return "set_property " + c.misc.replace("=", " ") return "set_property " + c.misc.replace("=", " ")
elif isinstance(c, Inverted): elif isinstance(c, Inverted):
return "" return None
else: else:
raise ValueError("unknown constraint {}".format(c)) raise ValueError("unknown constraint {}".format(c))
@ -33,6 +33,7 @@ def _format_xdc(signame, resname, *constraints):
fmt_r += "." + resname[2] fmt_r += "." + resname[2]
r = " ## {}\n".format(fmt_r) r = " ## {}\n".format(fmt_r)
for c in fmt_c: for c in fmt_c:
if c is not None:
r += c + " [get_ports " + signame + "]\n" r += c + " [get_ports " + signame + "]\n"
return r return r