36#include "params/BloomFilterMultiBitSel.hh"
45 :
Base(
p), numHashes(
p.num_hashes),
46 parFilterSize(
p.size / numHashes),
47 isParallel(
p.is_parallel), skipBits(
p.skip_bits)
50 fatal(
"Can't divide filter (%d) in %d equal portions",
p.size,
80 uint64_t value =
bits(
addr, std::numeric_limits<Addr>::digits - 1,
82 const int max_bits = std::numeric_limits<Addr>::digits -
offsetBits;
87 bit = (hash_number +
numHashes *
i) % max_bits;
88 if (value & (1 << bit)) {
96 return result %
filter.size();
std::vector< SatCounter8 > filter
The filter itself.
const int sizeBits
Number of bits needed to represent the size of the filter.
const unsigned offsetBits
Number of LSB bits to ignore from the the addresses.
const int skipBits
Bit offset from block number.
int getCount(Addr addr) const override
Get the value stored in the corresponding filter entry of an address.
MultiBitSel(const BloomFilterMultiBitSelParams &p)
const bool isParallel
Whether hashing should be performed in parallel.
virtual int hash(Addr addr, int hash_number) const
Apply the selected the hash functions to an address.
void set(Addr addr) override
Perform the filter specific function to set the corresponding entries (can be multiple) of an address...
const int parFilterSize
Size of the filter when doing parallel hashing.
const int numHashes
Number of hashes.
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
#define fatal(...)
This implements a cprintf based fatal() function.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.