Merge zizzer:/bk/newmem

into  zed.eecs.umich.edu:/z/hsul/work/m5/newmem

src/cpu/simple/timing.cc:
    hand merge

--HG--
extra : convert_revision : 083bf102249ad9bc63c447dbf85d3863f935f647
This commit is contained in:
Lisa Hsu
2006-10-12 18:56:57 -04:00
7 changed files with 36 additions and 16 deletions

View File

@@ -726,7 +726,12 @@ class SimObject(object):
child.resume()
def changeTiming(self, mode):
if isinstance(self, System):
if isinstance(self, m5.objects.System):
# i don't know if there's a better way to do this - calling
# setMemoryMode directly from self._ccObject results in calling
# SimObject::setMemoryMode, not the System::setMemoryMode
## system_ptr = cc_main.convertToSystemPtr(self._ccObject)
## system_ptr.setMemoryMode(mode)
self._ccObject.setMemoryMode(mode)
for child in self._children.itervalues():
child.changeTiming(mode)

View File

@@ -144,7 +144,7 @@ def restoreCheckpoint(root, dir):
resume(root)
def changeToAtomic(system):
if not isinstance(system, objects.Root) and not isinstance(system, System):
if not isinstance(system, objects.Root) and not isinstance(system, objects.System):
raise TypeError, "Object is not a root or system object. Checkpoint must be "
"called on a root object."
doDrain(system)
@@ -153,7 +153,7 @@ def changeToAtomic(system):
resume(system)
def changeToTiming(system):
if not isinstance(system, objects.Root) and not isinstance(system, System):
if not isinstance(system, objects.Root) and not isinstance(system, objects.System):
raise TypeError, "Object is not a root or system object. Checkpoint must be "
"called on a root object."
doDrain(system)
@@ -162,6 +162,7 @@ def changeToTiming(system):
resume(system)
def switchCpus(cpuList):
print "switching cpus"
if not isinstance(cpuList, list):
raise RuntimeError, "Must pass a list to this function"
for i in cpuList:
@@ -189,9 +190,9 @@ def switchCpus(cpuList):
cc_main.cleanupCountedDrain(drain_event)
# Now all of the CPUs are ready to be switched out
for old_cpu in old_cpus:
print "switching"
old_cpu._ccObject.switchOut()
index = 0
print "Switching CPUs"
for new_cpu in new_cpus:
new_cpu.takeOverFrom(old_cpus[index])
new_cpu._ccObject.resume()