Files
fail/src/core/sal/gem5/Gem5Connector.cc
friemel e0e95faa5b Restructured the gem5 backend:
- FailGem5Device is gone.
- There are now changes directly made to the gem5 source.
- Gem5Connector is a helper class that is compiled inside the gem5 context to workaround problems with gem5 header in fail.

Things that are working:
- BPSingleListener
- MemAccessListener
- Save and restore simulator state

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1820 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
2012-10-24 19:19:14 +00:00

26 lines
501 B
C++

#include "Gem5Connector.hpp"
#include "base/trace.hh"
#include "debug/FailState.hh"
#include "sim/root.hh"
Gem5Connector connector;
void Gem5Connector::save(const std::string &path)
{
DPRINTF(FailState, "Saving state to %s.\n", path);
Root* root = Root::root();
root->Serializable::serializeAll(path);
}
void Gem5Connector::restore(const std::string &path)
{
DPRINTF(FailState, "Restoring state from %s.\n", path);
Root* root = Root::root();
Checkpoint cp(path);
root->loadState(&cp);
}