35 #ifndef __BASE_TYPES_HH__ 36 #define __BASE_TYPES_HH__ 48 #define ULL(N) ((uint64_t)N##ULL) 50 #define LL(N) ((int64_t)N##LL) 92 explicit constexpr
Cycles(uint64_t _c) : c(_c) { }
98 constexpr
operator uint64_t()
const {
return c; }
102 { ++
c;
return *
this; }
106 { assert(c != 0); --
c;
return *
this; }
110 { c += cc.
c;
return *
this; }
122 throw std::invalid_argument(
"RHS cycle value larger than LHS");
126 {
return Cycles(c << shift); }
129 {
return Cycles(c >> shift); }
168 static inline uint32_t
180 static inline uint64_t
239 typedef std::shared_ptr<FaultBase>
Fault;
243 constexpr decltype(
nullptr)
NoFault =
nullptr;
250 #endif // __BASE_TYPES_HH__ constexpr Cycles operator-(const Cycles &b) const
decltype(nullptr) constexpr NoFault
Cycles is a wrapper class for representing cycle counts, i.e.
const PortID InvalidPortID
Cycles & operator++()
Prefix increment operator.
static float bitsToFloat32(uint32_t val)
constexpr Cycles operator>>(const int32_t shift) const
static const MicroPC MicroPCRomBit
constexpr Cycles(uint64_t _c)
Explicit constructor assigning a value.
static double bitsToFloat64(uint64_t val)
Classes for managing reference counted objects.
Cycles & operator+=(const Cycles &cc)
In-place addition of cycles.
uint64_t Tick
Tick count type.
uint64_t c
Member holding the actual value.
Cycles()
Default constructor for parameter classes.
constexpr Cycles operator+(const Cycles &b) const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
#define ULL(N)
uint64_t constant
static uint64_t floatToBits64(double val)
static MicroPC romMicroPC(MicroPC upc)
int64_t Counter
Statistics counter type.
static bool isRomMicroPC(MicroPC upc)
static double bitsToFloat(uint64_t val)
const ThreadID InvalidThreadID
constexpr bool operator>(const Cycles &cc) const
Greater than comparison used for > Cycles(0).
int16_t ThreadID
Thread index/ID type.
Cycles & operator--()
Prefix decrement operator.
const ContextID InvalidContextID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
static uint64_t floatToBits(double val)
constexpr Cycles operator<<(const int32_t shift) const
std::shared_ptr< FaultBase > Fault
static MicroPC normalMicroPC(MicroPC upc)
int ContextID
Globally unique thread context ID.
static uint32_t floatToBits32(float val)