From: Florent Kermarrec Date: Mon, 8 Jan 2018 16:03:19 +0000 (+0100) Subject: build/xilinx/vivado: only generate constraints that are not empty X-Git-Tag: 24jan2021_ls180~1768 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=10000eb607c3a44214a387a1c9b3af51d9f59f40;p=litex.git build/xilinx/vivado: only generate constraints that are not empty --- diff --git a/litex/build/xilinx/vivado.py b/litex/build/xilinx/vivado.py index 4b9fedfa..ea5eb011 100644 --- a/litex/build/xilinx/vivado.py +++ b/litex/build/xilinx/vivado.py @@ -21,7 +21,7 @@ def _format_constraint(c): elif isinstance(c, Misc): return "set_property " + c.misc.replace("=", " ") elif isinstance(c, Inverted): - return "" + return None else: raise ValueError("unknown constraint {}".format(c)) @@ -33,7 +33,8 @@ def _format_xdc(signame, resname, *constraints): fmt_r += "." + resname[2] r = " ## {}\n".format(fmt_r) for c in fmt_c: - r += c + " [get_ports " + signame + "]\n" + if c is not None: + r += c + " [get_ports " + signame + "]\n" return r