gem5 v25.0.0.1
Loading...
Searching...
No Matches
gem5::compression::DictionaryCompressor< T >::Pattern Class Referenceabstract

The compressed data is composed of multiple pattern entries. More...

#include <dictionary_compressor.hh>

Inheritance diagram for gem5::compression::DictionaryCompressor< T >::Pattern:
gem5::compression::DictionaryCompressor< T >::DeltaPattern< DeltaSizeBits > gem5::compression::DictionaryCompressor< T >::MaskedPattern< mask > gem5::compression::DictionaryCompressor< T >::RepeatedValuePattern< RepT > gem5::compression::DictionaryCompressor< T >::SignExtendedPattern< N > gem5::compression::DictionaryCompressor< T >::UncompressedPattern gem5::compression::DictionaryCompressor< T >::LocatedMaskedPattern< 0xFFFFFFFFFFFFFFFF, 0 > gem5::compression::DictionaryCompressor< T >::MaskedValuePattern< 0, 0xFFFFFFFFFFFFFFFF > gem5::compression::DictionaryCompressor< T >::LocatedMaskedPattern< mask, location > gem5::compression::DictionaryCompressor< T >::MaskedValuePattern< value, mask > gem5::compression::BaseDelta< BaseType, DeltaSizeBits >::PatternX gem5::compression::RepeatedQwords::PatternX gem5::compression::Zero::PatternX gem5::compression::RepeatedQwords::PatternM gem5::compression::Zero::PatternZ

Public Member Functions

 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.
virtual DictionaryEntry decompress (const DictionaryEntry dict_bytes) const =0
 Decompress the pattern.

Protected Attributes

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>
class gem5::compression::DictionaryCompressor< T >::Pattern

The compressed data is composed of multiple pattern entries.

To add a new pattern one should inherit from this class and implement isPattern() and decompress(). Then the new pattern must be added to the PatternFactory declaration in crescent order of size (in the DictionaryCompressor class).

Definition at line 285 of file dictionary_compressor.hh.

Constructor & Destructor Documentation

◆ Pattern()

template<class T>
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 )
inline

◆ ~Pattern()

template<class T>
virtual gem5::compression::DictionaryCompressor< T >::Pattern::~Pattern ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ decompress()

◆ getCode()

template<class T>
uint8_t gem5::compression::DictionaryCompressor< T >::Pattern::getCode ( ) const
inline

Get code of this pattern.

Returns
The code.

Definition at line 340 of file dictionary_compressor.hh.

References code.

Referenced by print().

◆ getMatchLocation()

template<class T>
uint8_t gem5::compression::DictionaryCompressor< T >::Pattern::getMatchLocation ( ) const
inline

Get the index of the dictionary match location.

Returns
The index of the match location.

Definition at line 347 of file dictionary_compressor.hh.

References matchLocation.

Referenced by gem5::compression::DictionaryCompressor< T >::decompressValue().

◆ getPatternNumber()

template<class T>
int gem5::compression::DictionaryCompressor< T >::Pattern::getPatternNumber ( ) const
inline

Get enum number associated to this pattern.

Returns
The pattern enum number.

Definition at line 333 of file dictionary_compressor.hh.

References patternNumber.

Referenced by print().

◆ getSizeBits()

template<class T>
virtual std::size_t gem5::compression::DictionaryCompressor< T >::Pattern::getSizeBits ( ) const
inlinevirtual

Get size, in bits, of the pattern (excluding prefix).

Corresponds to unmatched_data_size + code_length.

Returns
The size.

Definition at line 356 of file dictionary_compressor.hh.

References length, and numUnmatchedBits.

Referenced by print().

◆ print()

template<class T>
std::string gem5::compression::DictionaryCompressor< T >::Pattern::print ( ) const
inline

Extract pattern's information to a string.

Returns
A string containing the relevant pattern metadata.

Definition at line 374 of file dictionary_compressor.hh.

References gem5::csprintf(), getCode(), getPatternNumber(), and getSizeBits().

◆ shouldAllocate()

template<class T>
bool gem5::compression::DictionaryCompressor< T >::Pattern::shouldAllocate ( ) const
inline

Determine if pattern allocates a dictionary entry.

Returns
True if should allocate a dictionary entry.

Definition at line 366 of file dictionary_compressor.hh.

References allocate.

Referenced by gem5::compression::DictionaryCompressor< T >::decompressValue().

Member Data Documentation

◆ allocate

◆ code

◆ length

template<class T>
const uint8_t gem5::compression::DictionaryCompressor< T >::Pattern::length
protected

Length, in bits, of the code and match location.

Definition at line 295 of file dictionary_compressor.hh.

Referenced by getSizeBits(), and Pattern().

◆ matchLocation

template<class T>
const int gem5::compression::DictionaryCompressor< T >::Pattern::matchLocation
protected

Index representing the the match location.

Definition at line 301 of file dictionary_compressor.hh.

Referenced by getMatchLocation(), and Pattern().

◆ numUnmatchedBits

template<class T>
const uint8_t gem5::compression::DictionaryCompressor< T >::Pattern::numUnmatchedBits
protected

Number of unmatched bits.

Definition at line 298 of file dictionary_compressor.hh.

Referenced by getSizeBits(), and Pattern().

◆ patternNumber

template<class T>
const int gem5::compression::DictionaryCompressor< T >::Pattern::patternNumber
protected

Pattern enum number.

Definition at line 289 of file dictionary_compressor.hh.

Referenced by getPatternNumber(), and Pattern().


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

Generated on Sat Oct 18 2025 08:06:58 for gem5 by doxygen 1.14.0