actorlib/sim: swap TokenExchanger parameters
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Sat, 17 Nov 2012 18:46:28 +0000 (19:46 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Sat, 17 Nov 2012 18:46:28 +0000 (19:46 +0100)
migen/actorlib/sim.py

index 1d9387550aa7f6567569f69560f3b8b8f0febaa9..f63e15b4915e691714d06a1b992242e4a49842fc 100644 (file)
@@ -14,9 +14,9 @@ class Token:
 # NB: the possibility to push several tokens at once is important to interact
 # with actors that only accept a group of tokens when all of them are available.
 class TokenExchanger(PureSimulable):
-       def __init__(self, actor, generator):
-               self.actor = actor
+       def __init__(self, generator, actor):
                self.generator = generator
+               self.actor = actor
                self.active = set()
                self.done = False
 
@@ -71,7 +71,7 @@ class TokenExchanger(PureSimulable):
 class SimActor(Actor):
        def __init__(self, generator, *endpoint_descriptions, **misc):
                super().__init__(*endpoint_descriptions, **misc)
-               self.token_exchanger = TokenExchanger(self, generator)
+               self.token_exchanger = TokenExchanger(generator, self)
        
        def get_fragment(self):
                return self.token_exchanger.get_fragment()