Go to the documentation of this file.
36 #ifndef __MEM_CACHE_COMPRESSORS_BASE_HH__
37 #define __MEM_CACHE_COMPRESSORS_BASE_HH__
46 struct BaseCacheCompressorParams;
76 typedef uint64_t
Chunk;
154 virtual std::unique_ptr<CompressionData>
compress(
165 uint64_t* cache_line) = 0;
168 typedef BaseCacheCompressorParams
Params;
170 virtual ~Base() =
default;
181 std::unique_ptr<CompressionData>
252 #endif //__MEM_CACHE_COMPRESSORS_BASE_HH__
const std::size_t sizeThreshold
Size in bytes at which a compression is classified as bad and therefore the compressed block is resto...
std::size_t _size
Compressed cache line size (in bits).
CompressionData()
Default constructor.
const unsigned chunkSizeBits
Chunk size, in number of bits.
void regStats() override
Callback to set stat parameters.
Stats::Scalar failedCompressions
Number of failed compressions.
const std::size_t blkSize
Uncompressed cache line size (in bytes).
Stats::Formula avgCompressionSizeBits
Average data size after compression, in number of bits.
virtual ~CompressionData()
Virtual destructor.
std::size_t getSizeBits() const
Get compression size (in bits).
void fromChunks(const std::vector< Chunk > &chunks, uint64_t *data) const
This function re-joins the chunks to recreate the original data.
Base cache compressor interface.
A vector of scalar stats.
BaseStats(Base &compressor)
virtual std::unique_ptr< CompressionData > compress(const std::vector< Chunk > &chunks, Cycles &comp_lat, Cycles &decomp_lat)=0
Apply the compression process to the cache line.
This is a simple scalar statistic, like a counter.
Stats::Vector compressionSize
Number of blocks that were compressed to this power of two size.
static void setDecompressionLatency(CacheBlk *blk, const Cycles lat)
Set the decompression latency of compressed block.
virtual void decompress(const CompressionData *comp_data, uint64_t *cache_line)=0
Apply the decompression process to the compressed data.
Cycles getDecompressionLatency(const CacheBlk *blk)
Get the decompression latency if the block is compressed.
BaseCacheCompressorParams Params
std::vector< Chunk > toChunks(const uint64_t *data) const
This function splits the raw data into chunks, so that it can be parsed by the compressor.
Stats::Scalar compressions
Number of compressions performed.
Stats::Scalar compressionSizeBits
Total compressed data size, in number of bits.
std::size_t getSize() const
Get compression size (in bytes).
Cycles is a wrapper class for representing cycle counts, i.e.
Compressor::Base::BaseStats stats
Stats::Scalar decompressions
Number of decompressions performed.
void setSizeBits(std::size_t size)
Set compression size (in bits).
uint64_t Chunk
A chunk is a basic lexical unit.
static void setSizeBits(CacheBlk *blk, const std::size_t size_bits)
Set the size of the compressed block, in bits.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17