From 523e164f3c8339e24a9a7a6ffbf756583927d256 Mon Sep 17 00:00:00 2001 From: Daniel Benusovich <94083344+dbenusov-xilinx@users.noreply.github.com> Date: Sun, 29 Jan 2023 01:53:46 -0800 Subject: [PATCH] CR-1149626 sc warning (#7304) (#7310) * CR-1149626 Add warning for SC mismatch Signed-off-by: Daniel Benusovich * CR-1149626 Add default option to prevent failures due to warning queries Signed-off-by: Daniel Benusovich * CR-1149626 Update error message to remove 0.0.0 and replace with NA Signed-off-by: Daniel Benusovich Signed-off-by: Daniel Benusovich (cherry picked from commit a722d40bdf4a5de7334826add1681adfecbdb3e3) --- src/runtime_src/core/tools/common/XBUtilities.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/runtime_src/core/tools/common/XBUtilities.cpp b/src/runtime_src/core/tools/common/XBUtilities.cpp index a9d9b77fb29..1f5bcf0c1fa 100755 --- a/src/runtime_src/core/tools/common/XBUtilities.cpp +++ b/src/runtime_src/core/tools/common/XBUtilities.cpp @@ -331,6 +331,21 @@ XBUtilities::collect_devices( const std::set &_deviceBDFs, warnings.push_back(e.what()); } + try { + const std::string unavail = "N/A"; + const std::string zeroes = "0.0.0"; + auto cur_ver = xrt_core::device_query_default(device, unavail); + auto exp_ver = xrt_core::device_query_default(device, unavail); + cur_ver = (boost::equals(cur_ver, zeroes)) ? unavail : cur_ver; + exp_ver = (boost::equals(exp_ver, zeroes)) ? unavail : exp_ver; + if (boost::equals(cur_ver, unavail) || boost::equals(exp_ver, unavail)) + warnings.push_back(boost::str(boost::format("SC version data missing. Expected: %s Current: %s") % exp_ver % cur_ver)); + else if (!boost::equals(cur_ver, exp_ver)) + warnings.push_back(boost::str(boost::format("Invalid SC version. Expected: %s Current: %s") % exp_ver % cur_ver)); + } catch (const xrt_core::error& e) { + warnings.push_back(e.what()); + } + if (warnings.empty()) return;