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