simulate.py (9983:2cce74fe359e) | simulate.py (9993:bdd606534bdc) |
---|---|
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 --- 120 unchanged lines hidden (view full) --- 129 need_resume.append(root) 130 else: 131 for obj in root.descendants(): obj.initState() 132 133 # Check to see if any of the stat events are in the past after resuming from 134 # a checkpoint, If so, this call will shift them to be at a valid time. 135 updateStatEvents() 136 | 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 --- 120 unchanged lines hidden (view full) --- 129 need_resume.append(root) 130 else: 131 for obj in root.descendants(): obj.initState() 132 133 # Check to see if any of the stat events are in the past after resuming from 134 # a checkpoint, If so, this call will shift them to be at a valid time. 135 updateStatEvents() 136 |
137 # Reset to put the stats in a consistent state. 138 stats.reset() 139 | |
140need_resume = [] 141need_startup = True 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 | 137need_resume = [] 138need_startup = True 139def simulate(*args, **kwargs): 140 global need_resume, need_startup 141 142 if need_startup: 143 root = objects.Root.getInstance() 144 for obj in root.descendants(): obj.startup() 145 need_startup = False 146 147 # Python exit handlers happen in reverse order. 148 # We want to dump stats last. 149 atexit.register(stats.dump) 150 151 # register our C++ exit callback function with Python 152 atexit.register(internal.core.doExitCleanup) 153 |
154 # Reset to put the stats in a consistent state. 155 stats.reset() 156 |
|
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(): --- 147 unchanged lines hidden --- | 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(): --- 147 unchanged lines hidden --- |