bus/wishbone: allow specifying existing interface
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Sat, 17 Nov 2012 18:42:06 +0000 (19:42 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Sat, 17 Nov 2012 18:42:06 +0000 (19:42 +0100)
migen/bus/wishbone.py

index 0b60f9ea926ebd1225129980e383ffde2748c2d6..e55da5de142dd7ad60e66fd656890c38c0733bf8 100644 (file)
@@ -147,9 +147,9 @@ class Tap(PureSimulable):
                        self.handler(transaction)
 
 class Initiator(PureSimulable):
-       def __init__(self, generator):
+       def __init__(self, generator, bus=Interface()):
                self.generator = generator
-               self.bus = Interface()
+               self.bus = bus
                self.transaction_start = 0
                self.transaction = None
                self.done = False
@@ -192,8 +192,8 @@ class TargetModel:
                return True
 
 class Target(PureSimulable):
-       def __init__(self, model):
-               self.bus = Interface()
+       def __init__(self, model, bus=Interface()):
+               self.bus = bus
                self.model = model
        
        def do_simulation(self, s):