38 #ifndef __MEM_CACHE_COMPRESSORS_BASE_HH__ 39 #define __MEM_CACHE_COMPRESSORS_BASE_HH__ 48 struct BaseCacheCompressorParams;
116 virtual std::unique_ptr<CompressionData>
compress(
117 const uint64_t* cache_line,
Cycles& comp_lat,
Cycles& decomp_lat) = 0;
126 uint64_t* cache_line) = 0;
130 typedef BaseCacheCompressorParams
Params;
152 Cycles& decomp_lat, std::size_t& comp_size_bits);
209 std::size_t getSizeBits()
const;
216 std::size_t getSize()
const;
219 #endif //__MEM_CACHE_COMPRESSORS_BASE_HH__ virtual std::unique_ptr< CompressionData > compress(const uint64_t *cache_line, Cycles &comp_lat, Cycles &decomp_lat)=0
Apply the compression process to the cache line.
virtual ~BaseCacheCompressor()
Default destructor.
BaseCacheCompressor(const Params *p)
Default constructor.
Cycles is a wrapper class for representing cycle counts, i.e.
Stats::Scalar decompressions
Number of decompressions performed.
const std::size_t sizeThreshold
Size in bytes at which a compression is classified as bad and therefore the compressed block is resto...
A vector of scalar stats.
Stats::Scalar compressionSizeBits
Total compressed data size, in number of bits.
Declaration of Statistics objects.
This is a simple scalar statistic, like a counter.
static void setSizeBits(CacheBlk *blk, const std::size_t size_bits)
Set the size of the compressed block, in bits.
const BaseCacheCompressor & compressor
const std::size_t blkSize
Uncompressed cache line size (in bytes).
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
Base cache compressor interface.
Stats::Scalar compressions
Number of compressions performed.
Stats::Formula avgCompressionSizeBits
Average data size after compression, in number of bits.
std::size_t _size
Compressed cache line size (in bits).
BaseCacheCompressorParams Params
Convenience typedef.
BaseCacheCompressorStats(BaseCacheCompressor &compressor)
Cycles getDecompressionLatency(const CacheBlk *blk)
Get the decompression latency if the block is compressed.
void regStats() override
Callback to set stat parameters.
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.
std::vector< Info * > stats
Abstract superclass for simulation objects.
virtual void decompress(const CompressionData *comp_data, uint64_t *cache_line)=0
Apply the decompression process to the compressed data.