changeset dc656c4af516 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=dc656c4af516
description:
        Alpha System: override startup(), instead of loadState()
        Alpha System was overriding loadState() function to setup some 
functional
        event. The system tried to read/write to memory before the Ruby memory 
had
        unserialized the state. With this patch, Alpha System overrides the
        startup() function, and sets up functional events in this function. This
        works because startup() is called after Ruby memory system has 
unserialized
        the memory state.

diffstat:

 src/arch/alpha/system.cc |  15 ++++-----------
 src/arch/alpha/system.hh |   4 ++--
 2 files changed, 6 insertions(+), 13 deletions(-)

diffs (47 lines):

diff -r 86c0e6ca5e7c -r dc656c4af516 src/arch/alpha/system.cc
--- a/src/arch/alpha/system.cc  Wed Aug 15 10:38:08 2012 -0400
+++ b/src/arch/alpha/system.cc  Thu Aug 16 23:45:21 2012 -0500
@@ -134,24 +134,17 @@
         virtProxy.write(addr+0x58, data);
     } else
         panic("could not find hwrpb\n");
+}
 
+void
+AlphaSystem::startup()
+{
     // Setup all the function events now that we have a system and a symbol
     // table
     setupFuncEvents();
 }
 
 void
-AlphaSystem::loadState(Checkpoint *cp)
-{
-    System::loadState(cp);
-
-    // Setup all the function events now that we have a system and a symbol
-    // table
-    setupFuncEvents();
-
-}
-
-void
 AlphaSystem::setupFuncEvents()
 {
 #ifndef NDEBUG
diff -r 86c0e6ca5e7c -r dc656c4af516 src/arch/alpha/system.hh
--- a/src/arch/alpha/system.hh  Wed Aug 15 10:38:08 2012 -0400
+++ b/src/arch/alpha/system.hh  Thu Aug 16 23:45:21 2012 -0500
@@ -62,9 +62,9 @@
     virtual void serialize(std::ostream &os);
     virtual void unserialize(Checkpoint *cp, const std::string &section);
 
-    /** Override loadState to provide a path to call setupFuncEvents()
+    /** Override startup() to provide a path to call setupFuncEvents()
      */
-    virtual void loadState(Checkpoint *cp);
+    virtual void startup();
 
     /**
      * Set the m5AlphaAccess pointer in the console
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to