10ec8b83dSEd Tanous #pragma once 20ec8b83dSEd Tanous #include <nlohmann/json.hpp> 30ec8b83dSEd Tanous 40ec8b83dSEd Tanous namespace processor 50ec8b83dSEd Tanous { 60ec8b83dSEd Tanous // clang-format off 70ec8b83dSEd Tanous 80ec8b83dSEd Tanous enum class ProcessorType{ 90ec8b83dSEd Tanous Invalid, 100ec8b83dSEd Tanous CPU, 110ec8b83dSEd Tanous GPU, 120ec8b83dSEd Tanous FPGA, 130ec8b83dSEd Tanous DSP, 140ec8b83dSEd Tanous Accelerator, 150ec8b83dSEd Tanous Core, 160ec8b83dSEd Tanous Thread, 17*2ae81db9SGunnar Mills Partition, 180ec8b83dSEd Tanous OEM, 190ec8b83dSEd Tanous }; 200ec8b83dSEd Tanous 210ec8b83dSEd Tanous enum class ProcessorMemoryType{ 220ec8b83dSEd Tanous Invalid, 23a8d8f9d8SEd Tanous Cache, 240ec8b83dSEd Tanous L1Cache, 250ec8b83dSEd Tanous L2Cache, 260ec8b83dSEd Tanous L3Cache, 270ec8b83dSEd Tanous L4Cache, 280ec8b83dSEd Tanous L5Cache, 290ec8b83dSEd Tanous L6Cache, 300ec8b83dSEd Tanous L7Cache, 310ec8b83dSEd Tanous HBM1, 320ec8b83dSEd Tanous HBM2, 33a8d8f9d8SEd Tanous HBM2E, 340ec8b83dSEd Tanous HBM3, 350ec8b83dSEd Tanous SGRAM, 360ec8b83dSEd Tanous GDDR, 370ec8b83dSEd Tanous GDDR2, 380ec8b83dSEd Tanous GDDR3, 390ec8b83dSEd Tanous GDDR4, 400ec8b83dSEd Tanous GDDR5, 410ec8b83dSEd Tanous GDDR5X, 420ec8b83dSEd Tanous GDDR6, 430ec8b83dSEd Tanous DDR, 440ec8b83dSEd Tanous DDR2, 450ec8b83dSEd Tanous DDR3, 460ec8b83dSEd Tanous DDR4, 470ec8b83dSEd Tanous DDR5, 480ec8b83dSEd Tanous SDRAM, 490ec8b83dSEd Tanous SRAM, 500ec8b83dSEd Tanous Flash, 510ec8b83dSEd Tanous OEM, 520ec8b83dSEd Tanous }; 530ec8b83dSEd Tanous 540ec8b83dSEd Tanous enum class FpgaType{ 550ec8b83dSEd Tanous Invalid, 560ec8b83dSEd Tanous Integrated, 570ec8b83dSEd Tanous Discrete, 580ec8b83dSEd Tanous }; 590ec8b83dSEd Tanous 600ec8b83dSEd Tanous enum class SystemInterfaceType{ 610ec8b83dSEd Tanous Invalid, 620ec8b83dSEd Tanous QPI, 630ec8b83dSEd Tanous UPI, 640ec8b83dSEd Tanous PCIe, 650ec8b83dSEd Tanous Ethernet, 660ec8b83dSEd Tanous AMBA, 670ec8b83dSEd Tanous CCIX, 680ec8b83dSEd Tanous CXL, 690ec8b83dSEd Tanous OEM, 700ec8b83dSEd Tanous }; 710ec8b83dSEd Tanous 720ec8b83dSEd Tanous enum class TurboState{ 730ec8b83dSEd Tanous Invalid, 740ec8b83dSEd Tanous Enabled, 750ec8b83dSEd Tanous Disabled, 760ec8b83dSEd Tanous }; 770ec8b83dSEd Tanous 780ec8b83dSEd Tanous enum class BaseSpeedPriorityState{ 790ec8b83dSEd Tanous Invalid, 800ec8b83dSEd Tanous Enabled, 810ec8b83dSEd Tanous Disabled, 820ec8b83dSEd Tanous }; 830ec8b83dSEd Tanous 840ec8b83dSEd Tanous enum class ThrottleCause{ 850ec8b83dSEd Tanous Invalid, 860ec8b83dSEd Tanous PowerLimit, 870ec8b83dSEd Tanous ThermalLimit, 880ec8b83dSEd Tanous ClockLimit, 89f263e09cSEd Tanous ManagementDetectedFault, 900ec8b83dSEd Tanous Unknown, 910ec8b83dSEd Tanous OEM, 920ec8b83dSEd Tanous }; 930ec8b83dSEd Tanous 940ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(ProcessorType, { 950ec8b83dSEd Tanous {ProcessorType::Invalid, "Invalid"}, 960ec8b83dSEd Tanous {ProcessorType::CPU, "CPU"}, 970ec8b83dSEd Tanous {ProcessorType::GPU, "GPU"}, 980ec8b83dSEd Tanous {ProcessorType::FPGA, "FPGA"}, 990ec8b83dSEd Tanous {ProcessorType::DSP, "DSP"}, 1000ec8b83dSEd Tanous {ProcessorType::Accelerator, "Accelerator"}, 1010ec8b83dSEd Tanous {ProcessorType::Core, "Core"}, 1020ec8b83dSEd Tanous {ProcessorType::Thread, "Thread"}, 103*2ae81db9SGunnar Mills {ProcessorType::Partition, "Partition"}, 1040ec8b83dSEd Tanous {ProcessorType::OEM, "OEM"}, 1050ec8b83dSEd Tanous }); 1060ec8b83dSEd Tanous 1070ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(ProcessorMemoryType, { 1080ec8b83dSEd Tanous {ProcessorMemoryType::Invalid, "Invalid"}, 109a8d8f9d8SEd Tanous {ProcessorMemoryType::Cache, "Cache"}, 1100ec8b83dSEd Tanous {ProcessorMemoryType::L1Cache, "L1Cache"}, 1110ec8b83dSEd Tanous {ProcessorMemoryType::L2Cache, "L2Cache"}, 1120ec8b83dSEd Tanous {ProcessorMemoryType::L3Cache, "L3Cache"}, 1130ec8b83dSEd Tanous {ProcessorMemoryType::L4Cache, "L4Cache"}, 1140ec8b83dSEd Tanous {ProcessorMemoryType::L5Cache, "L5Cache"}, 1150ec8b83dSEd Tanous {ProcessorMemoryType::L6Cache, "L6Cache"}, 1160ec8b83dSEd Tanous {ProcessorMemoryType::L7Cache, "L7Cache"}, 1170ec8b83dSEd Tanous {ProcessorMemoryType::HBM1, "HBM1"}, 1180ec8b83dSEd Tanous {ProcessorMemoryType::HBM2, "HBM2"}, 119a8d8f9d8SEd Tanous {ProcessorMemoryType::HBM2E, "HBM2E"}, 1200ec8b83dSEd Tanous {ProcessorMemoryType::HBM3, "HBM3"}, 1210ec8b83dSEd Tanous {ProcessorMemoryType::SGRAM, "SGRAM"}, 1220ec8b83dSEd Tanous {ProcessorMemoryType::GDDR, "GDDR"}, 1230ec8b83dSEd Tanous {ProcessorMemoryType::GDDR2, "GDDR2"}, 1240ec8b83dSEd Tanous {ProcessorMemoryType::GDDR3, "GDDR3"}, 1250ec8b83dSEd Tanous {ProcessorMemoryType::GDDR4, "GDDR4"}, 1260ec8b83dSEd Tanous {ProcessorMemoryType::GDDR5, "GDDR5"}, 1270ec8b83dSEd Tanous {ProcessorMemoryType::GDDR5X, "GDDR5X"}, 1280ec8b83dSEd Tanous {ProcessorMemoryType::GDDR6, "GDDR6"}, 1290ec8b83dSEd Tanous {ProcessorMemoryType::DDR, "DDR"}, 1300ec8b83dSEd Tanous {ProcessorMemoryType::DDR2, "DDR2"}, 1310ec8b83dSEd Tanous {ProcessorMemoryType::DDR3, "DDR3"}, 1320ec8b83dSEd Tanous {ProcessorMemoryType::DDR4, "DDR4"}, 1330ec8b83dSEd Tanous {ProcessorMemoryType::DDR5, "DDR5"}, 1340ec8b83dSEd Tanous {ProcessorMemoryType::SDRAM, "SDRAM"}, 1350ec8b83dSEd Tanous {ProcessorMemoryType::SRAM, "SRAM"}, 1360ec8b83dSEd Tanous {ProcessorMemoryType::Flash, "Flash"}, 1370ec8b83dSEd Tanous {ProcessorMemoryType::OEM, "OEM"}, 1380ec8b83dSEd Tanous }); 1390ec8b83dSEd Tanous 1400ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(FpgaType, { 1410ec8b83dSEd Tanous {FpgaType::Invalid, "Invalid"}, 1420ec8b83dSEd Tanous {FpgaType::Integrated, "Integrated"}, 1430ec8b83dSEd Tanous {FpgaType::Discrete, "Discrete"}, 1440ec8b83dSEd Tanous }); 1450ec8b83dSEd Tanous 1460ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(SystemInterfaceType, { 1470ec8b83dSEd Tanous {SystemInterfaceType::Invalid, "Invalid"}, 1480ec8b83dSEd Tanous {SystemInterfaceType::QPI, "QPI"}, 1490ec8b83dSEd Tanous {SystemInterfaceType::UPI, "UPI"}, 1500ec8b83dSEd Tanous {SystemInterfaceType::PCIe, "PCIe"}, 1510ec8b83dSEd Tanous {SystemInterfaceType::Ethernet, "Ethernet"}, 1520ec8b83dSEd Tanous {SystemInterfaceType::AMBA, "AMBA"}, 1530ec8b83dSEd Tanous {SystemInterfaceType::CCIX, "CCIX"}, 1540ec8b83dSEd Tanous {SystemInterfaceType::CXL, "CXL"}, 1550ec8b83dSEd Tanous {SystemInterfaceType::OEM, "OEM"}, 1560ec8b83dSEd Tanous }); 1570ec8b83dSEd Tanous 1580ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(TurboState, { 1590ec8b83dSEd Tanous {TurboState::Invalid, "Invalid"}, 1600ec8b83dSEd Tanous {TurboState::Enabled, "Enabled"}, 1610ec8b83dSEd Tanous {TurboState::Disabled, "Disabled"}, 1620ec8b83dSEd Tanous }); 1630ec8b83dSEd Tanous 1640ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(BaseSpeedPriorityState, { 1650ec8b83dSEd Tanous {BaseSpeedPriorityState::Invalid, "Invalid"}, 1660ec8b83dSEd Tanous {BaseSpeedPriorityState::Enabled, "Enabled"}, 1670ec8b83dSEd Tanous {BaseSpeedPriorityState::Disabled, "Disabled"}, 1680ec8b83dSEd Tanous }); 1690ec8b83dSEd Tanous 1700ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(ThrottleCause, { 1710ec8b83dSEd Tanous {ThrottleCause::Invalid, "Invalid"}, 1720ec8b83dSEd Tanous {ThrottleCause::PowerLimit, "PowerLimit"}, 1730ec8b83dSEd Tanous {ThrottleCause::ThermalLimit, "ThermalLimit"}, 1740ec8b83dSEd Tanous {ThrottleCause::ClockLimit, "ClockLimit"}, 175f263e09cSEd Tanous {ThrottleCause::ManagementDetectedFault, "ManagementDetectedFault"}, 1760ec8b83dSEd Tanous {ThrottleCause::Unknown, "Unknown"}, 1770ec8b83dSEd Tanous {ThrottleCause::OEM, "OEM"}, 1780ec8b83dSEd Tanous }); 1790ec8b83dSEd Tanous 1800ec8b83dSEd Tanous } 1810ec8b83dSEd Tanous // clang-format on 182