Go to the documentation of this file.
41 #ifndef __BASE_SAT_COUNTER_HH__
42 #define __BASE_SAT_COUNTER_HH__
79 "Number of bits exceeds counter size");
81 "Saturating counter's Initial value exceeds max value.");
101 if (
this != &other) {
128 if (
this != &other) {
340 [[deprecated(
"Use SatCounter8 (or variants) instead")]]
343 #endif // __BASE_SAT_COUNTER_HH__
GenericSatCounter & operator--()
Pre-decrement operator.
GenericSatCounter & operator+=(const long long &value)
Add-assignment.
GenericSatCounter & operator=(GenericSatCounter &&other)
Move assignment.
GenericSatCounter< uint32_t > SatCounter32
GenericSatCounter()=delete
The default constructor should never be used.
void swap(GenericSatCounter &other)
Swap the contents of every member of the class.
GenericSatCounter & operator<<=(const int &shift)
Shift-left-assignment.
GenericSatCounter operator++(int)
Post-increment operator.
GenericSatCounter(const GenericSatCounter &other)
Copy constructor.
GenericSatCounter(unsigned bits, T initial_val=0)
Constructor for the counter.
GenericSatCounter & operator++()
Pre-increment operator.
Implements an n bit saturating counter and provides methods to increment, decrement,...
GenericSatCounter & operator>>=(const int &shift)
Shift-right-assignment.
GenericSatCounter(GenericSatCounter &&other)
Move constructor.
GenericSatCounter< uint64_t > SatCounter64
GenericSatCounter< uint16_t > SatCounter16
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
void reset()
Reset the counter to its initial value.
uint8_t saturate()
Saturate the counter.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
GenericSatCounter & operator-=(const long long &value)
Subtract-assignment.
double calcSaturation() const
Calculate saturation percentile of the current counter's value with regard to its maximum possible va...
GenericSatCounter operator--(int)
Post-decrement operator.
GenericSatCounter & operator=(const GenericSatCounter &other)
Copy assignment.
GenericSatCounter< uint8_t > SatCounter8
#define ULL(N)
uint64_t constant
bool isSaturated() const
Whether the counter has achieved its maximum value or not.
Generated on Tue Mar 23 2021 19:41:24 for gem5 by doxygen 1.8.17