29#ifndef __MEM_CACHE_COMPRESSORS_FREQUENT_VALUES_HH__
30#define __MEM_CACHE_COMPRESSORS_FREQUENT_VALUES_HH__
50struct FrequentValuesCompressorParams;
169 bool is_invalidation);
174 std::unique_ptr<Base::CompressionData>
compress(
176 Cycles& decomp_lat)
override;
181 typedef FrequentValuesCompressorParams
Params;
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
CacheEntry(TagExtractor ext)
std::function< Addr(Addr)> TagExtractor
virtual void invalidate()
Invalidate the block.
Cycles is a wrapper class for representing cycle counts, i.e.
ProbeListenerArgBase(std::string name)
CompressionData()
Default constructor.
std::vector< CompressedValue > compressedValues
The values contained in the original data, after being compressed sequentially.
FrequentValuesListener(FrequentValues &_parent, std::string name)
void notify(const DataUpdate &data_update) override
SatCounter32 counter
The ideal counter width (in bits) is determined by the maximum number of times a given value appears ...
uint64_t value
The value is stored as a 64 bit entry to accomodate for the uncompressed value.
void invalidate() override
Invalidate the block.
VFTEntry(std::size_t num_bits, TagExtractor ext)
FrequentValuesCompressorParams Params
const int counterBits
Number of bits in the saturating counters.
void decompress(const CompressionData *comp_data, uint64_t *data) override
Apply the decompression process to the compressed data.
void regProbeListeners() override
Register probe listeners for this object.
void sampleValues(const std::vector< uint64_t > &data, bool is_invalidation)
Sample values from a packet, adding them to the VFT.
std::unique_ptr< Base::CompressionData > compress(const std::vector< Chunk > &chunks, Cycles &comp_lat, Cycles &decomp_lat) override
Apply the compression process to the cache line.
unsigned takenSamples
Number of samples taken so far.
AssociativeCache< VFTEntry > VFT
The Value Frequency Table, a small cache that keeps track and estimates the frequency distribution of...
std::vector< ProbeListenerPtr< FrequentValuesListener > > listeners
CacheDataUpdateProbeArg DataUpdate
Phase
The phase that the compressor is at.
void probeNotify(const DataUpdate &data_update)
Process a notification event from the ProbeListener.
FrequentValues(const Params &p)
const unsigned numVFTEntries
Maximum number of VFT entries, and thus of codewords too.
const Tick codeGenerationTicks
Ticks needed to perform the CODE_GENERATION phase.
const bool checkSaturation
Whether an action must be performed when counters saturate.
void generateCodes()
End sampling phase and start the code generation.
~FrequentValues()=default
const unsigned numSamples
Number of samples in the sampling phase.
encoder::Huffman indexEncoder
The encoder applied to the VFT indices.
const bool useHuffmanEncoding
Whether Huffman encoding is applied to the VFT indices.
uint64_t uncompressedValue
A pseudo value is used as the representation of uncompressed values.
EventFunctionWrapper codeGenerationEvent
Event to handle finishing code generation and starting compression.
This encoder builds a Huffman tree using the frequency of each value to be encoded.
GenericSatCounter< uint32_t > SatCounter32
Declares a basic cache interface BaseCache.
Definition of a basic cache compressor.
Copyright (c) 2024 Arm Limited All rights reserved.
uint64_t Tick
Tick count type.
Overload hash function for BasicBlockRange type.
A data contents update is composed of the updated block's address, the old contents,...
uint64_t value
Original value, stored both for when the codeword marks an uncompressed entry, and to verify correctn...
encoder::Code code
The codeword.
CompressedValue(encoder::Code _code, uint64_t _value)