ruby: Reset ruby stats in RubySystem unserialize

The main purpose for clearing stats in the unserialize process is so
that the profiler can correctly set its start time to the unserialized
value of curTick.
This commit is contained in:
Brad Beckmann 2010-08-20 11:46:13 -07:00
parent 72044e3f5a
commit ac5bb214e3
2 changed files with 20 additions and 0 deletions

View file

@ -147,6 +147,23 @@ RubySystem::printStats(ostream& out)
m_network_ptr->printStats(out);
}
void
RubySystem::serialize(std::ostream &os)
{
}
void
RubySystem::unserialize(Checkpoint *cp, const string &section)
{
//
// The main purpose for clearing stats in the unserialize process is so
// that the profiler can correctly set its start time to the unserialized
// value of curTick
//
clearStats();
}
void
RubySystem::clearStats() const
{

View file

@ -125,6 +125,9 @@ class RubySystem : public SimObject
void print(std::ostream& out) const;
virtual void serialize(std::ostream &os);
virtual void unserialize(Checkpoint *cp, const std::string &section);
private:
// Private copy constructor and assignment operator
RubySystem(const RubySystem& obj);