30 #ifndef __BASE_FILTERS_BASE_HH__ 31 #define __BASE_FILTERS_BASE_HH__ 38 #include "params/BloomFilterBase.hh" 62 Base(
const BloomFilterBaseParams*
p)
63 :
SimObject(p), offsetBits(p->offset_bits),
65 sizeBits(
floorLog2(p->size)), setThreshold(p->threshold)
76 for (
auto& entry : filter) {
90 assert(filter.size() == other->
filter.size());
91 for (
int i = 0;
i < filter.size(); ++
i){
142 for (
const auto& entry : filter) {
151 #endif // __BASE_FILTERS_BASE_HH__
virtual void merge(const Base *other)
Merges the contents of both filters into this' (Bloom Filter union).
Base(const BloomFilterBaseParams *p)
Create and clear the filter.
virtual bool isSet(Addr addr) const
Check if the corresponding filter entries of an address should be considered as set.
virtual void unset(Addr addr)
Perform the filter specific function to clear the corresponding entries (can be multiple) of an addre...
std::vector< SatCounter > filter
The filter itself.
std::enable_if< std::is_integral< T >::value, int >::type floorLog2(T x)
const int sizeBits
Number of bits needed to represent the size of the filter.
Implements an n bit saturating counter and provides methods to increment, decrement, and read it.
const unsigned offsetBits
Number of LSB bits to ignore from the the addresses.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual void clear()
Clear the filter by resetting all values.
virtual int getCount(Addr addr) const
Get the value stored in the corresponding filter entry of an address.
const int setThreshold
Threshold at which a filter entry starts being considered as set.
Abstract superclass for simulation objects.
virtual int getTotalCount() const
Get the total value stored in the filter entries.