From: Derek Hower Date: Wed, 29 Jul 2009 18:46:58 +0000 (-0500) Subject: ruby: fixed clearStats X-Git-Tag: Calvin_Submission~159^2~6^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d9ff3021ba990503acccc9094e00111f087d9a9a;p=gem5.git ruby: fixed clearStats --- diff --git a/src/mem/ruby/system/CacheMemory.hh b/src/mem/ruby/system/CacheMemory.hh index cfaa229a5..7a46bd3a5 100644 --- a/src/mem/ruby/system/CacheMemory.hh +++ b/src/mem/ruby/system/CacheMemory.hh @@ -127,6 +127,7 @@ public: void print(ostream& out) const; void printData(ostream& out) const; + void clearStats() const; void printStats(ostream& out) const; private: @@ -561,6 +562,11 @@ void CacheMemory::printData(ostream& out) const out << "printData() not supported" << endl; } +inline void CacheMemory::clearStats() const +{ + m_profiler_ptr->clearStats(); +} + inline void CacheMemory::printStats(ostream& out) const { diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc index 2c24c9ade..ad67cdc80 100644 --- a/src/mem/ruby/system/System.cc +++ b/src/mem/ruby/system/System.cc @@ -347,15 +347,16 @@ void RubySystem::printStats(ostream& out) void RubySystem::clearStats() const { - /* m_profiler_ptr->clearStats(); - for (int i=0; iclearStats(); m_network_ptr->clearStats(); - for (int i=0; i < MachineType_base_level(MachineType_NUM); i++) - m_controllers[i][0]->clearStats(); - */ + for (map::const_iterator it = m_caches.begin(); + it != m_caches.end(); it++) { + (*it).second->clearStats(); + } + for (map::const_iterator it = m_controllers.begin(); + it != m_controllers.end(); it++) { + (*it).second->clearStats(); + } } void RubySystem::recordCacheContents(CacheRecorder& tr) const