diff options
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C | 75 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H | 16 |
2 files changed, 42 insertions, 49 deletions
diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C index 4dc7668d3..d09721414 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C @@ -31,6 +31,9 @@ #include <iipServiceDataCollector.h> #include <UtilHash.H> +// Platform includes +#include <prdfMemThresholds.H> + using namespace TARGETING; namespace PRDF @@ -98,6 +101,42 @@ uint32_t MemCeTable<T>::addEntry( const MemAddr & i_addr, // removing any entries, if the table is full. This is to catch the corner // case where the oldest entry is on the same rank as the new entry. + // Check MNFG thresholds, if needed. + if ( mfgMode() ) + { + // Get the MNFG CE thresholds. + uint32_t dramTh, rankTh, dimmTh; + getMnfgMemCeTh<T>( iv_chip, thisRank, dramTh, rankTh, dimmTh ); + + // Get MNFG counts from CE table. + uint32_t dramCount = 0, rankCount = 0, dimmCount = 0; + for ( auto & entry : iv_table ) + { + if ( i_symbol.getPortSlct() != entry.portSlct ) continue; + + MemRank itRank = entry.addr.getRank(); + + if ( thisRank.getDimmSlct() == itRank.getDimmSlct() ) + { + dimmCount++; + + if ( thisRank == itRank ) + { + rankCount++; + + if ( i_symbol.getDram() == entry.dram ) + dramCount++; + } + } + } + + // Check thresholds. Note that the thresholds are the number allowed. + // So we have to compare if the counts have exceeded the thresholds. + if ( dramTh < dramCount ) o_rc |= MNFG_TH_DRAM; + if ( rankTh < rankCount ) o_rc |= MNFG_TH_RANK; + if ( dimmTh < dimmCount ) o_rc |= MNFG_TH_DIMM; + } + // If the table is full, remove the oldest inactive entry if ( MAX_ENTRIES < iv_table.size() ) { @@ -143,42 +182,6 @@ void MemCeTable<T>::deactivateRank( const MemRank & i_rank ) //------------------------------------------------------------------------------ template <TARGETING::TYPE T> -void MemCeTable<T>::getMnfgCounts( const MemRank & i_rank, - const MemSymbol & i_symbol, - uint32_t & o_dramCount, - uint32_t & o_rankCount, - uint32_t & o_dimmCount ) -{ - o_dramCount = 0; o_rankCount = 0; o_dimmCount = 0; - - const uint32_t dram = i_symbol.getDram(); - const uint32_t ps = i_symbol.getPortSlct(); - const uint32_t ds = i_rank.getDimmSlct(); - - for ( auto & entry : iv_table ) - { - if ( ps != entry.portSlct ) continue; - - MemRank itRank = entry.addr.getRank(); - - if ( ds == itRank.getDimmSlct() ) - { - o_dimmCount++; - - if ( i_rank == itRank ) - { - o_rankCount++; - - if ( dram == entry.dram ) - o_dramCount++; - } - } - } -} - -//------------------------------------------------------------------------------ - -template <TARGETING::TYPE T> void MemCeTable<T>::addCapData( CaptureData & io_cd ) { static const size_t sz_word = sizeof(CPU_WORD); diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H index cc620853d..18a9fa12f 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H @@ -62,6 +62,9 @@ class MemCeTable ENTRY_TH_REACHED = 0x01, ///< The entry threshold has been reached. RANK_TH_REACHED = 0x02, ///< The rank threshold has been reached. TABLE_FULL = 0x04, ///< The table is full of active entries. + MNFG_TH_DRAM = 0x08, ///< MNFG DRAM threshold reached. + MNFG_TH_RANK = 0x10, ///< MNFG rank threshold reached. + MNFG_TH_DIMM = 0x20, ///< MNFG DIMM threshold reached. }; private: // constants, enums @@ -112,19 +115,6 @@ class MemCeTable void deactivateRank( const MemRank & i_rank ); /** - * @brief Iterates the entire table and returns the number of unique entries - * that exist for the target DRAM, half-rank, logical DIMM. - * @param i_rank The failing rank. - * @param i_symbol The failing symbol. - * @param o_dramCount The entry count for the target dram. - * @param o_rankCount The entry count for the target rank per logical DIMM. - * @param o_dimmCount The entry count for the target logical DIMM. - */ - void getMnfgCounts( const MemRank & i_rank, const MemSymbol & i_symbol, - uint32_t & o_dramCount, uint32_t & o_rankCount, - uint32_t & o_dimmCount ); - - /** * @brief Gathers all table data to be stored in capture data. * @param io_cd Capture data struct. */ |