summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2014-01-04 00:03:30 -0600
committerNilay Vaish <nilay@cs.wisc.edu>2014-01-04 00:03:30 -0600
commit9853ef6651e76883615595bf76f983ed43234f96 (patch)
tree56b3410497dbad5e4cbac88bc91ee6234d0438e5
parenta212844f6785f896b268b678f0018528c0ecfdc7 (diff)
downloadgem5-9853ef6651e76883615595bf76f983ed43234f96.tar.xz
ruby: some small changes
-rw-r--r--configs/ruby/Ruby.py2
-rw-r--r--src/mem/ruby/common/NetDest.cc10
-rw-r--r--src/mem/ruby/common/NetDest.hh2
-rw-r--r--src/mem/ruby/system/DirectoryMemory.cc2
4 files changed, 13 insertions, 3 deletions
diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py
index 0cd63b4f9..f8ca59734 100644
--- a/configs/ruby/Ruby.py
+++ b/configs/ruby/Ruby.py
@@ -167,7 +167,6 @@ def create_system(options, system, piobus = None, dma_ports = []):
#
total_mem_size = MemorySize('0B')
- dir_bits = int(math.log(options.num_dirs, 2))
ruby.block_size_bytes = options.cacheline_size
block_size_bits = int(math.log(options.cacheline_size, 2))
@@ -177,6 +176,7 @@ def create_system(options, system, piobus = None, dma_ports = []):
# if the numa_bit is not specified, set the directory bits as the
# lowest bits above the block offset bits, and the numa_bit as the
# highest of those directory bits
+ dir_bits = int(math.log(options.num_dirs, 2))
numa_bit = block_size_bits + dir_bits - 1
for dir_cntrl in dir_cntrls:
diff --git a/src/mem/ruby/common/NetDest.cc b/src/mem/ruby/common/NetDest.cc
index 97788345c..f7508f1da 100644
--- a/src/mem/ruby/common/NetDest.cc
+++ b/src/mem/ruby/common/NetDest.cc
@@ -275,3 +275,13 @@ NetDest::print(std::ostream& out) const
out << "]";
}
+bool
+NetDest::isEqual(const NetDest& n) const
+{
+ assert(m_bits.size() == n.m_bits.size());
+ for (unsigned int i = 0; i < m_bits.size(); ++i) {
+ if (!m_bits[i].isEqual(n.m_bits[i]))
+ return false;
+ }
+ return true;
+}
diff --git a/src/mem/ruby/common/NetDest.hh b/src/mem/ruby/common/NetDest.hh
index 5ad1b6100..0e113c269 100644
--- a/src/mem/ruby/common/NetDest.hh
+++ b/src/mem/ruby/common/NetDest.hh
@@ -66,7 +66,7 @@ class NetDest
void broadcast();
void broadcast(MachineType machine);
int count() const;
- bool isEqual(const NetDest& netDest);
+ bool isEqual(const NetDest& netDest) const;
// return the logical OR of this netDest and orNetDest
NetDest OR(const NetDest& orNetDest) const;
diff --git a/src/mem/ruby/system/DirectoryMemory.cc b/src/mem/ruby/system/DirectoryMemory.cc
index 1cf020910..cb1bf6f90 100644
--- a/src/mem/ruby/system/DirectoryMemory.cc
+++ b/src/mem/ruby/system/DirectoryMemory.cc
@@ -68,7 +68,7 @@ DirectoryMemory::init()
}
m_num_directories++;
- m_num_directories_bits = floorLog2(m_num_directories);
+ m_num_directories_bits = ceilLog2(m_num_directories);
m_total_size_bytes += m_size_bytes;
if (m_numa_high_bit == 0) {