changeset e0d2a8e9f445 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=e0d2a8e9f445
description:
        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.

diffstat:

 src/python/m5/SimObject.py |  13 -------------
 src/python/m5/simulate.py  |   6 ++----
 src/sim/sim_object.cc      |   6 ------
 src/sim/sim_object.hh      |   7 -------
 4 files changed, 2 insertions(+), 30 deletions(-)

diffs (79 lines):

diff -r f350fac86d0f -r e0d2a8e9f445 src/python/m5/SimObject.py
--- a/src/python/m5/SimObject.py        Tue Sep 25 11:49:40 2012 -0500
+++ b/src/python/m5/SimObject.py        Tue Sep 25 11:49:40 2012 -0500
@@ -1050,19 +1050,6 @@
         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)
 
diff -r f350fac86d0f -r e0d2a8e9f445 src/python/m5/simulate.py
--- a/src/python/m5/simulate.py Tue Sep 25 11:49:40 2012 -0500
+++ b/src/python/m5/simulate.py Tue Sep 25 11:49:40 2012 -0500
@@ -194,8 +194,7 @@
     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)):
@@ -204,8 +203,7 @@
 
     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"
diff -r f350fac86d0f -r e0d2a8e9f445 src/sim/sim_object.cc
--- a/src/sim/sim_object.cc     Tue Sep 25 11:49:40 2012 -0500
+++ b/src/sim/sim_object.cc     Tue Sep 25 11:49:40 2012 -0500
@@ -164,12 +164,6 @@
 }
 
 void
-SimObject::setMemoryMode(Enums::MemoryMode new_mode)
-{
-    panic("setMemoryMode() should only be called on systems");
-}
-
-void
 SimObject::switchOut()
 {
     panic("Unimplemented!");
diff -r f350fac86d0f -r e0d2a8e9f445 src/sim/sim_object.hh
--- a/src/sim/sim_object.hh     Tue Sep 25 11:49:40 2012 -0500
+++ b/src/sim/sim_object.hh     Tue Sep 25 11:49:40 2012 -0500
@@ -256,13 +256,6 @@
     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.
      *
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to