Go to the documentation of this file.
36 #ifndef __MEM_CACHE_COMPRESSORS_BASE_HH__
37 #define __MEM_CACHE_COMPRESSORS_BASE_HH__
47 struct BaseCacheCompressorParams;
77 typedef uint64_t
Chunk;
182 virtual std::unique_ptr<CompressionData>
compress(
193 uint64_t* cache_line) = 0;
196 typedef BaseCacheCompressorParams
Params;
198 virtual ~Base() =
default;
212 std::unique_ptr<CompressionData>
283 #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...
const Cycles decompExtraLatency
Extra latency added to decompression due to packaging, shifting or other operations.
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
const Cycles compChunksPerCycle
Degree of parallelization of the compression process.
const Cycles compExtraLatency
Extra latency added to compression due to packaging, shifting or other operations.
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).
const Cycles decompChunksPerCycle
Degree of parallelization of the decompression process.
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.
virtual void setCache(BaseCache *_cache)
The cache can only be set once.
BaseCache * cache
Pointer to the parent cache.
Abstract superclass for simulation objects.
Generated on Tue Jun 22 2021 15:28:25 for gem5 by doxygen 1.8.17