diff options
author | Nathan Binkert <nate@binkert.org> | 2010-04-02 11:20:32 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2010-04-02 11:20:32 -0700 |
commit | 141f61d83a23096dcff20df704bdd734c520f535 (patch) | |
tree | ee2383d721a039bb056bd6442a7241aa305d187e /src/mem/ruby/filters/MultiBitSelBloomFilter.cc | |
parent | f1c3f3044b73d890ffdfdd113b3b37ae2809d21b (diff) | |
download | gem5-141f61d83a23096dcff20df704bdd734c520f535.tar.xz |
ruby: get rid of gems_common/util.hh and .cc and use stuff in src/base
Diffstat (limited to 'src/mem/ruby/filters/MultiBitSelBloomFilter.cc')
-rw-r--r-- | src/mem/ruby/filters/MultiBitSelBloomFilter.cc | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/mem/ruby/filters/MultiBitSelBloomFilter.cc b/src/mem/ruby/filters/MultiBitSelBloomFilter.cc index 90f299fb4..466e3fccb 100644 --- a/src/mem/ruby/filters/MultiBitSelBloomFilter.cc +++ b/src/mem/ruby/filters/MultiBitSelBloomFilter.cc @@ -26,6 +26,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <vector> + +#include "base/intmath.hh" +#include "base/str.hh" #include "mem/gems_common/Map.hh" #include "mem/ruby/common/Address.hh" #include "mem/ruby/filters/MultiBitSelBloomFilter.hh" @@ -34,32 +38,28 @@ using namespace std; MultiBitSelBloomFilter::MultiBitSelBloomFilter(string str) { - string tail(str); - string head = string_split(tail, '_'); + vector<string> items; + tokenize(items, str, '_'); + assert(items.size() == 4); // head contains filter size, tail contains bit offset from block number - m_filter_size = atoi(head.c_str()); - - head = string_split(tail, '_'); - m_num_hashes = atoi(head.c_str()); - - head = string_split(tail, '_'); - m_skip_bits = atoi(head.c_str()); + m_filter_size = atoi(items[0].c_str()); + m_num_hashes = atoi(items[1].c_str()); + m_skip_bits = atoi(items[2].c_str()); - if(tail == "Regular") { + if (items[3] == "Regular") { isParallel = false; - } else if (tail == "Parallel") { + } else if (items[3] == "Parallel") { isParallel = true; } else { - cout << "ERROR: Incorrect config string for MultiBitSel Bloom! :" - << str << endl; - assert(0); + panic("ERROR: Incorrect config string for MultiBitSel Bloom! :%s", + str); } - m_filter_size_bits = log_int(m_filter_size); + m_filter_size_bits = floorLog2(m_filter_size); - m_par_filter_size = m_filter_size/m_num_hashes; - m_par_filter_size_bits = log_int(m_par_filter_size); + m_par_filter_size = m_filter_size / m_num_hashes; + m_par_filter_size_bits = floorLog2(m_par_filter_size); m_filter.setSize(m_filter_size); clear(); |