fhdl/structure: do not create Signal in Instance when parameter is int
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 6 Dec 2012 19:56:46 +0000 (20:56 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 6 Dec 2012 19:56:46 +0000 (20:56 +0100)
migen/fhdl/structure.py

index 250c57ae42db1a146bcc60bb15f284bd8ce4875d..1b2d38c5ab83892a9392ff586189ef0fcac9d33f 100644 (file)
@@ -242,12 +242,11 @@ class Instance(HUID):
                self.items = items
        
        class _IO:
-               def __init__(self, name, expr=1):
+               def __init__(self, name, expr=None):
                        self.name = name
-                       if isinstance(expr, (int, tuple)):
-                               self.expr = Signal(expr, name)
-                       else:
-                               self.expr = expr
+                       if expr is None:
+                               expr = Signal()
+                       self.expr = expr
        class Input(_IO):
                pass    
        class Output(_IO):