__init__.py (4174:fd48d7929d5c) __init__.py (4553:fac59b75a87d)
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

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

185 print "Restoring from checkpoint"
186 internal.sim_object.unserializeAll(dir)
187 need_resume.append(root)
188
189def changeToAtomic(system):
190 if not isinstance(system, (objects.Root, objects.System)):
191 raise TypeError, "Parameter of type '%s'. Must be type %s or %s." % \
192 (type(system), objects.Root, objects.System)
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

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

185 print "Restoring from checkpoint"
186 internal.sim_object.unserializeAll(dir)
187 need_resume.append(root)
188
189def changeToAtomic(system):
190 if not isinstance(system, (objects.Root, objects.System)):
191 raise TypeError, "Parameter of type '%s'. Must be type %s or %s." % \
192 (type(system), objects.Root, objects.System)
193 doDrain(system)
194 print "Changing memory mode to atomic"
195 system.changeTiming(internal.sim_object.SimObject.Atomic)
193 if system.getMemoryMode() != internal.sim_object.SimObject.Atomic:
194 doDrain(system)
195 print "Changing memory mode to atomic"
196 system.changeTiming(internal.sim_object.SimObject.Atomic)
196
197def changeToTiming(system):
198 if not isinstance(system, (objects.Root, objects.System)):
199 raise TypeError, "Parameter of type '%s'. Must be type %s or %s." % \
200 (type(system), objects.Root, objects.System)
197
198def changeToTiming(system):
199 if not isinstance(system, (objects.Root, objects.System)):
200 raise TypeError, "Parameter of type '%s'. Must be type %s or %s." % \
201 (type(system), objects.Root, objects.System)
201 doDrain(system)
202 print "Changing memory mode to timing"
203 system.changeTiming(internal.sim_object.SimObject.Timing)
204
202
203 if system.getMemoryMode() != internal.sim_object.SimObject.Timing:
204 doDrain(system)
205 print "Changing memory mode to timing"
206 system.changeTiming(internal.sim_object.SimObject.Timing)
207
205def switchCpus(cpuList):
206 print "switching cpus"
207 if not isinstance(cpuList, list):
208 raise RuntimeError, "Must pass a list to this function"
209 for i in cpuList:
210 if not isinstance(i, tuple):
211 raise RuntimeError, "List must have tuples of (oldCPU,newCPU)"
212

--- 41 unchanged lines hidden ---
208def switchCpus(cpuList):
209 print "switching cpus"
210 if not isinstance(cpuList, list):
211 raise RuntimeError, "Must pass a list to this function"
212 for i in cpuList:
213 if not isinstance(i, tuple):
214 raise RuntimeError, "List must have tuples of (oldCPU,newCPU)"
215

--- 41 unchanged lines hidden ---