summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2019-05-11 23:19:48 +0200
committerDaniel Carvalho <odanrc@yahoo.com.br>2019-09-10 07:00:09 +0000
commit8d65e51f7f0fed279d2ecfc8601671e479b3387c (patch)
treeea8494924565def2c915ca4347431c76e9e42d0d /src
parent9b9045bb67ac5f2cfa3306607635f347a3ee2f27 (diff)
downloadgem5-8d65e51f7f0fed279d2ecfc8601671e479b3387c.tar.xz
mem-ruby: Move Bloom Filters to base
All Bloom Filters are completely independent of Ruby, and therefore can be used everywhere. As a side effect, Ruby was not using the filters, so their dependency was removed. Change-Id: Ic5f430610c33c0791fb81c79101ebe737189497e Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18875 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src')
-rw-r--r--src/base/filters/BloomFilters.py (renamed from src/mem/ruby/filters/BloomFilters.py)20
-rw-r--r--src/base/filters/SConscript (renamed from src/mem/ruby/filters/SConscript)17
-rw-r--r--src/base/filters/base.hh (renamed from src/mem/ruby/filters/AbstractBloomFilter.hh)6
-rw-r--r--src/base/filters/block_bloom_filter.cc (renamed from src/mem/ruby/filters/BlockBloomFilter.cc)5
-rw-r--r--src/base/filters/block_bloom_filter.hh (renamed from src/mem/ruby/filters/BlockBloomFilter.hh)11
-rw-r--r--src/base/filters/bulk_bloom_filter.cc (renamed from src/mem/ruby/filters/BulkBloomFilter.cc)7
-rw-r--r--src/base/filters/bulk_bloom_filter.hh (renamed from src/mem/ruby/filters/BulkBloomFilter.hh)13
-rw-r--r--src/base/filters/h3_bloom_filter.cc (renamed from src/mem/ruby/filters/H3BloomFilter.cc)7
-rw-r--r--src/base/filters/h3_bloom_filter.hh (renamed from src/mem/ruby/filters/H3BloomFilter.hh)11
-rw-r--r--src/base/filters/lsb_counting_bloom_filter.cc (renamed from src/mem/ruby/filters/LSB_CountingBloomFilter.cc)5
-rw-r--r--src/base/filters/lsb_counting_bloom_filter.hh (renamed from src/mem/ruby/filters/LSB_CountingBloomFilter.hh)11
-rw-r--r--src/base/filters/multi_bit_sel_bloom_filter.cc (renamed from src/mem/ruby/filters/MultiBitSelBloomFilter.cc)5
-rw-r--r--src/base/filters/multi_bit_sel_bloom_filter.hh (renamed from src/mem/ruby/filters/MultiBitSelBloomFilter.hh)11
-rw-r--r--src/base/filters/multi_bloom_filter.cc (renamed from src/mem/ruby/filters/MultiGrainBloomFilter.cc)33
-rw-r--r--src/base/filters/multi_bloom_filter.hh (renamed from src/mem/ruby/filters/MultiGrainBloomFilter.hh)19
-rw-r--r--src/mem/ruby/SConscript1
-rw-r--r--src/mem/ruby/protocol/RubySlicc_Types.sm9
17 files changed, 108 insertions, 83 deletions
diff --git a/src/mem/ruby/filters/BloomFilters.py b/src/base/filters/BloomFilters.py
index 058c50405..208b8a97a 100644
--- a/src/mem/ruby/filters/BloomFilters.py
+++ b/src/base/filters/BloomFilters.py
@@ -33,7 +33,7 @@ from m5.SimObject import SimObject
class BloomFilterBase(SimObject):
type = 'BloomFilterBase'
abstract = True
- cxx_header = "mem/ruby/filters/AbstractBloomFilter.hh"
+ cxx_header = "base/filters/base.hh"
cxx_class = 'BloomFilter::Base'
size = Param.Int(4096, "Number of entries in the filter")
@@ -47,7 +47,7 @@ class BloomFilterBase(SimObject):
class BloomFilterBlock(BloomFilterBase):
type = 'BloomFilterBlock'
cxx_class = 'BloomFilter::Block'
- cxx_header = "mem/ruby/filters/BlockBloomFilter.hh"
+ cxx_header = "base/filters/block_bloom_filter.hh"
masks_lsbs = VectorParam.Unsigned([Self.offset_bits,
2 * Self.offset_bits], "Position of the LSB of each mask")
@@ -57,12 +57,12 @@ class BloomFilterBlock(BloomFilterBase):
class BloomFilterBulk(BloomFilterBase):
type = 'BloomFilterBulk'
cxx_class = 'BloomFilter::Bulk'
- cxx_header = "mem/ruby/filters/BulkBloomFilter.hh"
+ cxx_header = "base/filters/bulk_bloom_filter.hh"
class BloomFilterLSBCounting(BloomFilterBase):
type = 'BloomFilterLSBCounting'
cxx_class = 'BloomFilter::LSBCounting'
- cxx_header = "mem/ruby/filters/LSB_CountingBloomFilter.hh"
+ cxx_header = "base/filters/lsb_counting_bloom_filter.hh"
# By default use 4-bit saturating counters
max_value = Param.Int(15, "Maximum value of the filter entries")
@@ -73,7 +73,7 @@ class BloomFilterLSBCounting(BloomFilterBase):
class BloomFilterMultiBitSel(BloomFilterBase):
type = 'BloomFilterMultiBitSel'
cxx_class = 'BloomFilter::MultiBitSel'
- cxx_header = "mem/ruby/filters/MultiBitSelBloomFilter.hh"
+ cxx_header = "base/filters/multi_bit_sel_bloom_filter.hh"
num_hashes = Param.Int(4, "Number of hashes")
threshold = Self.num_hashes
@@ -83,12 +83,12 @@ class BloomFilterMultiBitSel(BloomFilterBase):
class BloomFilterH3(BloomFilterMultiBitSel):
type = 'BloomFilterH3'
cxx_class = 'BloomFilter::H3'
- cxx_header = "mem/ruby/filters/H3BloomFilter.hh"
+ cxx_header = "base/filters/h3_bloom_filter.hh"
-class BloomFilterMultiGrain(BloomFilterBase):
- type = 'BloomFilterMultiGrain'
- cxx_class = 'BloomFilter::MultiGrain'
- cxx_header = "mem/ruby/filters/MultiGrainBloomFilter.hh"
+class BloomFilterMulti(BloomFilterBase):
+ type = 'BloomFilterMulti'
+ cxx_class = 'BloomFilter::Multi'
+ cxx_header = "base/filters/multi_bloom_filter.hh"
# The base filter should not be used, since this filter is the combination
# of multiple sub-filters, so we use a dummy value
diff --git a/src/mem/ruby/filters/SConscript b/src/base/filters/SConscript
index 8c7b2a2f8..4c02ff122 100644
--- a/src/mem/ruby/filters/SConscript
+++ b/src/base/filters/SConscript
@@ -1,5 +1,6 @@
# -*- mode:python -*-
+# Copyright (c) 2019 Inria
# Copyright (c) 2009 The Hewlett-Packard Development Company
# All rights reserved.
#
@@ -27,17 +28,15 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Nathan Binkert
+# Daniel Carvalho
Import('*')
-if env['PROTOCOL'] == 'None':
- Return()
-
SimObject('BloomFilters.py')
-Source('BlockBloomFilter.cc')
-Source('BulkBloomFilter.cc')
-Source('H3BloomFilter.cc')
-Source('LSB_CountingBloomFilter.cc')
-Source('MultiBitSelBloomFilter.cc')
-Source('MultiGrainBloomFilter.cc')
+Source('block_bloom_filter.cc')
+Source('bulk_bloom_filter.cc')
+Source('h3_bloom_filter.cc')
+Source('lsb_counting_bloom_filter.cc')
+Source('multi_bit_sel_bloom_filter.cc')
+Source('multi_bloom_filter.cc')
diff --git a/src/mem/ruby/filters/AbstractBloomFilter.hh b/src/base/filters/base.hh
index b2bfa4d3e..1ce853979 100644
--- a/src/mem/ruby/filters/AbstractBloomFilter.hh
+++ b/src/base/filters/base.hh
@@ -29,8 +29,8 @@
* Authors: Daniel Carvalho
*/
-#ifndef __MEM_RUBY_FILTERS_ABSTRACTBLOOMFILTER_HH__
-#define __MEM_RUBY_FILTERS_ABSTRACTBLOOMFILTER_HH__
+#ifndef __BASE_FILTERS_BASE_HH__
+#define __BASE_FILTERS_BASE_HH__
#include <vector>
@@ -148,4 +148,4 @@ class Base : public SimObject
} // namespace BloomFilter
-#endif // __MEM_RUBY_FILTERS_ABSTRACTBLOOMFILTER_HH__
+#endif // __BASE_FILTERS_BASE_HH__
diff --git a/src/mem/ruby/filters/BlockBloomFilter.cc b/src/base/filters/block_bloom_filter.cc
index 5fe1fbbde..45e3b725e 100644
--- a/src/mem/ruby/filters/BlockBloomFilter.cc
+++ b/src/base/filters/block_bloom_filter.cc
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2019 Inria
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
@@ -24,9 +25,11 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Daniel Carvalho
*/
-#include "mem/ruby/filters/BlockBloomFilter.hh"
+#include "base/filters/block_bloom_filter.hh"
#include "base/bitfield.hh"
#include "base/logging.hh"
diff --git a/src/mem/ruby/filters/BlockBloomFilter.hh b/src/base/filters/block_bloom_filter.hh
index 880dd9d4b..9e7f7dbb0 100644
--- a/src/mem/ruby/filters/BlockBloomFilter.hh
+++ b/src/base/filters/block_bloom_filter.hh
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2019 Inria
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
@@ -24,14 +25,16 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Daniel Carvalho
*/
-#ifndef __MEM_RUBY_FILTERS_BLOCKBLOOMFILTER_HH__
-#define __MEM_RUBY_FILTERS_BLOCKBLOOMFILTER_HH__
+#ifndef __BASE_FILTERS_BLOCK_BLOOM_FILTER_HH__
+#define __BASE_FILTERS_BLOCK_BLOOM_FILTER_HH__
#include <vector>
-#include "mem/ruby/filters/AbstractBloomFilter.hh"
+#include "base/filters/base.hh"
struct BloomFilterBlockParams;
@@ -69,4 +72,4 @@ class Block : public Base
} // namespace BloomFilter
-#endif // __MEM_RUBY_FILTERS_BLOCKBLOOMFILTER_HH__
+#endif // __BASE_FILTERS_BLOCK_BLOOM_FILTER_HH__
diff --git a/src/mem/ruby/filters/BulkBloomFilter.cc b/src/base/filters/bulk_bloom_filter.cc
index 669b879ee..6488086c2 100644
--- a/src/mem/ruby/filters/BulkBloomFilter.cc
+++ b/src/base/filters/bulk_bloom_filter.cc
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2019 Inria
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
@@ -24,9 +25,13 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Daniel Carvalho
*/
-#include "mem/ruby/filters/BulkBloomFilter.hh"
+#include "base/filters/bulk_bloom_filter.hh"
+
+#include <vector>
#include <limits>
diff --git a/src/mem/ruby/filters/BulkBloomFilter.hh b/src/base/filters/bulk_bloom_filter.hh
index 8eb6edf14..7211aa2cd 100644
--- a/src/mem/ruby/filters/BulkBloomFilter.hh
+++ b/src/base/filters/bulk_bloom_filter.hh
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2019 Inria
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
@@ -24,14 +25,14 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Daniel Carvalho
*/
-#ifndef __MEM_RUBY_FILTERS_BULKBLOOMFILTER_HH__
-#define __MEM_RUBY_FILTERS_BULKBLOOMFILTER_HH__
-
-#include <vector>
+#ifndef __BASE_FILTERS_BULK_BLOOM_FILTER_HH__
+#define __BASE_FILTERS_BULK_BLOOM_FILTER_HH__
-#include "mem/ruby/filters/AbstractBloomFilter.hh"
+#include "base/filters/base.hh"
struct BloomFilterBulkParams;
@@ -62,4 +63,4 @@ class Bulk : public Base
} // namespace BloomFilter
-#endif // __MEM_RUBY_FILTERS_BULKBLOOMFILTER_HH__
+#endif // __BASE_FILTERS_BULK_BLOOM_FILTER_HH__
diff --git a/src/mem/ruby/filters/H3BloomFilter.cc b/src/base/filters/h3_bloom_filter.cc
index 3a4ba0cef..ca0899545 100644
--- a/src/mem/ruby/filters/H3BloomFilter.cc
+++ b/src/base/filters/h3_bloom_filter.cc
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2019 Inria
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
@@ -24,14 +25,16 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Daniel Carvalho
*/
-#include "mem/ruby/filters/H3BloomFilter.hh"
+#include "base/filters/h3_bloom_filter.hh"
#include <limits>
-#include "base/logging.hh"
#include "base/bitfield.hh"
+#include "base/logging.hh"
#include "params/BloomFilterH3.hh"
namespace BloomFilter {
diff --git a/src/mem/ruby/filters/H3BloomFilter.hh b/src/base/filters/h3_bloom_filter.hh
index 6235c028c..c90b40ff1 100644
--- a/src/mem/ruby/filters/H3BloomFilter.hh
+++ b/src/base/filters/h3_bloom_filter.hh
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2019 Inria
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
@@ -24,12 +25,14 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Daniel Carvalho
*/
-#ifndef __MEM_RUBY_FILTERS_H3BLOOMFILTER_HH__
-#define __MEM_RUBY_FILTERS_H3BLOOMFILTER_HH__
+#ifndef __BASE_FILTERS_H3_BLOOM_FILTER_HH__
+#define __BASE_FILTERS_H3_BLOOM_FILTER_HH__
-#include "mem/ruby/filters/MultiBitSelBloomFilter.hh"
+#include "base/filters/multi_bit_sel_bloom_filter.hh"
struct BloomFilterH3Params;
@@ -51,4 +54,4 @@ class H3 : public MultiBitSel
} // namespace BloomFilter
-#endif // __MEM_RUBY_FILTERS_H3BLOOMFILTER_HH__
+#endif // __BASE_FILTERS_H3_BLOOM_FILTER_HH__
diff --git a/src/mem/ruby/filters/LSB_CountingBloomFilter.cc b/src/base/filters/lsb_counting_bloom_filter.cc
index 9e0e8d2c5..16f858f01 100644
--- a/src/mem/ruby/filters/LSB_CountingBloomFilter.cc
+++ b/src/base/filters/lsb_counting_bloom_filter.cc
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2019 Inria
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
@@ -24,9 +25,11 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Daniel Carvalho
*/
-#include "mem/ruby/filters/LSB_CountingBloomFilter.hh"
+#include "base/filters/lsb_counting_bloom_filter.hh"
#include "base/bitfield.hh"
#include "params/BloomFilterLSBCounting.hh"
diff --git a/src/mem/ruby/filters/LSB_CountingBloomFilter.hh b/src/base/filters/lsb_counting_bloom_filter.hh
index efc6b67a2..6da6fd681 100644
--- a/src/mem/ruby/filters/LSB_CountingBloomFilter.hh
+++ b/src/base/filters/lsb_counting_bloom_filter.hh
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2019 Inria
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
@@ -24,12 +25,14 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Daniel Carvalho
*/
-#ifndef __MEM_RUBY_FILTERS_LSB_COUNTINGBLOOMFILTER_HH__
-#define __MEM_RUBY_FILTERS_LSB_COUNTINGBLOOMFILTER_HH__
+#ifndef __BASE_FILTERS_LSB_COUNTING_BLOOM_FILTER_HH__
+#define __BASE_FILTERS_LSB_COUNTING_BLOOM_FILTER_HH__
-#include "mem/ruby/filters/AbstractBloomFilter.hh"
+#include "base/filters/base.hh"
struct BloomFilterLSBCountingParams;
@@ -56,4 +59,4 @@ class LSBCounting : public Base
} // namespace BloomFilter
-#endif //__MEM_RUBY_FILTERS_LSB_COUNTINGBLOOMFILTER_HH__
+#endif //__BASE_FILTERS_LSB_COUNTING_BLOOM_FILTER_HH__
diff --git a/src/mem/ruby/filters/MultiBitSelBloomFilter.cc b/src/base/filters/multi_bit_sel_bloom_filter.cc
index beca335aa..efd20c315 100644
--- a/src/mem/ruby/filters/MultiBitSelBloomFilter.cc
+++ b/src/base/filters/multi_bit_sel_bloom_filter.cc
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2019 Inria
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
@@ -24,9 +25,11 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Daniel Carvalho
*/
-#include "mem/ruby/filters/MultiBitSelBloomFilter.hh"
+#include "base/filters/multi_bit_sel_bloom_filter.hh"
#include <limits>
diff --git a/src/mem/ruby/filters/MultiBitSelBloomFilter.hh b/src/base/filters/multi_bit_sel_bloom_filter.hh
index 58213351a..d289bb302 100644
--- a/src/mem/ruby/filters/MultiBitSelBloomFilter.hh
+++ b/src/base/filters/multi_bit_sel_bloom_filter.hh
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2019 Inria
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
@@ -24,12 +25,14 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Daniel Carvalho
*/
-#ifndef __MEM_RUBY_FILTERS_MULTIBITSELBLOOMFILTER_HH__
-#define __MEM_RUBY_FILTERS_MULTIBITSELBLOOMFILTER_HH__
+#ifndef __BASE_FILTERS_MULTI_BIT_SEL_BLOOM_FILTER_HH__
+#define __BASE_FILTERS_MULTI_BIT_SEL_BLOOM_FILTER_HH__
-#include "mem/ruby/filters/AbstractBloomFilter.hh"
+#include "base/filters/base.hh"
struct BloomFilterMultiBitSelParams;
@@ -76,4 +79,4 @@ class MultiBitSel : public Base
} // namespace BloomFilter
-#endif // __MEM_RUBY_FILTERS_MULTIBITSELBLOOMFILTER_HH__
+#endif // __BASE_FILTERS_MULTI_BIT_SEL_BLOOM_FILTER_HH__
diff --git a/src/mem/ruby/filters/MultiGrainBloomFilter.cc b/src/base/filters/multi_bloom_filter.cc
index e5998debe..fb64bdf1e 100644
--- a/src/mem/ruby/filters/MultiGrainBloomFilter.cc
+++ b/src/base/filters/multi_bloom_filter.cc
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2019 Inria
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
@@ -24,26 +25,28 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Daniel Carvalho
*/
-#include "mem/ruby/filters/MultiGrainBloomFilter.hh"
+#include "base/filters/multi_bloom_filter.hh"
#include "base/logging.hh"
-#include "params/BloomFilterMultiGrain.hh"
+#include "params/BloomFilterMulti.hh"
namespace BloomFilter {
-MultiGrain::MultiGrain(const BloomFilterMultiGrainParams* p)
+Multi::Multi(const BloomFilterMultiParams* p)
: Base(p), filters(p->filters)
{
}
-MultiGrain::~MultiGrain()
+Multi::~Multi()
{
}
void
-MultiGrain::clear()
+Multi::clear()
{
for (auto& sub_filter : filters) {
sub_filter->clear();
@@ -51,9 +54,9 @@ MultiGrain::clear()
}
void
-MultiGrain::merge(const Base* other)
+Multi::merge(const Base* other)
{
- auto* cast_other = static_cast<const MultiGrain*>(other);
+ auto* cast_other = static_cast<const Multi*>(other);
assert(filters.size() == cast_other->filters.size());
for (int i = 0; i < filters.size(); ++i){
filters[i]->merge(cast_other->filters[i]);
@@ -61,7 +64,7 @@ MultiGrain::merge(const Base* other)
}
void
-MultiGrain::set(Addr addr)
+Multi::set(Addr addr)
{
for (auto& sub_filter : filters) {
sub_filter->set(addr);
@@ -69,7 +72,7 @@ MultiGrain::set(Addr addr)
}
void
-MultiGrain::unset(Addr addr)
+Multi::unset(Addr addr)
{
for (auto& sub_filter : filters) {
sub_filter->unset(addr);
@@ -77,7 +80,7 @@ MultiGrain::unset(Addr addr)
}
bool
-MultiGrain::isSet(Addr addr) const
+Multi::isSet(Addr addr) const
{
int count = 0;
for (const auto& sub_filter : filters) {
@@ -89,7 +92,7 @@ MultiGrain::isSet(Addr addr) const
}
int
-MultiGrain::getCount(Addr addr) const
+Multi::getCount(Addr addr) const
{
int count = 0;
for (const auto& sub_filter : filters) {
@@ -99,7 +102,7 @@ MultiGrain::getCount(Addr addr) const
}
int
-MultiGrain::getTotalCount() const
+Multi::getTotalCount() const
{
int count = 0;
for (const auto& sub_filter : filters) {
@@ -110,9 +113,9 @@ MultiGrain::getTotalCount() const
} // namespace BloomFilter
-BloomFilter::MultiGrain*
-BloomFilterMultiGrainParams::create()
+BloomFilter::Multi*
+BloomFilterMultiParams::create()
{
- return new BloomFilter::MultiGrain(this);
+ return new BloomFilter::Multi(this);
}
diff --git a/src/mem/ruby/filters/MultiGrainBloomFilter.hh b/src/base/filters/multi_bloom_filter.hh
index 3f4a0db66..cb80a40f2 100644
--- a/src/mem/ruby/filters/MultiGrainBloomFilter.hh
+++ b/src/base/filters/multi_bloom_filter.hh
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2019 Inria
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
@@ -24,16 +25,18 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Daniel Carvalho
*/
-#ifndef __MEM_RUBY_FILTERS_MULTIGRAINBLOOMFILTER_HH__
-#define __MEM_RUBY_FILTERS_MULTIGRAINBLOOMFILTER_HH__
+#ifndef __BASE_FILTERS_MULTI_BLOOM_FILTER_HH__
+#define __BASE_FILTERS_MULTI_BLOOM_FILTER_HH__
#include <vector>
-#include "mem/ruby/filters/AbstractBloomFilter.hh"
+#include "base/filters/base.hh"
-struct BloomFilterMultiGrainParams;
+struct BloomFilterMultiParams;
namespace BloomFilter {
@@ -42,11 +45,11 @@ namespace BloomFilter {
* functionality. The results of the operations are the results of applying
* them to each sub-filter.
*/
-class MultiGrain : public Base
+class Multi : public Base
{
public:
- MultiGrain(const BloomFilterMultiGrainParams* p);
- ~MultiGrain();
+ Multi(const BloomFilterMultiParams* p);
+ ~Multi();
void clear() override;
void set(Addr addr) override;
@@ -64,4 +67,4 @@ class MultiGrain : public Base
} // namespace BloomFilter
-#endif // __MEM_RUBY_FILTERS_MULTIGRAINBLOOMFILTER_HH__
+#endif // __BASE_FILTERS_MULTI_BLOOM_FILTER_HH__
diff --git a/src/mem/ruby/SConscript b/src/mem/ruby/SConscript
index 22dd973c3..450a4bfca 100644
--- a/src/mem/ruby/SConscript
+++ b/src/mem/ruby/SConscript
@@ -125,7 +125,6 @@ MakeInclude('common/MachineID.hh')
MakeInclude('common/NetDest.hh')
MakeInclude('common/Set.hh')
MakeInclude('common/WriteMask.hh')
-MakeInclude('filters/AbstractBloomFilter.hh')
MakeInclude('network/MessageBuffer.hh')
MakeInclude('structures/CacheMemory.hh')
MakeInclude('structures/DirectoryMemory.hh')
diff --git a/src/mem/ruby/protocol/RubySlicc_Types.sm b/src/mem/ruby/protocol/RubySlicc_Types.sm
index 28fb6ef00..2d4c250da 100644
--- a/src/mem/ruby/protocol/RubySlicc_Types.sm
+++ b/src/mem/ruby/protocol/RubySlicc_Types.sm
@@ -233,15 +233,6 @@ structure (TimerTable, inport="yes", external = "yes") {
bool isSet(Addr);
}
-structure (AbstractBloomFilter, external = "yes") {
- void clear(int);
- void set(Addr, int);
- void unset(Addr, int);
-
- bool isSet(Addr, int);
- int getCount(Addr, int);
-}
-
structure (Prefetcher, external = "yes") {
void observeMiss(Addr, RubyRequestType);
void observePfHit(Addr);