42 m_filter_size_bits =
floorLog2(m_filter_size);
44 m_page_filter_size = tail;
45 m_page_filter_size_bits =
floorLog2(m_page_filter_size);
47 m_filter.resize(m_filter_size);
48 m_page_filter.resize(m_page_filter_size);
59 for (
int i = 0;
i < m_filter_size;
i++) {
62 for (
int i=0;
i < m_page_filter_size; ++
i){
89 int i = get_block_index(addr);
90 assert(i < m_filter_size);
91 assert(get_page_index(addr) < m_page_filter_size);
106 int i = get_block_index(addr);
107 assert(i < m_filter_size);
108 assert(get_page_index(addr) < m_page_filter_size);
110 return (m_filter[i] && m_page_filter[i]);
125 for (
int i = 0;
i < m_filter_size;
i++) {
126 count += m_filter[
i];
129 for (
int i=0;
i < m_page_filter_size; ++
i) {
130 count += m_page_filter[
i] = 0;
167 m_filter_size_bits - 1);
176 return bitSelect(addr, bits, bits + m_page_filter_size_bits - 1);
Addr bitSelect(Addr addr, unsigned int small, unsigned int big)
void decrement(Addr addr)
int get_block_index(Addr addr)
MultiGrainBloomFilter(int head, int tail)
int get_page_index(Addr addr)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void merge(AbstractBloomFilter *other_filter)
int readBit(const int index)
int floorLog2(unsigned x)
void writeBit(const int index, const int value)
void print(std::ostream &out) const
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...
void increment(Addr addr)
static uint32_t getBlockSizeBits()