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 --- 178 unchanged lines hidden (view full) --- 187 root = objects.Root.getInstance() 188 if not isinstance(root, objects.Root): 189 raise TypeError, "Checkpoint must be called on a root object." 190 doDrain(root) 191 print "Writing checkpoint" 192 internal.core.serializeAll(dir) 193 resume(root) 194 |
195def changeMemoryMode(system, mode): |
196 if not isinstance(system, (objects.Root, objects.System)): 197 raise TypeError, "Parameter of type '%s'. Must be type %s or %s." % \ 198 (type(system), objects.Root, objects.System) |
199 if system.getMemoryMode() != mode: |
200 doDrain(system) |
201 system.setMemoryMode(mode) 202 else: 203 print "System already in target mode. Memory mode unchanged." |
204 |
205def changeToAtomic(system, **kwargs): 206 print "Changing memory mode to atomic" 207 changeMemoryMode(system, objects.params.atomic, **kwargs) |
208 |
209def changeToTiming(system, **kwargs): 210 print "Changing memory mode to timing" 211 changeMemoryMode(system, objects.params.timing, **kwargs) |
212 213def switchCpus(cpuList): 214 print "switching cpus" 215 if not isinstance(cpuList, list): 216 raise RuntimeError, "Must pass a list to this function" 217 for item in cpuList: 218 if not isinstance(item, tuple) or len(item) != 2: 219 raise RuntimeError, "List must have tuples of (oldCPU,newCPU)" --- 15 unchanged lines hidden --- |