Deleted Added
sdiff udiff text old ( 2839:d5dd8a3cdea0 ) new ( 2860:843426871cbc )
full compact
1# Copyright (c) 2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

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

208# register our C++ exit callback function with Python
209atexit.register(cc_main.doExitCleanup)
210
211# This import allows user scripts to reference 'm5.objects.Foo' after
212# just doing an 'import m5' (without an 'import m5.objects'). May not
213# matter since most scripts will probably 'from m5.objects import *'.
214import objects
215
216def doDrain(root):
217 drain_event = cc_main.createCountedDrain()
218 unready_objects = root.startDrain(drain_event, True)
219 # If we've got some objects that can't drain immediately, then simulate
220 if unready_objects > 0:
221 drain_event.setCount(unready_objects)
222 simulate()
223 cc_main.cleanupCountedDrain(drain_event)
224
225def resume(root):
226 root.resume()
227
228def checkpoint(root):
229 if not isinstance(root, objects.Root):
230 raise TypeError, "Object is not a root object. Checkpoint must be called on a root object."
231 doDrain(root)

--- 61 unchanged lines hidden ---