actorlib/sim: drive busy high until generator is finished
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Wed, 5 Dec 2012 15:40:12 +0000 (16:40 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Wed, 5 Dec 2012 15:40:12 +0000 (16:40 +0100)
migen/actorlib/sim.py

index 00848e3f609c5c97c9c0fdb945839fa5c6e84857..e6885225eb7426c0629c8a9e29c33d912f3378ff 100644 (file)
@@ -73,8 +73,11 @@ class SimActor(Actor):
                super().__init__(*endpoint_descriptions, **misc)
                self.token_exchanger = TokenExchanger(generator, self)
        
+       def update_busy(self, s):
+               s.wr(self.busy, not self.token_exchanger.done)
+       
        def get_fragment(self):
-               return self.token_exchanger.get_fragment()
+               return self.token_exchanger.get_fragment() + Fragment(sim=[self.update_busy])
 
 class Dumper(SimActor):
        def __init__(self, layout, prefix=""):