gem5: save/restore moved to Gem5Controller

Change-Id: I0ce72f04a8de88f4f8b6c1f0bba7a9097c82e107
This commit is contained in:
Richard Hellwig
2013-05-03 15:53:43 +02:00
parent d9ba5e24ad
commit d525005990
4 changed files with 15 additions and 56 deletions

View File

@ -1,10 +1,13 @@
#include "Gem5Controller.hpp"
//#include "Gem5Connector.hpp"
#include "../Listener.hpp"
#include "Gem5Wrapper.hpp"
#include "base/trace.hh"
#include "debug/FailState.hh"
#include "sim/root.hh"
namespace fail {
void Gem5Controller::startup()
@ -34,16 +37,23 @@ Gem5Controller::~Gem5Controller()
delete m_Mem;
}
bool Gem5Controller::save(const std::string &path)
void Gem5Controller::save(const std::string &path)
{
// connector.save(path); // FIXME: not working?!
DPRINTF(FailState, "Saving state to %s.\n", path);
Root* root = Root::root();
root->Serializable::serializeAll(path);
return true;
}
void Gem5Controller::restore(const std::string &path)
{
// connector.restore(path); // FIXME: not working?!
// FIXME: not working currently
Root* root = Root::root();
Checkpoint cp(path);
root->loadState(&cp);
}
// TODO: Implement reboot