From: Nilay Vaish Date: Mon, 15 Oct 2012 22:27:17 +0000 (-0500) Subject: ruby: register multiple memory controllers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=61434a9943236e8586d9ac772cfe3de3145abb78;p=gem5.git ruby: register multiple memory controllers Currently the Ruby System maintains pointer to only one of the memory controllers. But there can be multiple controllers in the system. This patch adds a vector of memory controllers. --- diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc index 6e144a703..b41f2d727 100644 --- a/src/mem/ruby/system/System.cc +++ b/src/mem/ruby/system/System.cc @@ -119,7 +119,7 @@ RubySystem::registerSparseMemory(SparseMemory* s) void RubySystem::registerMemController(MemoryControl *mc) { - m_memory_controller = mc; + m_memory_controller_vec.push_back(mc); } RubySystem::~RubySystem() @@ -365,9 +365,13 @@ RubySystem::startup() delete m_cache_recorder; m_cache_recorder = NULL; m_warmup_enabled = false; + // reset DRAM so that it's not waiting for events on the old event // queue - m_memory_controller->reset(); + for (int i = 0; i < m_memory_controller_vec.size(); ++i) { + m_memory_controller_vec[i]->reset(); + } + // Restore eventq head eventq_head = eventq->replaceHead(eventq_head); // Restore curTick and Ruby System's clock diff --git a/src/mem/ruby/system/System.hh b/src/mem/ruby/system/System.hh index e9e46fedf..245fa677e 100644 --- a/src/mem/ruby/system/System.hh +++ b/src/mem/ruby/system/System.hh @@ -152,12 +152,12 @@ class RubySystem : public ClockedObject static int m_memory_size_bits; Network* m_network_ptr; - MemoryControl *m_memory_controller; + std::vector m_memory_controller_vec; + std::vector m_abs_cntrl_vec; public: Profiler* m_profiler_ptr; MemoryVector* m_mem_vec_ptr; - std::vector m_abs_cntrl_vec; bool m_warmup_enabled; bool m_cooldown_enabled; CacheRecorder* m_cache_recorder;