summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/System.cc
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2010-01-29 20:29:21 -0800
committerBrad Beckmann <Brad.Beckmann@amd.com>2010-01-29 20:29:21 -0800
commit1907e39fd2c30ead9589f0bb6995972cbd0e153f (patch)
tree2e5c96fcd6dfc18af9b5a7e717590292f810ff52 /src/mem/ruby/system/System.cc
parent020716cab3dca04d3f6b24b6dce67d5f5cbc4e5e (diff)
downloadgem5-1907e39fd2c30ead9589f0bb6995972cbd0e153f.tar.xz
ruby: added ruby stats print
Moved the previous rubymem stats print feature to ruby System so that ruby stats are printed on simulation exit.
Diffstat (limited to 'src/mem/ruby/system/System.cc')
-rw-r--r--src/mem/ruby/system/System.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc
index 4dcca2f83..3159a2888 100644
--- a/src/mem/ruby/system/System.cc
+++ b/src/mem/ruby/system/System.cc
@@ -56,6 +56,7 @@
//#include "mem/ruby/network/garnet-flexible-pipeline/GarnetNetwork.hh"
//#include "mem/ruby/network/garnet-fixed-pipeline/GarnetNetwork_d.hh"
#include "mem/ruby/system/MemoryControl.hh"
+#include "base/output.hh"
int RubySystem::m_random_seed;
bool RubySystem::m_randomization;
@@ -109,6 +110,12 @@ RubySystem::RubySystem(const Params *p)
g_system_ptr = this;
m_mem_vec_ptr = new MemoryVector;
m_mem_vec_ptr->setSize(m_memory_size_bytes);
+
+ //
+ // Print ruby configuration and stats at exit
+ //
+ RubyExitCallback* rubyExitCB = new RubyExitCallback(p->stats_filename);
+ registerExitCallback(rubyExitCB);
}
@@ -263,9 +270,20 @@ void RubySystem::checkGlobalCoherenceInvariant(const Address& addr ) {
}
#endif
-
RubySystem *
RubySystemParams::create()
{
return new RubySystem(this);
}
+
+/**
+ * virtual process function that is invoked when the callback
+ * queue is executed.
+ */
+void RubyExitCallback::process()
+{
+ std::ostream *os = simout.create(stats_filename);
+ RubySystem::printConfig(*os);
+ *os << endl;
+ RubySystem::printStats(*os);
+}