1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace processor
5 {
6 // clang-format off
7 
8 enum class ProcessorType{
9     Invalid,
10     CPU,
11     GPU,
12     FPGA,
13     DSP,
14     Accelerator,
15     Core,
16     Thread,
17     Partition,
18     OEM,
19 };
20 
21 enum class ProcessorMemoryType{
22     Invalid,
23     Cache,
24     L1Cache,
25     L2Cache,
26     L3Cache,
27     L4Cache,
28     L5Cache,
29     L6Cache,
30     L7Cache,
31     HBM1,
32     HBM2,
33     HBM2E,
34     HBM3,
35     SGRAM,
36     GDDR,
37     GDDR2,
38     GDDR3,
39     GDDR4,
40     GDDR5,
41     GDDR5X,
42     GDDR6,
43     DDR,
44     DDR2,
45     DDR3,
46     DDR4,
47     DDR5,
48     SDRAM,
49     SRAM,
50     Flash,
51     OEM,
52 };
53 
54 enum class FpgaType{
55     Invalid,
56     Integrated,
57     Discrete,
58 };
59 
60 enum class SystemInterfaceType{
61     Invalid,
62     QPI,
63     UPI,
64     PCIe,
65     Ethernet,
66     AMBA,
67     CCIX,
68     CXL,
69     OEM,
70 };
71 
72 enum class TurboState{
73     Invalid,
74     Enabled,
75     Disabled,
76 };
77 
78 enum class BaseSpeedPriorityState{
79     Invalid,
80     Enabled,
81     Disabled,
82 };
83 
84 enum class ThrottleCause{
85     Invalid,
86     PowerLimit,
87     ThermalLimit,
88     ClockLimit,
89     ManagementDetectedFault,
90     Unknown,
91     OEM,
92 };
93 
94 NLOHMANN_JSON_SERIALIZE_ENUM(ProcessorType, {
95     {ProcessorType::Invalid, "Invalid"},
96     {ProcessorType::CPU, "CPU"},
97     {ProcessorType::GPU, "GPU"},
98     {ProcessorType::FPGA, "FPGA"},
99     {ProcessorType::DSP, "DSP"},
100     {ProcessorType::Accelerator, "Accelerator"},
101     {ProcessorType::Core, "Core"},
102     {ProcessorType::Thread, "Thread"},
103     {ProcessorType::Partition, "Partition"},
104     {ProcessorType::OEM, "OEM"},
105 });
106 
107 NLOHMANN_JSON_SERIALIZE_ENUM(ProcessorMemoryType, {
108     {ProcessorMemoryType::Invalid, "Invalid"},
109     {ProcessorMemoryType::Cache, "Cache"},
110     {ProcessorMemoryType::L1Cache, "L1Cache"},
111     {ProcessorMemoryType::L2Cache, "L2Cache"},
112     {ProcessorMemoryType::L3Cache, "L3Cache"},
113     {ProcessorMemoryType::L4Cache, "L4Cache"},
114     {ProcessorMemoryType::L5Cache, "L5Cache"},
115     {ProcessorMemoryType::L6Cache, "L6Cache"},
116     {ProcessorMemoryType::L7Cache, "L7Cache"},
117     {ProcessorMemoryType::HBM1, "HBM1"},
118     {ProcessorMemoryType::HBM2, "HBM2"},
119     {ProcessorMemoryType::HBM2E, "HBM2E"},
120     {ProcessorMemoryType::HBM3, "HBM3"},
121     {ProcessorMemoryType::SGRAM, "SGRAM"},
122     {ProcessorMemoryType::GDDR, "GDDR"},
123     {ProcessorMemoryType::GDDR2, "GDDR2"},
124     {ProcessorMemoryType::GDDR3, "GDDR3"},
125     {ProcessorMemoryType::GDDR4, "GDDR4"},
126     {ProcessorMemoryType::GDDR5, "GDDR5"},
127     {ProcessorMemoryType::GDDR5X, "GDDR5X"},
128     {ProcessorMemoryType::GDDR6, "GDDR6"},
129     {ProcessorMemoryType::DDR, "DDR"},
130     {ProcessorMemoryType::DDR2, "DDR2"},
131     {ProcessorMemoryType::DDR3, "DDR3"},
132     {ProcessorMemoryType::DDR4, "DDR4"},
133     {ProcessorMemoryType::DDR5, "DDR5"},
134     {ProcessorMemoryType::SDRAM, "SDRAM"},
135     {ProcessorMemoryType::SRAM, "SRAM"},
136     {ProcessorMemoryType::Flash, "Flash"},
137     {ProcessorMemoryType::OEM, "OEM"},
138 });
139 
140 NLOHMANN_JSON_SERIALIZE_ENUM(FpgaType, {
141     {FpgaType::Invalid, "Invalid"},
142     {FpgaType::Integrated, "Integrated"},
143     {FpgaType::Discrete, "Discrete"},
144 });
145 
146 NLOHMANN_JSON_SERIALIZE_ENUM(SystemInterfaceType, {
147     {SystemInterfaceType::Invalid, "Invalid"},
148     {SystemInterfaceType::QPI, "QPI"},
149     {SystemInterfaceType::UPI, "UPI"},
150     {SystemInterfaceType::PCIe, "PCIe"},
151     {SystemInterfaceType::Ethernet, "Ethernet"},
152     {SystemInterfaceType::AMBA, "AMBA"},
153     {SystemInterfaceType::CCIX, "CCIX"},
154     {SystemInterfaceType::CXL, "CXL"},
155     {SystemInterfaceType::OEM, "OEM"},
156 });
157 
158 NLOHMANN_JSON_SERIALIZE_ENUM(TurboState, {
159     {TurboState::Invalid, "Invalid"},
160     {TurboState::Enabled, "Enabled"},
161     {TurboState::Disabled, "Disabled"},
162 });
163 
164 NLOHMANN_JSON_SERIALIZE_ENUM(BaseSpeedPriorityState, {
165     {BaseSpeedPriorityState::Invalid, "Invalid"},
166     {BaseSpeedPriorityState::Enabled, "Enabled"},
167     {BaseSpeedPriorityState::Disabled, "Disabled"},
168 });
169 
170 NLOHMANN_JSON_SERIALIZE_ENUM(ThrottleCause, {
171     {ThrottleCause::Invalid, "Invalid"},
172     {ThrottleCause::PowerLimit, "PowerLimit"},
173     {ThrottleCause::ThermalLimit, "ThermalLimit"},
174     {ThrottleCause::ClockLimit, "ClockLimit"},
175     {ThrottleCause::ManagementDetectedFault, "ManagementDetectedFault"},
176     {ThrottleCause::Unknown, "Unknown"},
177     {ThrottleCause::OEM, "OEM"},
178 });
179 
180 }
181 // clang-format on
182