g.add_connection(self.source, self.sink)
self.submodules.comp = CompositeActor(g)
+ def do_simulation(self, selfp):
+ if self.source.token_exchanger.done:
+ raise StopSimulation
+
if __name__ == "__main__":
run_simulation(TB())
self.actor = actor
self.active = set()
self.busy = True
+ self.done = False
def _process_transactions(self, selfp):
completed = set()
transactions = next(self.generator)
except StopIteration:
self.busy = False
+ self.done = True
raise StopSimulation
if isinstance(transactions, Token):
self.active = {transactions}
if not self.active:
self._next_transactions()
self._update_control_signals(selfp)
+ do_simulation.passive = True
class SimActor(Module):
def __init__(self, generator):
def do_simulation(self, selfp):
selfp.busy = self.token_exchanger.busy
+ do_simulation.passive = True
def _dumper_gen(prefix):
while True: