Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/18875

Change subject: mem-ruby: Move Bloom Filters to base
......................................................................

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 <[email protected]>
---
R src/base/filters/BloomFilters.py
R src/base/filters/SConscript
R src/base/filters/base.hh
R src/base/filters/block_bloom_filter.cc
R src/base/filters/block_bloom_filter.hh
R src/base/filters/bulk_bloom_filter.cc
R src/base/filters/bulk_bloom_filter.hh
R src/base/filters/h3_bloom_filter.cc
R src/base/filters/h3_bloom_filter.hh
R src/base/filters/lsb_counting_bloom_filter.cc
R src/base/filters/lsb_counting_bloom_filter.hh
R src/base/filters/multi_bit_sel_bloom_filter.cc
R src/base/filters/multi_bit_sel_bloom_filter.hh
R src/base/filters/multi_bloom_filter.cc
R src/base/filters/multi_bloom_filter.hh
M src/mem/protocol/RubySlicc_Types.sm
M src/mem/ruby/SConscript
17 files changed, 237 insertions(+), 82 deletions(-)



diff --git a/src/mem/ruby/filters/BloomFilters.py b/src/base/filters/BloomFilters.py
similarity index 88%
rename from src/mem/ruby/filters/BloomFilters.py
rename to src/base/filters/BloomFilters.py
index cedf1ee..71f954f 100644
--- a/src/mem/ruby/filters/BloomFilters.py
+++ b/src/base/filters/BloomFilters.py
@@ -33,7 +33,7 @@
 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 BloomFilterBlock(BloomFilterBase):
     type = 'BloomFilterBlock'
     cxx_class = 'BloomFilter::Block'
-    cxx_header = "mem/ruby/filters/BlockBloomFilter.hh"
+    cxx_header = "base/filters/block_bloom_filter.hh"

     offset_lsb = Param.Unsigned(Self.block_bits,
         "Number of bits between the LSB and the LSB bitfied")
@@ -61,12 +61,12 @@
 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")
@@ -77,7 +77,7 @@
 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
@@ -87,12 +87,12 @@
 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
similarity index 87%
rename from src/mem/ruby/filters/SConscript
rename to src/base/filters/SConscript
index 8c7b2a2..013fefd 100644
--- a/src/mem/ruby/filters/SConscript
+++ b/src/base/filters/SConscript
@@ -30,14 +30,11 @@

 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
similarity index 96%
rename from src/mem/ruby/filters/AbstractBloomFilter.hh
rename to src/base/filters/base.hh
index 23b9aed..84ac946 100644
--- a/src/mem/ruby/filters/AbstractBloomFilter.hh
+++ b/src/base/filters/base.hh
@@ -40,8 +40,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>

@@ -159,4 +159,4 @@

 } // 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
similarity index 81%
rename from src/mem/ruby/filters/BlockBloomFilter.cc
rename to src/base/filters/block_bloom_filter.cc
index 432a53b..9214bc8 100644
--- a/src/mem/ruby/filters/BlockBloomFilter.cc
+++ b/src/base/filters/block_bloom_filter.cc
@@ -1,4 +1,16 @@
 /*
+ * Copyright (c) 2019 Inria
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
  * All rights reserved.
  *
@@ -24,9 +36,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
similarity index 78%
rename from src/mem/ruby/filters/BlockBloomFilter.hh
rename to src/base/filters/block_bloom_filter.hh
index 4a4ee88..fda05c5 100644
--- a/src/mem/ruby/filters/BlockBloomFilter.hh
+++ b/src/base/filters/block_bloom_filter.hh
@@ -1,4 +1,16 @@
 /*
+ * Copyright (c) 2019 Inria
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
  * All rights reserved.
  *
@@ -24,12 +36,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_BLOCKBLOOMFILTER_HH__
-#define __MEM_RUBY_FILTERS_BLOCKBLOOMFILTER_HH__
+#ifndef __BASE_FILTERS_BLOCK_BLOOM_FILTER_HH__
+#define __BASE_FILTERS_BLOCK_BLOOM_FILTER_HH__

-#include "mem/ruby/filters/AbstractBloomFilter.hh"
+#include "base/filters/base.hh"

 struct BloomFilterBlockParams;

@@ -84,4 +98,4 @@

 } // 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
similarity index 87%
rename from src/mem/ruby/filters/BulkBloomFilter.cc
rename to src/base/filters/bulk_bloom_filter.cc
index 6824b98..d78c7d9 100644
--- a/src/mem/ruby/filters/BulkBloomFilter.cc
+++ b/src/base/filters/bulk_bloom_filter.cc
@@ -1,4 +1,16 @@
 /*
+ * Copyright (c) 2019 Inria
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
  * All rights reserved.
  *
@@ -24,9 +36,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 "base/bitfield.hh"
 #include "params/BloomFilterBulk.hh"
diff --git a/src/mem/ruby/filters/BulkBloomFilter.hh b/src/base/filters/bulk_bloom_filter.hh
similarity index 72%
rename from src/mem/ruby/filters/BulkBloomFilter.hh
rename to src/base/filters/bulk_bloom_filter.hh
index 8eb6edf..75988c0 100644
--- a/src/mem/ruby/filters/BulkBloomFilter.hh
+++ b/src/base/filters/bulk_bloom_filter.hh
@@ -1,4 +1,16 @@
 /*
+ * Copyright (c) 2019 Inria
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
  * All rights reserved.
  *
@@ -24,14 +36,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__
+#ifndef __BASE_FILTERS_BULK_BLOOM_FILTER_HH__
+#define __BASE_FILTERS_BULK_BLOOM_FILTER_HH__

-#include <vector>
-
-#include "mem/ruby/filters/AbstractBloomFilter.hh"
+#include "base/filters/base.hh"

 struct BloomFilterBulkParams;

@@ -62,4 +74,4 @@

 } // 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
similarity index 95%
rename from src/mem/ruby/filters/H3BloomFilter.cc
rename to src/base/filters/h3_bloom_filter.cc
index 8d04f95..7f3f3ee 100644
--- a/src/mem/ruby/filters/H3BloomFilter.cc
+++ b/src/base/filters/h3_bloom_filter.cc
@@ -1,4 +1,16 @@
 /*
+ * Copyright (c) 2019 Inria
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
  * All rights reserved.
  *
@@ -24,12 +36,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
  */

-#include "mem/ruby/filters/H3BloomFilter.hh"
+#include "base/filters/h3_bloom_filter.hh"

-#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
similarity index 69%
rename from src/mem/ruby/filters/H3BloomFilter.hh
rename to src/base/filters/h3_bloom_filter.hh
index 6235c02..8bff532 100644
--- a/src/mem/ruby/filters/H3BloomFilter.hh
+++ b/src/base/filters/h3_bloom_filter.hh
@@ -1,4 +1,16 @@
 /*
+ * Copyright (c) 2019 Inria
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
  * All rights reserved.
  *
@@ -24,12 +36,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 +65,4 @@

 } // 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
similarity index 79%
rename from src/mem/ruby/filters/LSB_CountingBloomFilter.cc
rename to src/base/filters/lsb_counting_bloom_filter.cc
index 30a535d..b0388f3 100644
--- a/src/mem/ruby/filters/LSB_CountingBloomFilter.cc
+++ b/src/base/filters/lsb_counting_bloom_filter.cc
@@ -1,4 +1,16 @@
 /*
+ * Copyright (c) 2019 Inria
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
  * All rights reserved.
  *
@@ -24,9 +36,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
similarity index 70%
rename from src/mem/ruby/filters/LSB_CountingBloomFilter.hh
rename to src/base/filters/lsb_counting_bloom_filter.hh
index efc6b67..50d5f49 100644
--- a/src/mem/ruby/filters/LSB_CountingBloomFilter.hh
+++ b/src/base/filters/lsb_counting_bloom_filter.hh
@@ -1,4 +1,16 @@
 /*
+ * Copyright (c) 2019 Inria
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
  * All rights reserved.
  *
@@ -24,12 +36,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 +70,4 @@

 } // 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
similarity index 80%
rename from src/mem/ruby/filters/MultiBitSelBloomFilter.cc
rename to src/base/filters/multi_bit_sel_bloom_filter.cc
index ecaf9f4..de668a5 100644
--- a/src/mem/ruby/filters/MultiBitSelBloomFilter.cc
+++ b/src/base/filters/multi_bit_sel_bloom_filter.cc
@@ -1,4 +1,16 @@
 /*
+ * Copyright (c) 2019 Inria
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
  * All rights reserved.
  *
@@ -24,9 +36,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 "base/bitfield.hh"
 #include "params/BloomFilterMultiBitSel.hh"
diff --git a/src/mem/ruby/filters/MultiBitSelBloomFilter.hh b/src/base/filters/multi_bit_sel_bloom_filter.hh
similarity index 75%
rename from src/mem/ruby/filters/MultiBitSelBloomFilter.hh
rename to src/base/filters/multi_bit_sel_bloom_filter.hh
index 5821335..2d7402a 100644
--- a/src/mem/ruby/filters/MultiBitSelBloomFilter.hh
+++ b/src/base/filters/multi_bit_sel_bloom_filter.hh
@@ -1,4 +1,16 @@
 /*
+ * Copyright (c) 2019 Inria
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
  * All rights reserved.
  *
@@ -24,12 +36,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 +90,4 @@

 } // 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
similarity index 69%
rename from src/mem/ruby/filters/MultiGrainBloomFilter.cc
rename to src/base/filters/multi_bloom_filter.cc
index e2f706a..a41680a 100644
--- a/src/mem/ruby/filters/MultiGrainBloomFilter.cc
+++ b/src/base/filters/multi_bloom_filter.cc
@@ -1,4 +1,16 @@
 /*
+ * Copyright (c) 2019 Inria
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
  * All rights reserved.
  *
@@ -24,28 +36,30 @@
  * 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)
 {
     fatal_if(p->num_filters != filters.size(), "The number of filters " \
              "should match the number of filters provided");
 }

-MultiGrain::~MultiGrain()
+Multi::~Multi()
 {
 }

 void
-MultiGrain::clear()
+Multi::clear()
 {
     for (auto& sub_filter : filters) {
         sub_filter->clear();
@@ -53,9 +67,9 @@
 }

 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]);
@@ -63,7 +77,7 @@
 }

 void
-MultiGrain::set(Addr addr)
+Multi::set(Addr addr)
 {
     for (auto& sub_filter : filters) {
         sub_filter->set(addr);
@@ -71,7 +85,7 @@
 }

 void
-MultiGrain::unset(Addr addr)
+Multi::unset(Addr addr)
 {
     for (auto& sub_filter : filters) {
         sub_filter->unset(addr);
@@ -79,7 +93,7 @@
 }

 int
-MultiGrain::getCount(Addr addr) const
+Multi::getCount(Addr addr) const
 {
     int count = 0;
     for (const auto& sub_filter : filters) {
@@ -89,7 +103,7 @@
 }

 int
-MultiGrain::getTotalCount() const
+Multi::getTotalCount() const
 {
     int count = 0;
     for (const auto& sub_filter : filters) {
@@ -100,9 +114,9 @@

 } // 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
similarity index 69%
rename from src/mem/ruby/filters/MultiGrainBloomFilter.hh
rename to src/base/filters/multi_bloom_filter.hh
index d2788ca..43cb94b 100644
--- a/src/mem/ruby/filters/MultiGrainBloomFilter.hh
+++ b/src/base/filters/multi_bloom_filter.hh
@@ -1,4 +1,16 @@
 /*
+ * Copyright (c) 2019 Inria
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
  * All rights reserved.
  *
@@ -24,16 +36,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 +56,11 @@
  * 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;
@@ -63,4 +77,4 @@

 } // namespace BloomFilter

-#endif // __MEM_RUBY_FILTERS_MULTIGRAINBLOOMFILTER_HH__
+#endif // __BASE_FILTERS_MULTI_BLOOM_FILTER_HH__
diff --git a/src/mem/protocol/RubySlicc_Types.sm b/src/mem/protocol/RubySlicc_Types.sm
index 28fb6ef..2d4c250 100644
--- a/src/mem/protocol/RubySlicc_Types.sm
+++ b/src/mem/protocol/RubySlicc_Types.sm
@@ -233,15 +233,6 @@
   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);
diff --git a/src/mem/ruby/SConscript b/src/mem/ruby/SConscript
index be52c02..a1ba0d6 100644
--- a/src/mem/ruby/SConscript
+++ b/src/mem/ruby/SConscript
@@ -125,7 +125,6 @@
 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')

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/18875
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ic5f430610c33c0791fb81c79101ebe737189497e
Gerrit-Change-Number: 18875
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to