Go to the documentation of this file.
41 #ifndef __BASE_SAT_COUNTER_HH__
42 #define __BASE_SAT_COUNTER_HH__
82 "Number of bits exceeds counter size");
84 "Saturating counter's initial value exceeds max value.");
104 if (
this != &other) {
131 if (
this != &other) {
345 #endif // __BASE_SAT_COUNTER_HH__
void swap(GenericSatCounter &other)
Swap the contents of every member of the class.
double calcSaturation() const
Calculate saturation percentile of the current counter's value with regard to its maximum possible va...
GenericSatCounter< uint8_t > SatCounter8
GenericSatCounter & operator+=(const long long &value)
Add-assignment.
GenericSatCounter & operator-=(const long long &value)
Subtract-assignment.
GenericSatCounter operator--(int)
Post-decrement operator.
GenericSatCounter & operator=(GenericSatCounter &&other)
Move assignment.
T saturate()
Saturate the counter.
GenericSatCounter()=delete
The default constructor should never be used.
bool isSaturated() const
Whether the counter has achieved its maximum value or not.
GenericSatCounter & operator--()
Pre-decrement operator.
GenericSatCounter< uint16_t > SatCounter16
Implements an n bit saturating counter and provides methods to increment, decrement,...
GenericSatCounter(unsigned bits, T initial_val=0)
Constructor for the counter.
GenericSatCounter & operator<<=(const int &shift)
Shift-left-assignment.
void reset()
Reset the counter to its initial value.
GenericSatCounter & operator++()
Pre-increment operator.
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
GenericSatCounter operator++(int)
Post-increment operator.
GenericSatCounter(const GenericSatCounter &other)
Copy constructor.
GenericSatCounter & operator=(const GenericSatCounter &other)
Copy assignment.
GenericSatCounter< uint64_t > SatCounter64
GenericSatCounter< uint32_t > SatCounter32
GenericSatCounter(GenericSatCounter &&other)
Move constructor.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
GenericSatCounter & operator>>=(const int &shift)
Shift-right-assignment.
Generated on Sun Jul 30 2023 01:56:51 for gem5 by doxygen 1.8.17