34 #include "params/BloomFilterBlock.hh" 39 :
Base(p), masksLSBs(p->masks_lsbs),
40 masksSizes(p->masks_sizes)
43 "Masks haven't been properly provided");
45 "There must be at least one mask to extract an address bitfield");
49 "The bitfields must be indexable in the filter");
51 std::numeric_limits<Addr>::digits,
52 "The total size of the bitfields cannot be bigger than the " \
53 "number of bits in an address");
88 assert(hashed_addr <
filter.size());
95 BloomFilterBlockParams::create()
std::vector< SatCounter > filter
The filter itself.
Block(const BloomFilterBlockParams *p)
int hash(Addr addr) const
XOR hash between bitfields of an address, provided by the mask vector.
std::vector< unsigned > masksLSBs
Position of the LSB of each mask.
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.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void set(Addr addr) override
Perform the filter specific function to set the corresponding entries (can be multiple) of an address...
int getCount(Addr addr) const override
Get the value stored in the corresponding filter entry of an address.
Simple deletable (with false negatives) bloom filter that extracts bitfields of an address to use as ...
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...
void unset(Addr addr) override
Perform the filter specific function to clear the corresponding entries (can be multiple) of an addre...
std::vector< unsigned > masksSizes
Number of bits in each mask.