Jason Lowe-Power has submitted this change and it was merged. (
https://gem5-review.googlesource.com/2169 )
Change subject: ruby: fix MOESI_hammer directory to work with > 3GB memory
......................................................................
ruby: fix MOESI_hammer directory to work with > 3GB memory
The MOESI_hammer directory assumes a contiguous address space, but X86
has an IO gap from 3-4GB. This patch allows the directory to work with
more than 3GB of memory on X86.
Assumptions: the physical address space (range of possible physical
addresses) is 0-XGB when X <= 3GB, and 0-(X+1)GB when X > 3GB. If there
is no IO gap this patch should still work.
Change-Id: I5453a09e953643cada2c096a91d339a3676f55ee
Reviewed-on: https://gem5-review.googlesource.com/2169
Reviewed-by: Jason Lowe-Power <ja...@lowepower.com>
Maintainer: Jason Lowe-Power <ja...@lowepower.com>
---
M src/mem/ruby/structures/DirectoryMemory.cc
M src/mem/ruby/structures/DirectoryMemory.py
2 files changed, 13 insertions(+), 1 deletion(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
diff --git a/src/mem/ruby/structures/DirectoryMemory.cc
b/src/mem/ruby/structures/DirectoryMemory.cc
index 8aad6f4..3a0694d 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 "base/intmath.hh"
@@ -32,6 +35,7 @@
#include "mem/ruby/slicc_interface/RubySlicc_Util.hh"
#include "mem/ruby/structures/DirectoryMemory.hh"
#include "mem/ruby/system/RubySystem.hh"
+#include "sim/system.hh"
using namespace std;
@@ -43,7 +47,14 @@
: 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 bb9765b..2518380 100644
--- a/src/mem/ruby/structures/DirectoryMemory.py
+++ b/src/mem/ruby/structures/DirectoryMemory.py
@@ -40,3 +40,4 @@
# 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")
--
To view, visit https://gem5-review.googlesource.com/2169
To unsubscribe, visit https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: hpca
Gerrit-MessageType: merged
Gerrit-Change-Id: I5453a09e953643cada2c096a91d339a3676f55ee
Gerrit-Change-Number: 2169
Gerrit-PatchSet: 4
Gerrit-Owner: Lena Olson <leol...@google.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Joe Gross <cri...@gmail.com>
Gerrit-Reviewer: Sooraj Puthoor <puthoorsoo...@gmail.com>
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev