summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2010-08-20 11:46:13 -0700
committerBrad Beckmann <Brad.Beckmann@amd.com>2010-08-20 11:46:13 -0700
commit593ae7457e0bd1150a08535ee6c79d52a0dfd175 (patch)
tree7df284f825f945eb445ee5741faff41a3419b24a /src/mem/ruby/system
parentac5bb214e3dd8ba91feebd9c50ae7d3d9028668c (diff)
downloadgem5-593ae7457e0bd1150a08535ee6c79d52a0dfd175.tar.xz
ruby: fixed DirectoryMemory's numa_high_bit configuration
This fix includes the off-by-one bit selection bug for numa mapping.
Diffstat (limited to 'src/mem/ruby/system')
-rw-r--r--src/mem/ruby/system/DirectoryMemory.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/mem/ruby/system/DirectoryMemory.cc b/src/mem/ruby/system/DirectoryMemory.cc
index 65b61c935..fbb48d7f5 100644
--- a/src/mem/ruby/system/DirectoryMemory.cc
+++ b/src/mem/ruby/system/DirectoryMemory.cc
@@ -71,7 +71,7 @@ DirectoryMemory::init()
m_total_size_bytes += m_size_bytes;
if (m_numa_high_bit == 0) {
- m_numa_high_bit = RubySystem::getMemorySizeBits();
+ m_numa_high_bit = RubySystem::getMemorySizeBits() - 1;
}
assert(m_numa_high_bit != 0);
}
@@ -125,7 +125,7 @@ DirectoryMemory::mapAddressToDirectoryVersion(PhysAddress address)
if (m_num_directories_bits == 0)
return 0;
- uint64 ret = address.bitSelect(m_numa_high_bit - m_num_directories_bits,
+ uint64 ret = address.bitSelect(m_numa_high_bit - m_num_directories_bits + 1,
m_numa_high_bit);
return ret;
}
@@ -140,10 +140,15 @@ DirectoryMemory::isPresent(PhysAddress address)
uint64
DirectoryMemory::mapAddressToLocalIdx(PhysAddress address)
{
- uint64 ret = address.bitRemove(m_numa_high_bit - m_num_directories_bits,
- m_numa_high_bit)
- >> (RubySystem::getBlockSizeBits());
- return ret;
+ uint64 ret;
+ if (m_num_directories_bits > 0) {
+ ret = address.bitRemove(m_numa_high_bit - m_num_directories_bits + 1,
+ m_numa_high_bit);
+ } else {
+ ret = address.getAddress();
+ }
+
+ return ret >> (RubySystem::getBlockSizeBits());
}
Directory_Entry&