From 3e84c66ba98c1ad1654c662d6996c94074aba7c9 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Fri, 6 Mar 2015 14:56:27 -0700 Subject: [PATCH] vivado: permit resources without pins This is required if the LOC is done by another, external constraints set, as in the case of the Zynq Processing System Instance. --- mibuild/xilinx/vivado.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mibuild/xilinx/vivado.py b/mibuild/xilinx/vivado.py index 497471799..418ec2b35 100644 --- a/mibuild/xilinx/vivado.py +++ b/mibuild/xilinx/vivado.py @@ -19,9 +19,11 @@ def _format_constraint(c): return "set_property DRIVE " + str(c.strength) elif isinstance(c, Misc): return "set_property " + c.misc.replace("=", " ") + else: + raise ValueError("unknown constraint %s" % c) -def _format_xdc(signame, pin, others, resname): - fmt_c = [_format_constraint(c) for c in ([Pins(pin)] + others)] +def _format_xdc(signame, resname, *constraints): + fmt_c = [_format_constraint(c) for c in constraints] fmt_r = resname[0] + ":" + str(resname[1]) if resname[2] is not None: fmt_r += "." + resname[2] @@ -35,9 +37,11 @@ def _build_xdc(named_sc, named_pc): for sig, pins, others, resname in named_sc: if len(pins) > 1: for i, p in enumerate(pins): - r += _format_xdc(sig + "[" + str(i) + "]", p, others, resname) + r += _format_xdc(sig + "[" + str(i) + "]", resname, Pins(p), *others) + elif pins: + r += _format_xdc(sig, resname, Pins(pins[0]), *others) else: - r += _format_xdc(sig, pins[0], others, resname) + r += _format_xdc(sig, resname, *others) if named_pc: r += "\n" + "\n\n".join(named_pc) return r