stdlib: Fix 'nozero' for Scalar SimStats (#972)

When the `statistics::nozero` flag is set gem5 does not output that stat
if its value is zero. This was not the case for SimStats which output in
this case. This patch correct this behavior.
This commit is contained in:
Bobby R. Bruce
2024-04-04 08:33:48 -07:00
committed by GitHub
parent 0c6543d781
commit 4ff34a75bb
2 changed files with 8 additions and 1 deletions

View File

@@ -145,6 +145,9 @@ pybind_init_stats(py::module_ &m_native)
.def_property_readonly("flags", [](const statistics::Info &info) {
return (statistics::FlagsType)info.flags;
})
.def_property_readonly("is_nozero", [](const statistics::Info &info) {
return info.flags.isSet(statistics::nozero);
})
.def("check", &statistics::Info::check)
.def("baseCheck", &statistics::Info::baseCheck)
.def("enable", &statistics::Info::enable)