simulate.py (4859:97c7749896a6) simulate.py (4945:6f40bdb0ba9f)
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

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

143 print "Restoring from checkpoint"
144 internal.core.unserializeAll(dir)
145 need_resume.append(root)
146
147def changeToAtomic(system):
148 if not isinstance(system, (objects.Root, objects.System)):
149 raise TypeError, "Parameter of type '%s'. Must be type %s or %s." % \
150 (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

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

143 print "Restoring from checkpoint"
144 internal.core.unserializeAll(dir)
145 need_resume.append(root)
146
147def changeToAtomic(system):
148 if not isinstance(system, (objects.Root, objects.System)):
149 raise TypeError, "Parameter of type '%s'. Must be type %s or %s." % \
150 (type(system), objects.Root, objects.System)
151 if system.getMemoryMode() != objects.params.SimObject.Atomic:
151 if system.getMemoryMode() != objects.params.atomic:
152 doDrain(system)
153 print "Changing memory mode to atomic"
152 doDrain(system)
153 print "Changing memory mode to atomic"
154 system.changeTiming(objects.params.SimObject.Atomic)
154 system.changeTiming(objects.params.atomic)
155
156def changeToTiming(system):
157 if not isinstance(system, (objects.Root, objects.System)):
158 raise TypeError, "Parameter of type '%s'. Must be type %s or %s." % \
159 (type(system), objects.Root, objects.System)
160
155
156def changeToTiming(system):
157 if not isinstance(system, (objects.Root, objects.System)):
158 raise TypeError, "Parameter of type '%s'. Must be type %s or %s." % \
159 (type(system), objects.Root, objects.System)
160
161 if system.getMemoryMode() != objects.params.SimObject.Timing:
161 if system.getMemoryMode() != objects.params.timing:
162 doDrain(system)
163 print "Changing memory mode to timing"
162 doDrain(system)
163 print "Changing memory mode to timing"
164 system.changeTiming(objects.params.SimObject.Timing)
164 system.changeTiming(objects.params.timing)
165
166def switchCpus(cpuList):
167 print "switching cpus"
168 if not isinstance(cpuList, list):
169 raise RuntimeError, "Must pass a list to this function"
170 for i in cpuList:
171 if not isinstance(i, tuple):
172 raise RuntimeError, "List must have tuples of (oldCPU,newCPU)"

--- 28 unchanged lines hidden ---
165
166def switchCpus(cpuList):
167 print "switching cpus"
168 if not isinstance(cpuList, list):
169 raise RuntimeError, "Must pass a list to this function"
170 for i in cpuList:
171 if not isinstance(i, tuple):
172 raise RuntimeError, "List must have tuples of (oldCPU,newCPU)"

--- 28 unchanged lines hidden ---