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/System.hh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mem/ruby/system/System.hh') diff --git a/src/mem/ruby/system/System.hh b/src/mem/ruby/system/System.hh index 72de74702..45e8aa8b4 100644 --- a/src/mem/ruby/system/System.hh +++ b/src/mem/ruby/system/System.hh @@ -74,6 +74,8 @@ class RubySystem : public ClockedObject static uint32_t getBlockSizeBytes() { return m_block_size_bytes; } static uint32_t getBlockSizeBits() { return m_block_size_bits; } static uint32_t getMemorySizeBits() { return m_memory_size_bits; } + static bool getWarmupEnabled() { return m_warmup_enabled; } + static bool getCooldownEnabled() { return m_cooldown_enabled; } SimpleMemory *getPhysMem() { return m_phys_mem; } const bool getAccessBackingStore() { return m_access_backing_store; } @@ -125,6 +127,9 @@ class RubySystem : public ClockedObject static uint32_t m_block_size_bytes; static uint32_t m_block_size_bits; static uint32_t m_memory_size_bits; + static bool m_warmup_enabled; + static unsigned m_systems_to_warmup; + static bool m_cooldown_enabled; SimpleMemory *m_phys_mem; const bool m_access_backing_store; @@ -133,8 +138,6 @@ class RubySystem : public ClockedObject public: Profiler* m_profiler; - bool m_warmup_enabled; - bool m_cooldown_enabled; CacheRecorder* m_cache_recorder; }; -- cgit v1.2.3