diff options
Diffstat (limited to 'src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C')
-rw-r--r-- | src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C index d17021c7a..e10a0595e 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C +++ b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C @@ -36,6 +36,7 @@ #include <prdfMemScrubUtils.H> #include <prdfMemVcm.H> #include <prdfP9McaExtraSig.H> +#include <UtilHash.H> // for Util::hashString using namespace TARGETING; @@ -271,6 +272,76 @@ uint32_t MemTdCtlr<TYPE_MBA>::checkEcc( bool & o_errorsFound, //------------------------------------------------------------------------------ +template <TARGETING::TYPE T> +void MemTdCtlr<T>::collectStateCaptureData( STEP_CODE_DATA_STRUCT & io_sc, + const char * i_startEnd ) +{ + #define PRDF_FUNC "[MemTdCtlr<T>::collectStateCaptureData] " + + // Get the number of entries in the TD queue (limit 15) + TdQueue::Queue queue = iv_queue.getQueue(); + uint8_t queueCount = queue.size(); + if ( 15 < queueCount ) queueCount = 15; + + // Get the buffer + uint32_t bitLen = 22 + queueCount*10; // Header + TD queue + BitStringBuffer bsb( bitLen ); + uint32_t curPos = 0; + + //###################################################################### + // Header data (18 bits) + //###################################################################### + + // Specifies running at IPL. Also ensures our data is non-zero. 4-bit + bsb.setFieldJustify( curPos, 4, TD_CTLR_DATA::Version::IPL ); curPos+=4; + + uint8_t mrnk = 0; + uint8_t srnk = 0; + uint8_t phase = TdEntry::Phase::TD_PHASE_0; + uint8_t type = TdEntry::TdType::INVALID_EVENT; + + if ( nullptr != iv_curProcedure ) + { + mrnk = iv_curProcedure->getRank().getMaster(); // 3-bit + srnk = iv_curProcedure->getRank().getSlave(); // 3-bit + phase = iv_curProcedure->getPhase(); // 4-bit + type = iv_curProcedure->getType(); // 4-bit + } + + bsb.setFieldJustify( curPos, 3, mrnk ); curPos+=3; + bsb.setFieldJustify( curPos, 3, srnk ); curPos+=3; + bsb.setFieldJustify( curPos, 4, phase ); curPos+=4; + bsb.setFieldJustify( curPos, 4, type ); curPos+=4; + + //###################################################################### + // TD Request Queue (min 4 bits, max 164 bits) + //###################################################################### + + bsb.setFieldJustify( curPos, 4, queueCount ); curPos+=4; // 4-bit + + for ( uint32_t n = 0; n < queueCount; n++ ) + { + uint8_t itMrnk = queue[n]->getRank().getMaster(); // 3-bit + uint8_t itSrnk = queue[n]->getRank().getSlave(); // 3-bit + uint8_t itType = queue[n]->getType(); // 4-bit + + bsb.setFieldJustify( curPos, 3, itMrnk ); curPos+=3; + bsb.setFieldJustify( curPos, 3, itSrnk ); curPos+=3; + bsb.setFieldJustify( curPos, 4, itType ); curPos+=4; + } + + //###################################################################### + // Add the capture data + //###################################################################### + CaptureData & cd = io_sc.service_data->GetCaptureData(); + cd.Add( iv_chip->getTrgt(), Util::hashString(i_startEnd), bsb ); + + + #undef PRDF_FUNC +} + +//------------------------------------------------------------------------------ + // Avoid linker errors with the template. template class MemTdCtlr<TYPE_MCBIST>; template class MemTdCtlr<TYPE_MBA>; |