simulate.py (9980:cc02ad629b36) simulate.py (9983:2cce74fe359e)
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

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

142def simulate(*args, **kwargs):
143 global need_resume, need_startup
144
145 if need_startup:
146 root = objects.Root.getInstance()
147 for obj in root.descendants(): obj.startup()
148 need_startup = False
149
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

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

142def simulate(*args, **kwargs):
143 global need_resume, need_startup
144
145 if need_startup:
146 root = objects.Root.getInstance()
147 for obj in root.descendants(): obj.startup()
148 need_startup = False
149
150 # Python exit handlers happen in reverse order.
151 # We want to dump stats last.
152 atexit.register(stats.dump)
153
154 # register our C++ exit callback function with Python
155 atexit.register(internal.core.doExitCleanup)
156
150 for root in need_resume:
151 resume(root)
152 need_resume = []
153
154 return internal.event.simulate(*args, **kwargs)
155
156# Export curTick to user script.
157def curTick():
158 return internal.core.curTick()
159
157 for root in need_resume:
158 resume(root)
159 need_resume = []
160
161 return internal.event.simulate(*args, **kwargs)
162
163# Export curTick to user script.
164def curTick():
165 return internal.core.curTick()
166
160# Python exit handlers happen in reverse order. We want to dump stats last.
161atexit.register(stats.dump)
162
163# register our C++ exit callback function with Python
164atexit.register(internal.core.doExitCleanup)
165
166# Drain the system in preparation of a checkpoint or memory mode
167# switch.
168def drain(root):
169 # Try to drain all objects. Draining might not be completed unless
170 # all objects return that they are drained on the first call. This
171 # is because as objects drain they may cause other objects to no
172 # longer be drained.
173 def _drain():

--- 137 unchanged lines hidden ---
167# Drain the system in preparation of a checkpoint or memory mode
168# switch.
169def drain(root):
170 # Try to drain all objects. Draining might not be completed unless
171 # all objects return that they are drained on the first call. This
172 # is because as objects drain they may cause other objects to no
173 # longer be drained.
174 def _drain():

--- 137 unchanged lines hidden ---