base: Add error messages to BloomFilter::Perfect
Warn the user when they use BloomFilter::Perfect's parameters incorrectly. Change-Id: Ib493c5f508e47a5f18e43c023755ef960954f5cc Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44112 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Daniel Carvalho
parent
4b2118ed4b
commit
c89971b0f8
@@ -98,3 +98,8 @@ class BloomFilterPerfect(BloomFilterBase):
|
||||
|
||||
# The base filter is not needed. Use a dummy value.
|
||||
size = 1
|
||||
|
||||
# This filter does not use saturating counters - as long as the entry is
|
||||
# set, it is present; thus, it only needs one bit.
|
||||
num_bits = 1
|
||||
threshold = 1
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "base/filters/perfect_bloom_filter.hh"
|
||||
|
||||
#include "base/logging.hh"
|
||||
#include "params/BloomFilterPerfect.hh"
|
||||
|
||||
namespace gem5
|
||||
@@ -40,6 +41,12 @@ namespace bloom_filter
|
||||
Perfect::Perfect(const BloomFilterPerfectParams &p)
|
||||
: Base(p)
|
||||
{
|
||||
fatal_if(p.size != 1, "The perfect Bloom filter cannot be limited to a "
|
||||
"specific size.");
|
||||
fatal_if(p.num_bits != 1, "The perfect Bloom filter tracks entries "
|
||||
"perfectly using an unlimited amount of 1-bit entries.");
|
||||
fatal_if(p.threshold != 1, "The perfect Bloom filter uses 1-bit entries; "
|
||||
"thus, their thresholds must be 1.");
|
||||
}
|
||||
|
||||
Perfect::~Perfect()
|
||||
|
||||
Reference in New Issue
Block a user