Go to the documentation of this file.
41 #ifndef __BASE_SAT_COUNTER_HH__
42 #define __BASE_SAT_COUNTER_HH__
76 "Number of bits exceeds counter size");
78 "Saturating counter's Initial value exceeds max value.");
125 if (
this != &other) {
328 #endif // __BASE_SAT_COUNTER_HH__
void reset()
Reset the counter to its initial value.
SatCounter & operator>>=(const int &shift)
Shift-right-assignment.
SatCounter()=delete
The default constructor should never be used.
SatCounter operator++(int)
Post-increment operator.
SatCounter & operator=(const SatCounter &other)
Copy assignment.
uint8_t saturate()
Saturate the counter.
double calcSaturation() const
Calculate saturation percentile of the current counter's value with regard to its maximum possible va...
SatCounter & operator<<=(const int &shift)
Shift-left-assignment.
SatCounter & operator--()
Pre-decrement operator.
SatCounter & operator+=(const int &value)
Add-assignment.
bool isSaturated() const
Whether the counter has achieved its maximum value or not.
void swap(SatCounter &other)
Swap the contents of every member of the class.
SatCounter(SatCounter &&other)
Move constructor.
SatCounter & operator-=(const int &value)
Subtract-assignment.
SatCounter(unsigned bits, uint8_t initial_val=0)
Constructor for the counter.
SatCounter & operator++()
Pre-increment operator.
Implements an n bit saturating counter and provides methods to increment, decrement,...
SatCounter operator--(int)
Post-decrement operator.
SatCounter(const SatCounter &other)
Copy constructor.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
SatCounter & operator=(SatCounter &&other)
Move assignment.
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17