diff --git a/src/runtime_src/core/pcie/linux/CMakeLists.txt b/src/runtime_src/core/pcie/linux/CMakeLists.txt index 443cdb212d0..c1c24bd4c1d 100644 --- a/src/runtime_src/core/pcie/linux/CMakeLists.txt +++ b/src/runtime_src/core/pcie/linux/CMakeLists.txt @@ -10,6 +10,7 @@ add_library(core_pcielinux_objects OBJECT pcidrv.cpp shim.cpp system_linux.cpp + smi.cpp ) target_compile_definitions(core_pcielinux_objects diff --git a/src/runtime_src/core/pcie/linux/device_linux.cpp b/src/runtime_src/core/pcie/linux/device_linux.cpp index cf58c969fe8..d6da96ff862 100644 --- a/src/runtime_src/core/pcie/linux/device_linux.cpp +++ b/src/runtime_src/core/pcie/linux/device_linux.cpp @@ -17,6 +17,7 @@ #include "core/include/xdp/spc.h" #include "core/pcie/driver/linux/include/mgmt-ioctl.h" +#include "smi.h" #include "pcidev.h" #include "xrt.h" @@ -906,6 +907,30 @@ struct am_counter }; +struct xrt_smi_config +{ + using result_type = std::any; + + static result_type + get(const xrt_core::device* device, key_type key, const std::any& reqType) + { + if (key != key_type::xrt_smi_config) + throw xrt_core::query::no_such_key(key, "Not implemented"); + std::string xrt_smi_config; + const auto xrt_smi_config_type = std::any_cast(reqType); + switch (xrt_smi_config_type) { + case xrt_core::query::xrt_smi_config::type::options_config: + xrt_smi_config = xrt_core::smi::get_smi_config(); + break; + default: + throw xrt_core::query::no_such_key(key, "Not implemented"); + } + + return xrt_smi_config; + } +}; + + /* ASM counter values * In PCIe Linux, access the sysfs file for ASM to retrieve the ASM counter values @@ -1457,6 +1482,7 @@ initialize_query_table() emplace_func4_request(); emplace_func4_request(); emplace_func4_request(); + emplace_func4_request(); emplace_func4_request(); emplace_func4_request(); emplace_func4_request(); diff --git a/src/runtime_src/core/pcie/linux/smi.cpp b/src/runtime_src/core/pcie/linux/smi.cpp new file mode 100644 index 00000000000..3ffa55af0d3 --- /dev/null +++ b/src/runtime_src/core/pcie/linux/smi.cpp @@ -0,0 +1,211 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved. +#include "smi.h" + +namespace xrt_core::smi { + +static constexpr std::string_view xrt_smi_config = + R"( + { + "subcommands": + [{ + "name" : "validate", + "description" : "Validates the given device by executing the platform's validate executable.", + "tag" : "basic", + "options" : + [ + { + "name": "device", + "alias": "d", + "description": "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest", + "tag": "basic", + "default_value": "", + "option_type": "common", + "value_type" : "string" + }, + { + "name": "format", + "alias": "f", + "description": "Report output format", + "tag": "basic", + "default_value": "JSON", + "option_type": "common", + "value_type" : "string" + }, + { + "name": "output", + "alias": "o", + "description" : "Direct the output to the given file", + "tag": "basic", + "default_value": "", + "option_type": "common", + "value_type" : "string" + }, + { + "name": "help", + "alias": "h", + "description" : "Help to use this sub-command", + "tag": "basic", + "default_value": "", + "option_type": "common", + "value_type" : "none" + }, + { + "name" : "run", + "alias" : "r", + "description" : "Run a subset of the test suite", + "tag" : "basic", + "option_type": "common", + "value_type" : "array", + "options" : [ + { + "name" : "latency", + "tag" : "basic", + "description" : "Run end-to-end latency test" + }, + { + "name" : "throughput", + "tag" : "basic", + "description" : "Run end-to-end throughput test" + }, + { + "name" : "cmd-chain-latency", + "tag" : "basic", + "description" : "Run command chain latency test" + }, + { + "name" : "cmd-chain-throughput", + "tag" : "basic", + "description" : "Run end-to-end throughput test using command chaining" + }, + { + "name" : "df-bw", + "tag" : "basic", + "description" : "Run dataflow bandwidth test" + }, + { + "name" : "tct-one-col", + "tag" : "basic", + "description" : "Run TCT test with one column" + }, + { + "name" : "tct-all-col", + "tag" : "basic", + "description" : "Run TCT test with all columns" + }, + { + "name" : "gemm", + "tag" : "basic", + "description" : "Run GEMM test" + }, + { + "name" : "aie-reconfig-overhead", + "tag" : "advanced", + "description" : "Run AIE reconfiguration overhead test" + }, + { + "name" : "spatial-sharing-overhead", + "tag" : "advanced", + "description" : "Run spatial sharing overhead test" + }, + { + "name" : "temporal-sharing-overhead", + "tag" : "advanced", + "description" : "Run temporal sharing overhead test" + } + ] + }, + { + "name" : "path", + "alias" : "p", + "description" : "Path to the directory containing validate xclbins", + "tag" : "basic", + "default_value": "", + "option_type": "hidden", + "value_type" : "string" + }, + { + "name" : "param", + "description" : "Extended parameter for a given test. Format: ::", + "tag" : "basic", + "option_type": "hidden", + "default_value": "", + "value_type" : "string" + }, + { + "name" : "pmode", + "description" : "Specify which power mode to run the benchmarks in. Note: Some tests might be unavailable for some modes", + "tag" : "basic", + "option_type": "hidden", + "default_value": "", + "value_type" : "string" + } + ] + }, + { + "name" : "examine", + "tag" : "basic", + "description": "This command will 'examine' the state of the system/device and will generate a report of interest in a text or JSON format.", + "options": + [ + { + "name": "device", + "description": "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest", + "tag": "devl", + "value_type": "string" + }, + { + "name": "format", + "description": "Report output format", + "tag": "devl", + "value_type": "string" + }, + { + "name": "report", + "description": "The type of report to be produced. Reports currently available are:", + "tag": "basic", + "options": [ + { + "name": "aie-partitions", + "tag": "basic", + "description": "AIE partition information" + }, + { + "name": "telemetry", + "tag": "devl", + "description": "Telemetry data for the device" + } + ] + } + ] + }, + { + "name" : "configure", + "tag" : "devl", + "description" : "Device and host configuration.", + "options" : + [ + { + "name": "device", + "description": "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest", + "tag": "devl", + "value_type" : "string" + }, + { + "name": "pmode", + "description": "Modes: default, powersaver, balanced, performance, turbo", + "tag": "basic", + "value_type": "string" + } + ] + }] +} +)"; + + +std::string +get_smi_config() +{ + return std::string(xrt_smi_config); +} +} // namespace xrt_core::smi diff --git a/src/runtime_src/core/pcie/linux/smi.h b/src/runtime_src/core/pcie/linux/smi.h new file mode 100644 index 00000000000..d986f07b555 --- /dev/null +++ b/src/runtime_src/core/pcie/linux/smi.h @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved. + +#include + +namespace xrt_core::smi { + +std::string +get_smi_config(); + +} // namespace xrt_core::smi diff --git a/src/runtime_src/core/tools/common/SubCmd.cpp b/src/runtime_src/core/tools/common/SubCmd.cpp index f6f67b8dbfa..757a8b50fa4 100644 --- a/src/runtime_src/core/tools/common/SubCmd.cpp +++ b/src/runtime_src/core/tools/common/SubCmd.cpp @@ -167,3 +167,15 @@ SubCmd::checkForSubOption(const boost::program_options::variables_map& vm, const return option; } +void +SubCmd::setOptionConfig(const boost::property_tree::ptree &config) +{ + m_jsonConfig = SubCmdJsonObjects::JsonConfig(config.get_child("subcommands"), getName()); + try{ + m_jsonConfig.addProgramOptions(m_commonOptions, "common", getName()); + m_jsonConfig.addProgramOptions(m_hiddenOptions, "hidden", getName()); + } + catch (const std::exception& e) { + std::cerr << "Error: " << e.what() << std::endl; + } +} diff --git a/src/runtime_src/core/tools/common/SubCmd.h b/src/runtime_src/core/tools/common/SubCmd.h index 2cace31780f..7cef998fd7e 100644 --- a/src/runtime_src/core/tools/common/SubCmd.h +++ b/src/runtime_src/core/tools/common/SubCmd.h @@ -12,6 +12,7 @@ #include #include "JSONConfigurable.h" +#include "SubCmdJsonObjects.h" #include "OptionOptions.h" class SubCmd : public JSONConfigurable { @@ -38,6 +39,7 @@ class SubCmd : public JSONConfigurable { const std::string & getExecutableName() const {return m_executableName; }; void setGlobalOptions(const boost::program_options::options_description &globalOptions) { m_globalOptions.add(globalOptions); }; + void setOptionConfig(const boost::property_tree::ptree &config); protected: const boost::program_options::options_description & getGlobalOptions() const { return m_globalOptions; }; @@ -85,6 +87,7 @@ class SubCmd : public JSONConfigurable { boost::program_options::options_description m_hiddenOptions; boost::program_options::positional_options_description m_positionals; boost::property_tree::ptree m_commandConfig; + SubCmdJsonObjects::JsonConfig m_jsonConfig; template std::vector> diff --git a/src/runtime_src/core/tools/common/SubCmdJsonObjects.cpp b/src/runtime_src/core/tools/common/SubCmdJsonObjects.cpp new file mode 100644 index 00000000000..748e8a7ece8 --- /dev/null +++ b/src/runtime_src/core/tools/common/SubCmdJsonObjects.cpp @@ -0,0 +1,199 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. + +#include +#include +#include + +#include +#include +#include "SubCmdJsonObjects.h" + +namespace SubCmdJsonObjects { + +static constexpr std::string_view const_name_literal = "name"; +static constexpr std::string_view const_description_literal = "description"; +static constexpr std::string_view const_tag_literal = "tag"; +static constexpr std::string_view const_alias_literal = "alias"; +static constexpr std::string_view const_default_value_literal = "default_value"; +static constexpr std::string_view const_option_type_literal = "option_type"; +static constexpr std::string_view const_value_type_literal = "value_type"; +static constexpr std::string_view const_options_literal = "options"; + +static std::unordered_map valueTypeMap = { + {"bool", ValueType::boolean}, + {"string", ValueType::string}, + {"array", ValueType::array}, + {"none", ValueType::none} +}; + +OptionBasic::OptionBasic(const pt::ptree& configurations) + : m_name(configurations.get(std::string(const_name_literal))), + m_description(configurations.get(std::string(const_description_literal))), + m_tag(configurations.get(std::string(const_tag_literal))) + {} + +void +OptionBasic::printOption() const +{ + std::cout << "Name: " << m_name << std::endl; + std::cout << "Description: " << m_description << std::endl; + std::cout << "Tag: " << m_tag << std::endl; +} + +SubCommandOption::SubCommandOption(const pt::ptree& configurations): + OptionBasic(configurations), + m_alias(configurations.get(std::string(const_alias_literal), "")), + m_defaultValue(configurations.get(std::string(const_default_value_literal), "")), + m_optionType(configurations.get(std::string(const_option_type_literal), "")), + m_valueType(configurations.get(std::string(const_value_type_literal), "")), + m_ptEmpty(pt::ptree()), + m_subOptionMap(createBasicOptions(configurations.get_child(std::string(const_options_literal), m_ptEmpty))){} + +/** + * Adds the sub-command option to the options description. + * This method checks the option type and adds the option to the provided options description + * based on its value type (BOOL, STRING, ARRAY). + * If the option type does not match the provided optionsType, the option is not added. + * If the value type is invalid, an exception is thrown. + */ +void +SubCommandOption::addProgramOption(po::options_description& options, const std::string& optionsType) +{ + if (m_optionType != optionsType) return; + + auto valueType = valueTypeMap.find(m_valueType); + if (valueType == valueTypeMap.end()) { + throw std::runtime_error("Invalid value type for option " + m_name); + } + switch (valueType->second){ + case ValueType::boolean: + { + auto defaultVal = m_defaultValue == "true" ? true : false; + options.add_options()((m_name + "," + m_alias).c_str() + , po::value()->default_value(defaultVal) + , m_description.c_str()); + break; + } + case ValueType::string: + { + options.add_options()((m_name + "," + m_alias).c_str() + , po::value()->implicit_value(m_defaultValue) + , m_description.c_str()); + break; + } + case ValueType::array: + { + options.add_options()((m_name + "," + m_alias).c_str() + , po::value>()->multitoken()->zero_tokens() + , m_description.c_str()); + break; + } + case ValueType::none: + { + options.add_options()((m_name + "," + m_alias).c_str() + , po::bool_switch() + , m_description.c_str()); + break; + } + default: + throw std::runtime_error("Invalid value type for option " + m_name); + } +} + +std::unordered_map +SubCommandOption::createBasicOptions(const pt::ptree& pt) +{ + std::unordered_map optionMap; + for (const auto& [key, value] : pt) { + optionMap.emplace(value.get(std::string(const_name_literal)), OptionBasic(value)); + } + return optionMap; +} + +void +SubCommandOption::printOption() const +{ + std::cout << "Name: " << m_name << std::endl; + std::cout << "Description: " << m_description << std::endl; + std::cout << "Tag: " << m_tag << std::endl; + std::cout << "Alias: " << m_alias << std::endl; + std::cout << "Default Value: " << m_defaultValue << std::endl; + std::cout << "Option Type: " << m_optionType << std::endl; + std::cout << "Value Type: " << m_valueType << std::endl; + for (const auto& [key, value] : m_subOptionMap) { + value.printOption(); + } +} + +SubCommand::SubCommand(const pt::ptree& configurations) : + OptionBasic(configurations), + m_optionMap(createSubCommandOptions(configurations.get_child(std::string(const_options_literal)))) + {} + +std::unordered_map +SubCommand::createSubCommandOptions(const pt::ptree& pt) +{ + std::unordered_map optionMap; + for (const auto& [key, value] : pt) { + optionMap.emplace(value.get(std::string(const_name_literal)), SubCommandOption(value)); + } + return optionMap; +} + +void +SubCommand::addProgramOptions(po::options_description& options, const std::string& optionsType) +{ + for (auto& [optionName, optionObj] : m_optionMap) { + optionObj.addProgramOption(options, optionsType); + } +} + +/** + * Creates sub-commands from the property tree. + * This method parses the property tree to create a map of sub-command names to SubCommand objects. + * Only sub-commands matching the provided subCommand name are included. + */ +std::unordered_map +JsonConfig::createSubCommands(const pt::ptree& pt, const std::string& subCommand) +{ + std::unordered_map subCommandMap; + for (const auto& [key, value] : pt) { + if (value.get(std::string(const_name_literal)) != subCommand) { + continue; + } + subCommandMap.emplace(value.get(std::string(const_name_literal)), SubCommand(value)); + } + return subCommandMap; +} + +/** + * Adds program options to the options description for a specific sub-command. + * This method finds the specified sub-command and adds its options to the provided options description. + * If the sub-command is not found, an exception is thrown. + */ +void +JsonConfig::addProgramOptions(po::options_description& options + , const std::string& optionsType + , const std::string& subCommand) +{ + auto subCommandIter = m_subCommandMap.find(subCommand); + if (subCommandIter == m_subCommandMap.end()) { + throw std::runtime_error("Subcommand not found"); + } + subCommandIter->second.addProgramOptions(options, optionsType); +} + +void +JsonConfig::printConfigurations() const +{ + for (const auto& [key, value] : m_subCommandMap) { + std::cout << "Subcommand: " << key << std::endl; + std::cout << "Description: " << value.getDescription() << std::endl; + std::cout << "Tag: " << value.getTag() << std::endl; + for (const auto& [key2, value2] : value.getOptionMap()) { + value2.printOption(); + } + } +} +} // namespace SubCmdJsonObjects diff --git a/src/runtime_src/core/tools/common/SubCmdJsonObjects.h b/src/runtime_src/core/tools/common/SubCmdJsonObjects.h new file mode 100644 index 00000000000..05d6d47323b --- /dev/null +++ b/src/runtime_src/core/tools/common/SubCmdJsonObjects.h @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. + +#pragma once + +#include +#include + +#include "boost/property_tree/ptree.hpp" +#include "boost/program_options.hpp" + +namespace SubCmdJsonObjects { + +namespace po = boost::program_options; +namespace pt = boost::property_tree; + +enum class ValueType { + boolean, + string, + array, + none +}; + +class OptionBasic { + +public: + std::string m_name; + std::string m_description; + std::string m_tag; + + public: + + OptionBasic(const pt::ptree& configurations); + + std::string getName() const { return m_name; } + std::string getDescription() const { return m_description; } + std::string getTag() const { return m_tag; } + void printOption() const; +}; + + +class SubCommandOption : public OptionBasic { + std::string m_alias; + std::string m_defaultValue; + std::string m_optionType; + std::string m_valueType; + pt::ptree m_ptEmpty; + + /* + * Map of option name vs SubCommandOption objects. Example: + * --run can have multiple option values like latency, throughput etc. + * latency : OptionBasic object + * throughput : OptionBasic object + * ................. + * df-bw : OptionBasic object + */ + std::unordered_map m_subOptionMap; + std::unordered_map + createBasicOptions(const pt::ptree& pt); + +public: + SubCommandOption(const pt::ptree& configurations); + + std::string getValueType() const { return m_valueType; } + std::string getAlias() const { return m_alias; } + std::string getDefaultValue() const { return m_defaultValue; } + std::string getOptionType() const { return m_optionType; } + std::unordered_map getSubOptionMap() const { return m_subOptionMap; } + + void addProgramOption(po::options_description& options, const std::string& optionsType); + void printOption() const; +}; + +class SubCommand : public OptionBasic { + /* + * Map of option name vs SubCommandOption objects. Example: + * --device : SubCommandOption object + * --format : SubCommandOption object + * ................. + * --run : SubCommandOption object + */ + std::unordered_map m_optionMap; + + std::unordered_map + createSubCommandOptions(const pt::ptree& pt); + +public: + SubCommand(const pt::ptree& configurations); + std::unordered_map getOptionMap() const { return m_optionMap; } + + void addProgramOptions(po::options_description& options, const std::string& optionsType); +}; + +/** + * @brief JsonConfig class to handle the json configurations. + * Each SubCommand class will keep an object of this class type. + * Ideally SubCommand object creation should also be done at run-time + * and there should only be one object of this class type in existence. + * But that's a task for future enhancements. + */ + +class JsonConfig { + /* Map of subcommand name vs Subcommand objects + * validate : SubCommand object + * configure : SubCommand object + * examine : SubCommand object + */ + std::unordered_map m_subCommandMap; + std::unordered_map + createSubCommands(const pt::ptree& pt, const std::string& subCommand); +public: + JsonConfig(const pt::ptree& configurations, const std::string& subCommand) + : m_subCommandMap(createSubCommands(configurations, subCommand)) + {} + JsonConfig() = default; + + void addProgramOptions(po::options_description& options, const std::string& optionsType, const std::string& subCommand); + void printConfigurations() const; +}; +} // namespace SubCmdJsonObjects diff --git a/src/runtime_src/core/tools/common/XBMain.cpp b/src/runtime_src/core/tools/common/XBMain.cpp index ffe21ebe493..0b2b560d803 100644 --- a/src/runtime_src/core/tools/common/XBMain.cpp +++ b/src/runtime_src/core/tools/common/XBMain.cpp @@ -16,6 +16,7 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files #include #include +#include namespace po = boost::program_options; @@ -173,9 +174,29 @@ void main_(int argc, char** argv, subCommand->setGlobalOptions(globalSubCmdOptions); + /* xrt-smi. Tool should query device upfront and get the configurations + * from shim. This moves the resposibility for option setting to each shim + * instead of xrt-smi. + * If the device is not found, then load the default xrt-smi config. + */ + if (isUserDomain) { + std::shared_ptr device; + boost::property_tree::ptree configTreeMain; + std::string config; + try { + device = XBU::get_device(boost::algorithm::to_lower_copy(sDevice), isUserDomain); + } catch (...) { + device = nullptr; + } + if (device) + config = xrt_core::device_query(device, xrt_core::query::xrt_smi_config::type::options_config); + else + config = XBU::loadDefaultSmiConfig(); + std::istringstream command_config_stream(config); + boost::property_tree::read_json(command_config_stream, configTreeMain); + subCommand->setOptionConfig(configTreeMain); + } + // -- Execute the sub-command subCommand->execute(subcmd_options); } - - - diff --git a/src/runtime_src/core/tools/common/XBUtilities.cpp b/src/runtime_src/core/tools/common/XBUtilities.cpp index d9ce655f122..001bfb5e370 100755 --- a/src/runtime_src/core/tools/common/XBUtilities.cpp +++ b/src/runtime_src/core/tools/common/XBUtilities.cpp @@ -774,3 +774,206 @@ fill_xrt_versions(const boost::property_tree::ptree& pt_xrt, //no device available } } + +std::string +XBUtilities::loadDefaultSmiConfig() +{ + return std::string( + R"( + { + "subcommands": + [{ + "name" : "validate", + "description" : "Validates the given device by executing the platform's validate executable.", + "tag" : "basic", + "options" : + [ + { + "name": "device", + "alias": "d", + "description": "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest", + "tag": "basic", + "default_value": "", + "option_type": "common", + "value_type" : "string" + }, + { + "name": "format", + "alias": "f", + "description": "Report output format", + "tag": "basic", + "default_value": "JSON", + "option_type": "common", + "value_type" : "string" + }, + { + "name": "output", + "alias": "o", + "description" : "Direct the output to the given file", + "tag": "basic", + "default_value": "", + "option_type": "common", + "value_type" : "string" + }, + { + "name": "help", + "alias": "h", + "description" : "Help to use this sub-command", + "tag": "basic", + "default_value": "", + "option_type": "common", + "value_type" : "none" + }, + { + "name" : "run", + "alias" : "r", + "description" : "Run a subset of the test suite", + "tag" : "basic", + "option_type": "common", + "value_type" : "array", + "options" : [ + { + "name" : "latency", + "tag" : "basic", + "description" : "Run end-to-end latency test" + }, + { + "name" : "throughput", + "tag" : "basic", + "description" : "Run end-to-end throughput test" + }, + { + "name" : "cmd-chain-latency", + "tag" : "basic", + "description" : "Run command chain latency test" + }, + { + "name" : "cmd-chain-throughput", + "tag" : "basic", + "description" : "Run end-to-end throughput test using command chaining" + }, + { + "name" : "df-bw", + "tag" : "basic", + "description" : "Run dataflow bandwidth test" + }, + { + "name" : "tct-one-col", + "tag" : "basic", + "description" : "Run TCT test with one column" + }, + { + "name" : "tct-all-col", + "tag" : "basic", + "description" : "Run TCT test with all columns" + }, + { + "name" : "gemm", + "tag" : "basic", + "description" : "Run GEMM test" + }, + { + "name" : "aie-reconfig-overhead", + "tag" : "advanced", + "description" : "Run AIE reconfiguration overhead test" + }, + { + "name" : "spatial-sharing-overhead", + "tag" : "advanced", + "description" : "Run spatial sharing overhead test" + }, + { + "name" : "temporal-sharing-overhead", + "tag" : "advanced", + "description" : "Run temporal sharing overhead test" + } + ] + }, + { + "name" : "path", + "alias" : "p", + "description" : "Path to the directory containing validate xclbins", + "tag" : "basic", + "default_value": "", + "option_type": "hidden", + "value_type" : "string" + }, + { + "name" : "param", + "description" : "Extended parameter for a given test. Format: ::", + "tag" : "basic", + "option_type": "hidden", + "default_value": "", + "value_type" : "string" + }, + { + "name" : "pmode", + "description" : "Specify which power mode to run the benchmarks in. Note: Some tests might be unavailable for some modes", + "tag" : "basic", + "option_type": "hidden", + "default_value": "", + "value_type" : "string" + } + ] + }, + { + "name" : "examine", + "tag" : "basic", + "description": "This command will 'examine' the state of the system/device and will generate a report of interest in a text or JSON format.", + "options": + [ + { + "name": "device", + "description": "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest", + "tag": "devl", + "value_type": "string" + }, + { + "name": "format", + "description": "Report output format", + "tag": "devl", + "value_type": "string" + }, + { + "name": "report", + "description": "The type of report to be produced. Reports currently available are:", + "tag": "basic", + "options": [ + { + "name": "aie-partitions", + "tag": "basic", + "description": "AIE partition information" + }, + { + "name": "telemetry", + "tag": "devl", + "description": "Telemetry data for the device" + } + ] + } + ] + }, + { + "name" : "configure", + "tag" : "devl", + "description" : "Device and host configuration.", + "options" : + [ + { + "name": "device", + "description": "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest", + "tag": "devl", + "value_type" : "string" + }, + { + "name": "pmode", + "description": "Modes: default, powersaver, balanced, performance, turbo", + "tag": "basic", + "value_type": "string" + } + ] + }] +} +)" + ); +}// end of namespace XBValidateUtils diff --git a/src/runtime_src/core/tools/common/XBUtilities.h b/src/runtime_src/core/tools/common/XBUtilities.h index ce409835ffc..aaa32a92786 100644 --- a/src/runtime_src/core/tools/common/XBUtilities.h +++ b/src/runtime_src/core/tools/common/XBUtilities.h @@ -153,6 +153,7 @@ namespace XBUtilities { m_device->close_context(m_uuid, std::numeric_limits::max()); } }; + std::string loadDefaultSmiConfig(); }; diff --git a/src/runtime_src/core/tools/xbflash2/CMakeLists.txt b/src/runtime_src/core/tools/xbflash2/CMakeLists.txt index dce47786d9d..6250f8862ab 100755 --- a/src/runtime_src/core/tools/xbflash2/CMakeLists.txt +++ b/src/runtime_src/core/tools/xbflash2/CMakeLists.txt @@ -18,6 +18,7 @@ file(GLOB XBFLASH_BASE_FILES "../common/OptionOptions.cpp" "../common/XBHelpMenusCore.cpp" "../common/JSONConfigurable.cpp" + "../common/SubCmdJsonObjects.cpp" "../../pcie/tools/xbflash.qspi/firmware_image.cpp" "../../pcie/tools/xbflash.qspi/pcidev.cpp" "../../pcie/tools/xbflash.qspi/xqspips.cpp" diff --git a/src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt b/src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt index 4f6985d9a17..3f6c688ce27 100644 --- a/src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt +++ b/src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt @@ -10,6 +10,7 @@ file(GLOB XBMGMT_V2_BASE_FILES "../common/XBUtilities.cpp" "../common/JSONConfigurable.cpp" "../common/SubCmd.cpp" + "../common/SubCmdJsonObjects.cpp" "../common/SubCmdConfigureInternal.cpp" "../common/SubCmdExamineInternal.cpp" "../common/XBHelpMenusCore.cpp" diff --git a/src/runtime_src/core/tools/xbutil2/CMakeLists.txt b/src/runtime_src/core/tools/xbutil2/CMakeLists.txt index 96ba609af4c..6b7313ced5a 100644 --- a/src/runtime_src/core/tools/xbutil2/CMakeLists.txt +++ b/src/runtime_src/core/tools/xbutil2/CMakeLists.txt @@ -3,6 +3,7 @@ # Copyright (C) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. # # Collect files outside of this directory + file(GLOB XBUTIL_V2_BASE_FILES "xbutil.cpp" "../common/XBMain.cpp" @@ -10,6 +11,7 @@ file(GLOB XBUTIL_V2_BASE_FILES "../common/XBUtilities.cpp" "../common/JSONConfigurable.cpp" "../common/SubCmd.cpp" + "../common/SubCmdJsonObjects.cpp" "../common/SubCmdConfigureInternal.cpp" "../common/SubCmdExamineInternal.cpp" "../common/OptionOptions.cpp" @@ -118,4 +120,5 @@ endif() # Install our built executable install (TARGETS ${XBUTIL2_NAME} RUNTIME DESTINATION ${XRT_INSTALL_UNWRAPPED_DIR}) install (PROGRAMS ${XRT_HELPER_SCRIPTS} DESTINATION ${XRT_INSTALL_BIN_DIR}) + # ----------------------------------------------------------------------------- diff --git a/src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp b/src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp index a8341aa3a5d..d7b569f26eb 100644 --- a/src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp +++ b/src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp @@ -375,41 +375,13 @@ static std::vector extendedKeysCollection = { {"dma", "block-size", "Memory transfer size (bytes)"} }; -std::string -extendedKeysOptions() -{ - static unsigned int m_maxColumnWidth = 100; - std::stringstream fmt_output; - // Formatting color parameters - const std::string fgc_header = XBU::is_escape_codes_disabled() ? "" : EscapeCodes::fgcolor(EscapeCodes::FGC_HEADER).string(); - const std::string fgc_optionName = XBU::is_escape_codes_disabled() ? "" : EscapeCodes::fgcolor(EscapeCodes::FGC_OPTION).string(); - const std::string fgc_optionBody = XBU::is_escape_codes_disabled() ? "" : EscapeCodes::fgcolor(EscapeCodes::FGC_OPTION_BODY).string(); - const std::string fgc_reset = XBU::is_escape_codes_disabled() ? "" : EscapeCodes::fgcolor::reset(); - - // Report option group name (if defined) - boost::format fmtHeader(fgc_header + "\n%s:\n" + fgc_reset); - fmt_output << fmtHeader % "EXTENDED KEYS"; - - // Report the options - boost::format fmtOption(fgc_optionName + " %-18s " + fgc_optionBody + "- %s\n" + fgc_reset); - unsigned int optionDescTab = 23; - - for (auto& param : extendedKeysCollection) { - const auto key_desc = (boost::format("%s: - %s") % param.param_name % param.description).str(); - const auto& formattedString = XBU::wrap_paragraphs(key_desc, optionDescTab, m_maxColumnWidth - optionDescTab, false); - fmt_output << fmtOption % param.test_name % formattedString; - } - - return fmt_output.str(); -} - } //end anonymous namespace // ----- C L A S S M E T H O D S ------------------------------------------- XBU::VectorPairStrings -SubCmdValidate::getTestNameDescriptions(const bool addAdditionOptions) const +SubCmdValidate::getTestNameDescriptions(const SubCmdValidateOptions& options, const bool addAdditionOptions) const { XBU::VectorPairStrings reportDescriptionCollection; @@ -421,7 +393,7 @@ SubCmdValidate::getTestNameDescriptions(const bool addAdditionOptions) const const auto& configs = JSONConfigurable::parse_configuration_tree(m_commandConfig); const auto& testOptionsMap = JSONConfigurable::extract_subcmd_config(testSuite, configs, getConfigName(), std::string("test")); - const std::string& deviceClass = XBU::get_device_class(m_device, true); + const std::string& deviceClass = XBU::get_device_class(options.m_device, true); const auto it = testOptionsMap.find(deviceClass); const std::vector>& testOptions = (it == testOptionsMap.end()) ? testSuite : it->second; @@ -435,7 +407,6 @@ SubCmdValidate::getTestNameDescriptions(const bool addAdditionOptions) const } // -- Build up the format options -static boost::program_options::options_description common_options; static std::map>> jsonOptions; static const std::pair all_test = {"all", "All applicable validate tests will be executed (default)"}; static const std::pair quick_test = {"quick", "Run a subset of four tests: \n1. latency\n2. throughput\n3. cmd-chain-latency\n4. cmd-chain-throughput"}; @@ -443,14 +414,6 @@ static const std::pair quick_test = {"quick", "Run a s SubCmdValidate::SubCmdValidate(bool _isHidden, bool _isDepricated, bool _isPreliminary, const boost::property_tree::ptree& configurations) : SubCmd("validate", "Validates the basic device acceleration functionality") - , m_device("") - , m_tests_to_run({"all"}) - , m_format("JSON") - , m_output("") - , m_param("") - , m_xclbin_location("") - , m_pmode("") - , m_help(false) { const std::string longDescription = "Validates the given device by executing the platform's validate executable."; setLongDescription(longDescription); @@ -465,90 +428,87 @@ SubCmdValidate::SubCmdValidate(bool _isHidden, bool _isDepricated, bool _isPreli jsonOptions = JSONConfigurable::extract_subcmd_config(testSuite, configs, getConfigName(), std::string("test")); // -- Build up the format options - static const auto formatOptionValues = XBU::create_suboption_list_string(Report::getSchemaDescriptionVector()); XBUtilities::VectorPairStrings common_tests; common_tests.emplace_back(all_test); common_tests.emplace_back(quick_test); static const auto formatRunValues = XBU::create_suboption_list_map("", jsonOptions, common_tests); - - common_options.add_options() - ("device,d", boost::program_options::value(&m_device), "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest") - ("format,f", boost::program_options::value(&m_format)->implicit_value(""), (std::string("Report output format. Valid values are:\n") + formatOptionValues).c_str() ) - ("output,o", boost::program_options::value(&m_output)->implicit_value(""), "Direct the output to the given file") - ("help", boost::program_options::bool_switch(&m_help), "Help to use this sub-command") - ; - - m_hiddenOptions.add_options() - ("path,p", boost::program_options::value(&m_xclbin_location)->implicit_value(""), "Path to the directory containing validate xclbins") - ("param", boost::program_options::value(&m_param)->implicit_value(""), (std::string("Extended parameter for a given test. Format: ::\n") + extendedKeysOptions()).c_str()) - ("pmode", boost::program_options::value(&m_pmode)->implicit_value(""), "Specify which power mode to run the benchmarks in. Note: Some tests might be unavailable for some modes") - ; - - m_commonOptions.add(common_options); - m_commonOptions.add_options() - ("run,r", boost::program_options::value(&m_tests_to_run)->multitoken()->zero_tokens(), (std::string("Run a subset of the test suite. Valid options are:\n") + formatRunValues).c_str() ) - ; } void -SubCmdValidate::print_help_internal() const +SubCmdValidate::print_help_internal(const SubCmdValidateOptions& options) const { - if (m_device.empty()) { + if (options.m_device.empty()) { printHelp(false); return; } - const std::string deviceClass = XBU::get_device_class(m_device, true); + const std::string deviceClass = XBU::get_device_class(options.m_device, true); auto it = jsonOptions.find(deviceClass); XBUtilities::VectorPairStrings help_tests = { all_test }; if (it != jsonOptions.end() && it->second.size() > 3) help_tests.emplace_back(quick_test); + const auto formatOptionValues = XBU::create_suboption_list_string(Report::getSchemaDescriptionVector()); static const std::string testOptionValues = XBU::create_suboption_list_map(deviceClass, jsonOptions, help_tests); std::vector tempVec; + boost::program_options::options_description common_options; + + /* TODO: xrt-smi rearchitecture + * These add_options calls should be obsoleted and help printing should be done through m_jsonConfig. + * This is not done in patch since this help printing is tightly coupled with JSONConfigurable to get + * the test names and report names. This should be refactored in a separate patch and JSONConfigurable + * should be obsoleted. + */ common_options.add_options() - ("run,r", boost::program_options::value(&tempVec)->multitoken(), (std::string("Run a subset of the test suite. Valid options are:\n") + testOptionValues).c_str() ) - ; + ("device,d", boost::program_options::value(), "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest") + ("format,f", boost::program_options::value()->implicit_value(""), (std::string("Report output format. Valid values are:\n") + formatOptionValues).c_str() ) + ("output,o", boost::program_options::value()->implicit_value(""), "Direct the output to the given file") + ("help", boost::program_options::bool_switch(), "Help to use this sub-command") + ("run,r", boost::program_options::value()->multitoken(), (std::string("Run a subset of the test suite. Valid options are:\n") + testOptionValues).c_str() ) + ; printHelp(common_options, m_hiddenOptions, deviceClass, false); } void -SubCmdValidate::handle_errors_and_validate_tests(po::variables_map& vm, + +SubCmdValidate::handle_errors_and_validate_tests(const boost::program_options::variables_map& vm, + const SubCmdValidateOptions& options, std::vector& validatedTests, std::vector& param) const { - const auto testNameDescription = getTestNameDescriptions(true /* Add "all" and "quick" options*/); - if (vm.count("output") && m_output.empty()) - throw xrt_core::error("Output file not specified"); + const auto testNameDescription = getTestNameDescriptions(options, true /* Add "all" and "quick" options*/); + + if (vm.count("output") && options.m_output.empty()) + throw xrt_core::error("Output file not specified "); - if (vm.count("path") && m_xclbin_location.empty()) + if (vm.count("path") && options.m_xclbin_path.empty()) throw xrt_core::error("xclbin path not specified"); - if (vm.count("param") && m_param.empty()) + if (vm.count("param") && options.m_param.empty()) throw xrt_core::error("Parameter not specified"); - if (vm.count("pmode") && m_pmode.empty()) + if (vm.count("pmode") && options.m_pmode.empty()) throw xrt_core::error("Power mode not specified"); - if (vm.count("format") && m_format.empty()) + if (vm.count("format") && options.m_format.empty()) throw xrt_core::error("Output format not specified"); - if (!m_output.empty() && !XBU::getForce() && std::filesystem::exists(m_output)) - throw xrt_core::error((boost::format("Output file already exists: '%s'") % m_output).str()); + if (!options.m_output.empty() && !XBU::getForce() && std::filesystem::exists(options.m_output)) + throw xrt_core::error((boost::format("Output file already exists: '%s'") % options.m_output).str()); - if (m_tests_to_run.empty()) + if (options.m_tests_to_run.empty()) throw xrt_core::error("No test given to validate against."); // Validate the user test requests - for (auto &userTestName : m_tests_to_run) { + for (auto &userTestName : options.m_tests_to_run) { const auto validateTestName = boost::algorithm::to_lower_copy(userTestName); - if ((validateTestName == "all") && (m_tests_to_run.size() > 1)) + if ((validateTestName == "all") && (options.m_tests_to_run.size() > 1)) throw xrt_core::error("The 'all' value for the tests to run cannot be used with any other named tests."); - if ((validateTestName == "quick") && (m_tests_to_run.size() > 1)) + if ((validateTestName == "quick") && (options.m_tests_to_run.size() > 1)) throw xrt_core::error("The 'quick' value for the tests to run cannot be used with any other name tests."); // Verify the current user test request exists in the test suite @@ -556,13 +516,13 @@ SubCmdValidate::handle_errors_and_validate_tests(po::variables_map& vm, validatedTests.push_back(validateTestName); } //check if param option is provided - if (!m_param.empty()) { + if (!options.m_param.empty()) { XBU::verbose("Sub command: --param"); - boost::split(param, m_param, boost::is_any_of(":")); // eg: dma:block-size:1024 + boost::split(param, options.m_param, boost::is_any_of(":")); // eg: dma:block-size:1024 //check parameter format if (param.size() != 3) - throw xrt_core::error((boost::format("Invalid parameter format (expected 3 positional arguments): '%s'") % m_param).str()); + throw xrt_core::error((boost::format("Invalid parameter format (expected 3 positional arguments): '%s'") % options.m_param).str()); //check test case name doesTestExist(param[0], testNameDescription); @@ -580,8 +540,10 @@ SubCmdValidate::execute(const SubCmdOptions& _options) const { // Parse sub-command ... po::variables_map vm; + SubCmdValidateOptions options; try{ const auto unrecognized_options = process_arguments(vm, _options, false); + fill_option_values(vm, options); if (!unrecognized_options.empty()) { @@ -595,13 +557,14 @@ SubCmdValidate::execute(const SubCmdOptions& _options) const catch (const boost::program_options::error& e) { std::cerr << boost::format("ERROR: %s\n") % e.what(); - print_help_internal(); + print_help_internal(options); throw xrt_core::error(std::errc::operation_canceled); } + // Check to see if help was requested or no command was found - if (m_help) { - print_help_internal(); + if (options.m_help) { + print_help_internal(options); return; } @@ -609,15 +572,15 @@ SubCmdValidate::execute(const SubCmdOptions& _options) const Report::SchemaVersion schemaVersion = Report::SchemaVersion::unknown; // Output schema version std::vector param; std::vector validatedTests; - std::string validateXclbinPath = m_xclbin_location; + std::string validateXclbinPath = options.m_xclbin_path; try { // Output Format - schemaVersion = Report::getSchemaDescription(m_format).schemaVersion; + schemaVersion = Report::getSchemaDescription(options.m_format).schemaVersion; if (schemaVersion == Report::SchemaVersion::unknown) - throw xrt_core::error((boost::format("Unknown output format: '%s'") % m_format).str()); + throw xrt_core::error((boost::format("Unknown output format: '%s'") % options.m_format).str()); // All Error Handling for xrt-smi validate should go here - handle_errors_and_validate_tests(vm, validatedTests, param); + handle_errors_and_validate_tests(vm, options, validatedTests, param); // check if xclbin folder path is provided if (!validateXclbinPath.empty()) { @@ -632,7 +595,7 @@ SubCmdValidate::execute(const SubCmdOptions& _options) const } catch (const xrt_core::error& e) { // Catch only the exceptions that we have generated earlier std::cerr << boost::format("ERROR: %s\n") % e.what(); - print_help_internal(); + print_help_internal(options); throw xrt_core::error(std::errc::operation_canceled); } @@ -640,7 +603,7 @@ SubCmdValidate::execute(const SubCmdOptions& _options) const // Find device of interest std::shared_ptr device; try { - device = XBU::get_device(boost::algorithm::to_lower_copy(m_device), true /*inUserDomain*/); + device = XBU::get_device(boost::algorithm::to_lower_copy(options.m_device), true /*inUserDomain*/); } catch (const std::runtime_error& e) { // Catch only the exceptions that we have generated earlier std::cerr << boost::format("ERROR: %s\n") % e.what(); @@ -649,10 +612,10 @@ SubCmdValidate::execute(const SubCmdOptions& _options) const const auto& configs = JSONConfigurable::parse_configuration_tree(m_commandConfig); auto testOptionsMap = JSONConfigurable::extract_subcmd_config(testSuite, configs, getConfigName(), std::string("test")); - const std::string& deviceClass = XBU::get_device_class(m_device, true); + const std::string& deviceClass = XBU::get_device_class(options.m_device, true); auto it = testOptionsMap.find(deviceClass); if (it == testOptionsMap.end()) - XBU::throw_cancel(boost::format("Invalid device class %s. Device: %s") % deviceClass % m_device); + XBU::throw_cancel(boost::format("Invalid device class %s. Device: %s") % deviceClass % options.m_device); std::vector>& testOptions = it->second; // Collect all of the tests of interests @@ -703,25 +666,25 @@ SubCmdValidate::execute(const SubCmdOptions& _options) const const auto curr_mode = xrt_core::device_query_default(device, 0); //--pmode try { - if (!m_pmode.empty()) { + if (!options.m_pmode.empty()) { XBU::verbose("Sub command: --param"); - if (boost::iequals(m_pmode, "DEFAULT")) { + if (boost::iequals(options.m_pmode, "DEFAULT")) { xrt_core::device_update(device.get(), xrt_core::query::performance_mode::power_type::basic); // default } - else if (boost::iequals(m_pmode, "PERFORMANCE")) { + else if (boost::iequals(options.m_pmode, "PERFORMANCE")) { xrt_core::device_update(device.get(), xrt_core::query::performance_mode::power_type::performance); } - else if (boost::iequals(m_pmode, "TURBO")) { + else if (boost::iequals(options.m_pmode, "TURBO")) { xrt_core::device_update(device.get(), xrt_core::query::performance_mode::power_type::turbo); } - else if (boost::iequals(m_pmode, "POWERSAVER") || boost::iequals(m_pmode, "BALANCED")) { - throw xrt_core::error(boost::str(boost::format("No tests are supported in %s mode\n") % m_pmode)); + else if (boost::iequals(options.m_pmode, "POWERSAVER") || boost::iequals(options.m_pmode, "BALANCED")) { + throw xrt_core::error(boost::str(boost::format("No tests are supported in %s mode\n") % options.m_pmode)); } else { - throw xrt_core::error(boost::str(boost::format("Invalid pmode value: '%s'\n") % m_pmode)); + throw xrt_core::error(boost::str(boost::format("Invalid pmode value: '%s'\n") % options.m_pmode)); } - XBU::verbose(boost::str(boost::format("Setting power mode to `%s` \n") % m_pmode)); + XBU::verbose(boost::str(boost::format("Setting power mode to `%s` \n") % options.m_pmode)); } else { xrt_core::device_update(device.get(), xrt_core::query::performance_mode::power_type::performance); @@ -749,17 +712,29 @@ SubCmdValidate::execute(const SubCmdOptions& _options) const } // -- Write output file ---------------------------------------------- - if (!m_output.empty()) { + if (!options.m_output.empty()) { std::ofstream fOutput; - fOutput.open(m_output, std::ios::out | std::ios::binary); + fOutput.open(options.m_output, std::ios::out | std::ios::binary); if (!fOutput.is_open()) - throw xrt_core::error((boost::format("Unable to open the file '%s' for writing.") % m_output).str()); + throw xrt_core::error((boost::format("Unable to open the file '%s' for writing.") % options.m_output).str()); fOutput << oSchemaOutput.str(); - std::cout << boost::format("Successfully wrote the %s file: %s") % m_format % m_output << std::endl; + std::cout << boost::format("Successfully wrote the %s file: %s") % options.m_format % options.m_output << std::endl; } if (has_failures == true) throw xrt_core::error(std::errc::operation_canceled); } + +void SubCmdValidate::fill_option_values(const po::variables_map& vm, SubCmdValidateOptions& options) const +{ + options.m_device = vm.count("device") ? vm["device"].as() : ""; + options.m_format = vm.count("format") ? vm["format"].as() : "JSON"; + options.m_output = vm.count("output") ? vm["output"].as() : ""; + options.m_param = vm.count("param") ? vm["param"].as() : ""; + options.m_xclbin_path = vm.count("path") ? vm["path"].as() : ""; + options.m_pmode = vm.count("pmode") ? vm["pmode"].as() : ""; + options.m_tests_to_run = vm.count("run") ? vm["run"].as>() : std::vector({"all"}); + options.m_help = vm.count("help") ? vm["help"].as() : false; +} \ No newline at end of file diff --git a/src/runtime_src/core/tools/xbutil2/SubCmdValidate.h b/src/runtime_src/core/tools/xbutil2/SubCmdValidate.h index 6efe9681a29..0a7f4e3c864 100644 --- a/src/runtime_src/core/tools/xbutil2/SubCmdValidate.h +++ b/src/runtime_src/core/tools/xbutil2/SubCmdValidate.h @@ -9,6 +9,17 @@ #include "tools/common/SubCmd.h" #include "tools/common/XBHelpMenus.h" +struct SubCmdValidateOptions { + std::string m_device; + std::string m_format; + std::string m_output; + std::string m_param; + std::string m_xclbin_path; + std::string m_pmode; + std::vector m_tests_to_run; + bool m_help; +}; + class SubCmdValidate : public SubCmd { public: virtual void execute(const SubCmdOptions &_options) const; @@ -17,20 +28,14 @@ class SubCmdValidate : public SubCmd { SubCmdValidate(bool _isHidden, bool _isDepricated, bool _isPreliminary, const boost::property_tree::ptree& configurations); private: - std::string m_device; - std::vector m_tests_to_run; - std::string m_format; - std::string m_output; - std::string m_param; - std::string m_xclbin_location; - std::string m_pmode; - bool m_help; - - void print_help_internal() const; - void handle_errors_and_validate_tests(boost::program_options::variables_map&, + + void fill_option_values(const boost::program_options::variables_map& vm, SubCmdValidateOptions& options) const; + void print_help_internal(const SubCmdValidateOptions& ) const; + void handle_errors_and_validate_tests(const boost::program_options::variables_map&, + const SubCmdValidateOptions&, std::vector&, std::vector&) const; - XBUtilities::VectorPairStrings getTestNameDescriptions(const bool addAdditionOptions) const; + XBUtilities::VectorPairStrings getTestNameDescriptions(const SubCmdValidateOptions&, const bool addAdditionOptions) const; }; #endif diff --git a/src/runtime_src/core/tools/xbutil2/xbutil.cpp b/src/runtime_src/core/tools/xbutil2/xbutil.cpp index 0502eed078e..e46875e919a 100644 --- a/src/runtime_src/core/tools/xbutil2/xbutil.cpp +++ b/src/runtime_src/core/tools/xbutil2/xbutil.cpp @@ -9,6 +9,7 @@ #include "SubCmdProgram.h" #include "SubCmdReset.h" #include "SubCmdValidate.h" +#include "tools/common/tests/TestValidateUtilities.h" // Supporting tools #include "common/error.h" @@ -17,6 +18,7 @@ #include "tools/common/XBMain.h" #include "tools/common/XBUtilities.h" #include "tools/common/JSONConfigurable.h" +#include "core/common/module_loader.h" // System include files #include