Support for platform info
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 26 Mar 2013 18:17:35 +0000 (19:17 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 26 Mar 2013 18:17:35 +0000 (19:17 +0100)
mibuild/generic_platform.py
mibuild/xilinx_ise.py

index e34360450f1503dba0783d1ee8487a136a03aaf3..3ff2f02e76febd7aa44f4a64c1e69034e43430ce 100644 (file)
@@ -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
index 7d194c53f89a81acafa03f868a723133ef2396cc..cddbbb81e4fbf21610b19202454e228f6bfb2a1b 100644 (file)
@@ -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]