From 9853ef6651e76883615595bf76f983ed43234f96 Mon Sep 17 00:00:00 2001 From: Nilay Vaish Date: Sat, 4 Jan 2014 00:03:30 -0600 Subject: ruby: some small changes --- src/mem/ruby/common/NetDest.cc | 10 ++++++++++ src/mem/ruby/common/NetDest.hh | 2 +- src/mem/ruby/system/DirectoryMemory.cc | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/mem/ruby') 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) { -- cgit v1.2.3