gem5  v19.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  * Authors: Daniel Carvalho
29  */
30 
36 #ifndef __MEM_CACHE_COMPRESSORS_MULTI_HH__
37 #define __MEM_CACHE_COMPRESSORS_MULTI_HH__
38 
39 #include <cstdint>
40 #include <vector>
41 
42 #include "base/types.hh"
44 
45 struct MultiCompressorParams;
46 
48 {
49  protected:
56 
59 
67 
72  public:
74  typedef MultiCompressorParams Params;
75 
77  MultiCompressor(const Params *p);
78 
81 
82  void regStats() override;
83 
84  std::unique_ptr<BaseCacheCompressor::CompressionData> compress(
85  const uint64_t* data, Cycles& comp_lat, Cycles& decomp_lat) override;
86 
87  void decompress(const CompressionData* comp_data, uint64_t* data) override;
88 };
89 
91 {
92  private:
94  const uint8_t index;
95 
96  public:
98  std::unique_ptr<BaseCacheCompressor::CompressionData> compData;
99 
106  MultiCompData(unsigned index,
107  std::unique_ptr<BaseCacheCompressor::CompressionData> comp_data);
108 
110  ~MultiCompData() = default;
111 
113  uint8_t getIndex() const;
114 };
115 
116 #endif //__MEM_CACHE_COMPRESSORS_MULTI_HH__
MultiCompressorParams Params
Convenience typedef.
Definition: multi.hh:74
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:83
void decompress(const CompressionData *comp_data, uint64_t *data) override
Apply the decompression process to the compressed data.
Definition: multi.cc:151
const uint8_t index
Index of the compressor that provided these compression results.
Definition: multi.hh:94
Definition of a basic cache compressor.
std::vector< BaseCacheCompressor * > compressors
List of sub-compressors.
Definition: multi.hh:55
std::unique_ptr< BaseCacheCompressor::CompressionData > compData
Compression data of the best compressor.
Definition: multi.hh:98
STL vector class.
Definition: stl.hh:40
MultiCompData(unsigned index, std::unique_ptr< BaseCacheCompressor::CompressionData > comp_data)
Default constructor.
Definition: multi.cc:45
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:72
Stats::Vector2d rankStats
Number of times each compressor provided the nth best compression.
Definition: multi.hh:66
~MultiCompData()=default
Default destructor.
MultiCompressor(const Params *p)
Default constructor.
Definition: multi.cc:58
uint8_t getIndex() const
Get the index of the best compressor.
Definition: multi.cc:53
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
Base cache compressor interface.
Definition: base.hh:54
void regStats() override
Callback to set stat parameters.
Definition: multi.cc:161
~MultiCompressor()
Default destructor.
Definition: multi.cc:64
A 2-Dimensional vecto of scalar stats.
Definition: statistics.hh:2578
Bitfield< 0 > p
const char data[]

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