gem5 v24.0.0.0
|
Cycles is a wrapper class for representing cycle counts, i.e. More...
#include <types.hh>
Public Member Functions | |
constexpr | Cycles (uint64_t _c) |
Explicit constructor assigning a value. | |
Cycles () | |
Default constructor for parameter classes. | |
constexpr | operator uint64_t () const |
Converting back to the value type. | |
Cycles & | operator++ () |
Prefix increment operator. | |
Cycles & | operator-- () |
Prefix decrement operator. | |
Cycles & | operator+= (const Cycles &cc) |
In-place addition of cycles. | |
constexpr bool | operator> (const Cycles &cc) const |
Greater than comparison used for > Cycles(0). | |
constexpr Cycles | operator+ (const Cycles &b) const |
constexpr Cycles | operator- (const Cycles &b) const |
constexpr Cycles | operator<< (const int32_t shift) const |
constexpr Cycles | operator>> (const int32_t shift) const |
Private Attributes | |
uint64_t | c |
Member holding the actual value. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Cycles &cycles) |
Cycles is a wrapper class for representing cycle counts, i.e.
a relative difference between two points in time, expressed in a number of clock cycles.
The Cycles wrapper class is a type-safe alternative to a typedef, aiming to avoid unintentional mixing of cycles and ticks in the code base.
Note that there is no overloading of the bool operator as the compiler is allowed to turn booleans into integers and this causes a whole range of issues in a handful locations. The solution to this problem would be to use the safe bool idiom, but for now we make do without the test and use the more elaborate comparison > Cycles(0).
|
inlineexplicitconstexpr |
|
inline |
Default constructor for parameter classes.
Definition at line 92 of file types.hh.
Referenced by operator+(), operator-(), operator<<(), and operator>>().
|
inlineconstexpr |
Definition at line 114 of file types.hh.
References gem5::ArmISA::b, c, and Cycles().
|
inline |
Definition at line 120 of file types.hh.
References gem5::ArmISA::b, c, and Cycles().
|
inline |
|
inlineconstexpr |
Definition at line 126 of file types.hh.
References c, Cycles(), and gem5::ArmISA::shift.
|
inlineconstexpr |
|
inlineconstexpr |
Definition at line 133 of file types.hh.
References c, Cycles(), and gem5::ArmISA::shift.
|
friend |
|
private |
Member holding the actual value.
Definition at line 84 of file types.hh.
Referenced by operator uint64_t(), operator+(), operator++(), operator+=(), operator-(), operator--(), operator<<(), operator>(), and operator>>().