|
gem5
v19.0.0.0
|
Implements an n bit saturating counter and provides methods to increment, decrement, and read it. More...
#include <sat_counter.hh>
Public Member Functions | |
| SatCounter ()=delete | |
| The default constructor should never be used. More... | |
| SatCounter (unsigned bits, uint8_t initial_val=0) | |
| Constructor for the counter. More... | |
| SatCounter (const SatCounter &other) | |
| Copy constructor. More... | |
| SatCounter & | operator= (const SatCounter &other) |
| Copy assignment. More... | |
| SatCounter (SatCounter &&other) | |
| Move constructor. More... | |
| SatCounter & | operator= (SatCounter &&other) |
| Move assignment. More... | |
| void | swap (SatCounter &other) |
| Swap the contents of every member of the class. More... | |
| SatCounter & | operator++ () |
| Pre-increment operator. More... | |
| SatCounter | operator++ (int) |
| Post-increment operator. More... | |
| SatCounter & | operator-- () |
| Pre-decrement operator. More... | |
| SatCounter | operator-- (int) |
| Post-decrement operator. More... | |
| SatCounter & | operator>>= (const int &shift) |
| Shift-right-assignment. More... | |
| SatCounter & | operator<<= (const int &shift) |
| Shift-left-assignment. More... | |
| SatCounter & | operator+= (const int &value) |
| Add-assignment. More... | |
| SatCounter & | operator-= (const int &value) |
| Subtract-assignment. More... | |
| operator uint8_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 | |
| uint8_t | initialVal |
| uint8_t | maxVal |
| uint8_t | counter |
Implements an n bit saturating counter and provides methods to increment, decrement, and read it.
Definition at line 57 of file sat_counter.hh.
|
delete |
The default constructor should never be used.
|
inlineexplicit |
Constructor for the counter.
The explicit keyword is used to make sure the user does not assign a number to the counter thinking it will be used as a counter value when it is in fact used as the number of bits.
| bits | How many bits the counter will have. |
| initial_val | Starting value for the counter. |
Definition at line 72 of file sat_counter.hh.
|
inline |
Copy constructor.
Definition at line 83 of file sat_counter.hh.
|
inline |
Move constructor.
Definition at line 99 of file sat_counter.hh.
References counter, initialVal, and maxVal.
|
inline |
Calculate saturation percentile of the current counter's value with regard to its maximum possible value.
Definition at line 240 of file sat_counter.hh.
References counter, and maxVal.
Referenced by SignaturePathPrefetcher::calculateLookaheadConfidence(), IndirectMemoryPrefetcher::calculatePrefetch(), SignaturePathPrefetcher::calculatePrefetchConfidence(), and TEST().
|
inline |
Whether the counter has achieved its maximum value or not.
Definition at line 247 of file sat_counter.hh.
References counter, and maxVal.
Referenced by SignaturePathPrefetcherV2::increasePatternEntryCounter(), and TEST().
|
inline |
|
inline |
Pre-increment operator.
Definition at line 136 of file sat_counter.hh.
|
inline |
Post-increment operator.
Definition at line 146 of file sat_counter.hh.
|
inline |
|
inline |
|
inline |
Post-decrement operator.
Definition at line 165 of file sat_counter.hh.
|
inline |
|
inline |
Shift-left-assignment.
Definition at line 183 of file sat_counter.hh.
References counter, maxVal, and ArmISA::shift.
|
inline |
|
inline |
Move assignment.
Definition at line 109 of file sat_counter.hh.
References counter, initialVal, and maxVal.
|
inline |
Shift-right-assignment.
Definition at line 174 of file sat_counter.hh.
References counter, and ArmISA::shift.
|
inline |
Reset the counter to its initial value.
Definition at line 231 of file sat_counter.hh.
References counter, and initialVal.
Referenced by IrregularStreamBufferPrefetcher::addStructuralToPhysicalEntry(), IrregularStreamBufferPrefetcher::calculatePrefetch(), SignaturePathPrefetcher::PatternEntry::getStrideEntry(), IndirectMemoryPrefetcher::PrefetchTableEntry::invalidate(), SignaturePathPrefetcher::PatternEntry::invalidate(), TEST(), BRRIPRP::touch(), and IndirectMemoryPrefetcher::trackMissIndex2().
|
inline |
Saturate the counter.
Definition at line 254 of file sat_counter.hh.
References counter, and maxVal.
Referenced by BRRIPRP::reset(), and TEST().
|
inline |
Swap the contents of every member of the class.
Used for the default copy-assignment created by the compiler.
| other | The other object to swap contents with. |
Definition at line 127 of file sat_counter.hh.
References counter, initialVal, and maxVal.
Referenced by operator=().
|
private |
Definition at line 264 of file sat_counter.hh.
Referenced by calcSaturation(), SignaturePathPrefetcher::PatternEntry::getStrideEntry(), SignaturePathPrefetcherV2::increasePatternEntryCounter(), isSaturated(), operator uint8_t(), operator++(), operator+=(), operator--(), operator-=(), operator<<=(), operator=(), operator>>=(), reset(), SatCounter(), saturate(), and swap().
|
private |
Definition at line 262 of file sat_counter.hh.
Referenced by operator=(), reset(), SatCounter(), and swap().
|
private |
Definition at line 263 of file sat_counter.hh.
Referenced by calcSaturation(), isSaturated(), operator++(), operator+=(), operator<<=(), operator=(), SatCounter(), saturate(), and swap().