gem5  v19.0.0.0
base_dictionary_compressor.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2019 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  * Authors: Daniel Carvalho
29  */
30 
37 #include "params/BaseDictionaryCompressor.hh"
38 
40  : BaseCacheCompressor(p), dictionarySize(p->dictionary_size), numEntries(0)
41 {
42 }
43 
44 void
46 {
48 
49  // We store the frequency of each pattern
52  .name(name() + ".pattern")
53  .desc("Number of data entries that were compressed to this pattern.")
54  ;
55 
56  for (unsigned i = 0; i < getNumPatterns(); ++i) {
58  patternStats.subdesc(i, "Number of data entries that match pattern " +
59  getName(i));
60  }
61 }
Derived & subname(off_type index, const std::string &name)
Set the subfield name for the given index, and marks this stat to print at the end of simulation...
Definition: statistics.hh:379
Bitfield< 7 > i
void regStats() override
Callback to set stat parameters.
virtual void regStats()
Callback to set stat parameters.
Definition: group.cc:66
Derived & subdesc(off_type index, const std::string &desc)
Set the subfield description for the given index and marks this stat to print at the end of simulatio...
Definition: statistics.hh:403
Derived & init(size_type size)
Set this vector to have the given size.
Definition: statistics.hh:1152
virtual std::string getName(int number) const =0
Get meta-name assigned to the given pattern.
virtual uint64_t getNumPatterns() const =0
Trick function to get the number of patterns.
Base cache compressor interface.
Definition: base.hh:54
virtual const std::string name() const
Definition: sim_object.hh:120
Stats::Vector patternStats
Number of data entries that were compressed to each pattern.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
Definition: statistics.hh:279
Definition of a dictionary based cache compressor.
BaseCacheCompressorParams Params
Convenience typedef.
Definition: base.hh:130
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
Definition: statistics.hh:312
Bitfield< 0 > p

Generated on Fri Feb 28 2020 16:27:01 for gem5 by doxygen 1.8.13