33#ifndef __MEM_CACHE_COMPRESSORS_BASE_DELTA_IMPL_HH__
34#define __MEM_CACHE_COMPRESSORS_BASE_DELTA_IMPL_HH__
36#include "debug/CacheComp.hh"
46template <
class BaseType, std::
size_t DeltaSizeBits>
52template <
class BaseType, std::
size_t DeltaSizeBits>
62template <
class BaseType, std::
size_t DeltaSizeBits>
72template <
class BaseType, std::
size_t DeltaSizeBits>
73std::unique_ptr<Base::CompressionData>
78 std::unique_ptr<Base::CompressionData> comp_data =
85 const int diff = DEFAULT_MAX_NUM_BASES -
89 DPRINTF(CacheComp,
"Base%dDelta%d compression failed\n",
90 8 *
sizeof(BaseType), DeltaSizeBits);
91 }
else if (diff > 0) {
92 comp_data->setSizeBits(comp_data->getSizeBits() +
93 8 *
sizeof(BaseType) * diff);
Definition of a base delta immediate compressor.
Cycles is a wrapper class for representing cycle counts, i.e.
BaseDelta(const Params &p)
std::unique_ptr< Base::CompressionData > compress(const std::vector< Base::Chunk > &chunks, Cycles &comp_lat, Cycles &decomp_lat) override
Apply the compression process to the cache line.
void addToDictionary(DictionaryEntry data) override
void resetDictionary() override
Clear all dictionary entries.
typename DictionaryCompressor< BaseType >::DictionaryEntry DictionaryEntry
BaseDictionaryCompressorParams Params
static void setSizeBits(CacheBlk *blk, const std::size_t size_bits)
Set the size of the compressed block, in bits.
A template version of the dictionary compressor that allows to choose the dictionary size.
virtual void resetDictionary()
Clear all dictionary entries.
std::unique_ptr< Base::CompressionData > compress(const std::vector< Chunk > &chunks)
Apply compression.
Implementation of a dictionary based cache compressor.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.