From 3b19dfc412137393f1f3d3d5907f3aca05c21bd8 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 26 Mar 2013 19:17:35 +0100 Subject: [PATCH] Support for platform info --- mibuild/generic_platform.py | 8 ++++++++ mibuild/xilinx_ise.py | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mibuild/generic_platform.py b/mibuild/generic_platform.py index e3436045..3ff2f02e 100644 --- a/mibuild/generic_platform.py +++ b/mibuild/generic_platform.py @@ -31,6 +31,10 @@ class Subsignal: self.name = name self.constraints = list(constraints) +class PlatformInfo: + def __init__(self, info): + self.info = info + def _lookup(description, name, number): for resource in description: if resource[0] == name and (number is None or resource[1] == number): @@ -79,6 +83,10 @@ class ConstraintManager: obj = Signal(rt, name_override=resource[0]) else: obj = Record(rt, name=resource[0]) + for element in resource[2:]: + if isinstance(element, PlatformInfo): + obj.platform_info = element.info + break self.available.remove(resource) self.matched.append((resource, obj)) return obj diff --git a/mibuild/xilinx_ise.py b/mibuild/xilinx_ise.py index 7d194c53..cddbbb81 100644 --- a/mibuild/xilinx_ise.py +++ b/mibuild/xilinx_ise.py @@ -46,7 +46,11 @@ def _format_constraint(c): return c.misc def _format_ucf(signame, pin, others, resname): - fmt_c = [_format_constraint(c) for c in ([Pins(pin)] + others)] + fmt_c = [] + for c in [Pins(pin)] + others: + fc = _format_constraint(c) + if fc is not None: + fmt_c.append(fc) fmt_r = resname[0] + ":" + str(resname[1]) if resname[2] is not None: fmt_r += "." + resname[2] -- 2.30.2