gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::compression::DictionaryCompressor< T >::DeltaPattern< DeltaSizeBits > Class Template Reference

A pattern that checks whether the difference of the value and the dictionary entries' is below a certain threshold. More...

#include <dictionary_compressor.hh>

Inheritance diagram for gem5::compression::DictionaryCompressor< T >::DeltaPattern< DeltaSizeBits >:
gem5::compression::DictionaryCompressor< T >::Pattern

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.
 

Detailed Description

template<class T>
template<std::size_t DeltaSizeBits>
class gem5::compression::DictionaryCompressor< T >::DeltaPattern< DeltaSizeBits >

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.

Template Parameters
DeltaSizeBitsSize 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.

Constructor & Destructor Documentation

◆ DeltaPattern()

template<class T >
template<std::size_t DeltaSizeBits>
gem5::compression::DictionaryCompressor< T >::DeltaPattern< DeltaSizeBits >::DeltaPattern ( const int number,
const uint64_t code,
const uint64_t metadata_length,
const int match_location,
const DictionaryEntry bytes )
inline

Definition at line 697 of file dictionary_compressor.hh.

Member Function Documentation

◆ decompress()

template<class T >
template<std::size_t DeltaSizeBits>
DictionaryEntry gem5::compression::DictionaryCompressor< T >::DeltaPattern< DeltaSizeBits >::decompress ( const DictionaryEntry dict_bytes) const
inlineoverridevirtual

Decompress the pattern.

Each pattern has its own way of interpreting its data.

Parameters
dict_bytesThe bytes in the corresponding matching entry.
Returns
The decompressed pattern.

Implements gem5::compression::DictionaryCompressor< T >::Pattern.

Definition at line 738 of file dictionary_compressor.hh.

◆ isPattern()

template<class T >
template<std::size_t DeltaSizeBits>
static bool gem5::compression::DictionaryCompressor< T >::DeltaPattern< DeltaSizeBits >::isPattern ( const DictionaryEntry & bytes,
const DictionaryEntry & dict_bytes,
const int match_location )
inlinestatic

Definition at line 731 of file dictionary_compressor.hh.

◆ isValidDelta()

template<class T >
template<std::size_t DeltaSizeBits>
static bool gem5::compression::DictionaryCompressor< T >::DeltaPattern< DeltaSizeBits >::isValidDelta ( const DictionaryEntry & bytes,
const DictionaryEntry & base_bytes )
inlinestatic

Compares a given value against a base to calculate their delta, and then determines whether it fits a limited sized container.

Parameters
bytesValue to be compared against base.
base_bytesBase value.
Returns
Whether the value fits in the container.

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.

Member Data Documentation

◆ bytes

template<class T >
template<std::size_t DeltaSizeBits>
const DictionaryEntry gem5::compression::DictionaryCompressor< T >::DeltaPattern< DeltaSizeBits >::bytes
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.


The documentation for this class was generated from the following file:

Generated on Tue Jun 18 2024 16:24:18 for gem5 by doxygen 1.11.0