1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace memory 5 { 6 // clang-format off 7 8 enum class MemoryType{ 9 Invalid, 10 DRAM, 11 NVDIMM_N, 12 NVDIMM_F, 13 NVDIMM_P, 14 IntelOptane, 15 }; 16 17 enum class MemoryDeviceType{ 18 Invalid, 19 DDR, 20 DDR2, 21 DDR3, 22 DDR4, 23 DDR4_SDRAM, 24 DDR4E_SDRAM, 25 LPDDR4_SDRAM, 26 DDR3_SDRAM, 27 LPDDR3_SDRAM, 28 DDR2_SDRAM, 29 DDR2_SDRAM_FB_DIMM, 30 DDR2_SDRAM_FB_DIMM_PROBE, 31 DDR_SGRAM, 32 DDR_SDRAM, 33 ROM, 34 SDRAM, 35 EDO, 36 FastPageMode, 37 PipelinedNibble, 38 Logical, 39 HBM, 40 HBM2, 41 HBM2E, 42 HBM3, 43 GDDR, 44 GDDR2, 45 GDDR3, 46 GDDR4, 47 GDDR5, 48 GDDR5X, 49 GDDR6, 50 DDR5, 51 OEM, 52 LPDDR5_SDRAM, 53 }; 54 55 enum class BaseModuleType{ 56 Invalid, 57 RDIMM, 58 UDIMM, 59 SO_DIMM, 60 LRDIMM, 61 Mini_RDIMM, 62 Mini_UDIMM, 63 SO_RDIMM_72b, 64 SO_UDIMM_72b, 65 SO_DIMM_16b, 66 SO_DIMM_32b, 67 Die, 68 }; 69 70 enum class MemoryMedia{ 71 Invalid, 72 DRAM, 73 NAND, 74 Intel3DXPoint, 75 Proprietary, 76 }; 77 78 enum class SecurityStates{ 79 Invalid, 80 Enabled, 81 Disabled, 82 Unlocked, 83 Locked, 84 Frozen, 85 Passphraselimit, 86 }; 87 88 enum class ErrorCorrection{ 89 Invalid, 90 NoECC, 91 SingleBitECC, 92 MultiBitECC, 93 AddressParity, 94 }; 95 96 enum class MemoryClassification{ 97 Invalid, 98 Volatile, 99 ByteAccessiblePersistent, 100 Block, 101 }; 102 103 enum class OperatingMemoryModes{ 104 Invalid, 105 Volatile, 106 PMEM, 107 Block, 108 }; 109 110 NLOHMANN_JSON_SERIALIZE_ENUM(MemoryType, { 111 {MemoryType::Invalid, "Invalid"}, 112 {MemoryType::DRAM, "DRAM"}, 113 {MemoryType::NVDIMM_N, "NVDIMM_N"}, 114 {MemoryType::NVDIMM_F, "NVDIMM_F"}, 115 {MemoryType::NVDIMM_P, "NVDIMM_P"}, 116 {MemoryType::IntelOptane, "IntelOptane"}, 117 }); 118 119 NLOHMANN_JSON_SERIALIZE_ENUM(MemoryDeviceType, { 120 {MemoryDeviceType::Invalid, "Invalid"}, 121 {MemoryDeviceType::DDR, "DDR"}, 122 {MemoryDeviceType::DDR2, "DDR2"}, 123 {MemoryDeviceType::DDR3, "DDR3"}, 124 {MemoryDeviceType::DDR4, "DDR4"}, 125 {MemoryDeviceType::DDR4_SDRAM, "DDR4_SDRAM"}, 126 {MemoryDeviceType::DDR4E_SDRAM, "DDR4E_SDRAM"}, 127 {MemoryDeviceType::LPDDR4_SDRAM, "LPDDR4_SDRAM"}, 128 {MemoryDeviceType::DDR3_SDRAM, "DDR3_SDRAM"}, 129 {MemoryDeviceType::LPDDR3_SDRAM, "LPDDR3_SDRAM"}, 130 {MemoryDeviceType::DDR2_SDRAM, "DDR2_SDRAM"}, 131 {MemoryDeviceType::DDR2_SDRAM_FB_DIMM, "DDR2_SDRAM_FB_DIMM"}, 132 {MemoryDeviceType::DDR2_SDRAM_FB_DIMM_PROBE, "DDR2_SDRAM_FB_DIMM_PROBE"}, 133 {MemoryDeviceType::DDR_SGRAM, "DDR_SGRAM"}, 134 {MemoryDeviceType::DDR_SDRAM, "DDR_SDRAM"}, 135 {MemoryDeviceType::ROM, "ROM"}, 136 {MemoryDeviceType::SDRAM, "SDRAM"}, 137 {MemoryDeviceType::EDO, "EDO"}, 138 {MemoryDeviceType::FastPageMode, "FastPageMode"}, 139 {MemoryDeviceType::PipelinedNibble, "PipelinedNibble"}, 140 {MemoryDeviceType::Logical, "Logical"}, 141 {MemoryDeviceType::HBM, "HBM"}, 142 {MemoryDeviceType::HBM2, "HBM2"}, 143 {MemoryDeviceType::HBM2E, "HBM2E"}, 144 {MemoryDeviceType::HBM3, "HBM3"}, 145 {MemoryDeviceType::GDDR, "GDDR"}, 146 {MemoryDeviceType::GDDR2, "GDDR2"}, 147 {MemoryDeviceType::GDDR3, "GDDR3"}, 148 {MemoryDeviceType::GDDR4, "GDDR4"}, 149 {MemoryDeviceType::GDDR5, "GDDR5"}, 150 {MemoryDeviceType::GDDR5X, "GDDR5X"}, 151 {MemoryDeviceType::GDDR6, "GDDR6"}, 152 {MemoryDeviceType::DDR5, "DDR5"}, 153 {MemoryDeviceType::OEM, "OEM"}, 154 {MemoryDeviceType::LPDDR5_SDRAM, "LPDDR5_SDRAM"}, 155 }); 156 157 NLOHMANN_JSON_SERIALIZE_ENUM(BaseModuleType, { 158 {BaseModuleType::Invalid, "Invalid"}, 159 {BaseModuleType::RDIMM, "RDIMM"}, 160 {BaseModuleType::UDIMM, "UDIMM"}, 161 {BaseModuleType::SO_DIMM, "SO_DIMM"}, 162 {BaseModuleType::LRDIMM, "LRDIMM"}, 163 {BaseModuleType::Mini_RDIMM, "Mini_RDIMM"}, 164 {BaseModuleType::Mini_UDIMM, "Mini_UDIMM"}, 165 {BaseModuleType::SO_RDIMM_72b, "SO_RDIMM_72b"}, 166 {BaseModuleType::SO_UDIMM_72b, "SO_UDIMM_72b"}, 167 {BaseModuleType::SO_DIMM_16b, "SO_DIMM_16b"}, 168 {BaseModuleType::SO_DIMM_32b, "SO_DIMM_32b"}, 169 {BaseModuleType::Die, "Die"}, 170 }); 171 172 NLOHMANN_JSON_SERIALIZE_ENUM(MemoryMedia, { 173 {MemoryMedia::Invalid, "Invalid"}, 174 {MemoryMedia::DRAM, "DRAM"}, 175 {MemoryMedia::NAND, "NAND"}, 176 {MemoryMedia::Intel3DXPoint, "Intel3DXPoint"}, 177 {MemoryMedia::Proprietary, "Proprietary"}, 178 }); 179 180 NLOHMANN_JSON_SERIALIZE_ENUM(SecurityStates, { 181 {SecurityStates::Invalid, "Invalid"}, 182 {SecurityStates::Enabled, "Enabled"}, 183 {SecurityStates::Disabled, "Disabled"}, 184 {SecurityStates::Unlocked, "Unlocked"}, 185 {SecurityStates::Locked, "Locked"}, 186 {SecurityStates::Frozen, "Frozen"}, 187 {SecurityStates::Passphraselimit, "Passphraselimit"}, 188 }); 189 190 NLOHMANN_JSON_SERIALIZE_ENUM(ErrorCorrection, { 191 {ErrorCorrection::Invalid, "Invalid"}, 192 {ErrorCorrection::NoECC, "NoECC"}, 193 {ErrorCorrection::SingleBitECC, "SingleBitECC"}, 194 {ErrorCorrection::MultiBitECC, "MultiBitECC"}, 195 {ErrorCorrection::AddressParity, "AddressParity"}, 196 }); 197 198 NLOHMANN_JSON_SERIALIZE_ENUM(MemoryClassification, { 199 {MemoryClassification::Invalid, "Invalid"}, 200 {MemoryClassification::Volatile, "Volatile"}, 201 {MemoryClassification::ByteAccessiblePersistent, "ByteAccessiblePersistent"}, 202 {MemoryClassification::Block, "Block"}, 203 }); 204 205 NLOHMANN_JSON_SERIALIZE_ENUM(OperatingMemoryModes, { 206 {OperatingMemoryModes::Invalid, "Invalid"}, 207 {OperatingMemoryModes::Volatile, "Volatile"}, 208 {OperatingMemoryModes::PMEM, "PMEM"}, 209 {OperatingMemoryModes::Block, "Block"}, 210 }); 211 212 } 213 // clang-format on 214