Odyssey PLL unlock analysis plugin
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: Ia53910eecdcdeb836bd836039a509f00121a67f7
diff --git a/analyzer/filter-root-cause.cpp b/analyzer/filter-root-cause.cpp
index d122a32..4efcff0 100644
--- a/analyzer/filter-root-cause.cpp
+++ b/analyzer/filter-root-cause.cpp
@@ -37,15 +37,35 @@
bool __findPllUnlock(const std::vector<libhei::Signature>& i_list,
libhei::Signature& o_rootCause)
{
+ using namespace util::pdbg;
+
// TODO: Consider returning all of them instead of one as root cause.
- auto itr = std::find_if(i_list.begin(), i_list.end(), [&](const auto& t) {
- return (libhei::hash<libhei::NodeId_t>("PLL_UNLOCK") == t.getId() &&
- (0 == t.getBit() || 1 == t.getBit()));
+
+ auto nodeId = libhei::hash<libhei::NodeId_t>("PLL_UNLOCK");
+
+ // First, look for any PLL unlock attentions reported by a processsor chip.
+ auto itr1 = std::find_if(i_list.begin(), i_list.end(), [&](const auto& t) {
+ return (nodeId == t.getId() &&
+ TYPE_PROC == getTrgtType(getTrgt(t.getChip())));
});
- if (i_list.end() != itr)
+ if (i_list.end() != itr1)
{
- o_rootCause = *itr;
+ o_rootCause = *itr1;
+ return true;
+ }
+
+ // Then, look for any PLL unlock attentions reported by an OCMB chip. This
+ // is specifically for Odyssey, which are the only OCMBs that would report
+ // PLL unlock attentions.
+ auto itr2 = std::find_if(i_list.begin(), i_list.end(), [&](const auto& t) {
+ return (nodeId == t.getId() &&
+ TYPE_OCMB == getTrgtType(getTrgt(t.getChip())));
+ });
+
+ if (i_list.end() != itr2)
+ {
+ o_rootCause = *itr2;
return true;
}