gem5  v22.1.0.0
Public Member Functions | Protected Attributes | List of all members
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. More...
 
virtual ~Pattern ()=default
 Default destructor. More...
 
int getPatternNumber () const
 Get enum number associated to this pattern. More...
 
uint8_t getCode () const
 Get code of this pattern. More...
 
uint8_t getMatchLocation () const
 Get the index of the dictionary match location. More...
 
virtual std::size_t getSizeBits () const
 Get size, in bits, of the pattern (excluding prefix). More...
 
bool shouldAllocate () const
 Determine if pattern allocates a dictionary entry. More...
 
std::string print () const
 Extract pattern's information to a string. More...
 
virtual DictionaryEntry decompress (const DictionaryEntry dict_bytes) const =0
 Decompress the pattern. More...
 

Protected Attributes

const int patternNumber
 Pattern enum number. More...
 
const uint8_t code
 Code associated to the pattern. More...
 
const uint8_t length
 Length, in bits, of the code and match location. More...
 
const uint8_t numUnmatchedBits
 Number of unmatched bits. More...
 
const int matchLocation
 Index representing the the match location. More...
 
const bool allocate
 Wether the pattern allocates a dictionary entry or not. More...
 

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 286 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

Default constructor.

Parameters
numberPattern number.
codeCode associated to this pattern.
metadata_lengthLength, in bits, of the code and match location.
num_unmatched_bitsNumber of unmatched bits.
match_locationIndex of the match location.

Definition at line 317 of file dictionary_compressor.hh.

◆ ~Pattern()

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

Default destructor.

Member Function Documentation

◆ decompress()

template<class T >
virtual DictionaryEntry gem5::compression::DictionaryCompressor< T >::Pattern::decompress ( const DictionaryEntry  dict_bytes) const
pure virtual

◆ 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 341 of file dictionary_compressor.hh.

◆ 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 348 of file dictionary_compressor.hh.

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 334 of file dictionary_compressor.hh.

◆ 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 357 of file dictionary_compressor.hh.

◆ 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 375 of file dictionary_compressor.hh.

References gem5::csprintf().

◆ 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 367 of file dictionary_compressor.hh.

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

Member Data Documentation

◆ allocate

template<class T >
const bool gem5::compression::DictionaryCompressor< T >::Pattern::allocate
protected

Wether the pattern allocates a dictionary entry or not.

Definition at line 305 of file dictionary_compressor.hh.

◆ code

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

Code associated to the pattern.

Definition at line 293 of file dictionary_compressor.hh.

◆ 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 296 of file dictionary_compressor.hh.

◆ matchLocation

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

Index representing the the match location.

Definition at line 302 of file dictionary_compressor.hh.

◆ numUnmatchedBits

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

Number of unmatched bits.

Definition at line 299 of file dictionary_compressor.hh.

◆ patternNumber

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

Pattern enum number.

Definition at line 290 of file dictionary_compressor.hh.


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

Generated on Wed Dec 21 2022 10:23:39 for gem5 by doxygen 1.9.1