summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mem/ruby/structures/DirectoryMemory.cc13
-rw-r--r--src/mem/ruby/structures/DirectoryMemory.py1
2 files changed, 13 insertions, 1 deletions
diff --git a/src/mem/ruby/structures/DirectoryMemory.cc b/src/mem/ruby/structures/DirectoryMemory.cc
index f79382c26..ee77931d7 100644
--- a/src/mem/ruby/structures/DirectoryMemory.cc
+++ b/src/mem/ruby/structures/DirectoryMemory.cc
@@ -1,5 +1,6 @@
/*
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
+ * Copyright (c) 2017 Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,6 +25,8 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Lena Olson
*/
#include "mem/ruby/structures/DirectoryMemory.hh"
@@ -33,6 +36,7 @@
#include "debug/RubyStats.hh"
#include "mem/ruby/slicc_interface/RubySlicc_Util.hh"
#include "mem/ruby/system/RubySystem.hh"
+#include "sim/system.hh"
using namespace std;
@@ -44,7 +48,14 @@ DirectoryMemory::DirectoryMemory(const Params *p)
: SimObject(p)
{
m_version = p->version;
- m_size_bytes = p->size;
+ // In X86, there is an IO gap in the 3-4GB range.
+ if (p->system->getArch() == Arch::X86ISA && p->size > 0xc0000000){
+ // We need to add 1GB to the size for the gap
+ m_size_bytes = p->size + 0x40000000;
+ }
+ else {
+ m_size_bytes = p->size;
+ }
m_size_bits = floorLog2(m_size_bytes);
m_num_entries = 0;
m_numa_high_bit = p->numa_high_bit;
diff --git a/src/mem/ruby/structures/DirectoryMemory.py b/src/mem/ruby/structures/DirectoryMemory.py
index bb9765bdb..2518380b2 100644
--- a/src/mem/ruby/structures/DirectoryMemory.py
+++ b/src/mem/ruby/structures/DirectoryMemory.py
@@ -40,3 +40,4 @@ class RubyDirectoryMemory(SimObject):
# the default value of the numa high bit is specified in the command line
# option and must be passed into the directory memory sim object
numa_high_bit = Param.Int("numa high bit")
+ system = Param.System(Parent.any, "system object")