summaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2010-03-21 21:22:21 -0700
committerBrad Beckmann <Brad.Beckmann@amd.com>2010-03-21 21:22:21 -0700
commit8b15ed7ebf939688e68ed2e6b1b2099972e1d295 (patch)
treec23fd506b49fcc04188255a1d5570dae09babb9c /src/mem
parent92cfd1cac7f6f2d0abf64808f08f063cd0db1263 (diff)
downloadgem5-8b15ed7ebf939688e68ed2e6b1b2099972e1d295.tar.xz
ruby: Added flag to disable mem_vec allocation
The RubySystem flag no_mem_vec will disable Ruby from allocating it's memory data array.
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/ruby/system/DirectoryMemory.cc3
-rw-r--r--src/mem/ruby/system/RubySystem.py1
-rw-r--r--src/mem/ruby/system/System.cc12
3 files changed, 11 insertions, 5 deletions
diff --git a/src/mem/ruby/system/DirectoryMemory.cc b/src/mem/ruby/system/DirectoryMemory.cc
index 78ca1e9e4..2c32eacdc 100644
--- a/src/mem/ruby/system/DirectoryMemory.cc
+++ b/src/mem/ruby/system/DirectoryMemory.cc
@@ -68,10 +68,9 @@ void DirectoryMemory::init()
m_entries = new Directory_Entry*[m_num_entries];
for (int i=0; i < m_num_entries; i++)
m_entries[i] = NULL;
+ m_ram = g_system_ptr->getMemoryVector();
}
- m_ram = g_system_ptr->getMemoryVector();
-
m_num_directories++;
m_num_directories_bits = log_int(m_num_directories);
m_total_size_bytes += m_size_bytes;
diff --git a/src/mem/ruby/system/RubySystem.py b/src/mem/ruby/system/RubySystem.py
index 36bbd81ae..00d02b3df 100644
--- a/src/mem/ruby/system/RubySystem.py
+++ b/src/mem/ruby/system/RubySystem.py
@@ -45,3 +45,4 @@ class RubySystem(SimObject):
tracer = Param.RubyTracer("");
stats_filename = Param.String("ruby.stats",
"file to which ruby dumps its stats")
+ no_mem_vec = Param.Bool(False, "do not allocate Ruby's mem vector");
diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc
index 105f6fb36..69dbf69c4 100644
--- a/src/mem/ruby/system/System.cc
+++ b/src/mem/ruby/system/System.cc
@@ -89,8 +89,12 @@ RubySystem::RubySystem(const Params *p)
g_eventQueue_ptr = new RubyEventQueue(p->eventq, m_clock);
g_system_ptr = this;
- m_mem_vec_ptr = new MemoryVector;
- m_mem_vec_ptr->setSize(m_memory_size_bytes);
+ if (p->no_mem_vec) {
+ m_mem_vec_ptr = NULL;
+ } else {
+ m_mem_vec_ptr = new MemoryVector;
+ m_mem_vec_ptr->setSize(m_memory_size_bytes);
+ }
//
// Print ruby configuration and stats at exit
@@ -111,7 +115,9 @@ RubySystem::~RubySystem()
delete m_network_ptr;
delete m_profiler_ptr;
delete m_tracer_ptr;
- delete m_mem_vec_ptr;
+ if (m_mem_vec_ptr != NULL) {
+ delete m_mem_vec_ptr;
+ }
}
void RubySystem::printSystemConfig(ostream & out)