generic_platform: fix request

This commit is contained in:
Sebastien Bourdeauducq 2013-02-11 17:54:01 +01:00
parent ce6701c6e4
commit 709845e618
1 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ def _lookup(description, name, number):
for resource in description: for resource in description:
if resource[0] == name and (number is None or resource[1] == number): if resource[0] == name and (number is None or resource[1] == number):
return resource return resource
raise ConstraintError("Resource not found") raise ConstraintError("Resource not found: " + name + "." + str(number))
def _resource_type(resource, name_map): def _resource_type(resource, name_map):
t = None t = None
@ -107,8 +107,8 @@ class ConstraintManager:
if isinstance(t, int): if isinstance(t, int):
assert(isinstance(obj, Signal) and obj.nbits == t) assert(isinstance(obj, Signal) and obj.nbits == t)
else: else:
for name, nbits in t: for attr, nbits in t:
sig = getattr(obj, name) sig = getattr(obj, attr)
assert(isinstance(sig, Signal) and sig.nbits == nbits) assert(isinstance(sig, Signal) and sig.nbits == nbits)
# Register the request # Register the request