-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmi.cpp
More file actions
81 lines (72 loc) · 3.46 KB
/
smi.cpp
File metadata and controls
81 lines (72 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
#include "smi.h"
namespace shim_pcie::smi {
smi_pcie::
smi_pcie() : smi_base()
{
validate_test_desc = {
{"all", "All applicable validate tests will be executed (default)", "common"},
{"aux-connection", "Check if auxiliary power is connected", "common"},
{"dma", "Run dma test", "common"},
{"hostmem-bw", "Run 'bandwidth kernel' when host memory is enabled", "common"},
{"m2m", "Run M2M test", "common"},
{"mem-bw", "Run 'bandwidth kernel' and check the throughput", "common"},
{"p2p", "Run P2P test", "common"},
{"pcie-link", "Check if PCIE link is active", "common"},
{"quick", "Only the first 4 tests will be executed", "common"},
{"sc-version","Check if SC firmware is up-to-date", "common"},
{"verify", "Run 'Hello World' kernel test", "common"}
};
examine_report_desc = {
{"aie", "AIE metadata in xclbin", "common"},
{"aiemem", "AIE memory tile information", "common"},
{"aieshim", "AIE shim tile status", "common"},
{"debug-ip-status", "Status of Debug IPs present in xclbin loaded on device", "common"},
{"dynamic-regions", "Information about the xclbin and the compute units", "common"},
{"electrical", "Electrical and power sensors present on the device", "common"},
{"error", "Asyncronus Error present on the device", "common"},
{"firewall", "Firewall status", "common"},
{"host", "Host information", "common"},
{"mailbox", "Mailbox metrics of the device", "common"},
{"mechanical", "Mechanical sensors on and surrounding the device", "common"},
{"memory", "Memory information present on the device", "common"},
{"pcie-info", "Pcie information of the device", "common"},
{"platform", "Platforms flashed on the device", "common"},
{"qspi-status", "QSPI write protection status", "common"},
{"thermal", "Thermal sensors present on the device", "common"}
};
configure_options = {
{"device", "d", "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest", "common", "", "string"},
{"help", "h", "Help to use this sub-command", "common", "", "none"},
{"daemon", "", "Update the device daemon configuration", "hidden", "", "none"},
{"purge", "", "Remove the daemon configuration file", "hidden", "", "string"},
{"host", "", "IP or hostname for device peer", "hidden", "", "string"},
{"security", "", "Update the security level for the device", "hidden", "", "string"},
{"clk_throttle", "", "Enable/disable the device clock throttling", "hidden", "", "string"},
{"ct_threshold_power_override", "", "Update the power threshold in watts", "hidden", "", "string"},
{"ct_threshold_temp_override", "", "Update the temperature threshold in celsius", "hidden", "", "string"},
{"ct_reset", "", "Reset all throttling options", "hidden", "", "string"},
{"showx", "", "Display the device configuration settings", "hidden", "", "string"}
};
}
// Create an instance of the derived class
static shim_pcie::smi::smi_pcie smi_instance;
std::string
get_smi_config(){
// Call the get_smi_config method
return smi_instance.get_smi_config();
}
const xrt_core::smi::tuple_vector&
get_validate_tests()
{
// Call the get_validate_tests method
return smi_instance.get_validate_tests();
}
const xrt_core::smi::tuple_vector&
get_examine_reports()
{
// Call the get_examine_reports method
return smi_instance.get_examine_reports();
}
} // namespace shim_pcie::smi