summaryrefslogtreecommitdiff
path: root/src/mem/ruby/profiler
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2015-07-10 16:05:24 -0500
committerBrandon Potter <brandon.potter@amd.com>2015-07-10 16:05:24 -0500
commitbfe7ee96ad5abec40639d47dc2b0512d6baa0f81 (patch)
treebf731166c1e2d1e1fb6a98fe3916700a4104671d /src/mem/ruby/profiler
parentf9a370f1728fe5d752fa6962ba23774eec8c883e (diff)
downloadgem5-bfe7ee96ad5abec40639d47dc2b0512d6baa0f81.tar.xz
ruby: replace global g_abs_controls with per-RubySystem var
This is another step in the process of removing global variables from Ruby to enable multiple RubySystem instances in a single simulation. The list of abstract controllers is per-RubySystem and should be represented that way, rather than as a global. Since this is the last remaining Ruby global variable, the src/mem/ruby/Common/Global.* files are also removed.
Diffstat (limited to 'src/mem/ruby/profiler')
-rw-r--r--src/mem/ruby/profiler/AccessTraceForAddress.hh1
-rw-r--r--src/mem/ruby/profiler/Profiler.cc15
-rw-r--r--src/mem/ruby/profiler/Profiler.hh5
3 files changed, 11 insertions, 10 deletions
diff --git a/src/mem/ruby/profiler/AccessTraceForAddress.hh b/src/mem/ruby/profiler/AccessTraceForAddress.hh
index 289b83a3a..acd03a3fa 100644
--- a/src/mem/ruby/profiler/AccessTraceForAddress.hh
+++ b/src/mem/ruby/profiler/AccessTraceForAddress.hh
@@ -34,7 +34,6 @@
#include "mem/protocol/RubyAccessMode.hh"
#include "mem/protocol/RubyRequestType.hh"
#include "mem/ruby/common/Address.hh"
-#include "mem/ruby/common/Global.hh"
#include "mem/ruby/common/Set.hh"
class Histogram;
diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc
index 070db6807..7decd497a 100644
--- a/src/mem/ruby/profiler/Profiler.cc
+++ b/src/mem/ruby/profiler/Profiler.cc
@@ -60,7 +60,8 @@
using namespace std;
using m5::stl_helpers::operator<<;
-Profiler::Profiler(const RubySystemParams *p)
+Profiler::Profiler(const RubySystemParams *p, RubySystem *rs)
+ : m_ruby_system(rs)
{
m_hot_lines = p->hot_lines;
m_all_instructions = p->all_instructions;
@@ -253,8 +254,8 @@ Profiler::collateStats()
uint32_t numVNets = Network::getNumberOfVirtualNetworks();
for (uint32_t i = 0; i < MachineType_NUM; i++) {
for (map<uint32_t, AbstractController*>::iterator it =
- g_abs_controls[i].begin();
- it != g_abs_controls[i].end(); ++it) {
+ m_ruby_system->m_abstract_controls[i].begin();
+ it != m_ruby_system->m_abstract_controls[i].end(); ++it) {
AbstractController *ctr = (*it).second;
delayHistogram.add(ctr->getDelayHist());
@@ -267,8 +268,8 @@ Profiler::collateStats()
for (uint32_t i = 0; i < MachineType_NUM; i++) {
for (map<uint32_t, AbstractController*>::iterator it =
- g_abs_controls[i].begin();
- it != g_abs_controls[i].end(); ++it) {
+ m_ruby_system->m_abstract_controls[i].begin();
+ it != m_ruby_system->m_abstract_controls[i].end(); ++it) {
AbstractController *ctr = (*it).second;
Sequencer *seq = ctr->getSequencer();
@@ -280,8 +281,8 @@ Profiler::collateStats()
for (uint32_t i = 0; i < MachineType_NUM; i++) {
for (map<uint32_t, AbstractController*>::iterator it =
- g_abs_controls[i].begin();
- it != g_abs_controls[i].end(); ++it) {
+ m_ruby_system->m_abstract_controls[i].begin();
+ it != m_ruby_system->m_abstract_controls[i].end(); ++it) {
AbstractController *ctr = (*it).second;
Sequencer *seq = ctr->getSequencer();
diff --git a/src/mem/ruby/profiler/Profiler.hh b/src/mem/ruby/profiler/Profiler.hh
index 5b1c9fe1e..146beadd6 100644
--- a/src/mem/ruby/profiler/Profiler.hh
+++ b/src/mem/ruby/profiler/Profiler.hh
@@ -56,7 +56,6 @@
#include "mem/protocol/PrefetchBit.hh"
#include "mem/protocol/RubyAccessMode.hh"
#include "mem/protocol/RubyRequestType.hh"
-#include "mem/ruby/common/Global.hh"
#include "mem/ruby/common/MachineID.hh"
#include "params/RubySystem.hh"
@@ -66,9 +65,11 @@ class AddressProfiler;
class Profiler
{
public:
- Profiler(const RubySystemParams *params);
+ Profiler(const RubySystemParams *params, RubySystem *rs);
~Profiler();
+ RubySystem *m_ruby_system;
+
void wakeup();
void regStats(const std::string &name);
void collateStats();