Support for platform info

This commit is contained in:
Sebastien Bourdeauducq 2013-03-26 19:17:35 +01:00
parent 74cc4d22cd
commit 3b19dfc412
2 changed files with 13 additions and 1 deletions

View 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

View 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]