gem5 v24.0.0.0
Loading...
Searching...
No Matches
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.
 
 GenericSatCounter (unsigned bits, T initial_val=0)
 Constructor for the counter.
 
 GenericSatCounter (const GenericSatCounter &other)
 Copy constructor.
 
GenericSatCounteroperator= (const GenericSatCounter &other)
 Copy assignment.
 
 GenericSatCounter (GenericSatCounter &&other)
 Move constructor.
 
GenericSatCounteroperator= (GenericSatCounter &&other)
 Move assignment.
 
void swap (GenericSatCounter &other)
 Swap the contents of every member of the class.
 
GenericSatCounteroperator++ ()
 Pre-increment operator.
 
GenericSatCounter operator++ (int)
 Post-increment operator.
 
GenericSatCounteroperator-- ()
 Pre-decrement operator.
 
GenericSatCounter operator-- (int)
 Post-decrement operator.
 
GenericSatCounteroperator>>= (const int &shift)
 Shift-right-assignment.
 
GenericSatCounteroperator<<= (const int &shift)
 Shift-left-assignment.
 
GenericSatCounteroperator+= (const long long &value)
 Add-assignment.
 
GenericSatCounteroperator-= (const long long &value)
 Subtract-assignment.
 
 operator T () const
 Read the counter's value.
 
void reset ()
 Reset the counter to its initial value.
 
double calcSaturation () const
 Calculate saturation percentile of the current counter's value with regard to its maximum possible value.
 
bool isSaturated () const
 Whether the counter has achieved its maximum value or not.
 
saturate ()
 Saturate the counter.
 

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

◆ initialVal

◆ maxVal


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

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