gem5  v20.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
multi.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 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 
34 #ifndef __MEM_CACHE_COMPRESSORS_MULTI_HH__
35 #define __MEM_CACHE_COMPRESSORS_MULTI_HH__
36 
37 #include <cstdint>
38 #include <vector>
39 
40 #include "base/types.hh"
42 
43 struct MultiCompressorParams;
44 
46 {
47  protected:
54 
57 
65 
70  public:
72  typedef MultiCompressorParams Params;
73 
75  MultiCompressor(const Params *p);
76 
79 
80  void regStats() override;
81 
82  std::unique_ptr<BaseCacheCompressor::CompressionData> compress(
83  const uint64_t* data, Cycles& comp_lat, Cycles& decomp_lat) override;
84 
85  void decompress(const CompressionData* comp_data, uint64_t* data) override;
86 };
87 
89 {
90  private:
92  const uint8_t index;
93 
94  public:
96  std::unique_ptr<BaseCacheCompressor::CompressionData> compData;
97 
104  MultiCompData(unsigned index,
105  std::unique_ptr<BaseCacheCompressor::CompressionData> comp_data);
106 
108  ~MultiCompData() = default;
109 
111  uint8_t getIndex() const;
112 };
113 
114 #endif //__MEM_CACHE_COMPRESSORS_MULTI_HH__
MultiCompressorParams Params
Convenience typedef.
Definition: multi.hh:72
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:81
void decompress(const CompressionData *comp_data, uint64_t *data) override
Apply the decompression process to the compressed data.
Definition: multi.cc:149
const uint8_t index
Index of the compressor that provided these compression results.
Definition: multi.hh:92
Definition of a basic cache compressor.
std::vector< BaseCacheCompressor * > compressors
List of sub-compressors.
Definition: multi.hh:53
std::unique_ptr< BaseCacheCompressor::CompressionData > compData
Compression data of the best compressor.
Definition: multi.hh:96
STL vector class.
Definition: stl.hh:37
MultiCompData(unsigned index, std::unique_ptr< BaseCacheCompressor::CompressionData > comp_data)
Default constructor.
Definition: multi.cc:43
std::unique_ptr< BaseCacheCompressor::CompressionData > compress(const uint64_t *data, Cycles &comp_lat, Cycles &decomp_lat) override
Apply the compression process to the cache line.
Definition: multi.cc:70
Stats::Vector2d rankStats
Number of times each compressor provided the nth best compression.
Definition: multi.hh:64
~MultiCompData()=default
Default destructor.
MultiCompressor(const Params *p)
Default constructor.
Definition: multi.cc:56
uint8_t getIndex() const
Get the index of the best compressor.
Definition: multi.cc:51
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
Base cache compressor interface.
Definition: base.hh:52
void regStats() override
Callback to set stat parameters.
Definition: multi.cc:159
~MultiCompressor()
Default destructor.
Definition: multi.cc:62
A 2-Dimensional vecto of scalar stats.
Definition: statistics.hh:2575
Bitfield< 0 > p
const char data[]

Generated on Thu May 28 2020 16:21:33 for gem5 by doxygen 1.8.13