Permalink
Browse files

instances: signal override

  • Loading branch information...
1 parent c43f3da commit ed05ec5f6a2be6eeb332e9040b0a2124a8348e52 @sbourdeauducq sbourdeauducq committed Dec 8, 2011
Showing with 9 additions and 2 deletions.
  1. +9 −2 migen/fhdl/structure.py
@@ -157,8 +157,15 @@ def __init__(self, of, outs=[], ins=[], parameters=[], clkport="", rstport="", n
self.name = name
else:
self.name = of
- self.outs = dict([(x[0], Signal(x[1], self.name + "_" + x[0])) for x in outs])
- self.ins = dict([(x[0], Signal(x[1], self.name + "_" + x[0])) for x in ins])
+ def process_io(x):
+ 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.clkport = clkport
self.rstport = rstport

0 comments on commit ed05ec5

Please sign in to comment.