gem5  v20.1.0.0
base_dictionary_compressor.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2020 Inria
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met: redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
35 #include "params/BaseDictionaryCompressor.hh"
36 
37 namespace Compressor {
38 
40  : Base(p), dictionarySize(p->dictionary_size),
41  numEntries(0), dictionaryStats(stats, *this)
42 {
43 }
44 
46  BaseStats& base_group, BaseDictionaryCompressor& _compressor)
47  : Stats::Group(&base_group), compressor(_compressor),
48  patterns(this, "pattern",
49  "Number of data entries that were compressed to this pattern")
50 {
51 }
52 
53 void
55 {
57 
58  // We store the frequency of each pattern
59  patterns.init(compressor.getNumPatterns());
60  for (unsigned i = 0; i < compressor.getNumPatterns(); ++i) {
61  const std::string name = compressor.getName(i);
62  patterns.subname(i, name);
63  patterns.subdesc(i, "Number of data entries that match pattern " +
64  name);
65  }
66 }
67 
68 } // namespace Compressor
Stats::Group::regStats
virtual void regStats()
Callback to set stat parameters.
Definition: group.cc:64
Compressor::BaseDictionaryCompressor
Definition: dictionary_compressor.hh:62
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
Compressor
Definition: base.cc:46
Compressor::BaseDictionaryCompressor::BaseDictionaryCompressor
BaseDictionaryCompressor(const Params *p)
Definition: base_dictionary_compressor.cc:39
Compressor::Base
Base cache compressor interface.
Definition: base.hh:58
Compressor::Base::BaseStats
Definition: base.hh:98
dictionary_compressor.hh
Compressor::BaseDictionaryCompressor::DictionaryStats::DictionaryStats
DictionaryStats(BaseStats &base_group, BaseDictionaryCompressor &_compressor)
Definition: base_dictionary_compressor.cc:45
Compressor::Base::Params
BaseCacheCompressorParams Params
Definition: base.hh:168
SimObject::name
virtual const std::string name() const
Definition: sim_object.hh:133
Stats
Definition: statistics.cc:61
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
Compressor::BaseDictionaryCompressor::DictionaryStats::regStats
void regStats() override
Callback to set stat parameters.
Definition: base_dictionary_compressor.cc:54

Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17