36#ifndef __MEM_CACHE_COMPRESSORS_BASE_HH__
37#define __MEM_CACHE_COMPRESSORS_BASE_HH__
51struct BaseCacheCompressorParams;
198 uint64_t* cache_line) = 0;
201 typedef BaseCacheCompressorParams
Params;
217 std::unique_ptr<CompressionData>
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Cycles is a wrapper class for representing cycle counts, i.e.
Abstract superclass for simulation objects.
virtual ~CompressionData()
Virtual destructor.
CompressionData()
Default constructor.
std::size_t getSize() const
Get compression size (in bytes).
void setSizeBits(std::size_t size)
Set compression size (in bits).
std::size_t _size
Compressed cache line size (in bits).
std::size_t getSizeBits() const
Get compression size (in bits).
Base cache compressor interface.
const Cycles compExtraLatency
Extra latency added to compression due to packaging, shifting or other operations.
BaseCacheCompressorParams Params
void fromChunks(const std::vector< Chunk > &chunks, uint64_t *data) const
This function re-joins the chunks to recreate the original data.
gem5::compression::Base::BaseStats stats
BaseCache * cache
Pointer to the parent cache.
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.
const Cycles decompExtraLatency
Extra latency added to decompression due to packaging, shifting or other operations.
const Cycles compChunksPerCycle
Degree of parallelization of the compression process.
uint64_t Chunk
A chunk is a basic lexical unit.
Cycles getDecompressionLatency(const CacheBlk *blk)
Get the decompression latency if the block is compressed.
static void setSizeBits(CacheBlk *blk, const std::size_t size_bits)
Set the size of the compressed block, in bits.
const std::size_t blkSize
Uncompressed cache line size (in bytes).
virtual void setCache(BaseCache *_cache)
The cache can only be set once.
virtual void decompress(const CompressionData *comp_data, uint64_t *cache_line)=0
Apply the decompression process to the compressed data.
const unsigned chunkSizeBits
Chunk size, in number of bits.
const std::size_t sizeThreshold
Size in bytes at which a compression is classified as bad and therefore the compressed block is resto...
static void setDecompressionLatency(CacheBlk *blk, const Cycles lat)
Set the decompression latency of compressed block.
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.
const Cycles decompChunksPerCycle
Degree of parallelization of the decompression process.
This is a simple scalar statistic, like a counter.
A vector of scalar stats.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Declaration of Statistics objects.
statistics::Scalar compressions
Number of compressions performed.
void regStats() override
Callback to set stat parameters.
BaseStats(Base &compressor)
statistics::Scalar decompressions
Number of decompressions performed.
statistics::Vector compressionSize
Number of blocks that were compressed to this power of two size.
statistics::Formula avgCompressionSizeBits
Average data size after compression, in number of bits.
statistics::Scalar failedCompressions
Number of failed compressions.
statistics::Scalar compressionSizeBits
Total compressed data size, in number of bits.