29#ifndef __MEM_CACHE_COMPRESSORS_FREQUENT_VALUES_HH__
30#define __MEM_CACHE_COMPRESSORS_FREQUENT_VALUES_HH__
50struct FrequentValuesCompressorParams;
76 const std::string &
name)
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,...
A CacheEntry is an entry containing a tag.
virtual void invalidate()
Invalidate the block.
Cycles is a wrapper class for representing cycle counts, i.e.
ProbeListenerArgBase is used to define the base interface to a ProbeListenerArg (i....
ProbeManager is a conduit class that lives on each SimObject, and is used to match up probe listeners...
Base cache compressor interface.
std::vector< CompressedValue > compressedValues
The values contained in the original data, after being compressed sequentially.
FrequentValuesListener(FrequentValues &_parent, ProbeManager *pm, const 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 ...
VFTEntry(std::size_t num_bits)
uint64_t value
The value is stored as a 64 bit entry to accomodate for the uncompressed value.
void invalidate() override
Invalidate the block.
This compressor samples the cache for a while, trying to define the most frequently used values.
std::vector< FrequentValuesListener * > listeners
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...
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.
void reset()
Reset the counter to its initial value.
Declares a basic cache interface BaseCache.
Definition of a basic cache compressor.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Tick
Tick count type.
A data contents update is composed of the updated block's address, the old contents,...
A compressed value contains its encoding, and the compressed data itself.
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)