diff options
author | Andreas Sandberg <Andreas.Sandberg@arm.com> | 2012-11-02 11:32:01 -0500 |
---|---|---|
committer | Andreas Sandberg <Andreas.Sandberg@arm.com> | 2012-11-02 11:32:01 -0500 |
commit | b81a977e6ab7dbfd122cb778cfe3d40ca7451198 (patch) | |
tree | 09804c27367de8cf93623ec4644bf47abf316bf9 /src/python/m5/simulate.py | |
parent | eb703a4b4e167e4d45f92203a1e0849f19cdba6d (diff) | |
download | gem5-b81a977e6ab7dbfd122cb778cfe3d40ca7451198.tar.xz |
sim: Move the draining interface into a separate base class
This patch moves the draining interface from SimObject to a separate
class that can be used by any object needing draining. However,
objects not visible to the Python code (i.e., objects not deriving
from SimObject) still depend on their parents informing them when to
drain. This patch also gets rid of the CountedDrainEvent (which isn't
really an event) and replaces it with a DrainManager.
Diffstat (limited to 'src/python/m5/simulate.py')
-rw-r--r-- | src/python/m5/simulate.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/python/m5/simulate.py b/src/python/m5/simulate.py index 89b6b1e9d..df30f654a 100644 --- a/src/python/m5/simulate.py +++ b/src/python/m5/simulate.py @@ -169,19 +169,19 @@ def doDrain(root): # be drained. def drain(root): all_drained = False - drain_event = internal.event.createCountedDrain() - unready_objs = sum(obj.drain(drain_event) for obj in root.descendants()) + dm = internal.drain.createDrainManager() + unready_objs = sum(obj.drain(dm) for obj in root.descendants()) # If we've got some objects that can't drain immediately, then simulate if unready_objs > 0: - drain_event.setCount(unready_objs) + dm.setCount(unready_objs) simulate() else: all_drained = True - internal.event.cleanupCountedDrain(drain_event) + internal.drain.cleanupDrainManager(dm) return all_drained def resume(root): - for obj in root.descendants(): obj.resume() + for obj in root.descendants(): obj.drainResume() def checkpoint(dir): root = objects.Root.getInstance() |