From 8d65e51f7f0fed279d2ecfc8601671e479b3387c Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Sat, 11 May 2019 23:19:48 +0200 Subject: [PATCH] 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 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18875 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- .../ruby => base}/filters/BloomFilters.py | 20 +++++------ src/{mem/ruby => base}/filters/SConscript | 17 +++++----- .../filters/base.hh} | 6 ++-- .../filters/block_bloom_filter.cc} | 5 ++- .../filters/block_bloom_filter.hh} | 11 ++++--- .../filters/bulk_bloom_filter.cc} | 7 +++- .../filters/bulk_bloom_filter.hh} | 13 ++++---- .../filters/h3_bloom_filter.cc} | 7 ++-- .../filters/h3_bloom_filter.hh} | 11 ++++--- .../filters/lsb_counting_bloom_filter.cc} | 5 ++- .../filters/lsb_counting_bloom_filter.hh} | 11 ++++--- .../filters/multi_bit_sel_bloom_filter.cc} | 5 ++- .../filters/multi_bit_sel_bloom_filter.hh} | 11 ++++--- .../filters/multi_bloom_filter.cc} | 33 ++++++++++--------- .../filters/multi_bloom_filter.hh} | 19 ++++++----- src/mem/ruby/SConscript | 1 - src/mem/ruby/protocol/RubySlicc_Types.sm | 9 ----- 17 files changed, 108 insertions(+), 83 deletions(-) rename src/{mem/ruby => base}/filters/BloomFilters.py (87%) rename src/{mem/ruby => base}/filters/SConscript (86%) rename src/{mem/ruby/filters/AbstractBloomFilter.hh => base/filters/base.hh} (96%) rename src/{mem/ruby/filters/BlockBloomFilter.cc => base/filters/block_bloom_filter.cc} (96%) rename src/{mem/ruby/filters/BlockBloomFilter.hh => base/filters/block_bloom_filter.hh} (91%) rename src/{mem/ruby/filters/BulkBloomFilter.cc => base/filters/bulk_bloom_filter.cc} (97%) rename src/{mem/ruby/filters/BulkBloomFilter.hh => base/filters/bulk_bloom_filter.hh} (90%) rename src/{mem/ruby/filters/H3BloomFilter.cc => base/filters/h3_bloom_filter.cc} (99%) rename src/{mem/ruby/filters/H3BloomFilter.hh => base/filters/h3_bloom_filter.hh} (88%) rename src/{mem/ruby/filters/LSB_CountingBloomFilter.cc => base/filters/lsb_counting_bloom_filter.cc} (96%) rename src/{mem/ruby/filters/LSB_CountingBloomFilter.hh => base/filters/lsb_counting_bloom_filter.hh} (89%) rename src/{mem/ruby/filters/MultiBitSelBloomFilter.cc => base/filters/multi_bit_sel_bloom_filter.cc} (96%) rename src/{mem/ruby/filters/MultiBitSelBloomFilter.hh => base/filters/multi_bit_sel_bloom_filter.hh} (91%) rename src/{mem/ruby/filters/MultiGrainBloomFilter.cc => base/filters/multi_bloom_filter.cc} (81%) rename src/{mem/ruby/filters/MultiGrainBloomFilter.hh => base/filters/multi_bloom_filter.hh} (86%) diff --git a/src/mem/ruby/filters/BloomFilters.py b/src/base/filters/BloomFilters.py similarity index 87% rename from src/mem/ruby/filters/BloomFilters.py rename to 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 similarity index 86% rename from src/mem/ruby/filters/SConscript rename to 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 similarity index 96% rename from src/mem/ruby/filters/AbstractBloomFilter.hh rename to 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 @@ -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 similarity index 96% rename from src/mem/ruby/filters/BlockBloomFilter.cc rename to 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 similarity index 91% rename from src/mem/ruby/filters/BlockBloomFilter.hh rename to 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 -#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 similarity index 97% rename from src/mem/ruby/filters/BulkBloomFilter.cc rename to 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 #include diff --git a/src/mem/ruby/filters/BulkBloomFilter.hh b/src/base/filters/bulk_bloom_filter.hh similarity index 90% rename from src/mem/ruby/filters/BulkBloomFilter.hh rename to 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 +#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 similarity index 99% rename from src/mem/ruby/filters/H3BloomFilter.cc rename to 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 -#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 88% rename from src/mem/ruby/filters/H3BloomFilter.hh rename to 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 similarity index 96% rename from src/mem/ruby/filters/LSB_CountingBloomFilter.cc rename to 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 similarity index 89% rename from src/mem/ruby/filters/LSB_CountingBloomFilter.hh rename to 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 similarity index 96% rename from src/mem/ruby/filters/MultiBitSelBloomFilter.cc rename to 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 diff --git a/src/mem/ruby/filters/MultiBitSelBloomFilter.hh b/src/base/filters/multi_bit_sel_bloom_filter.hh similarity index 91% rename from src/mem/ruby/filters/MultiBitSelBloomFilter.hh rename to 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 similarity index 81% rename from src/mem/ruby/filters/MultiGrainBloomFilter.cc rename to 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(other); + auto* cast_other = static_cast(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 similarity index 86% rename from src/mem/ruby/filters/MultiGrainBloomFilter.hh rename to 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 -#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); -- 2.30.2