From f9a370f1728fe5d752fa6962ba23774eec8c883e Mon Sep 17 00:00:00 2001 From: Brandon Potter Date: Fri, 10 Jul 2015 16:05:23 -0500 Subject: ruby: replace global g_system_ptr with per-object pointers This is another step in the process of removing global variables from Ruby to enable multiple RubySystem instances in a single simulation. With possibly multiple RubySystem objects, we can no longer use a global variable to find "the" RubySystem object. Instead, each Ruby component has to carry a pointer to the RubySystem object to which it belongs. --- src/mem/ruby/structures/BankedArray.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mem/ruby/structures/BankedArray.hh') diff --git a/src/mem/ruby/structures/BankedArray.hh b/src/mem/ruby/structures/BankedArray.hh index ed9269eaa..5cc3eee32 100644 --- a/src/mem/ruby/structures/BankedArray.hh +++ b/src/mem/ruby/structures/BankedArray.hh @@ -35,6 +35,7 @@ #include #include "mem/ruby/common/TypeDefines.hh" +#include "mem/ruby/system/System.hh" #include "sim/core.hh" class BankedArray @@ -44,6 +45,7 @@ class BankedArray Cycles accessLatency; unsigned int bankBits; unsigned int startIndexBit; + RubySystem *m_ruby_system; class AccessRecord { @@ -62,7 +64,7 @@ class BankedArray public: BankedArray(unsigned int banks, Cycles accessLatency, - unsigned int startIndexBit); + unsigned int startIndexBit, RubySystem *rs); // Note: We try the access based on the cache index, not the address // This is so we don't get aliasing on blocks being replaced -- cgit v1.2.3