instances: signal override

This commit is contained in:
Sebastien Bourdeauducq 2011-12-08 18:56:14 +01:00
parent c43f3da534
commit ed05ec5f6a
1 changed files with 9 additions and 2 deletions

View File

@ -157,8 +157,15 @@ class Instance:
self.name = name self.name = name
else: else:
self.name = of self.name = of
self.outs = dict([(x[0], Signal(x[1], self.name + "_" + x[0])) for x in outs]) def process_io(x):
self.ins = dict([(x[0], Signal(x[1], self.name + "_" + x[0])) for x in ins]) if isinstance(x[1], Signal):
return x # override
elif isinstance(x[1], BV):
return (x[0], Signal(x[1], self.name + "_" + x[0]))
else:
raise TypeError
self.outs = dict(map(process_io, outs))
self.ins = dict(map(process_io, ins))
self.parameters = parameters self.parameters = parameters
self.clkport = clkport self.clkport = clkport
self.rstport = rstport self.rstport = rstport