summaryrefslogtreecommitdiffstats
path: root/src/usr/diag
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/diag')
-rwxr-xr-xsrc/usr/diag/prdf/common/framework/rule/prdfGroup.C26
-rwxr-xr-xsrc/usr/diag/prdf/common/framework/rule/prdfGroup.H19
-rw-r--r--src/usr/diag/prdf/common/framework/rule/prdfRuleMetaData.C2
-rwxr-xr-xsrc/usr/diag/prdf/common/util/prdfFilters.C20
4 files changed, 46 insertions, 21 deletions
diff --git a/src/usr/diag/prdf/common/framework/rule/prdfGroup.C b/src/usr/diag/prdf/common/framework/rule/prdfGroup.C
index ad8042fe7..61043540a 100755
--- a/src/usr/diag/prdf/common/framework/rule/prdfGroup.C
+++ b/src/usr/diag/prdf/common/framework/rule/prdfGroup.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -222,7 +222,7 @@ void Group::Add(SCAN_COMM_REGISTER_CLASS * i_reg,
};
-void Group::AddFilter(FilterClass * i_filter)
+void Group::AddFilter(FilterClass * i_filter, bool i_addFirst )
{
// Add to filter list, for deallocation later.
cv_filters.push_back(i_filter);
@@ -233,25 +233,31 @@ void Group::AddFilter(FilterClass * i_filter)
i++)
{
// Get old filter.
- FilterClass * l_filter = ((ResolutionMap *)(*i).second)->getFilter();
+ FilterClass * l_bitFilter =
+ ((ResolutionMap *)(*i).second)->getFilter();
// Need new filter link?
- if (NULL != l_filter)
+ if (NULL != l_bitFilter)
{
- // Use original filters first. (we add transposes first.)
- l_filter = new FilterLink(*l_filter,
- *i_filter); // pw01
+ if( i_addFirst )
+ {
+ l_bitFilter = new FilterLink( *i_filter, *l_bitFilter );
+ }
+ else
+ {
+ l_bitFilter = new FilterLink( *l_bitFilter, *i_filter );
+ }
// Add to filter list, for deallocation later.
- cv_filters.push_back(l_filter);
+ cv_filters.push_back(l_bitFilter);
}
else
{
- l_filter = i_filter;
+ l_bitFilter = i_filter;
}
// Assign filter to resolution map.
- ((ResolutionMap *)(*i).second)->setFilter(l_filter);
+ ((ResolutionMap *)(*i).second)->setFilter(l_bitFilter);
}
}
diff --git a/src/usr/diag/prdf/common/framework/rule/prdfGroup.H b/src/usr/diag/prdf/common/framework/rule/prdfGroup.H
index 6300acd8f..de859c960 100755
--- a/src/usr/diag/prdf/common/framework/rule/prdfGroup.H
+++ b/src/usr/diag/prdf/common/framework/rule/prdfGroup.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2004,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -74,8 +76,19 @@ class Group : public ErrorRegisterType
Resolution & i_action,
ResetAndMaskPair &,
uint16_t i_scrID); // add default action.
-
- void AddFilter(FilterClass * i_filter);
+ /**
+ * @brief adds filter to the group.
+ * @param i_filter filter to be added to the group.
+ * @param i_addFirst true, if filter should act ahead of filter(s)
+ * added previously to the group, false otherwise.
+ * @note In most cases, we use original filter first. It ensures
+ * transpose filters acts first on FIR data. However, if
+ * secondary filter is defined for the group, it assumes
+ * highest priority and should be added before any other
+ * filter. It's because it should be the first filter acting on
+ * FIR data.
+ */
+ void AddFilter( FilterClass * i_filter, bool i_addFirst = false );
/**
* No Filters applied by this Error Register - so undo is no-op
diff --git a/src/usr/diag/prdf/common/framework/rule/prdfRuleMetaData.C b/src/usr/diag/prdf/common/framework/rule/prdfRuleMetaData.C
index 7d2a334f4..7133e23fe 100644
--- a/src/usr/diag/prdf/common/framework/rule/prdfRuleMetaData.C
+++ b/src/usr/diag/prdf/common/framework/rule/prdfRuleMetaData.C
@@ -1010,7 +1010,7 @@ void RuleMetaData::createGroup(Group * i_group,
i_data.cv_loadChip->cv_groupSecondaryBits[i_groupId]);
FilterClass * l_filter = new SecondaryBitsFilter( l_bits );
- i_group->AddFilter( l_filter );
+ i_group->AddFilter( l_filter, true );
}
diff --git a/src/usr/diag/prdf/common/util/prdfFilters.C b/src/usr/diag/prdf/common/util/prdfFilters.C
index 8d90d1637..bfdd52d16 100755
--- a/src/usr/diag/prdf/common/util/prdfFilters.C
+++ b/src/usr/diag/prdf/common/util/prdfFilters.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -164,16 +164,22 @@ bool FilterTranspose::Undo(BitKey & iBitList)
bool FilterLink::Apply( BitKey & bit_list, STEP_CODE_DATA_STRUCT & io_sdc )
{
- bool rc = xFilter1.Apply( bit_list, io_sdc );
- rc = rc || xFilter2.Apply( bit_list,io_sdc );
- return rc;
+ // NOTE: Apply() for both filters must be called regardless of the rc.
+ bool rc1 = xFilter1.Apply( bit_list, io_sdc );
+ bool rc2 = xFilter2.Apply( bit_list,io_sdc );
+ rc2 = rc1 || rc2;
+
+ return rc2;
}
bool FilterLink::Undo( BitKey & bit_list )
{
- bool rc = xFilter1.Undo(bit_list);
- rc = rc || xFilter2.Undo(bit_list);
- return rc;
+ // NOTE: Undo() for both filters must be called regardless of the rc.
+ bool rc1 = xFilter1.Undo(bit_list);
+ bool rc2 = xFilter2.Undo(bit_list);
+ rc2 = rc1 || rc2;
+
+ return rc2;
}
//------------------------------------------------------------------------------
OpenPOWER on IntegriCloud