gem5  v22.1.0.0
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
gem5::compression::DictionaryCompressor< T >::MaskedPattern< mask > Class Template Reference

A pattern that compares masked values against dictionary entries. More...

#include <dictionary_compressor.hh>

Inheritance diagram for gem5::compression::DictionaryCompressor< T >::MaskedPattern< mask >:
gem5::compression::DictionaryCompressor< T >::Pattern 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::RepeatedQwords::PatternM gem5::compression::Zero::PatternZ

Public Member Functions

 MaskedPattern (const int number, const uint64_t code, const uint64_t metadata_length, const int match_location, const DictionaryEntry bytes, const bool allocate=true)
 
DictionaryEntry decompress (const DictionaryEntry dict_bytes) const override
 Decompress the pattern. More...
 
- 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. 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...
 

Static Public Member Functions

static bool isPattern (const DictionaryEntry &bytes, const DictionaryEntry &dict_bytes, const int match_location)
 

Private Attributes

const T bits
 A copy of the bits that do not belong to the mask. More...
 

Additional Inherited Members

- Protected Attributes inherited from gem5::compression::DictionaryCompressor< T >::Pattern
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>
template<T mask>
class gem5::compression::DictionaryCompressor< T >::MaskedPattern< mask >

A pattern that compares masked values against dictionary entries.

If the masked dictionary entry matches perfectly the masked value to be compressed, there is a pattern match.

For example, if the mask is 0xFF00 (that is, this pattern matches the MSB), the value (V) 0xFF20 is being compressed, and the dictionary contains the value (D) 0xFF03, this is a match (V & mask == 0xFF00 == D & mask), and 0x0020 is added to the list of unmatched bits.

Template Parameters
maskA mask containing the bits that must match.

Definition at line 464 of file dictionary_compressor.hh.

Constructor & Destructor Documentation

◆ MaskedPattern()

template<class T >
template<T mask>
gem5::compression::DictionaryCompressor< T >::MaskedPattern< mask >::MaskedPattern ( const int  number,
const uint64_t  code,
const uint64_t  metadata_length,
const int  match_location,
const DictionaryEntry  bytes,
const bool  allocate = true 
)
inline

Definition at line 475 of file dictionary_compressor.hh.

Member Function Documentation

◆ decompress()

template<class T >
template<T mask>
DictionaryEntry gem5::compression::DictionaryCompressor< T >::MaskedPattern< mask >::decompress ( const DictionaryEntry  dict_bytes) const
inlineoverridevirtual

◆ isPattern()

template<class T >
template<T mask>
static bool gem5::compression::DictionaryCompressor< T >::MaskedPattern< mask >::isPattern ( const DictionaryEntry bytes,
const DictionaryEntry dict_bytes,
const int  match_location 
)
inlinestatic

Member Data Documentation

◆ bits

template<class T >
template<T mask>
const T gem5::compression::DictionaryCompressor< T >::MaskedPattern< mask >::bits
private

A copy of the bits that do not belong to the mask.

Definition at line 472 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