Skip to content

Commit

Permalink
CR-1149626 sc warning (#7304) (#7310)
Browse files Browse the repository at this point in the history
* CR-1149626 Add warning for SC mismatch

Signed-off-by: Daniel Benusovich <[email protected]>

* CR-1149626 Add default option to prevent failures due to warning queries

Signed-off-by: Daniel Benusovich <[email protected]>

* CR-1149626 Update error message to remove 0.0.0 and replace with NA

Signed-off-by: Daniel Benusovich <[email protected]>

Signed-off-by: Daniel Benusovich <[email protected]>
(cherry picked from commit a722d40)
  • Loading branch information
dbenusov authored Jan 29, 2023
1 parent 29f4e0e commit 523e164
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/runtime_src/core/tools/common/XBUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,21 @@ XBUtilities::collect_devices( const std::set<std::string> &_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<xrt_core::query::hwmon_sdm_active_msp_ver>(device, unavail);
auto exp_ver = xrt_core::device_query_default<xrt_core::query::hwmon_sdm_target_msp_ver>(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;

Expand Down

0 comments on commit 523e164

Please sign in to comment.