12 #ifndef SST_CORE_SST_TYPES_H 13 #define SST_CORE_SST_TYPES_H 23 using ComponentId_t = uint64_t;
24 using StatisticId_t = uint64_t;
25 using LinkId_t = uint32_t;
26 using HandlerId_t = uint64_t;
27 using Cycle_t = uint64_t;
28 using SimTime_t = uint64_t;
29 using Time_t = double;
31 using PortModuleId_t = std::pair<std::string, size_t>;
33 #define PRI_SIMTIME PRIu64 35 static constexpr StatisticId_t STATALL_ID = std::numeric_limits<StatisticId_t>::max();
37 #define MAX_SIMTIME_T 0xFFFFFFFFFFFFFFFFl 40 #define UNSET_COMPONENT_ID 0xFFFFFFFFFFFFFFFFULL 41 #define UNSET_STATISTIC_ID 0xFFFFFFFFFFFFFFFFULL 42 #define COMPONENT_ID_BITS 32 43 #define COMPONENT_ID_MASK(x) ((x) & 0xFFFFFFFFULL) 44 #define SUBCOMPONENT_ID_BITS 16 45 #define SUBCOMPONENT_ID_MASK(x) ((x) >> COMPONENT_ID_BITS) 46 #define SUBCOMPONENT_ID_CREATE(compId, sCompId) ((((uint64_t)sCompId) << COMPONENT_ID_BITS) | compId) 47 #define CONFIG_COMPONENT_ID_BITS (COMPONENT_ID_BITS + SUBCOMPONENT_ID_BITS) 48 #define CONFIG_COMPONENT_ID_MASK(x) ((x) & 0xFFFFFFFFFFFFULL) 49 #define STATISTIC_ID_CREATE(compId, statId) ((((uint64_t)statId) << CONFIG_COMPONENT_ID_BITS) | compId) 50 #define COMPDEFINED_SUBCOMPONENT_ID_MASK(x) ((x) >> 63) 51 #define COMPDEFINED_SUBCOMPONENT_ID_CREATE(compId, sCompId) \ 52 ((((uint64_t)sCompId) << COMPONENT_ID_BITS) | compId | 0x8000000000000000ULL) 55 using joules = double;
56 using farads = double;
60 #define LIKELY(x) __builtin_expect((int)(x), 1) 61 #define UNLIKELY(x) __builtin_expect((int)(x), 0) 64 enum class SimulationRunMode {
72 std::ostream& operator<<(std::ostream& os,
const SimulationRunMode& mode);
88 #endif // SST_CORE_SST_TYPES_H