summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2012-10-02 14:35:45 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2012-10-02 14:35:45 -0500
commit88ba1c452b25de7f11dcb4a14bbeb8f540809918 (patch)
tree03dab82a1b7e2d7de285ec1b19c0980a9310dd8f /src/mem/ruby/system
parent4488379244cdf3c211e76dbf3b4278347f639039 (diff)
downloadgem5-88ba1c452b25de7f11dcb4a14bbeb8f540809918.tar.xz
ruby: makes some members non-static
This patch makes some of the members (profiler, network, memory vector) of ruby system non-static.
Diffstat (limited to 'src/mem/ruby/system')
-rw-r--r--src/mem/ruby/system/System.cc12
-rw-r--r--src/mem/ruby/system/System.hh18
2 files changed, 13 insertions, 17 deletions
diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc
index 25857464d..8c267654f 100644
--- a/src/mem/ruby/system/System.cc
+++ b/src/mem/ruby/system/System.cc
@@ -51,10 +51,6 @@ int RubySystem::m_block_size_bits;
uint64 RubySystem::m_memory_size_bytes;
int RubySystem::m_memory_size_bits;
-Network* RubySystem::m_network_ptr;
-Profiler* RubySystem::m_profiler_ptr;
-MemoryVector* RubySystem::m_mem_vec_ptr;
-
RubySystem::RubySystem(const Params *p)
: ClockedObject(p)
{
@@ -84,11 +80,9 @@ RubySystem::RubySystem(const Params *p)
m_mem_vec_ptr->resize(m_memory_size_bytes);
}
- //
// Print ruby configuration and stats at exit
- //
- RubyExitCallback* rubyExitCB = new RubyExitCallback(p->stats_filename);
- registerExitCallback(rubyExitCB);
+ registerExitCallback(new RubyExitCallback(p->stats_filename, this));
+
m_warmup_enabled = false;
m_cooldown_enabled = false;
}
@@ -636,5 +630,5 @@ void
RubyExitCallback::process()
{
std::ostream *os = simout.create(stats_filename);
- RubySystem::printStats(*os);
+ ruby_system->printStats(*os);
}
diff --git a/src/mem/ruby/system/System.hh b/src/mem/ruby/system/System.hh
index c0614cb1a..e9e46fedf 100644
--- a/src/mem/ruby/system/System.hh
+++ b/src/mem/ruby/system/System.hh
@@ -81,7 +81,7 @@ class RubySystem : public ClockedObject
Cycles getTime() const { return curCycle(); }
// Public Methods
- static Network*
+ Network*
getNetwork()
{
assert(m_network_ptr != NULL);
@@ -95,14 +95,14 @@ class RubySystem : public ClockedObject
return m_profiler_ptr;
}
- static MemoryVector*
+ MemoryVector*
getMemoryVector()
{
assert(m_mem_vec_ptr != NULL);
return m_mem_vec_ptr;
}
- static void printStats(std::ostream& out);
+ void printStats(std::ostream& out);
void clearStats() const;
uint64 getInstructionCount(int thread) { return 1; }
@@ -150,13 +150,13 @@ class RubySystem : public ClockedObject
static int m_block_size_bits;
static uint64 m_memory_size_bytes;
static int m_memory_size_bits;
- static Network* m_network_ptr;
+ Network* m_network_ptr;
MemoryControl *m_memory_controller;
public:
- static Profiler* m_profiler_ptr;
- static MemoryVector* m_mem_vec_ptr;
+ Profiler* m_profiler_ptr;
+ MemoryVector* m_mem_vec_ptr;
std::vector<AbstractController*> m_abs_cntrl_vec;
bool m_warmup_enabled;
bool m_cooldown_enabled;
@@ -176,16 +176,18 @@ class RubyExitCallback : public Callback
{
private:
std::string stats_filename;
+ RubySystem *ruby_system;
public:
virtual ~RubyExitCallback() {}
- RubyExitCallback(const std::string& _stats_filename)
+ RubyExitCallback(const std::string& _stats_filename, RubySystem *system)
{
stats_filename = _stats_filename;
+ ruby_system = system;
}
- virtual void process();
+ void process();
};
#endif // __MEM_RUBY_SYSTEM_SYSTEM_HH__