From 2d1d25f1964653aeed849cb1119feb6c6aaa5b08 Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Mon, 6 May 2019 00:11:08 +0200 Subject: [PATCH] mem-ruby: Remove index based functions in bloom filters Most of the index based functions were not implemented, and a user is more likely to be interested in checking the filter contents based on an address than an index. As a side effect, the Bulk's hash function became unused, and according to the paper permute() was doing more than just permuting, so it was renamed. Change-Id: I6423a2565a082fee2e7f11fa489a11f253064d99 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18732 Maintainer: Nikos Nikoleris Tested-by: kokoro Reviewed-by: Nikos Nikoleris --- src/mem/ruby/filters/AbstractBloomFilter.hh | 4 ---- src/mem/ruby/filters/BlockBloomFilter.cc | 18 ----------------- src/mem/ruby/filters/BlockBloomFilter.hh | 3 --- src/mem/ruby/filters/BulkBloomFilter.cc | 19 ------------------ src/mem/ruby/filters/BulkBloomFilter.hh | 3 --- src/mem/ruby/filters/H3BloomFilter.cc | 17 ---------------- src/mem/ruby/filters/H3BloomFilter.hh | 4 ---- .../ruby/filters/LSB_CountingBloomFilter.cc | 19 ------------------ .../ruby/filters/LSB_CountingBloomFilter.hh | 3 --- .../ruby/filters/MultiBitSelBloomFilter.cc | 17 ---------------- .../ruby/filters/MultiBitSelBloomFilter.hh | 4 ---- src/mem/ruby/filters/MultiGrainBloomFilter.cc | 20 ------------------- src/mem/ruby/filters/MultiGrainBloomFilter.hh | 3 --- .../ruby/filters/NonCountingBloomFilter.cc | 18 ----------------- .../ruby/filters/NonCountingBloomFilter.hh | 4 ---- 15 files changed, 156 deletions(-) diff --git a/src/mem/ruby/filters/AbstractBloomFilter.hh b/src/mem/ruby/filters/AbstractBloomFilter.hh index bdf7c6323..3e90cadd9 100644 --- a/src/mem/ruby/filters/AbstractBloomFilter.hh +++ b/src/mem/ruby/filters/AbstractBloomFilter.hh @@ -51,10 +51,6 @@ class AbstractBloomFilter virtual bool isSet(Addr addr) = 0; virtual int getCount(Addr addr) = 0; virtual int getTotalCount() = 0; - - virtual int getIndex(Addr addr) = 0; - virtual int readBit(const int index) = 0; - virtual void writeBit(const int index, const int value) = 0; }; #endif // __MEM_RUBY_FILTERS_ABSTRACTBLOOMFILTER_HH__ diff --git a/src/mem/ruby/filters/BlockBloomFilter.cc b/src/mem/ruby/filters/BlockBloomFilter.cc index e990497d0..351692885 100644 --- a/src/mem/ruby/filters/BlockBloomFilter.cc +++ b/src/mem/ruby/filters/BlockBloomFilter.cc @@ -99,24 +99,6 @@ BlockBloomFilter::getTotalCount() return count; } -int -BlockBloomFilter::getIndex(Addr addr) -{ - return get_index(addr); -} - -int -BlockBloomFilter::readBit(const int index) -{ - return m_filter[index]; -} - -void -BlockBloomFilter::writeBit(const int index, const int value) -{ - m_filter[index] = value; -} - int BlockBloomFilter::get_index(Addr addr) { diff --git a/src/mem/ruby/filters/BlockBloomFilter.hh b/src/mem/ruby/filters/BlockBloomFilter.hh index 088759c5e..5eaf6ead3 100644 --- a/src/mem/ruby/filters/BlockBloomFilter.hh +++ b/src/mem/ruby/filters/BlockBloomFilter.hh @@ -48,9 +48,6 @@ class BlockBloomFilter : public AbstractBloomFilter bool isSet(Addr addr); int getCount(Addr addr); int getTotalCount(); - int getIndex(Addr addr); - int readBit(const int index); - void writeBit(const int index, const int value); private: int get_index(Addr addr); diff --git a/src/mem/ruby/filters/BulkBloomFilter.cc b/src/mem/ruby/filters/BulkBloomFilter.cc index d7fa1a388..da873f942 100644 --- a/src/mem/ruby/filters/BulkBloomFilter.cc +++ b/src/mem/ruby/filters/BulkBloomFilter.cc @@ -163,25 +163,6 @@ BulkBloomFilter::getTotalCount() return count; } -int -BulkBloomFilter::getIndex(Addr addr) -{ - return get_index(addr); -} - -int -BulkBloomFilter::readBit(const int index) -{ - return 0; - // TODO -} - -void -BulkBloomFilter::writeBit(const int index, const int value) -{ - // TODO -} - int BulkBloomFilter::get_index(Addr addr) { diff --git a/src/mem/ruby/filters/BulkBloomFilter.hh b/src/mem/ruby/filters/BulkBloomFilter.hh index a3df10530..39cd80944 100644 --- a/src/mem/ruby/filters/BulkBloomFilter.hh +++ b/src/mem/ruby/filters/BulkBloomFilter.hh @@ -47,9 +47,6 @@ class BulkBloomFilter : public AbstractBloomFilter bool isSet(Addr addr); int getCount(Addr addr); int getTotalCount(); - int getIndex(Addr addr); - int readBit(const int index); - void writeBit(const int index, const int value); private: int get_index(Addr addr); diff --git a/src/mem/ruby/filters/H3BloomFilter.cc b/src/mem/ruby/filters/H3BloomFilter.cc index 90b3546d9..7f44a2bd3 100644 --- a/src/mem/ruby/filters/H3BloomFilter.cc +++ b/src/mem/ruby/filters/H3BloomFilter.cc @@ -438,23 +438,6 @@ H3BloomFilter::getCount(Addr addr) return isSet(addr)? 1: 0; } -int -H3BloomFilter::getIndex(Addr addr) -{ - return 0; -} - -int -H3BloomFilter::readBit(const int index) -{ - return 0; -} - -void -H3BloomFilter::writeBit(const int index, const int value) -{ -} - int H3BloomFilter::getTotalCount() { diff --git a/src/mem/ruby/filters/H3BloomFilter.hh b/src/mem/ruby/filters/H3BloomFilter.hh index 93dc7d373..1df0d2a16 100644 --- a/src/mem/ruby/filters/H3BloomFilter.hh +++ b/src/mem/ruby/filters/H3BloomFilter.hh @@ -48,10 +48,6 @@ class H3BloomFilter : public AbstractBloomFilter int getCount(Addr addr); int getTotalCount(); - int getIndex(Addr addr); - int readBit(const int index); - void writeBit(const int index, const int value); - int operator[](const int index) const { diff --git a/src/mem/ruby/filters/LSB_CountingBloomFilter.cc b/src/mem/ruby/filters/LSB_CountingBloomFilter.cc index 98c480b4e..5d9475bed 100644 --- a/src/mem/ruby/filters/LSB_CountingBloomFilter.cc +++ b/src/mem/ruby/filters/LSB_CountingBloomFilter.cc @@ -101,25 +101,6 @@ LSB_CountingBloomFilter::getTotalCount() return count; } -int -LSB_CountingBloomFilter::getIndex(Addr addr) -{ - return get_index(addr); -} - -int -LSB_CountingBloomFilter::readBit(const int index) -{ - return 0; - // TODO -} - -void -LSB_CountingBloomFilter::writeBit(const int index, const int value) -{ - // TODO -} - int LSB_CountingBloomFilter::get_index(Addr addr) { diff --git a/src/mem/ruby/filters/LSB_CountingBloomFilter.hh b/src/mem/ruby/filters/LSB_CountingBloomFilter.hh index 11df169dd..7c02f7726 100644 --- a/src/mem/ruby/filters/LSB_CountingBloomFilter.hh +++ b/src/mem/ruby/filters/LSB_CountingBloomFilter.hh @@ -48,9 +48,6 @@ class LSB_CountingBloomFilter : public AbstractBloomFilter bool isSet(Addr addr); int getCount(Addr addr); int getTotalCount(); - int getIndex(Addr addr); - int readBit(const int index); - void writeBit(const int index, const int value); private: int get_index(Addr addr); diff --git a/src/mem/ruby/filters/MultiBitSelBloomFilter.cc b/src/mem/ruby/filters/MultiBitSelBloomFilter.cc index 206e5b07a..f64e14eab 100644 --- a/src/mem/ruby/filters/MultiBitSelBloomFilter.cc +++ b/src/mem/ruby/filters/MultiBitSelBloomFilter.cc @@ -93,23 +93,6 @@ MultiBitSelBloomFilter::getCount(Addr addr) return isSet(addr)? 1: 0; } -int -MultiBitSelBloomFilter::getIndex(Addr addr) -{ - return 0; -} - -int -MultiBitSelBloomFilter::readBit(const int index) -{ - return 0; -} - -void -MultiBitSelBloomFilter::writeBit(const int index, const int value) -{ -} - int MultiBitSelBloomFilter::getTotalCount() { diff --git a/src/mem/ruby/filters/MultiBitSelBloomFilter.hh b/src/mem/ruby/filters/MultiBitSelBloomFilter.hh index 94ec38d38..45952de93 100644 --- a/src/mem/ruby/filters/MultiBitSelBloomFilter.hh +++ b/src/mem/ruby/filters/MultiBitSelBloomFilter.hh @@ -50,10 +50,6 @@ class MultiBitSelBloomFilter : public AbstractBloomFilter int getCount(Addr addr); int getTotalCount(); - int getIndex(Addr addr); - int readBit(const int index); - void writeBit(const int index, const int value); - int operator[](const int index) const { diff --git a/src/mem/ruby/filters/MultiGrainBloomFilter.cc b/src/mem/ruby/filters/MultiGrainBloomFilter.cc index a4de7a7af..29af6eb1b 100644 --- a/src/mem/ruby/filters/MultiGrainBloomFilter.cc +++ b/src/mem/ruby/filters/MultiGrainBloomFilter.cc @@ -111,26 +111,6 @@ MultiGrainBloomFilter::getTotalCount() return count; } -int -MultiGrainBloomFilter::getIndex(Addr addr) -{ - return 0; - // TODO -} - -int -MultiGrainBloomFilter::readBit(const int index) -{ - return 0; - // TODO -} - -void -MultiGrainBloomFilter::writeBit(const int index, const int value) -{ - // TODO -} - int MultiGrainBloomFilter::get_block_index(Addr addr) { diff --git a/src/mem/ruby/filters/MultiGrainBloomFilter.hh b/src/mem/ruby/filters/MultiGrainBloomFilter.hh index 3be6ff640..6f9a58478 100644 --- a/src/mem/ruby/filters/MultiGrainBloomFilter.hh +++ b/src/mem/ruby/filters/MultiGrainBloomFilter.hh @@ -47,9 +47,6 @@ class MultiGrainBloomFilter : public AbstractBloomFilter bool isSet(Addr addr); int getCount(Addr addr); int getTotalCount(); - int getIndex(Addr addr); - int readBit(const int index); - void writeBit(const int index, const int value); private: int get_block_index(Addr addr); diff --git a/src/mem/ruby/filters/NonCountingBloomFilter.cc b/src/mem/ruby/filters/NonCountingBloomFilter.cc index f012a7249..50432d7a8 100644 --- a/src/mem/ruby/filters/NonCountingBloomFilter.cc +++ b/src/mem/ruby/filters/NonCountingBloomFilter.cc @@ -104,24 +104,6 @@ NonCountingBloomFilter::getTotalCount() return count; } -int -NonCountingBloomFilter::getIndex(Addr addr) -{ - return get_index(addr); -} - -int -NonCountingBloomFilter::readBit(const int index) -{ - return m_filter[index]; -} - -void -NonCountingBloomFilter::writeBit(const int index, const int value) -{ - m_filter[index] = value; -} - int NonCountingBloomFilter::get_index(Addr addr) { diff --git a/src/mem/ruby/filters/NonCountingBloomFilter.hh b/src/mem/ruby/filters/NonCountingBloomFilter.hh index 2f1885d8d..08610606e 100644 --- a/src/mem/ruby/filters/NonCountingBloomFilter.hh +++ b/src/mem/ruby/filters/NonCountingBloomFilter.hh @@ -49,10 +49,6 @@ class NonCountingBloomFilter : public AbstractBloomFilter int getCount(Addr addr); int getTotalCount(); - int getIndex(Addr addr); - int readBit(const int index); - void writeBit(const int index, const int value); - int operator[](const int index) const { -- 2.30.2