summaryrefslogtreecommitdiff
path: root/src/mem/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby')
-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)