diff options
Diffstat (limited to 'src/mem/ruby/filters/LSB_CountingBloomFilter.cc')
-rw-r--r-- | src/mem/ruby/filters/LSB_CountingBloomFilter.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mem/ruby/filters/LSB_CountingBloomFilter.cc b/src/mem/ruby/filters/LSB_CountingBloomFilter.cc index 7ec927d6c..029ce1501 100644 --- a/src/mem/ruby/filters/LSB_CountingBloomFilter.cc +++ b/src/mem/ruby/filters/LSB_CountingBloomFilter.cc @@ -26,6 +26,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "base/intmath.hh" +#include "base/str.hh" #include "mem/gems_common/Map.hh" #include "mem/ruby/common/Address.hh" #include "mem/ruby/filters/LSB_CountingBloomFilter.hh" @@ -34,14 +36,18 @@ using namespace std; LSB_CountingBloomFilter::LSB_CountingBloomFilter(string str) { - string tail(str); - string head = string_split(tail, ':'); + string head, tail; +#ifndef NDEBUG + bool success = +#endif + split_first(str, head, tail, '_'); + assert(success); m_filter_size = atoi(head.c_str()); - m_filter_size_bits = log_int(m_filter_size); + m_filter_size_bits = floorLog2(m_filter_size); m_count = atoi(tail.c_str()); - m_count_bits = log_int(m_count); + m_count_bits = floorLog2(m_count); m_filter.setSize(m_filter_size); clear(); |