simulate.py (10023:91faf6649de0) simulate.py (10436:bdb307e8be54)
1# Copyright (c) 2012 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 170 unchanged lines hidden (view full) ---

179 # longer be drained.
180 def _drain():
181 all_drained = False
182 dm = internal.drain.createDrainManager()
183 unready_objs = sum(obj.drain(dm) for obj in root.descendants())
184 # If we've got some objects that can't drain immediately, then simulate
185 if unready_objs > 0:
186 dm.setCount(unready_objs)
1# Copyright (c) 2012 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 170 unchanged lines hidden (view full) ---

179 # longer be drained.
180 def _drain():
181 all_drained = False
182 dm = internal.drain.createDrainManager()
183 unready_objs = sum(obj.drain(dm) for obj in root.descendants())
184 # If we've got some objects that can't drain immediately, then simulate
185 if unready_objs > 0:
186 dm.setCount(unready_objs)
187 simulate()
187 #WARNING: if a valid exit event occurs while draining, it will not
188 # get returned to the user script
189 exit_event = simulate()
190 while exit_event.getCause() != 'Finished drain':
191 exit_event = simulate()
188 else:
189 all_drained = True
190 internal.drain.cleanupDrainManager(dm)
191 return all_drained
192
193 all_drained = _drain()
194 while (not all_drained):
195 all_drained = _drain()

--- 122 unchanged lines hidden ---
192 else:
193 all_drained = True
194 internal.drain.cleanupDrainManager(dm)
195 return all_drained
196
197 all_drained = _drain()
198 while (not all_drained):
199 all_drained = _drain()

--- 122 unchanged lines hidden ---