12#ifndef SST_CORE_SST_TYPES_H
13#define SST_CORE_SST_TYPES_H
15#include "sst/core/util/bit_util.h"
29using ComponentId_t = uint64_t;
30using StatisticId_t = uint64_t;
31using LinkId_t = uint64_t;
32using HandlerId_t = uint64_t;
33using Cycle_t = uint64_t;
34using SimTime_t = uint64_t;
38using PortModuleId_t = std::pair<std::string, size_t>;
41#define PRI_SIMTIME PRIu64
44static constexpr StatisticId_t STATALL_ID = std::numeric_limits<StatisticId_t>::max();
46constexpr SimTime_t MAX_SIMTIME_T = SST::bit_util::type_max<ComponentId_t>;
61constexpr ComponentId_t UNSET_COMPONENT_ID = SST::bit_util::type_max<ComponentId_t>;
64constexpr StatisticId_t UNSET_STATISTIC_ID = SST::bit_util::type_max<StatisticId_t>;
67constexpr size_t COMPONENT_ID_BITS = 32;
77COMPONENT_ID_MASK(ComponentId_t complete_id)
79 return complete_id & SST::bit_util::lower_mask<ComponentId_t, COMPONENT_ID_BITS>;
83constexpr size_t SUBCOMPONENT_ID_BITS = 16;
93SUBCOMPONENT_ID_MASK(ComponentId_t complete_id)
95 return (complete_id >> COMPONENT_ID_BITS) & SST::bit_util::lower_mask<ComponentId_t, SUBCOMPONENT_ID_BITS>;
108SUBCOMPONENT_ID_CREATE(ComponentId_t comp_id, ComponentId_t sub_comp_id)
110 return (sub_comp_id << COMPONENT_ID_BITS) | comp_id;
114constexpr size_t CONFIG_COMPONENT_ID_BITS = (COMPONENT_ID_BITS + SUBCOMPONENT_ID_BITS);
125CONFIG_COMPONENT_ID_MASK(ComponentId_t complete_id)
127 return complete_id & SST::bit_util::lower_mask<ComponentId_t, COMPONENT_ID_BITS + SUBCOMPONENT_ID_BITS>;
140STATISTIC_ID_CREATE(ComponentId_t comp_id, StatisticId_t stat_id)
142 return (stat_id << CONFIG_COMPONENT_ID_BITS) | comp_id;
153COMPDEFINED_SUBCOMPONENT_ID_MASK(ComponentId_t complete_id)
155 return complete_id >> (
sizeof(ComponentId_t) * 8 - 1);
169COMPDEFINED_SUBCOMPONENT_ID_CREATE(ComponentId_t comp_id, ComponentId_t sub_comp_id)
171 return (sub_comp_id << COMPONENT_ID_BITS) | comp_id | SST::bit_util::upper_mask<ComponentId_t, 1>;
174using watts [[deprecated(
"watts will be removed in SST 17")]] = double;
175using joules [[deprecated(
"joules will be removed in SST 17")]] = double;
176using farads [[deprecated(
"farads will be removed in SST 17")]] = double;
177using volts [[deprecated(
"volts will be removed in SST 17")]] = double;
180#define LIKELY(x) __builtin_expect((int)(x), 1)
181#define UNLIKELY(x) __builtin_expect((int)(x), 0)
184enum class SimulationRunMode {
192std::ostream& operator<<(std::ostream& os,
const SimulationRunMode& mode);
200struct AttachPointMetaData
202 AttachPointMetaData() {}
203 virtual ~AttachPointMetaData() {}