for portRef in self._port_refs.itervalues():
portRef.ccConnect()
- def getMemoryMode(self):
- if not isinstance(self, m5.objects.System):
- return None
-
- return self._ccObject.getMemoryMode()
-
- def changeTiming(self, mode):
- 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
- self._ccObject.setMemoryMode(mode)
-
def takeOverFrom(self, old_cpu):
self._ccObject.takeOverFrom(old_cpu._ccObject)
if system.getMemoryMode() != objects.params.atomic:
doDrain(system)
print "Changing memory mode to atomic"
- for obj in system.descendants():
- obj.changeTiming(objects.params.atomic)
+ system.setMemoryMode(objects.params.atomic)
def changeToTiming(system):
if not isinstance(system, (objects.Root, objects.System)):
if system.getMemoryMode() != objects.params.timing:
print "Changing memory mode to timing"
- for obj in system.descendants():
- obj.changeTiming(objects.params.timing)
+ system.setMemoryMode(objects.params.timing)
def switchCpus(cpuList):
print "switching cpus"
state = Running;
}
-void
-SimObject::setMemoryMode(Enums::MemoryMode new_mode)
-{
- panic("setMemoryMode() should only be called on systems");
-}
-
void
SimObject::switchOut()
{
*/
virtual void resume();
- /**
- * Change the memory mode the simulator operates in.
- *
- * @note Should only be implemented in the System object.
- */
- virtual void setMemoryMode(Enums::MemoryMode new_mode);
-
/**
* Prepare a CPU model to be switched out, invoked on active CPUs
* that are about to be replaced.