diff options
author | Prem Shanker Jha <premjha2@in.ibm.com> | 2015-01-20 05:22:21 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-02-04 12:07:31 -0600 |
commit | 4faa8140cb446ea259f68d50a1c9d7ad7a3e6135 (patch) | |
tree | 56ed6e9b67a754eb32fe9fa14e482ce9a1e8dbdb /src/usr/diag | |
parent | ed9910fb0c31c40656651bfc20ee071192be83e4 (diff) | |
download | talos-hostboot-4faa8140cb446ea259f68d50a1c9d7ad7a3e6135.tar.gz talos-hostboot-4faa8140cb446ea259f68d50a1c9d7ad7a3e6135.zip |
PRD: Fixed problems with filter cascading.
1. fixed behavior of link filter.
2. fixed cascading of transpose filter with secondary filter.
Change-Id: I1e312d5b855684117d34b47c75e4089d54f2e546
CQ: SW291648
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15260
Tested-by: Jenkins Server
Reviewed-by: Christopher T. Phan <cphan@us.ibm.com>
Reviewed-by: Bilicon Patil <bilpatil@in.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Reviewed-by: Zane Shelley <zshelle@us.ibm.com>
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15528
Diffstat (limited to 'src/usr/diag')
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; } //------------------------------------------------------------------------------ |