SST  10.0.0
StructuralSimulationToolkit
sst_types.h
1 // Copyright 2009-2020 NTESS. Under the terms
2 // of Contract DE-NA0003525 with NTESS, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2020, NTESS
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 
12 #ifndef SST_CORE_SST_TYPES_H
13 #define SST_CORE_SST_TYPES_H
14 
15 #include <cstdint>
16 
17 namespace SST {
18 
19 typedef uint64_t ComponentId_t;
20 typedef int32_t LinkId_t;
21 typedef uint64_t Cycle_t;
22 typedef uint64_t SimTime_t;
23 typedef double Time_t;
24 
25 #define MAX_SIMTIME_T 0xFFFFFFFFFFFFFFFFl
26 /* Subcomponent IDs are in the high-16 bits of the Component ID */
27 #define UNSET_COMPONENT_ID 0xFFFFFFFFFFFFFFFFULL
28 #define COMPONENT_ID_BITS 48
29 #define COMPONENT_ID_MASK(x) ((x) & 0x0000FFFFFFFFFFFFULL)
30 #define SUBCOMPONENT_ID_BITS 16
31 #define SUBCOMPONENT_ID_MASK(x) ((x) >> COMPONENT_ID_BITS)
32 #define SUBCOMPONENT_ID_CREATE(compId, sCompId) ((((uint64_t)sCompId) << COMPONENT_ID_BITS) | compId)
33 #define COMPDEFINED_SUBCOMPONENT_ID_CREATE(compId, sCompId) ((((uint64_t)sCompId) << COMPONENT_ID_BITS) | compId | 0x8000000000000000ULL)
34 #define COMPDEFINED_SUBCOMPONENT_ID_MASK(x) ((x) >> 63)
35 
36 typedef double watts;
37 typedef double joules;
38 typedef double farads;
39 typedef double volts;
40 
41 #ifndef LIKELY
42 #define LIKELY(x) __builtin_expect((int)(x),1)
43 #define UNLIKELY(x) __builtin_expect((int)(x),0)
44 #endif
45 
46 
47 } // namespace SST
48 
49 #endif //SST_CORE_SST_TYPES_H