From: Daniel R. Carvalho Date: Mon, 6 May 2019 06:58:07 +0000 (+0200) Subject: mem-ruby: Bloom filters - Remove in/decrement X-Git-Tag: v19.0.0.0~750 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bb450fe0aa25e25b254f50c3dbba85fe75af4d1c;p=gem5.git mem-ruby: Bloom filters - Remove in/decrement Increment and decrement were functions created to supply the different naming convention used by the counting bloom filter. They were removed, and the set and unset functions were used in their place instead, as in the other filters. Change-Id: I45732bdfa3083add0a975f374a0f3560003e9d09 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18729 Maintainer: Nikos Nikoleris Tested-by: kokoro Reviewed-by: Nikos Nikoleris --- diff --git a/src/mem/protocol/RubySlicc_Types.sm b/src/mem/protocol/RubySlicc_Types.sm index 27a045d29..28fb6ef00 100644 --- a/src/mem/protocol/RubySlicc_Types.sm +++ b/src/mem/protocol/RubySlicc_Types.sm @@ -235,8 +235,6 @@ structure (TimerTable, inport="yes", external = "yes") { structure (AbstractBloomFilter, external = "yes") { void clear(int); - void increment(Addr, int); - void decrement(Addr, int); void set(Addr, int); void unset(Addr, int); diff --git a/src/mem/ruby/filters/AbstractBloomFilter.hh b/src/mem/ruby/filters/AbstractBloomFilter.hh index 097e0e204..51c5e92b2 100644 --- a/src/mem/ruby/filters/AbstractBloomFilter.hh +++ b/src/mem/ruby/filters/AbstractBloomFilter.hh @@ -38,8 +38,6 @@ class AbstractBloomFilter public: virtual ~AbstractBloomFilter() {}; virtual void clear() = 0; - virtual void increment(Addr addr) = 0; - virtual void decrement(Addr addr) = 0; virtual void merge(AbstractBloomFilter * other_filter) = 0; virtual void set(Addr addr) = 0; virtual void unset(Addr addr) = 0; diff --git a/src/mem/ruby/filters/BlockBloomFilter.cc b/src/mem/ruby/filters/BlockBloomFilter.cc index 9587fa927..262ca8bab 100644 --- a/src/mem/ruby/filters/BlockBloomFilter.cc +++ b/src/mem/ruby/filters/BlockBloomFilter.cc @@ -56,18 +56,6 @@ BlockBloomFilter::clear() } } -void -BlockBloomFilter::increment(Addr addr) -{ - // Not used -} - -void -BlockBloomFilter::decrement(Addr addr) -{ - // Not used -} - void BlockBloomFilter::merge(AbstractBloomFilter * other_filter) { diff --git a/src/mem/ruby/filters/BlockBloomFilter.hh b/src/mem/ruby/filters/BlockBloomFilter.hh index 8e6a94fa1..bd24aa66a 100644 --- a/src/mem/ruby/filters/BlockBloomFilter.hh +++ b/src/mem/ruby/filters/BlockBloomFilter.hh @@ -42,8 +42,6 @@ class BlockBloomFilter : public AbstractBloomFilter ~BlockBloomFilter(); void clear(); - void increment(Addr addr); - void decrement(Addr addr); void merge(AbstractBloomFilter * other_filter); void set(Addr addr); void unset(Addr addr); diff --git a/src/mem/ruby/filters/BulkBloomFilter.cc b/src/mem/ruby/filters/BulkBloomFilter.cc index 3bd2b4d32..4a80d538a 100644 --- a/src/mem/ruby/filters/BulkBloomFilter.cc +++ b/src/mem/ruby/filters/BulkBloomFilter.cc @@ -65,18 +65,6 @@ BulkBloomFilter::clear() } } -void -BulkBloomFilter::increment(Addr addr) -{ - // Not used -} - -void -BulkBloomFilter::decrement(Addr addr) -{ - // Not used -} - void BulkBloomFilter::merge(AbstractBloomFilter * other_filter) { diff --git a/src/mem/ruby/filters/BulkBloomFilter.hh b/src/mem/ruby/filters/BulkBloomFilter.hh index 059f8b17a..231622125 100644 --- a/src/mem/ruby/filters/BulkBloomFilter.hh +++ b/src/mem/ruby/filters/BulkBloomFilter.hh @@ -42,8 +42,6 @@ class BulkBloomFilter : public AbstractBloomFilter ~BulkBloomFilter(); void clear(); - void increment(Addr addr); - void decrement(Addr addr); void merge(AbstractBloomFilter * other_filter); void set(Addr addr); void unset(Addr addr); diff --git a/src/mem/ruby/filters/H3BloomFilter.cc b/src/mem/ruby/filters/H3BloomFilter.cc index 71d4c88ce..91aa16857 100644 --- a/src/mem/ruby/filters/H3BloomFilter.cc +++ b/src/mem/ruby/filters/H3BloomFilter.cc @@ -404,18 +404,6 @@ H3BloomFilter::clear() } } -void -H3BloomFilter::increment(Addr addr) -{ - // Not used -} - -void -H3BloomFilter::decrement(Addr addr) -{ - // Not used -} - void H3BloomFilter::merge(AbstractBloomFilter *other_filter) { diff --git a/src/mem/ruby/filters/H3BloomFilter.hh b/src/mem/ruby/filters/H3BloomFilter.hh index 443487fac..efbdec341 100644 --- a/src/mem/ruby/filters/H3BloomFilter.hh +++ b/src/mem/ruby/filters/H3BloomFilter.hh @@ -42,8 +42,6 @@ class H3BloomFilter : public AbstractBloomFilter ~H3BloomFilter(); void clear(); - void increment(Addr addr); - void decrement(Addr addr); void merge(AbstractBloomFilter * other_filter); void set(Addr addr); void unset(Addr addr); diff --git a/src/mem/ruby/filters/LSB_CountingBloomFilter.cc b/src/mem/ruby/filters/LSB_CountingBloomFilter.cc index e8050b16d..25e1dbfa8 100644 --- a/src/mem/ruby/filters/LSB_CountingBloomFilter.cc +++ b/src/mem/ruby/filters/LSB_CountingBloomFilter.cc @@ -57,23 +57,6 @@ LSB_CountingBloomFilter::clear() } } -void -LSB_CountingBloomFilter::increment(Addr addr) -{ - int i = get_index(addr); - if (m_filter[i] < m_count) - m_filter[i] += 1; -} - - -void -LSB_CountingBloomFilter::decrement(Addr addr) -{ - int i = get_index(addr); - if (m_filter[i] > 0) - m_filter[i] -= 1; -} - void LSB_CountingBloomFilter::merge(AbstractBloomFilter * other_filter) { @@ -83,13 +66,17 @@ LSB_CountingBloomFilter::merge(AbstractBloomFilter * other_filter) void LSB_CountingBloomFilter::set(Addr addr) { - // TODO + int i = get_index(addr); + if (m_filter[i] < m_count) + m_filter[i] += 1; } void LSB_CountingBloomFilter::unset(Addr addr) { - // TODO + int i = get_index(addr); + if (m_filter[i] > 0) + m_filter[i] -= 1; } bool diff --git a/src/mem/ruby/filters/LSB_CountingBloomFilter.hh b/src/mem/ruby/filters/LSB_CountingBloomFilter.hh index 05749be6c..48e83805a 100644 --- a/src/mem/ruby/filters/LSB_CountingBloomFilter.hh +++ b/src/mem/ruby/filters/LSB_CountingBloomFilter.hh @@ -42,8 +42,6 @@ class LSB_CountingBloomFilter : public AbstractBloomFilter ~LSB_CountingBloomFilter(); void clear(); - void increment(Addr addr); - void decrement(Addr addr); void merge(AbstractBloomFilter * other_filter); void set(Addr addr); void unset(Addr addr); diff --git a/src/mem/ruby/filters/MultiBitSelBloomFilter.cc b/src/mem/ruby/filters/MultiBitSelBloomFilter.cc index cee28db04..f46442ece 100644 --- a/src/mem/ruby/filters/MultiBitSelBloomFilter.cc +++ b/src/mem/ruby/filters/MultiBitSelBloomFilter.cc @@ -59,19 +59,6 @@ MultiBitSelBloomFilter::clear() } } -void -MultiBitSelBloomFilter::increment(Addr addr) -{ - // Not used -} - - -void -MultiBitSelBloomFilter::decrement(Addr addr) -{ - // Not used -} - void MultiBitSelBloomFilter::merge(AbstractBloomFilter *other_filter) { diff --git a/src/mem/ruby/filters/MultiBitSelBloomFilter.hh b/src/mem/ruby/filters/MultiBitSelBloomFilter.hh index 23d970a2e..315e2725f 100644 --- a/src/mem/ruby/filters/MultiBitSelBloomFilter.hh +++ b/src/mem/ruby/filters/MultiBitSelBloomFilter.hh @@ -44,8 +44,6 @@ class MultiBitSelBloomFilter : public AbstractBloomFilter ~MultiBitSelBloomFilter(); void clear(); - void increment(Addr addr); - void decrement(Addr addr); void merge(AbstractBloomFilter * other_filter); void set(Addr addr); void unset(Addr addr); diff --git a/src/mem/ruby/filters/MultiGrainBloomFilter.cc b/src/mem/ruby/filters/MultiGrainBloomFilter.cc index c1d558c8c..5f541b5a8 100644 --- a/src/mem/ruby/filters/MultiGrainBloomFilter.cc +++ b/src/mem/ruby/filters/MultiGrainBloomFilter.cc @@ -64,19 +64,6 @@ MultiGrainBloomFilter::clear() } } -void -MultiGrainBloomFilter::increment(Addr addr) -{ - // Not used -} - - -void -MultiGrainBloomFilter::decrement(Addr addr) -{ - // Not used -} - void MultiGrainBloomFilter::merge(AbstractBloomFilter *other_filter) { diff --git a/src/mem/ruby/filters/MultiGrainBloomFilter.hh b/src/mem/ruby/filters/MultiGrainBloomFilter.hh index e4c83957d..8bfd39b46 100644 --- a/src/mem/ruby/filters/MultiGrainBloomFilter.hh +++ b/src/mem/ruby/filters/MultiGrainBloomFilter.hh @@ -42,8 +42,6 @@ class MultiGrainBloomFilter : public AbstractBloomFilter ~MultiGrainBloomFilter(); void clear(); - void increment(Addr addr); - void decrement(Addr addr); void merge(AbstractBloomFilter * other_filter); void set(Addr addr); void unset(Addr addr); diff --git a/src/mem/ruby/filters/NonCountingBloomFilter.cc b/src/mem/ruby/filters/NonCountingBloomFilter.cc index 15b169794..ca1cbab01 100644 --- a/src/mem/ruby/filters/NonCountingBloomFilter.cc +++ b/src/mem/ruby/filters/NonCountingBloomFilter.cc @@ -57,18 +57,6 @@ NonCountingBloomFilter::clear() } } -void -NonCountingBloomFilter::increment(Addr addr) -{ - // Not used -} - -void -NonCountingBloomFilter::decrement(Addr addr) -{ - // Not used -} - void NonCountingBloomFilter::merge(AbstractBloomFilter *other_filter) { diff --git a/src/mem/ruby/filters/NonCountingBloomFilter.hh b/src/mem/ruby/filters/NonCountingBloomFilter.hh index b0599e74b..bdd05db3a 100644 --- a/src/mem/ruby/filters/NonCountingBloomFilter.hh +++ b/src/mem/ruby/filters/NonCountingBloomFilter.hh @@ -42,8 +42,6 @@ class NonCountingBloomFilter : public AbstractBloomFilter ~NonCountingBloomFilter(); void clear(); - void increment(Addr addr); - void decrement(Addr addr); void merge(AbstractBloomFilter * other_filter); void set(Addr addr); void unset(Addr addr);