gem5  v21.1.0.2
Public Member Functions | Private Attributes | List of all members
gem5::GenericSatCounter< T > Class Template Reference

Implements an n bit saturating counter and provides methods to increment, decrement, and read it. More...

#include <sat_counter.hh>

Public Member Functions

 GenericSatCounter ()=delete
 The default constructor should never be used. More...
 
 GenericSatCounter (unsigned bits, T initial_val=0)
 Constructor for the counter. More...
 
 GenericSatCounter (const GenericSatCounter &other)
 Copy constructor. More...
 
GenericSatCounteroperator= (const GenericSatCounter &other)
 Copy assignment. More...
 
 GenericSatCounter (GenericSatCounter &&other)
 Move constructor. More...
 
GenericSatCounteroperator= (GenericSatCounter &&other)
 Move assignment. More...
 
void swap (GenericSatCounter &other)
 Swap the contents of every member of the class. More...
 
GenericSatCounteroperator++ ()
 Pre-increment operator. More...
 
GenericSatCounter operator++ (int)
 Post-increment operator. More...
 
GenericSatCounteroperator-- ()
 Pre-decrement operator. More...
 
GenericSatCounter operator-- (int)
 Post-decrement operator. More...
 
GenericSatCounteroperator>>= (const int &shift)
 Shift-right-assignment. More...
 
GenericSatCounteroperator<<= (const int &shift)
 Shift-left-assignment. More...
 
GenericSatCounteroperator+= (const long long &value)
 Add-assignment. More...
 
GenericSatCounteroperator-= (const long long &value)
 Subtract-assignment. More...
 
 operator T () const
 Read the counter's value. More...
 
void reset ()
 Reset the counter to its initial value. More...
 
double calcSaturation () const
 Calculate saturation percentile of the current counter's value with regard to its maximum possible value. More...
 
bool isSaturated () const
 Whether the counter has achieved its maximum value or not. More...
 
uint8_t saturate ()
 Saturate the counter. More...
 

Private Attributes

initialVal
 
maxVal
 
counter
 

Detailed Description

template<class T>
class gem5::GenericSatCounter< T >

Implements an n bit saturating counter and provides methods to increment, decrement, and read it.

Template Parameters
TThe type of the underlying counter container.

Definition at line 60 of file sat_counter.hh.

Constructor & Destructor Documentation

◆ GenericSatCounter()

template<class T >
gem5::GenericSatCounter< T >::GenericSatCounter ( )
delete

The default constructor should never be used.

Member Data Documentation

◆ counter

template<class T >
T gem5::GenericSatCounter< T >::counter
private

◆ initialVal

template<class T >
T gem5::GenericSatCounter< T >::initialVal
private

◆ maxVal

template<class T >
T gem5::GenericSatCounter< T >::maxVal
private

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

Generated on Tue Sep 21 2021 12:27:37 for gem5 by doxygen 1.8.17