diff options
Diffstat (limited to 'src/usr/diag/prdf')
19 files changed, 781 insertions, 636 deletions
diff --git a/src/usr/diag/prdf/common/framework/register/iipErrorRegisterFilter.h b/src/usr/diag/prdf/common/framework/register/iipErrorRegisterFilter.h index cc9665450..3aae09983 100755 --- a/src/usr/diag/prdf/common/framework/register/iipErrorRegisterFilter.h +++ b/src/usr/diag/prdf/common/framework/register/iipErrorRegisterFilter.h @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2001,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -124,18 +126,13 @@ public: protected: // functions /** - Filter the bit string (if a filter is provided) & convert it to a BitList - <ul> - <br><b>Parameters: </b> Bit String - <br><b>Returns: </b> Bit List - <br><b>Requirements:</b> Read() - <br><b>Promises: </b> Bit list representation of the (filtered) bit string - <br><b>Exceptions: </b> None. - <br><b>Notes: </b> filter is called only if provided - - DEFINTION in iipErrorRegisterMask.C - </ul><br> + * @brief Filter the bit string and convert it to a BitList + * @param i_bs bit string + * @param io_sdc reference to STEP_CODE_DATA struct + * @return bit key */ - virtual BitKey Filter(const BIT_STRING_CLASS & bs); + virtual BitKey Filter( const BIT_STRING_CLASS & bs, + STEP_CODE_DATA_STRUCT & io_sdc ); /** * Certain filters need to be reversed in order for Reset() to work right diff --git a/src/usr/diag/prdf/common/framework/register/prdfErrorRegister.C b/src/usr/diag/prdf/common/framework/register/prdfErrorRegister.C index 83227ad88..dee5ae1fc 100755 --- a/src/usr/diag/prdf/common/framework/register/prdfErrorRegister.C +++ b/src/usr/diag/prdf/common/framework/register/prdfErrorRegister.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 1996,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -80,28 +82,36 @@ namespace PRDF int32_t ErrorRegister::SetErrorSignature( STEP_CODE_DATA_STRUCT & error, BitKey & bl ) { - int32_t rc = SUCCESS; - ErrorSignature * esig = error.service_data->GetErrorSignature(); - uint32_t blen = bl.size(); - switch(blen) - { - case 0: - (error.service_data->GetErrorSignature())->setErrCode(PRD_SCAN_COMM_REGISTER_ZERO); - if(xNoErrorOnZeroScr != true) rc = PRD_SCAN_COMM_REGISTER_ZERO; - break; - - case 1: - esig->setErrCode(bl.getListValue(0)); - break; - - default: - for(uint32_t index = 0; index < blen; ++index) //dg01a - { //dg01a - esig->setErrCode(bl.getListValue(index)); //dg01a - } //dg01a - esig->setErrCode(PRD_MULTIPLE_ERRORS); - }; - return rc; + int32_t rc = SUCCESS; + ErrorSignature * esig = error.service_data->GetErrorSignature(); + uint32_t blen = bl.size(); + switch( blen ) + { + case 0: + (error.service_data->GetErrorSignature())->setErrCode( + PRD_SCAN_COMM_REGISTER_ZERO ); + if( error.service_data->isPrimaryPass() ) + { + rc = PRD_SCAN_COMM_REGISTER_ZERO; + } + else if( !xNoErrorOnZeroScr ) + { + rc = PRD_SCAN_COMM_REGISTER_ZERO; + } + break; + + case 1: + esig->setErrCode(bl.getListValue(0)); + break; + + default: + for( uint32_t index = 0; index < blen; ++index ) + { + esig->setErrCode(bl.getListValue(index)); + } + esig->setErrCode(PRD_MULTIPLE_ERRORS); + }; + return rc; } /*---------------------------------------------------------------------*/ @@ -119,113 +129,114 @@ ErrorRegister::ErrorRegister( SCAN_COMM_REGISTER_CLASS & r, ResolutionMap & rm, int32_t ErrorRegister::Analyze(STEP_CODE_DATA_STRUCT & error) { - int32_t rc = SUCCESS; - - uint32_t l_savedErrSig = 0; // @pw01 - - if(xScrId == 0x0fff) - { - (error.service_data->GetErrorSignature())->setRegId(scr.GetAddress()); - } - else - { - (error.service_data->GetErrorSignature())->setRegId(xScrId); - } - - // Get Data from hardware - const BIT_STRING_CLASS &bs = Read(error.service_data->GetCauseAttentionType()); // @pw02 - BitKey bl; // null bit list has length 0 - - if (scr_rc == SUCCESS) - { - bl = Filter(bs); - rc = SetErrorSignature(error,bl); //dg02c - made function of this block of code - // @pw01 - // Save signature to determine if it changes during resolution execution. - l_savedErrSig = (error.service_data->GetErrorSignature())->getSigId(); - } - - uint32_t res_rc = Lookup(error, bl); // lookup and execute the resolutions - if(SUCCESS == rc) rc = res_rc; // previous rc has prioity over res_rc - - - // @pw01 - // If we had a DD02 and the signature changes, ignore DD02. - if ((rc == PRD_SCAN_COMM_REGISTER_ZERO) && - ((error.service_data->GetErrorSignature())->getSigId() - != l_savedErrSig) - ) - { - // Found a better answer during the DD02 analysis. - rc = res_rc; - } - - - if(scr_rc == SUCCESS) - { - FilterUndo(bl); // dg03a - // NOTE: This is an unusual work-a-round for NOT clearing - // particular FIR bits in a register because they are cleared - // in another part of the plugin code. jl01 - if(rc == PRD_NO_CLEAR_FIR_BITS) + int32_t rc = SUCCESS; + + uint32_t l_savedErrSig = 0; + + if(xScrId == 0x0fff) { - rc = SUCCESS; //Return success to indicate that we understand the DDFF + ( error.service_data->GetErrorSignature() )->setRegId(scr.GetAddress()); } else { - int32_t reset_rc; - reset_rc = Reset(bl,error); - if(rc == SUCCESS)rc = reset_rc; + ( error.service_data->GetErrorSignature() )->setRegId( xScrId ); } - } - else // scr read failed - { - (error.service_data->GetErrorSignature())->setErrCode(PRD_SCANCOM_FAILURE); - rc = scr_rc; - } - - return(rc); + + // Get Data from hardware + const BIT_STRING_CLASS &bs = + Read( error.service_data->GetCauseAttentionType() ); + BitKey bl; // null bit list has length 0 + + if ( scr_rc == SUCCESS ) + { + bl = Filter( bs ); + rc = SetErrorSignature( error,bl ); + + // Save signature to determine if it changes during resolution + // execution. + l_savedErrSig = (error.service_data->GetErrorSignature())->getSigId(); + } + + uint32_t res_rc = Lookup(error, bl); // lookup and execute the resolutions + if(SUCCESS == rc) rc = res_rc; // previous rc has prioity over res_rc + + // If we had a DD02 and the signature changes, ignore DD02. + if ( rc == PRD_SCAN_COMM_REGISTER_ZERO ) + { + uint32_t l_currentSig = + error.service_data->GetErrorSignature()->getSigId(); + if( l_currentSig != l_savedErrSig ) + { + // Found a better answer during the DD02 analysis. + rc = res_rc; + } + } + + if( scr_rc == SUCCESS ) + { + FilterUndo( bl ); + // NOTE: This is an unusual work-a-round for NOT clearing + // particular FIR bits in a register because they are cleared + // in another part of the plugin code. + if( rc == PRD_NO_CLEAR_FIR_BITS ) + { + //Return success to indicate that we understand the DDFF + rc = SUCCESS; + } + else + { + int32_t reset_rc; + reset_rc = Reset(bl,error); + if( rc == SUCCESS ) rc = reset_rc; + } + } + else // scr read failed + { + ( error.service_data->GetErrorSignature() )->setErrCode( + PRD_SCANCOM_FAILURE ); + rc = scr_rc; + } + return(rc); } /*---------------------------------------------------------------------*/ const BIT_STRING_CLASS & ErrorRegister::Read(ATTENTION_TYPE i_attn) { - scr_rc = scr.Read(); - return (*scr.GetBitString(i_attn)); + scr_rc = scr.Read(); + return (*scr.GetBitString(i_attn)); } /*---------------------------------------------------------------------*/ -BitKey ErrorRegister::Filter -(const BIT_STRING_CLASS & bs) +BitKey ErrorRegister::Filter( const BIT_STRING_CLASS & bs ) { - BitKey bit_list; - bit_list = bs; - return(bit_list); + BitKey bit_list; + bit_list = bs; + return( bit_list ); } /*---------------------------------------------------------------------*/ -int32_t ErrorRegister::Lookup(STEP_CODE_DATA_STRUCT & sdc, BitKey & bl) // dg02c dg03c +int32_t ErrorRegister::Lookup(STEP_CODE_DATA_STRUCT & sdc, BitKey & bl) { - int32_t rc = SUCCESS; -// if (bl.GetListLength() == 0) return(rMap.GetDefault()); /dg00d - ResolutionList rList; - rMap.LookUp(rList,bl,sdc); // dg04c - // SetErrorSignature(sdc,bl); // LookUp may have changed bl dg02a dg04d - for(ResolutionList::iterator i = rList.begin(); i != rList.end(); ++i) - { - rc |= (*i)->Resolve(sdc); - } - return rc; + int32_t rc = SUCCESS; + ResolutionList rList; + rc = rMap.LookUp( rList,bl,sdc ); + for( ResolutionList::iterator i = rList.begin(); i != rList.end(); ++i ) + { + rc |= (*i)->Resolve( sdc ); + } + + return rc; } /*---------------------------------------------------------------------*/ -int32_t ErrorRegister::Reset(const BitKey & bit_list, STEP_CODE_DATA_STRUCT & error) +int32_t ErrorRegister::Reset( const BitKey & bit_list, + STEP_CODE_DATA_STRUCT & error ) { - return(SUCCESS); + return(SUCCESS); } } // end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/register/prdfErrorRegisterMask.C b/src/usr/diag/prdf/common/framework/register/prdfErrorRegisterMask.C index 7b1f5764b..f237ccdce 100755 --- a/src/usr/diag/prdf/common/framework/register/prdfErrorRegisterMask.C +++ b/src/usr/diag/prdf/common/framework/register/prdfErrorRegisterMask.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 1996,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -153,13 +155,13 @@ int32_t ErrorRegisterMask::Reset(const BIT_LIST_CLASS & bit_list, // *************************************************************************** -BIT_LIST_CLASS ErrorRegisterFilter::Filter -(const BIT_STRING_CLASS & bs) +BIT_LIST_CLASS ErrorRegisterFilter::Filter( const BIT_STRING_CLASS & bs, + STEP_CODE_DATA_STRUCT & io_sdc ) { - BIT_LIST_CLASS bit_list; - bit_list = bs; - if(filter) filter->Apply(bit_list); - return bit_list; + BIT_LIST_CLASS bit_list; + bit_list = bs; + if( filter ) filter->Apply( bit_list, io_sdc ); + return bit_list; } } //End namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.C b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.C index e30378328..597fceb37 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.C +++ b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2004,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -247,51 +249,73 @@ void ResolutionMap::Add(const uint8_t *i_ble, //------------------------------------------------------------------------------ -void ResolutionMap::LookUp( ResolutionList & o_list, - BitKey & io_bitList, - STEP_CODE_DATA_STRUCT & scd ) +int32_t ResolutionMap::LookUp( ResolutionList & o_list, + BitKey & io_bitList, + STEP_CODE_DATA_STRUCT & scd ) { uint32_t lsize = o_list.size(); + int32_t l_rc = SUCCESS; if(iv_filter != NULL) { - iv_filter->Apply(io_bitList); + iv_filter->Apply( io_bitList,scd ); } ErrorSignature * esig = scd.service_data->GetErrorSignature(); - switch(io_bitList.size()) + switch( io_bitList.size() ) { + // we are setting rc to PRD_SCAN_COMM_REGISTER_ZERO in case 0 below. + // But we don't set rc to bit found set ( case 1 ) or + // PRD_MULTIPLE_ERRORS. It's because for the code calling this + // function, one bit set or multiple bit set make little + // difference. In both cases, it has to do same set of actions. + // We need to treat case 0 separately. It is because we want to + // know the outcome of action of secondary filter. If secondary + // filter yields 0xdd02, we know we need to launch one more pass + // with filter turned off. case 0: - esig->setErrCode(PRD_SCAN_COMM_REGISTER_ZERO); + esig->setErrCode( PRD_SCAN_COMM_REGISTER_ZERO ); + l_rc = PRD_SCAN_COMM_REGISTER_ZERO; break; case 1: - esig->setErrCode(io_bitList.getListValue(0)); + esig->setErrCode( io_bitList.getListValue(0) ); break; default: - for(uint32_t index = 0; index < io_bitList.size(); ++index) + for( uint32_t index = 0; index < io_bitList.size(); ++index ) { - esig->setErrCode(io_bitList.getListValue(index)); + esig->setErrCode( io_bitList.getListValue(index) ); } - esig->setErrCode(PRD_MULTIPLE_ERRORS); + esig->setErrCode( PRD_MULTIPLE_ERRORS ); }; - for(MapList::iterator i = iv_list.begin(); i != iv_list.end(); ++i) + for( MapList::iterator i = iv_list.begin(); i != iv_list.end(); ++i ) { - if((i->iv_blist).isSubset(io_bitList)) + if( ( i->iv_blist ).isSubset( io_bitList ) ) { - o_list.push_back(i->iv_res); + o_list.push_back( i->iv_res ); } } - if(lsize == o_list.size()) // we didn't find anything to add, so use default + // we didn't find anything to add, so use default + if( lsize == o_list.size() ) { - o_list.push_back(defaultRes); + // if it is a primary pass and we haven't found any bit set, let us + // prevent default resolution from getting executed. It is primarily + // because end of primary pass doesn't necessarily mean end of analysis. + // There may be a case when a FIR has only a secondary bit on. In that + // case, primary pass shall fail to find any bit set and initiate + // secondary pass. In secondary pass, bits set shall be identified and + // associated resolution shall be executed. + + if( !scd.service_data->isPrimaryPass() ) o_list.push_back( defaultRes ); } - if(iv_filter != NULL) + if( iv_filter != NULL ) { iv_filter->Undo(io_bitList); // so returned bit list will have proper // value for reset } + + return l_rc; } //------------------------------------------------------------------------------ diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.H b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.H index 77ca2e04d..9e8b03a34 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.H +++ b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2004,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -178,17 +180,18 @@ public: void AddRange(const char *i_ble, Resolution * r1, Resolution * r2, Resolution * r3, Resolution * r4, Resolution * r5, Resolution * r6) { Add(i_ble,r1,r2,r3,r4,r5,r6); } - /** - Look up a Resolution for a bitlist - @param bitList - @returns List of all Resolutions that match - @pre none - @post Resolution returned is only valid until the next call to LookUp or this object is destroyed. - i_bitList may be modified - @notes if the bitList does not have a match then the defaultResolution is returned. - */ - void LookUp( ResolutionList & o_list, BitKey & io_bitList, - STEP_CODE_DATA_STRUCT & scd ); + /** + * @brief Look up resolutions associated with a bitlist + * @param o_list list of resolution. + * All the resolutions associated with a particular bit + * is stacked in this list. + * @param io_bitList bit key under analysis. + * @param scd reference to STEP_CODE_STRUCT + * @return PRD_SCAN_COMM_REGISTER_ZERO, if filter returns bitkey of zero + * size, SUCCESS otherwise. + */ + int32_t LookUp( ResolutionList & o_list, BitKey & io_bitList, + STEP_CODE_DATA_STRUCT & scd ); /** * @brief Get the stored filter associated with this resolution map. diff --git a/src/usr/diag/prdf/common/framework/rule/prdfRuleMetaData.C b/src/usr/diag/prdf/common/framework/rule/prdfRuleMetaData.C index f882208c7..1661bcb68 100644 --- a/src/usr/diag/prdf/common/framework/rule/prdfRuleMetaData.C +++ b/src/usr/diag/prdf/common/framework/rule/prdfRuleMetaData.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* [+] 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. */ @@ -991,6 +993,29 @@ void RuleMetaData::createGroup(Group * i_group, // Do flags. --- + // For idea of secondary bit filter to work, it must be the first filter + // applicable on register data. To manage this, first of all, we must push + // secondary filter to group. + // We are supporting the concept of cascaded filter where one filter works + // after other in harmony. When secondary filter acts, it shall make + // all the secondary bits( which are ON ) as "DON'T CARE" during primary + // pass. So, the intent is to filter out secondary bits or in other words + // analyze only primary bits in primary pass. + + if ( i_data.cv_loadChip->cv_groupFlags[i_groupId] & + Prdr::PRDR_GROUP_FILTER_SECONDARY ) + { + // Add secondary filter to find out if any secondary bit + // is on. + std::vector<uint8_t> l_bits; + CreateBitString::execute(l_bits, + i_data.cv_loadChip->cv_groupSecondaryBits[i_groupId]); + + FilterClass * l_filter = new SecondaryBitsFilter( l_bits ); + i_group->AddFilter( l_filter ); + + } + // Do Priority filter flag. if (i_data.cv_loadChip->cv_groupFlags[i_groupId] & Prdr::PRDR_GROUP_FILTER_PRIORITY) diff --git a/src/usr/diag/prdf/common/framework/rule/prdrCommon.H b/src/usr/diag/prdf/common/framework/rule/prdrCommon.H index b56afa720..6e1b1d7e4 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrCommon.H +++ b/src/usr/diag/prdf/common/framework/rule/prdrCommon.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2005,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -81,9 +83,11 @@ namespace Prdr enum GroupFlags { /** Single Bit Filter */ - PRDR_GROUP_FILTER_SINGLE_BIT = 0x1, + PRDR_GROUP_FILTER_SINGLE_BIT = 0x1, /** Priority Bit Filter */ - PRDR_GROUP_FILTER_PRIORITY = 0x2, + PRDR_GROUP_FILTER_PRIORITY = 0x2, + /** Secondary Bit Filter */ + PRDR_GROUP_FILTER_SECONDARY = 0x4, }; /** diff --git a/src/usr/diag/prdf/common/framework/rule/prdrCompile.lex b/src/usr/diag/prdf/common/framework/rule/prdrCompile.lex index eb5d82270..a1d503547 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrCompile.lex +++ b/src/usr/diag/prdf/common/framework/rule/prdrCompile.lex @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2004,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -147,6 +149,7 @@ day { return PRDR_TIME_DAY; } filter { return PRDR_FILTER; } singlebit { return PRDR_FILTER_SINGLE_BIT; } priority { return PRDR_FILTER_PRIORITY; } +secondarybits { return PRDR_FILTER_SECONDARY; } "\<\<" { return PRDR_OP_LEFTSHIFT; } "\>\>" { return PRDR_OP_RIGHTSHIFT; } diff --git a/src/usr/diag/prdf/common/framework/rule/prdrCompile.y b/src/usr/diag/prdf/common/framework/rule/prdrCompile.y index 0e0b927ae..1ccb5ae33 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrCompile.y +++ b/src/usr/diag/prdf/common/framework/rule/prdrCompile.y @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2004,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -55,6 +57,7 @@ using namespace PRDR_COMPILER; %} + /* Union for the 'yylval' variable in lex or $$ variables in yacc code. Used * to store the data associated with a parsed token. */ @@ -157,6 +160,7 @@ using namespace PRDR_COMPILER; %token PRDR_FILTER %token PRDR_FILTER_SINGLE_BIT %token PRDR_FILTER_PRIORITY +%token PRDR_FILTER_SECONDARY /* Terminal tokens for Doxygen-style comments */ %token <str_ptr> PRDR_DOX_COMMENT @@ -596,6 +600,12 @@ grpfilt_item: PRDR_FILTER_PRIORITY '(' bitandlist ')' } ; +grpfilt_item: PRDR_FILTER_SECONDARY '(' bitandlist ')' + { + $$ = new std::list<Group_Filter *>; + $$->push_back(new Group_Filter_Secondary($3)); + } +; grouplines: { $$ = new Group(); } diff --git a/src/usr/diag/prdf/common/framework/rule/prdrGroup.H b/src/usr/diag/prdf/common/framework/rule/prdrGroup.H index 5ddf3605f..b0cb90afb 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrGroup.H +++ b/src/usr/diag/prdf/common/framework/rule/prdrGroup.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2004,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -44,6 +46,7 @@ class Group public: std::list<Expr *> cv_rules; Expr * cv_priorityList; + Expr * cv_secondaryList; char cv_op; uint8_t cv_flags; @@ -51,11 +54,13 @@ class Group Group() : cv_priorityList(NULL), + cv_secondaryList(NULL), cv_op(Prdr::GROUP), cv_flags(0), cv_doxcomment() {}; Group(char o) : cv_priorityList(NULL), + cv_secondaryList(NULL), cv_op(o), cv_flags(0), cv_doxcomment() {}; @@ -74,6 +79,12 @@ class Group if (NULL != i_l->cv_priorityList) i_r->cv_priorityList = i_l->cv_priorityList; + // Set Secondary bit list. + if ( NULL != i_l->cv_secondaryList ) + { + i_r->cv_secondaryList = i_l->cv_secondaryList; + } + }; void setComment(std::string & i_comment) @@ -180,18 +191,21 @@ class Group if (Prdr::GROUP == cv_op) { PRDR_FWRITE(&cv_flags, 1, 1, i_file); - if (Prdr::PRDR_GROUP_FILTER_PRIORITY & cv_flags) + if ( Prdr::PRDR_GROUP_FILTER_PRIORITY & cv_flags ) { - cv_priorityList->output(i_file); + cv_priorityList->output( i_file ); + } + if ( Prdr::PRDR_GROUP_FILTER_SECONDARY & cv_flags ) + { + cv_secondaryList->output( i_file ); } } - for (std::list<Expr *>::iterator i = cv_rules.begin(); i != cv_rules.end(); i++) { - (*i)->output(i_file); + (*i)->output( i_file ); } return 0; @@ -235,6 +249,20 @@ class Group_Filter_Priority : public Group_Filter Expr * iv_list; }; +class Group_Filter_Secondary : public Group_Filter +{ + public: + Group_Filter_Secondary( Expr * i_list ) : iv_secList( i_list ) {}; + + void AddFilter( Group * i_group ) + { + i_group->cv_flags |= Prdr::PRDR_GROUP_FILTER_SECONDARY; + i_group->cv_secondaryList = iv_secList; + }; + + private: + Expr * iv_secList; +}; } // end namespace PRDR_COMPILER #endif diff --git a/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.C b/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.C index 7e75803f9..0e24abe35 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.C +++ b/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2004,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -229,12 +231,15 @@ errlHndl_t LoadChip(UtilStream & i_stream, Chip & o_chip) o_chip.cv_groupSize = new uint16_t[o_chip.cv_groupCount]; o_chip.cv_groupFlags = new uint8_t[o_chip.cv_groupCount]; o_chip.cv_groupPriorityBits = new Expr * [o_chip.cv_groupCount]; + o_chip.cv_groupSecondaryBits = new Expr * [o_chip.cv_groupCount]; for (uint32_t i = 0; i < o_chip.cv_groupCount; i++) { i_stream >> l_temp[0]; // should be 'G' i_stream >> o_chip.cv_groupSize[i]; i_stream >> o_chip.cv_groupFlags[i]; - if (PRDR_GROUP_FILTER_PRIORITY & o_chip.cv_groupFlags[i]) + + //check if priority filter has been specified + if ( PRDR_GROUP_FILTER_PRIORITY & o_chip.cv_groupFlags[i] ) { o_chip.cv_groupPriorityBits[i] = new Expr(); ReadExpr(i_stream, *o_chip.cv_groupPriorityBits[i]); @@ -243,6 +248,17 @@ errlHndl_t LoadChip(UtilStream & i_stream, Chip & o_chip) { o_chip.cv_groupPriorityBits[i] = NULL; } + + //check if secondary filter has been specified + if( PRDR_GROUP_FILTER_SECONDARY & o_chip.cv_groupFlags[i] ) + { + o_chip.cv_groupSecondaryBits[i] = new Expr(); + ReadExpr(i_stream, *o_chip.cv_groupSecondaryBits[i]); + } + else + { + o_chip.cv_groupSecondaryBits[i] = NULL; + } if (0 != o_chip.cv_groupSize[i]) { o_chip.cv_groups[i] = new Expr[o_chip.cv_groupSize[i]]; diff --git a/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.H b/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.H index f80d69925..2fc998377 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.H +++ b/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2004,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -191,24 +193,25 @@ namespace Prdr uint32_t cv_dumpType; // default dump content type. uint16_t cv_scomLen; // default scom length. uint16_t cv_regCount; - Register * cv_registers; + Register * cv_registers; uint16_t cv_ruleCount; - Expr * cv_rules; + Expr * cv_rules; uint16_t cv_groupCount; uint16_t cv_groupAttn[NUM_GROUP_ATTN]; uint16_t * cv_groupSize; uint8_t * cv_groupFlags; - Expr ** cv_groupPriorityBits; - Expr ** cv_groups; + Expr ** cv_groupPriorityBits; + Expr ** cv_groupSecondaryBits; + Expr ** cv_groups; uint16_t cv_actionCount; uint16_t * cv_actionSize; - Expr ** cv_actions; + Expr ** cv_actions; Chip() : cv_regCount(0), cv_registers(NULL), cv_ruleCount(0), cv_rules(NULL), cv_groupCount(0), cv_groupSize(NULL), cv_groupFlags(NULL), cv_groupPriorityBits(NULL), - cv_groups(NULL), + cv_groupSecondaryBits(NULL), cv_groups(NULL), cv_actionCount(0), cv_actionSize(NULL), cv_actions(NULL) { @@ -222,6 +225,9 @@ namespace Prdr { if (NULL != cv_groupPriorityBits[i]) delete cv_groupPriorityBits[i]; + + if ( NULL != cv_groupSecondaryBits[i] ) + delete cv_groupSecondaryBits[i]; if (NULL != cv_groups[i]) delete[] cv_groups[i]; } @@ -229,6 +235,8 @@ namespace Prdr if (NULL != cv_groupSize) delete[] cv_groupSize; if (NULL != cv_groupFlags) delete[] cv_groupFlags; if (NULL != cv_groupPriorityBits) delete[] cv_groupPriorityBits; + if ( NULL != cv_groupSecondaryBits ) + delete[] cv_groupSecondaryBits; for (int i = 0; i < cv_actionCount; i++) if (NULL != cv_actions[i]) delete[] cv_actions[i]; if (NULL != cv_actions) delete[] cv_actions; diff --git a/src/usr/diag/prdf/common/framework/service/iipServiceDataCollector.h b/src/usr/diag/prdf/common/framework/service/iipServiceDataCollector.h index ec0b988db..0a52e942c 100755 --- a/src/usr/diag/prdf/common/framework/service/iipServiceDataCollector.h +++ b/src/usr/diag/prdf/common/framework/service/iipServiceDataCollector.h @@ -143,6 +143,9 @@ public: /** If this flag is set, We are mainly interested in getting signature * for attention. */ PASS_ISOLATION_ONLY = 0x01, + /** If this flag is set, only bits not marked as secondary + * meaning ( primary ) are taken up for analysis. */ + PASS_PRIMARY = 0x02, }; #ifndef PRDF_SDC_FLAGS_MAP_ONLY @@ -562,6 +565,21 @@ public: */ void clearIsolationOnlyPass() { analysisFlags &= !PASS_ISOLATION_ONLY ;} + /** + * @brief Returns true if it is a primary analysis phase, false otherwise. + */ + bool isPrimaryPass(void) const + { return ( ( analysisFlags & PASS_PRIMARY ) != 0 ) ; } + /** + * @brief sets status bit meant for primary analysis pass. + */ + void setPrimaryPass() { analysisFlags |= PASS_PRIMARY ; } + + /** + * @brief clears status bit meant for primary analysis pass. + */ + void clearPrimaryPass() { analysisFlags &= ~PASS_PRIMARY; } + /** Set ErrorType for Gard <ul> diff --git a/src/usr/diag/prdf/common/plat/pegasus/Membuf_acts_NEST.rule b/src/usr/diag/prdf/common/plat/pegasus/Membuf_acts_NEST.rule index 47778c604..d8557d306 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/Membuf_acts_NEST.rule +++ b/src/usr/diag/prdf/common/plat/pegasus/Membuf_acts_NEST.rule @@ -779,7 +779,8 @@ rule Mba1_MbsEccFir ~MBA1_MBSECCFIR_ACT0 & MBA1_MBSECCFIR_ACT1; }; -group gMbsEccFir filter priority(19,41) # UEs highest priority +group gMbsEccFir filter secondarybits(0,1,2,3,4,5,6,7,16,17,20,21,22,23,24, + 25,26,27), priority (19,41) { /** MBA0_MBSECCFIR[0] * Memory chip mark on rank 0 diff --git a/src/usr/diag/prdf/common/prdfMain_common.C b/src/usr/diag/prdf/common/prdfMain_common.C index a765316db..5774ec592 100755 --- a/src/usr/diag/prdf/common/prdfMain_common.C +++ b/src/usr/diag/prdf/common/prdfMain_common.C @@ -253,7 +253,36 @@ errlHndl_t main( ATTENTION_VALUE_TYPE i_attentionType, PlatServices::getCurrentTime( timeOfError ); serviceData.SetTOE( timeOfError ); - int32_t analyzeRc = systemPtr->Analyze(sdc, i_attentionType); + ServiceDataCollector l_tempSdc = serviceData; + l_tempSdc.setPrimaryPass(); + sdc.service_data = &l_tempSdc; + + int32_t analyzeRc = systemPtr->Analyze( sdc, i_attentionType ); + + if( PRD_SCAN_COMM_REGISTER_ZERO == analyzeRc ) + { + // So, the first pass has failed. Hence, there are no primary + // bits set. We must start second pass to see if there are any + //secondary bits set. + sdc.service_data = &serviceData; + + // starting the second pass + PRDF_INF( "PRDF::main() No bits found set in first pass," + " starting second pass" ); + analyzeRc = systemPtr->Analyze( sdc, i_attentionType ); + + // merging capture data of primary pass with capture data of + // secondary pass for better FFDC. + serviceData.GetCaptureData().mergeData( + l_tempSdc.GetCaptureData()); + + } + else + { + serviceData = l_tempSdc; + sdc.service_data = &serviceData; + } + // flush Cache to free up the memory RegDataCache::getCachedRegisters().flush(); ScanFacility & l_scanFac = ScanFacility::Access(); @@ -262,8 +291,6 @@ errlHndl_t main( ATTENTION_VALUE_TYPE i_attentionType, l_scanFac.ResetPluginRegister(); if(analyzeRc != SUCCESS && g_prd_errlHndl == NULL) { - // We have a bad RC, but no error log - Fill out SDC and have - // service generator make one (serviceData.GetErrorSignature())->setErrCode( (uint16_t)analyzeRc ); serviceData.SetCallout(SP_CODE); diff --git a/src/usr/diag/prdf/common/util/prdfBitKey.C b/src/usr/diag/prdf/common/util/prdfBitKey.C index c0e5bb61e..82970a233 100755 --- a/src/usr/diag/prdf/common/util/prdfBitKey.C +++ b/src/usr/diag/prdf/common/util/prdfBitKey.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2004,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -35,17 +37,18 @@ namespace PRDF { -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ // Local -//------------------------------------------------------------------------------------------------- -inline uint32_t getWordSize(uint32_t bitCount) // # of bit32's needed for this bit_count +//------------------------------------------------------------------------------ +// # of bit32's needed for this bit_count +inline uint32_t getWordSize(uint32_t bitCount) { return (bitCount/32) + ((bitCount%32)? 1:0); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ // member function definitions -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ BitKey::BitKey(void) : iv_Capacity(0), iv_storage1(0) @@ -53,7 +56,7 @@ BitKey::BitKey(void) iv_rep.storage2 = 0; } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ BitKey::BitKey(uint32_t i_bitPos) : iv_Capacity(0), iv_storage1(0) @@ -62,7 +65,7 @@ BitKey::BitKey(uint32_t i_bitPos) setBit(i_bitPos); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ BitKey::BitKey(const uint8_t * i_array,uint8_t i_size) : iv_Capacity(0), iv_storage1(0) @@ -76,7 +79,21 @@ BitKey::BitKey(const uint8_t * i_array,uint8_t i_size) } } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ + +BitKey::BitKey( const std::vector <uint8_t> & i_bitList ) + : iv_Capacity(0), iv_storage1(0) +{ + iv_rep.storage2 = 0; + std::vector< uint8_t >::const_iterator itList = i_bitList.begin(); + while( itList != i_bitList.end() ) + { + setBit( *itList ); + itList++; + } +} + +//------------------------------------------------------------------------------ BitKey::BitKey(const char * i_ble) : iv_Capacity(0), iv_storage1(0) @@ -89,14 +106,14 @@ BitKey::BitKey(const char * i_ble) } } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ BitKey::~BitKey(void) { if(!IsDirect()) delete [] iv_rep.buffer; } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ BitKey::BitKey (const BitKey & bit_list) : iv_Capacity(bit_list.iv_Capacity), iv_storage1(bit_list.iv_storage1) @@ -113,7 +130,7 @@ BitKey::BitKey (const BitKey & bit_list) } } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ BitKey & BitKey::operator=(const BitKey & bit_list) { @@ -143,7 +160,7 @@ BitKey & BitKey::operator=(const BitKey & bit_list) return(*this); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ BitKey & BitKey::operator=(const BitString & bit_string) { @@ -158,7 +175,7 @@ BitKey & BitKey::operator=(const BitString & bit_string) return(*this); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ BitKey & BitKey::operator=(const char * string_ptr) { @@ -177,7 +194,7 @@ BitKey & BitKey::operator=(const char * string_ptr) return(*this); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ bool BitKey::operator==(const BitKey & that) const { @@ -212,7 +229,7 @@ bool BitKey::operator==(const BitKey & that) const } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ // Candidate funciton for bs class bool BitKey::isSubset(const BitKey & that) const @@ -223,9 +240,11 @@ bool BitKey::isSubset(const BitKey & that) const uint32_t mysize = getWordSize(iv_Capacity); uint32_t yosize = getWordSize(that.iv_Capacity); uint32_t smsize = (yosize < mysize)? yosize : mysize; - // size can be non-zero with no bits on - so if that has no bits than use operator== + // size can be non-zero with no bits on - so if that has no bits than use + // operator== BitKey zero; - if(that == zero) result = operator==(that); // only true if both are empty - eg not bits on" + // only true if both are empty - eg not bits on" + if(that == zero) result = operator==(that); // if yosize <= mysize than just match smallest amount of data // if yozize > mysize than extra yodata must be zero for(uint32_t i = 0; (i < smsize) && (result == true); ++i,++mydata,++yodata) @@ -243,7 +262,7 @@ bool BitKey::isSubset(const BitKey & that) const return result; } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ // get bit position of nth bit that is set uint32_t BitKey::getListValue(uint32_t n) const @@ -265,7 +284,7 @@ uint32_t BitKey::getListValue(uint32_t n) const return bitPos; } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ uint32_t BitKey::size(void) const { @@ -273,7 +292,7 @@ uint32_t BitKey::size(void) const return bs.GetSetCount(); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ void BitKey::removeBit(uint32_t n) { @@ -284,7 +303,7 @@ void BitKey::removeBit(uint32_t n) } } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ void BitKey::removeBit(void) { @@ -301,7 +320,7 @@ void BitKey::removeBit(void) } } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ void BitKey::removeBits(const BitKey & i_bk) { @@ -310,7 +329,7 @@ void BitKey::removeBits(const BitKey & i_bk) mybs.Mask(yobs); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ void BitKey::setBit(uint32_t i_bitValue) { @@ -322,7 +341,7 @@ void BitKey::setBit(uint32_t i_bitValue) bs.Set(i_bitValue); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ void BitKey::ReAllocate(uint32_t i_len) { diff --git a/src/usr/diag/prdf/common/util/prdfBitKey.H b/src/usr/diag/prdf/common/util/prdfBitKey.H index 1bfaa96a4..964b14660 100755 --- a/src/usr/diag/prdf/common/util/prdfBitKey.H +++ b/src/usr/diag/prdf/common/util/prdfBitKey.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2004,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -29,6 +31,7 @@ #define PRDFBITLKEY_H #include <prdf_types.h> +#include <vector> namespace PRDF { @@ -127,8 +130,13 @@ class BitKey */ BitKey(const char * i_ble); + /** + * @brief constructor from vector of bits + * @param i_bitList list of FIR bit position + */ + BitKey( const std::vector <uint8_t> & i_bitList ); //! Copy Constructor - BitKey (const BitKey & bit_list); + BitKey ( const BitKey & bit_list ); //! Destructor ~BitKey(void); diff --git a/src/usr/diag/prdf/common/util/prdfFilters.C b/src/usr/diag/prdf/common/util/prdfFilters.C index 8d25656eb..141688bf3 100755 --- a/src/usr/diag/prdf/common/util/prdfFilters.C +++ b/src/usr/diag/prdf/common/util/prdfFilters.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 1996,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -35,9 +37,9 @@ #include <prdfBitKey.H> #include <prdfFilters.H> //#include <xspprdScanCommFilter.h> -#include <iipscr.h> //#include <xspprdFilterLink.h> - +#include <iipstep.h> +#include <iipServiceDataCollector.h> #undef iipFilters_C namespace PRDF @@ -69,49 +71,50 @@ namespace PRDF FilterClass::~FilterClass(void) {} -//------------------------------------------------------------------------------------------------- +//----------------------------------------------------------------------------- -bool FilterPriority::Apply(BitKey & ioBitList) +bool FilterPriority::Apply( BitKey & ioBitList, STEP_CODE_DATA_STRUCT & io_sdc ) { - bool modified = false; - if(ioBitList.isSubset(ivBitKey)) - { - ioBitList = ivBitKey; - modified = true; - } - return modified; + bool modified = false; + if( ioBitList.isSubset(ivBitKey) ) + { + ioBitList = ivBitKey; + modified = true; + } + return modified; } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ -bool SingleBitFilter::Apply(BitKey & bit_list) +bool SingleBitFilter::Apply( BitKey & bit_list, STEP_CODE_DATA_STRUCT & io_sdc ) { - bool rc = false; - uint32_t list_length = bit_list.size(); - if(list_length > 1) - { - rc = true; - while(--list_length) + bool rc = false; + uint32_t list_length = bit_list.size(); + if( list_length > 1 ) { - bit_list.removeBit(); + rc = true; + while( --list_length ) + { + bit_list.removeBit(); + } } - } - return(rc); + return( rc ); } -//------------------------------------------------------------------------------------------------- +//----------------------------------------------------------------------------- -bool PrioritySingleBitFilter::Apply(BitKey & bit_list) +bool PrioritySingleBitFilter::Apply( BitKey & bit_list, + STEP_CODE_DATA_STRUCT & io_sdc ) { bool l_modified = false; // Do priority bit. - for (size_t i = 0; i < iv_bitList.size(); i++) + for ( size_t i = 0; i < iv_bitList.size(); i++ ) { BitKey l_key = iv_bitList[i]; - if (bit_list.isSubset(l_key)) + if ( bit_list.isSubset(l_key) ) { l_modified = true; bit_list = l_key; @@ -119,9 +122,9 @@ bool PrioritySingleBitFilter::Apply(BitKey & bit_list) } } // Do single bit filter portion. - if (!l_modified) + if ( !l_modified ) { - while (1 < bit_list.size()) + while ( 1 < bit_list.size() ) { l_modified = true; bit_list.removeBit(); @@ -130,93 +133,72 @@ bool PrioritySingleBitFilter::Apply(BitKey & bit_list) return l_modified; } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ -bool FilterTranspose::Apply(BitKey & iBitList) +bool FilterTranspose::Apply( BitKey & iBitList, STEP_CODE_DATA_STRUCT & io_sdc ) { - bool result = false; - if(iBitList == ivBitKey) - { - BitKey bk(ivSingleBitPos); - iBitList = bk; - result = true; - } - return result; + bool result = false; + if(iBitList == ivBitKey) + { + BitKey bk(ivSingleBitPos); + iBitList = bk; + result = true; + } + return result; } bool FilterTranspose::Undo(BitKey & iBitList) { - bool result = false; - BitKey testbl(ivSingleBitPos); - if(iBitList.isSubset(testbl)) - { - iBitList = ivBitKey; - result = true; - } - - return result; + bool result = false; + BitKey testbl(ivSingleBitPos); + if(iBitList.isSubset(testbl)) + { + iBitList = ivBitKey; + result = true; + } + + return result; } -//------------------------------------------------------------------------------------------------- +//----------------------------------------------------------------------------- -bool FilterLink::Apply(BitKey & bit_list) +bool FilterLink::Apply( BitKey & bit_list, STEP_CODE_DATA_STRUCT & io_sdc ) { - bool rc = xFilter1.Apply(bit_list); - rc = rc || xFilter2.Apply(bit_list); - return rc; + bool rc = xFilter1.Apply( bit_list, io_sdc ); + rc = rc || xFilter2.Apply( bit_list,io_sdc ); + return rc; } -bool FilterLink::Undo(BitKey & bit_list) +bool FilterLink::Undo( BitKey & bit_list ) { - bool rc = xFilter1.Undo(bit_list); - rc = rc || xFilter2.Undo(bit_list); - return rc; + bool rc = xFilter1.Undo(bit_list); + rc = rc || xFilter2.Undo(bit_list); + return rc; } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ -bool ScanCommFilter::Apply(BitKey & bitList) +bool SecondaryBitsFilter::Apply( BitKey & io_bitList, + STEP_CODE_DATA_STRUCT & io_sdc ) { - // Read HW register - scr.Read(); - - // local copy of bit string from scan comm register - BIT_STRING_BUFFER_CLASS bsb(*scr.GetBitString()); - BitKey bl; - bool rc = false; - - // Invert if necessary - if (xInvert) - { - bsb = ~bsb; - } - - // Create bit list - bl = bsb; - uint32_t bsize = bitList.size(); - bitList.removeBits(bl); - if(bsize != bitList.size()) - { - rc = true; - } - - return(rc); + bool l_modified = false; + do + { + // if it is not a primary pass then we need not apply this filter. + // so continuing with usual flow. + if( !( io_sdc.service_data )->isPrimaryPass( ) ) break; + //if there is no secondary bit position to flip or if no bit is set in + //bit key then let us skip this apply. + if( ( 0 == iv_secBitList.size() ) || ( 0 == io_bitList.size()) ) break; + + BitKey l_key ( iv_secBitList ); + io_bitList.removeBits( l_key ); + l_modified = true; + + }while(0); + + return l_modified; } + } //End namespace PRDF -// Change Log ************************************************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ------- -------- -------- ------------------------------ -// v4r1 09/05/96 DGILBERT Initial Creation -// v4r3 01/27/98 SERAFIN Add PrioritySingleBitFilter -// dg00 v4r5 06/30/99 DGILBERT fix PrioritySingleBitFilter -// mk01 P4904712 v4r5 10/21/99 mkobler really fix PrioritySingleBitFilter -// 490420.x v5r2 07/06/00 mkobler Add ScanCommFilter -// 490420.x v5r2 07/06/00 dgilbert added FilterLink -// fips 03/19/04 dgilbert rename to Filters.C;rewrote PrioritySingleBitFilter -// changed to use BitKey -// 558003 fips310 06/21/06 dgilbert Add Undo() -// 582595 fips310 12/12/06 iawillia Update priority sb filter to maintain bit order. -// -// End Change Log ********************************************************************************* diff --git a/src/usr/diag/prdf/common/util/prdfFilters.H b/src/usr/diag/prdf/common/util/prdfFilters.H index 932f53d51..bdad805d8 100755 --- a/src/usr/diag/prdf/common/util/prdfFilters.H +++ b/src/usr/diag/prdf/common/util/prdfFilters.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2004,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] 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. */ @@ -36,7 +38,6 @@ #if !defined(PRDFBITLKEY_H) #include <prdfBitKey.H> #endif - #include <vector> namespace PRDF @@ -46,157 +47,159 @@ namespace PRDF /*--------------------------------------------------------------------*/ class BitKey; +struct STEP_CODE_DATA_STRUCT; /*--------------------------------------------------------------------*/ /* User Types */ /*--------------------------------------------------------------------*/ /** - FilterClass Specifies and interface for removing unwanted bits from a BitKey. - Abstract base class - @see BitKey -*/ + * @brief Defines FilterClass + * Describes interface for removing unwanted bits from a BitKey. + * It is a abstract base class. + * see BitKey + */ class FilterClass { -public: - - - /** - Destructor. This implementation does nothing - */ - virtual ~FilterClass(void); - - - /** - Apply filter to the BitKey. - @post bit_list may be modified - @return true if bit_list was modified, otherwise false - */ - virtual bool Apply(BitKey & io_bit_list) = 0; - - /** - * Undo the filter effect (if possible) - * @post bit_list may be modified - * @Return tru if bit_list was modified, otherwise false - * @note: bit_lists are sometimes used to reset an error register based on the bit that was - * analyzed. If the Apply() function modifes the bit_list in such a way that make it unusable - * to reset the error register (eg. moves a bit to a new postition) than the Undo() function - * should put the bit_list back into a state that can be used to reset an error register. - */ - virtual bool Undo(BitKey & io_bit_list) { return false; } - -protected: - - /** - Default Constructor - @note The default compiler generated copy constructor and assignment operator - are adaquate. - */ - FilterClass(void) {} + public: + + /** + * @brief Destructor. This implementation does nothing + */ + virtual ~FilterClass(void); + + /** + * @brief Applies filter on given bitkey + * @param i_bitList bitkey on which filter acts. + * @param io_sdc reference to STEP_CODE_DATA struct. + * @return true if bit key is modified false otherwise. + */ + virtual bool Apply( BitKey & io_bit_list, + STEP_CODE_DATA_STRUCT & io_sdc ) = 0; + + /** + * Undo the filter effect (if possible) + * @post bit_list may be modified + * @Return tru if bit_list was modified, otherwise false + * @note: bit_lists are sometimes used to reset an error register based on + * the bit that was analyzed. If the Apply() function modifes the bit_list + * in such a way that make it unusable to reset the error register + * (eg. moves a bit to a new postition) than the Undo() function should put + * the bit_list back into a state that can be used to reset an error + * register. + */ + virtual bool Undo(BitKey & io_bit_list) { return false; } + + protected: + + /** + * @brief Default Constructor + * @note The default compiler generated copy constructor and assignment + * operator are adaquate. + */ + FilterClass(void) {} }; -//! FilterPriority -/*! - FilterPriority maintains a "subset" BitKey or a "priority" set of bits. - When this filter is applied to a BitKey, If the "priority" BitKey is a subset of the - BitKey than the BitKey becomes the priorty BitKey. (The non-priority bits are turned off); - Otherwise the BitKey remains unchanged. - - \verbatim - Examples: - Priority BitKey: ("1") - Original BitKey: ("1", "5", "31") - Filtered BitKey: ("1") - - Priority BitKey: ("1") - Original BitKey: ("5", "31") - Filtered BitKey: ("5", "31") - - Priority BitKey: ("2", "7") - Original BitKey: ("2", "5", "31") - Filtered BitKey: ("2", "5", "31") - - Priority BitKey: ("2", "7") - Original BitKey: ("2", "7", "31") - Filtered BitKey: ("2", "7") - \endverbatim - */ -class FilterPriority : public FilterClass -{ -public: - - /*! - Constructor - \param i_bld ptr bit list string encoding - */ - FilterPriority(const char * i_ble) - : ivBitKey(i_ble) - {} - - - /*! - Constructor - \param iBitList BitKey - */ - FilterPriority(const BitKey & iBitList) - : ivBitKey(iBitList) - {} +/** @brief description of FilterPriority filter. - /*! - Apply the filter to a bit list - \param ioBitList to apply filter to - \returns true if iBitList modified otherwise false - */ - virtual bool Apply(BitKey & ioBitList); + * FilterPriority maintains a "subset" BitKey or a "priority" set of bits. + * When this filter is applied to a BitKey, If the "priority" BitKey is a subset + * of the BitKey than the BitKey becomes the priorty BitKey. (The non-priority + * bits are turned off ).Otherwise the BitKey remains unchanged. -protected: + * Examples: + * Priority BitKey: ("1") + * Original BitKey: ("1", "5", "31") + * Filtered BitKey: ("1") + * Priority BitKey: ("1") + * Original BitKey: ("5", "31") + * Filtered BitKey: ("5", "31") - BitKey ivBitKey; + * Priority BitKey: ("2", "7") + * Original BitKey: ("2", "5", "31") + * Filtered BitKey: ("2", "5", "31") + * Priority BitKey: ("2", "7") + * Original BitKey: ("2", "7", "31") + * Filtered BitKey: ("2", "7") + */ +class FilterPriority : public FilterClass +{ + public: + + /** + * @brief Constructor + * @param i_ble ptr bit list string encoding + */ + FilterPriority(const char * i_ble) + : ivBitKey(i_ble) + {} + + + /*! + Constructor + \param iBitList BitKey + */ + FilterPriority(const BitKey & iBitList) + : ivBitKey(iBitList) + {} + + /** + * @brief Applies priority filter on given bitkey. + * @param i_bitList bitkey on which filter acts. + * @param io_sdc reference to STEP_CODE_DATA struct. + * @return true if bit key is modified false otherwise. + */ + virtual bool Apply( BitKey & ioBitList, STEP_CODE_DATA_STRUCT & io_sdc ); + + protected: + + BitKey ivBitKey; }; //! PrioritySingleBitFilter /*! - PrioritySingleBitFilter removes all but one bit from a BitKey object. - Priority (to not be removed) is given to the bits specified and in the order - specified. - @par Example - @code - const char * const BIT_LIST_STRING_31_26 = "\x20\x1B"; // priority bits - PrioritySingleBitFilter psbFilter(BIT_LIST_STRING_31_26); - ScanCommRegisterChip scr(...); // see iipScanCommRegisterChip.h - ResolutionMap resMap(...); // see iipResolutionMap.h - - // when the error register is read, the resulting list of bits on - // is passed to psbFilter. the result is used to look up a resolution - // in the ResultionMapa resMap and the resolution is called - ErrorRegisterMask ereg(scr,resMap,&psbFilter); - ... - rc = ereg.Analyze(serviceData); // See iipErrorRegisterMask.h - // ereg will apply filter prioritizing bit 31 then bit 26 - // and finally any remaining bits - @endcode - @par functionality - - if no priority bits exist in BitKey object then - - eliminate all but first entry in list - - else if priority bits exist then - - eliminate all non-priority bit entries - - if multiple priority bit entries exist then elminate all but one, - favoring the first qualified entry found in the list. +PrioritySingleBitFilter removes all but one bit from a BitKey object. +Priority (to not be removed) is given to the bits specified and in the order +specified. +@par Example +@code + const char * const BIT_LIST_STRING_31_26 = "\x20\x1B"; // priority bits + PrioritySingleBitFilter psbFilter(BIT_LIST_STRING_31_26); + ScanCommRegisterChip scr(...); // see iipScanCommRegisterChip.h + ResolutionMap resMap(...); // see iipResolutionMap.h + + // when the error register is read, the resulting list of bits on + // is passed to psbFilter. the result is used to look up a resolution + // in the ResultionMapa resMap and the resolution is called + ErrorRegisterMask ereg(scr,resMap,&psbFilter); + ... + rc = ereg.Analyze(serviceData); // See iipErrorRegisterMask.h + // ereg will apply filter prioritizing bit 31 then bit 26 + // and finally any remaining bits +@endcode +@par functionality +- if no priority bits exist in BitKey object then +- eliminate all but first entry in list +- else if priority bits exist then +- eliminate all non-priority bit entries +- if multiple priority bit entries exist then elminate all but one, + favoring the first qualified entry found in the list. */ class PrioritySingleBitFilter : public FilterClass { -public: - - /** - Constructor - @param pbls Priority bit list string: list of bit positions that have priority - @note bit position priority values in pbls are the bit position + 1 of the bit list, - thus to prioritize bit positions 0,1, & 2 in the bit list, pbls would = "\x01\x02\x03"; - */ - PrioritySingleBitFilter(const char * pbls = NULL) + public: + + /** + * @brief Constructor + * @param pbls list of bit positions that have priority + * @note bit position priority values in pbls are the bit position + 1 of + * the bit list, thus to prioritize bit positions 0,1, & 2 in the bit list, + * pbls would = "\x01\x02\x03"; + */ + PrioritySingleBitFilter(const char * pbls = NULL) { if (NULL != pbls) { @@ -208,243 +211,199 @@ public: } }; - PrioritySingleBitFilter(const std::vector<uint8_t> & pbls) + PrioritySingleBitFilter(const std::vector<uint8_t> & pbls) { iv_bitList = pbls; }; - /** - Apply filter to bit list - @param bit_list : the bit list to filter - @pre none - @post Bit list will only have one value - the one with the highest - priority. If multiple values have equally highest priority then the first - value in the list is used. - @return true of bit list was modified otherwise false - @note If the bit list is empty then it will be left empty. - */ - virtual bool Apply(BitKey & bit_list); + /** + * @brief Apply filter to bitkey. + * Bit list will only have one value - the one with the highest + * priority. If multiple values have equally highest priority then + * the first value in the list is used. + * @param i_bitList bitkey on which seondary filter need to act. + * @param io_sdc reference to STEP_CODE_DATA struct. + * @return true if bit key is modified false otherwise. + */ + virtual bool Apply( BitKey & ioBitList, STEP_CODE_DATA_STRUCT & io_sdc ); -private: // functions -private: // Data + private: // functions + private: // Data - std::vector<uint8_t> iv_bitList; + std::vector<uint8_t> iv_bitList; }; -//! FilterTranspose -/*! - FilterTranspose transposes an exactly matching key to a single bit. If there is not an - exact match, the key is not modified. -*/ +/** + * @brief FilterTranspose + + * FilterTranspose transposes an exactly matching key to a single bit. If there + * is not an exact match, the key is not modified. + */ class FilterTranspose : public FilterPriority { -public: - - /** - Constructor - \param i_bitKey bit list key - \param iBitPos bit to set if i_bitKey matches target. - */ - FilterTranspose(const BitKey &i_bitKey,uint32_t iBitPos) - : FilterPriority(i_bitKey),ivSingleBitPos(iBitPos) - {} - - /** - Apply filter to bit list - \param bit_list : the bit list to filter - \pre none - \post If the provide BitList exactly matches the internal BitList than the provided - bitlist is modified such that all bits are cleared and ivSingleBitPos is set. - \return true of bit list was modified otherwise false - */ - virtual bool Apply(BitKey & iBitList); - - /** - * Undo the filter Apply() - * @post bit_list may be modified - * @Return true if bit_list was modified, otherwise false - * @Note This function will only Undo the transposition if the transposed result bit is on - */ - virtual bool Undo(BitKey & iBitList); - -private: // functions -private: // Data - - uint32_t ivSingleBitPos; + public: + + /** + Constructor + \param i_bitKey bit list key + \param iBitPos bit to set if i_bitKey matches target. + */ + FilterTranspose(const BitKey &i_bitKey,uint32_t iBitPos) + : FilterPriority(i_bitKey),ivSingleBitPos(iBitPos) + {} + + /** + * @brief Applies transpose filter on given bitlist + * If the provide BitList exactly matches the internal BitList than + * the provid bitlist is modified such that all bits are cleared and + * ivSingleBitPos is set. + * @param i_bitList bitkey on which filter acts. + * @param io_sdc reference to STEP_CODE_DATA struct. + * @return true if bit key is modified false otherwise. + */ + virtual bool Apply( BitKey & ioBitList, STEP_CODE_DATA_STRUCT & io_sdc ); + + /** + * Undo the filter Apply() + * @post bit_list may be modified + * @Return true if bit_list was modified, otherwise false + * @Note This function will only Undo the transposition if the transposed + * result bit is on + */ + virtual bool Undo(BitKey & iBitList); + + private: // functions + private: // Data + + uint32_t ivSingleBitPos; }; -//! SingleBitFilter -/*! - Reduces a BitKey to single bit - \code - // usually in chip class header file - SingleBitFilter sbFilter; - ScanCommRegisterChip scr; // @see iipScanCommRegisterChip.h - ResolutionMap resMap; // @see prdfResolutionMap.H - - // in ctor of chip class definition - ErrorRegisterMask ereg(scr,resMap,&sbFilter); - // ... - rc = ereg.Analyze(serviceData); // See iipErrorRegisterMask.h - // ereg will apply filter before analyzing the error - \endcode +/** + * @brief Description of interface for SingleBitFilter. + * + * reduces a BitKey to single bit e.g. + * .... + * ErrorRegisterMask ereg(scr,resMap,&sbFilter); + * rc = ereg.Analyze(serviceData); ( See iipErrorRegisterMask.h ) + * ereg will apply filter before analyzing the error */ + class SingleBitFilter: public FilterClass { -public: - /*! - Constructor - */ - SingleBitFilter(): FilterClass() {} - - /*! - Remove all but one bit from bit_list - \param ioBitList Target bit list - \returns true if ioBitList was modified otherwise false - */ - virtual bool Apply(BitKey & ioBitList); - -private: // functions -private: // Data + public: + + /** + @param Constructor + */ + SingleBitFilter(): FilterClass() {} + + /** + * @brief joins two different filter such that one acts after other. + * @param i_bitList bitkey on which SingleBitFilter filter acts. + * @param io_sdc reference to STEP_CODE_DATA struct. + * @return true if bit key is modified false otherwise. + */ + virtual bool Apply( BitKey & ioBitList, STEP_CODE_DATA_STRUCT & io_sdc ); + + private: // functions + private: // Data }; //! FilterLink /*! - FilterLink links two FILTER_CLASS types together allowing two filters - to act on a single BitKey object. - @code +FilterLink links two FILTER_CLASS types together allowing two filters +to act on a single BitKey object. +@code - Filter * foo(Filter & f1, Filter & f2) - { - Filter * joint = new FilterLink(f1,f2); - return joint; - } - @endcode - */ + Filter * foo(Filter & f1, Filter & f2) + { + Filter * joint = new FilterLink(f1,f2); + return joint; + } +@endcode +*/ class FilterLink: public FilterClass { -public: - /** - Constructor - <ul> - <br><b>Parameters: </b> Two FilterClasss to be linked - <br><b>Requirements:</b> parm filters objects must exist and be valid - <br><b>Promises: </b> Object created - <br><b>Exceptions: </b> N/A - <br><b>Notes: </b> - </ul><br> - */ - FilterLink(FilterClass & f1, FilterClass & f2); - - /* - Destructor - <ul> - <br><b>Parameters: </b> None. - <br><b>Returns: </b> No value returned - <br><b>Requirements:</b> None. - <br><b>Promises: </b> None. - <br><b>Exceptions: </b> None. - <br><b>Notes: </b> Default is sufficient - </ul><br> - */ - // ~xspprdFilterLink(); - - /** - Apply Filter(s) - <ul> - <br><b>Parameters: </b> reference to a BIT_LIST (see iipbtlst.h) - <br><b>Returns: </b> [TRUE | FALSE] - was bit list modified? - <br><b>Requirements:</b> None. - <br><b>Promises: </b> bit_list is modified (if rc == TRUE) - <br><b>Exceptions: </b> N/A - <br><b>Notes: </b> calls all the other associated filters - </ul><br> - */ - virtual bool Apply ( BitKey & bit_list ); - - /** - * Undo the filter Apply() - * @post bit_list may be modified - * @Return true if bit_list was modified, otherwise false - */ - virtual bool Undo(BitKey & iBitList); - -private: // functions -private: // Data - - // may be extended to use a vector if needed - FilterClass & xFilter1; - FilterClass & xFilter2; + public: + + /** + * @brief Constructor + * @param i_f1 first filter. usually existing one. + * @param i_f2 second filter. usually the new one. + */ + FilterLink(FilterClass & f1, FilterClass & f2); + + /** + * @brief joins two different filter such that one can act after other. + * @param i_bitList bitkey on which seondary filter need to act. + * @param io_sdc reference to STEP_CODE_DATA struct. + * @return true if bit key is modified false otherwise. + */ + virtual bool Apply( BitKey & ioBitList, STEP_CODE_DATA_STRUCT & io_sdc ); + + /** + * Undo the filter Apply() + * @post bit_list may be modified + * @Return true if bit_list was modified, otherwise false + */ + virtual bool Undo(BitKey & iBitList); + + private: // functions + private: // Data + + // may be extended to use a vector if needed + FilterClass & xFilter1; + FilterClass & xFilter2; }; +inline FilterLink::FilterLink(FilterClass & f1, FilterClass & f2) +: xFilter1(f1), xFilter2(f2) {} -class SCAN_COMM_REGISTER_CLASS; - -//! ScanCommFilter -/*! - ScanCommFilter reads a HW scom register to determin which bits to - removes bits from a BitKey object - @par Base class Filter - @code - // This class is useful for Error registers whose bits can be - // configured to report different ways depending on another - // enable register. - - ScanCommRegister enableScr(...); // see iipScanCommRegisterChip.h - ScanCommFilter scfFirXstop(enableScr,INVERT); - ScanCommFilter scfFirRer(enableScr,NONINVERT); - ScanCommRegister scr(...); // see iipScanCommRegisterChip.h - ResolutionMap resMap(...); // see iipResolutionMap.h - ErrorRegisterMask eregFirXstop(scr,resMap,&scfFirXstop); - ErrorRegisterMask eregFirRer(scr,resMap,&scfFirRer); - ... - rc = eregFirXstop.Analyze(serviceData); // See iipErrorRegisterMask.h - // ereg will apply filter - @endcode - */ -class ScanCommFilter: public FilterClass +class SecondaryBitsFilter: public FilterClass { -public: - - // Enum for use as the second parameter in the constructor. - enum InvertValue { - NONINVERT = 0x0, - INVERT = 0x1 - }; - - /*! - Constructor - \param r Reference to a scan comm register - \param invert whether or not to bit-wise invert the value from the scan comm read - */ - ScanCommFilter(SCAN_COMM_REGISTER_CLASS & i_r, InvertValue invert = NONINVERT) - : - FilterClass(), - scr(i_r), - xInvert(invert) - { } - - /*! - Turn off bits in bit list based on contents of scan com register - @post bit_list may be modified - @return true if bit_list was modified, otherwise false - */ - virtual bool Apply(BitKey & bit_list); - -private: // functions -private: // Data - SCAN_COMM_REGISTER_CLASS & scr; - InvertValue xInvert; -}; + public: + + /** + * @brief constructor + * @param i_bitList list of bits identified as secondary in a FIR. + * @note This filter maintains a list of bits which it + * considers it as secondary. PRDF analysis is broken in to two + * steps. The first pass is known as primary pass and second pass + * is known as secondary pass. In first pass, secondary filter + * gets activiated but in secondary pass it remains inactive. + * In primary pass, filter ignores all the secondary bits for + * analysis. If primary bits are on, due to action of + * secondary filter, primary pass ends up with return code 0xdd02. + * Inorder to make sure there are really no bits on, secondary + * pass is launched. In this pass, secondary filter doesn't + * operate so analysis continues as usual. Intention of this + * pass is to identify and analyze secondary error bits which were + * ignored during primary pass due to action of this filter. + */ + SecondaryBitsFilter( const std::vector<uint8_t> & i_bitList ) + { + iv_secBitList = i_bitList; + } -inline FilterLink::FilterLink(FilterClass & f1, FilterClass & f2) -: xFilter1(f1), xFilter2(f2) {} + /** + * @brief clears all the bits identified as secondary in the given BitKey. + * @param i_bitList bitkey on which seondary filter need to act. + * @param io_sdc reference to STEP_CODE_DATA struct. + * @return true if bit key is modified false otherwise. + */ + virtual bool Apply( BitKey & ioBitList, STEP_CODE_DATA_STRUCT & io_sdc ); + + private: // data + + std::vector<uint8_t> iv_secBitList; // list of bit pos marked as secondary + +}; } //End namespace PRDF |