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 ManagementDetectedFault, 89 Unknown, 90 OEM, 91 }; 92 93 NLOHMANN_JSON_SERIALIZE_ENUM(ProcessorType, { 94 {ProcessorType::Invalid, "Invalid"}, 95 {ProcessorType::CPU, "CPU"}, 96 {ProcessorType::GPU, "GPU"}, 97 {ProcessorType::FPGA, "FPGA"}, 98 {ProcessorType::DSP, "DSP"}, 99 {ProcessorType::Accelerator, "Accelerator"}, 100 {ProcessorType::Core, "Core"}, 101 {ProcessorType::Thread, "Thread"}, 102 {ProcessorType::OEM, "OEM"}, 103 }); 104 105 NLOHMANN_JSON_SERIALIZE_ENUM(ProcessorMemoryType, { 106 {ProcessorMemoryType::Invalid, "Invalid"}, 107 {ProcessorMemoryType::Cache, "Cache"}, 108 {ProcessorMemoryType::L1Cache, "L1Cache"}, 109 {ProcessorMemoryType::L2Cache, "L2Cache"}, 110 {ProcessorMemoryType::L3Cache, "L3Cache"}, 111 {ProcessorMemoryType::L4Cache, "L4Cache"}, 112 {ProcessorMemoryType::L5Cache, "L5Cache"}, 113 {ProcessorMemoryType::L6Cache, "L6Cache"}, 114 {ProcessorMemoryType::L7Cache, "L7Cache"}, 115 {ProcessorMemoryType::HBM1, "HBM1"}, 116 {ProcessorMemoryType::HBM2, "HBM2"}, 117 {ProcessorMemoryType::HBM2E, "HBM2E"}, 118 {ProcessorMemoryType::HBM3, "HBM3"}, 119 {ProcessorMemoryType::SGRAM, "SGRAM"}, 120 {ProcessorMemoryType::GDDR, "GDDR"}, 121 {ProcessorMemoryType::GDDR2, "GDDR2"}, 122 {ProcessorMemoryType::GDDR3, "GDDR3"}, 123 {ProcessorMemoryType::GDDR4, "GDDR4"}, 124 {ProcessorMemoryType::GDDR5, "GDDR5"}, 125 {ProcessorMemoryType::GDDR5X, "GDDR5X"}, 126 {ProcessorMemoryType::GDDR6, "GDDR6"}, 127 {ProcessorMemoryType::DDR, "DDR"}, 128 {ProcessorMemoryType::DDR2, "DDR2"}, 129 {ProcessorMemoryType::DDR3, "DDR3"}, 130 {ProcessorMemoryType::DDR4, "DDR4"}, 131 {ProcessorMemoryType::DDR5, "DDR5"}, 132 {ProcessorMemoryType::SDRAM, "SDRAM"}, 133 {ProcessorMemoryType::SRAM, "SRAM"}, 134 {ProcessorMemoryType::Flash, "Flash"}, 135 {ProcessorMemoryType::OEM, "OEM"}, 136 }); 137 138 NLOHMANN_JSON_SERIALIZE_ENUM(FpgaType, { 139 {FpgaType::Invalid, "Invalid"}, 140 {FpgaType::Integrated, "Integrated"}, 141 {FpgaType::Discrete, "Discrete"}, 142 }); 143 144 NLOHMANN_JSON_SERIALIZE_ENUM(SystemInterfaceType, { 145 {SystemInterfaceType::Invalid, "Invalid"}, 146 {SystemInterfaceType::QPI, "QPI"}, 147 {SystemInterfaceType::UPI, "UPI"}, 148 {SystemInterfaceType::PCIe, "PCIe"}, 149 {SystemInterfaceType::Ethernet, "Ethernet"}, 150 {SystemInterfaceType::AMBA, "AMBA"}, 151 {SystemInterfaceType::CCIX, "CCIX"}, 152 {SystemInterfaceType::CXL, "CXL"}, 153 {SystemInterfaceType::OEM, "OEM"}, 154 }); 155 156 NLOHMANN_JSON_SERIALIZE_ENUM(TurboState, { 157 {TurboState::Invalid, "Invalid"}, 158 {TurboState::Enabled, "Enabled"}, 159 {TurboState::Disabled, "Disabled"}, 160 }); 161 162 NLOHMANN_JSON_SERIALIZE_ENUM(BaseSpeedPriorityState, { 163 {BaseSpeedPriorityState::Invalid, "Invalid"}, 164 {BaseSpeedPriorityState::Enabled, "Enabled"}, 165 {BaseSpeedPriorityState::Disabled, "Disabled"}, 166 }); 167 168 NLOHMANN_JSON_SERIALIZE_ENUM(ThrottleCause, { 169 {ThrottleCause::Invalid, "Invalid"}, 170 {ThrottleCause::PowerLimit, "PowerLimit"}, 171 {ThrottleCause::ThermalLimit, "ThermalLimit"}, 172 {ThrottleCause::ClockLimit, "ClockLimit"}, 173 {ThrottleCause::ManagementDetectedFault, "ManagementDetectedFault"}, 174 {ThrottleCause::Unknown, "Unknown"}, 175 {ThrottleCause::OEM, "OEM"}, 176 }); 177 178 } 179 // clang-format on 180