From 0479569f6748202f1704d70aad3b03b3d17f6092 Mon Sep 17 00:00:00 2001 From: Joel Hestness Date: Tue, 19 May 2015 10:56:51 -0500 Subject: ruby: Fix RubySystem warm-up and cool-down scope The processes of warming up and cooling down Ruby caches are simulation-wide processes, not just RubySystem instance-specific processes. Thus, the warm-up and cool-down variables should be globally visible to any Ruby components participating in either process. Make these variables static members and track the warm-up and cool-down processes as appropriate. This patch also has two side benefits: 1) It removes references to the RubySystem g_system_ptr, which are problematic for allowing multiple RubySystem instances in a single simulation. Warmup and cooldown variables being static (global) reduces the need for instance-specific dereferences through the RubySystem. 2) From the AbstractController, it removes local RubySystem pointers, which are used inconsistently with other uses of the RubySystem: 11 other uses reference the RubySystem with the g_system_ptr. Only sequencers have local pointers. --- src/mem/ruby/system/Sequencer.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mem/ruby/system/Sequencer.cc') diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc index 98649dcd5..b1d22b549 100644 --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -525,7 +525,7 @@ Sequencer::hitCallback(SequencerRequest* srequest, DataBlock& data, request_address, total_latency); // update the data unless it is a non-data-carrying flush - if (g_system_ptr->m_warmup_enabled) { + if (RubySystem::getWarmupEnabled()) { data.setData(pkt->getConstPtr(), request_address.getOffset(), pkt->getSize()); } else if (!pkt->isFlush()) { @@ -557,12 +557,12 @@ Sequencer::hitCallback(SequencerRequest* srequest, DataBlock& data, delete srequest; - if (g_system_ptr->m_warmup_enabled) { + if (RubySystem::getWarmupEnabled()) { assert(pkt->req); delete pkt->req; delete pkt; g_system_ptr->m_cache_recorder->enqueueNextFetchRequest(); - } else if (g_system_ptr->m_cooldown_enabled) { + } else if (RubySystem::getCooldownEnabled()) { delete pkt; g_system_ptr->m_cache_recorder->enqueueNextFlushRequest(); } else { -- cgit v1.2.3