def wait_for_simulation_stop(self, timeout=None):
start = datetime.now()<EOL>while self.get_is_sim_running():<EOL><INDENT>sleep(<NUM_LIT:0.5>)<EOL>if timeout is not None:<EOL><INDENT>if (datetime.now() - start).seconds >= timeout:<EOL><INDENT>ret = None<EOL>break<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>ret = self.simulation_info()<EOL><DEDENT>return ret<EOL>
Block until the simulation is done or timeout seconds exceeded.

        If the simulation stops before timeout, siminfo is returned.