gem5 v24.0.0.0
|
A pattern that checks whether the difference of the value and the dictionary entries' is below a certain threshold. More...
#include <dictionary_compressor.hh>
Public Member Functions | |
DeltaPattern (const int number, const uint64_t code, const uint64_t metadata_length, const int match_location, const DictionaryEntry bytes) | |
DictionaryEntry | decompress (const DictionaryEntry dict_bytes) const override |
Decompress the pattern. | |
Public Member Functions inherited from gem5::compression::DictionaryCompressor< T >::Pattern | |
Pattern (const int number, const uint64_t code, const uint64_t metadata_length, const uint64_t num_unmatched_bits, const int match_location, const bool allocate=true) | |
Default constructor. | |
virtual | ~Pattern ()=default |
Default destructor. | |
int | getPatternNumber () const |
Get enum number associated to this pattern. | |
uint8_t | getCode () const |
Get code of this pattern. | |
uint8_t | getMatchLocation () const |
Get the index of the dictionary match location. | |
virtual std::size_t | getSizeBits () const |
Get size, in bits, of the pattern (excluding prefix). | |
bool | shouldAllocate () const |
Determine if pattern allocates a dictionary entry. | |
std::string | print () const |
Extract pattern's information to a string. | |
Static Public Member Functions | |
static bool | isValidDelta (const DictionaryEntry &bytes, const DictionaryEntry &base_bytes) |
Compares a given value against a base to calculate their delta, and then determines whether it fits a limited sized container. | |
static bool | isPattern (const DictionaryEntry &bytes, const DictionaryEntry &dict_bytes, const int match_location) |
Private Attributes | |
const DictionaryEntry | bytes |
The original value. | |
Additional Inherited Members | |
Protected Attributes inherited from gem5::compression::DictionaryCompressor< T >::Pattern | |
const int | patternNumber |
Pattern enum number. | |
const uint8_t | code |
Code associated to the pattern. | |
const uint8_t | length |
Length, in bits, of the code and match location. | |
const uint8_t | numUnmatchedBits |
Number of unmatched bits. | |
const int | matchLocation |
Index representing the the match location. | |
const bool | allocate |
Wether the pattern allocates a dictionary entry or not. | |
A pattern that checks whether the difference of the value and the dictionary entries' is below a certain threshold.
If so, the pattern is successful, and only the delta bits need to be stored.
For example, if the delta can only contain up to 4 bits, and the dictionary contains the entry 0xA231, the value 0xA232 would be compressible, and the delta 0x1 would be stored. The value 0xA249, on the other hand, would not be compressible, since its delta (0x18) needs 5 bits to be stored.
DeltaSizeBits | Size of a delta entry, in number of bits, which determines the threshold. Must always be smaller than the dictionary entry type's size. |
Definition at line 682 of file dictionary_compressor.hh.
|
inline |
Definition at line 697 of file dictionary_compressor.hh.
|
inlineoverridevirtual |
Decompress the pattern.
Each pattern has its own way of interpreting its data.
dict_bytes | The bytes in the corresponding matching entry. |
Implements gem5::compression::DictionaryCompressor< T >::Pattern.
Definition at line 738 of file dictionary_compressor.hh.
|
inlinestatic |
Definition at line 731 of file dictionary_compressor.hh.
|
inlinestatic |
Compares a given value against a base to calculate their delta, and then determines whether it fits a limited sized container.
bytes | Value to be compared against base. |
base_bytes | Base value. |
Definition at line 717 of file dictionary_compressor.hh.
References gem5::X86ISA::base, gem5::compression::DictionaryCompressor< T >::fromDictionaryEntry(), gem5::X86ISA::limit, and gem5::ArmISA::mask.
|
private |
The original value.
In theory we should keep only the deltas, but the dictionary entry is not inserted in the dictionary before the call to the constructor, so the delta cannot be calculated then.
Definition at line 694 of file dictionary_compressor.hh.