sim: Remove SimObject::setMemoryMode
Remove SimObject::setMemoryMode from the main SimObject class since it is only valid for the System class. In addition to removing the method from the C++ sources, this patch also removes getMemoryMode and changeTiming from SimObject.py and updates the simulation code to call the (get|set)MemoryMode method on the System object instead.
This commit is contained in:
parent
d060a28a29
commit
5f32eceeda
4 changed files with 2 additions and 30 deletions
|
@ -1050,19 +1050,6 @@ class SimObject(object):
|
||||||
for portRef in self._port_refs.itervalues():
|
for portRef in self._port_refs.itervalues():
|
||||||
portRef.ccConnect()
|
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):
|
def takeOverFrom(self, old_cpu):
|
||||||
self._ccObject.takeOverFrom(old_cpu._ccObject)
|
self._ccObject.takeOverFrom(old_cpu._ccObject)
|
||||||
|
|
||||||
|
|
|
@ -194,8 +194,7 @@ def changeToAtomic(system):
|
||||||
if system.getMemoryMode() != objects.params.atomic:
|
if system.getMemoryMode() != objects.params.atomic:
|
||||||
doDrain(system)
|
doDrain(system)
|
||||||
print "Changing memory mode to atomic"
|
print "Changing memory mode to atomic"
|
||||||
for obj in system.descendants():
|
system.setMemoryMode(objects.params.atomic)
|
||||||
obj.changeTiming(objects.params.atomic)
|
|
||||||
|
|
||||||
def changeToTiming(system):
|
def changeToTiming(system):
|
||||||
if not isinstance(system, (objects.Root, objects.System)):
|
if not isinstance(system, (objects.Root, objects.System)):
|
||||||
|
@ -204,8 +203,7 @@ def changeToTiming(system):
|
||||||
|
|
||||||
if system.getMemoryMode() != objects.params.timing:
|
if system.getMemoryMode() != objects.params.timing:
|
||||||
print "Changing memory mode to timing"
|
print "Changing memory mode to timing"
|
||||||
for obj in system.descendants():
|
system.setMemoryMode(objects.params.timing)
|
||||||
obj.changeTiming(objects.params.timing)
|
|
||||||
|
|
||||||
def switchCpus(cpuList):
|
def switchCpus(cpuList):
|
||||||
print "switching cpus"
|
print "switching cpus"
|
||||||
|
|
|
@ -163,12 +163,6 @@ SimObject::resume()
|
||||||
state = Running;
|
state = Running;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
SimObject::setMemoryMode(Enums::MemoryMode new_mode)
|
|
||||||
{
|
|
||||||
panic("setMemoryMode() should only be called on systems");
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SimObject::switchOut()
|
SimObject::switchOut()
|
||||||
{
|
{
|
||||||
|
|
|
@ -255,13 +255,6 @@ class SimObject : public EventManager, public Serializable
|
||||||
*/
|
*/
|
||||||
virtual void resume();
|
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
|
* Prepare a CPU model to be switched out, invoked on active CPUs
|
||||||
* that are about to be replaced.
|
* that are about to be replaced.
|
||||||
|
|
Loading…
Reference in a new issue