From 678f705ab7552ad0695df1c3e2b358f0359f6bfc Mon Sep 17 00:00:00 2001 From: Stephen Glancy Date: Thu, 16 Feb 2017 11:13:28 -0600 Subject: Updates MCBIST to use subtests for FIFO mode FW found a bug where sf_init was timing out because the FIFO settings were not being set correctly. This update fixes that bug by using the subtests in the MCBIST to determine if FIFO mode needs to be run. Change-Id: Ie787a6aaa530ac1763ca04c7f47212bbb0ecdcc7 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36563 Reviewed-by: Louis Stermole Reviewed-by: ANDRE A. MARIN Dev-Ready: STEPHEN GLANCY Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: Thi N. Tran Tested-by: Thi N. Tran Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36601 Reviewed-by: Hostboot Team Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- .../p9/procedures/hwp/memory/lib/mcbist/mcbist.C | 12 +++++ .../p9/procedures/hwp/memory/lib/mcbist/mcbist.H | 51 ++++++++++++++-------- .../p9/procedures/hwp/memory/lib/mcbist/memdiags.H | 3 -- 3 files changed, 44 insertions(+), 22 deletions(-) (limited to 'src/import/chips/p9/procedures/hwp/memory/lib') diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C index 5c7e847a7..4ad610e13 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C @@ -53,6 +53,18 @@ const std::pair mcbistTraits::add { START_ADDRESS_3, END_ADDRESS_3 }, }; +const std::vector< mss::mcbist::op_type > mcbistTraits::FIFO_MODE_REQUIRED_OP_TYPES = +{ + mss::mcbist::op_type::WRITE , + mss::mcbist::op_type::READ , + mss::mcbist::op_type::READ_WRITE , + mss::mcbist::op_type::WRITE_READ , + mss::mcbist::op_type::READ_WRITE_READ , + mss::mcbist::op_type::READ_WRITE_WRITE , + mss::mcbist::op_type::RAND_SEQ , + mss::mcbist::op_type::READ_READ_WRITE , +}; + namespace mcbist { diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H index d548951d8..12258b142 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H @@ -129,6 +129,9 @@ class mcbistTraits // of an index, like master rank. This allows us to do that. static const std::pair address_pairs[]; + // Subtest types that need to be run in FIFO mode + static const std::vector< mss::mcbist::op_type > FIFO_MODE_REQUIRED_OP_TYPES; + enum { // Subtest control bits. These are the same in all '16 bit subtest' field @@ -429,6 +432,25 @@ class subtest_t iv_mcbmr(i_data) {} + /// + /// @brief Checks if the op type requires FIFO mode to be on + /// @return bool fifo_mode_requried - true if FIFO mode is required to be forced on + /// + inline bool fifo_mode_required() const + { + // Gets the op type for this subtest + uint64_t l_value_to_find = 0; + iv_mcbmr.extractToRight(l_value_to_find); + + // Finds if this op type is in the vector that stores the OP types that require FIFO mode to be run + const auto l_op_type_it = std::find(TT::FIFO_MODE_REQUIRED_OP_TYPES.begin(), TT::FIFO_MODE_REQUIRED_OP_TYPES.end(), + l_value_to_find); + + // If the op type is required (aka was found), it will be less than end + // std::find returns the ending iterator if it was not found, so this will return false in that case + return l_op_type_it != TT::FIFO_MODE_REQUIRED_OP_TYPES.end(); + } + /// /// @brief Convert to a 16 bit int /// @return the subtest as a 16 bit integer, useful for testing @@ -1021,7 +1043,6 @@ class program iv_config(0), iv_control(0), iv_async(false), - iv_fifo_mode(true), iv_pattern(PATTERN_0), iv_random24_data_seed(RANDOM24_SEEDS_0), iv_random24_seed_map(RANDOM24_SEED_MAP_0), @@ -2024,18 +2045,6 @@ class program return; } - /// - /// @brief Enable or disable FIFO mode - /// @param[in] i_program the program in question - /// @param[in] i_mode mss::ON to enable, programs will run in FIFO vs mainline mode - /// @return void - /// - inline void change_fifo_mode( const bool i_mode ) - { - iv_fifo_mode = i_mode; - return; - } - /// /// @brief Select the port(s) to be used by the MCBIST /// @param[in] i_ports uint64_t representing the ports. Multiple bits set imply broadcast @@ -2199,7 +2208,6 @@ class program l_equal &= iv_config == i_rhs.iv_config; l_equal &= iv_control == i_rhs.iv_control; l_equal &= iv_async == i_rhs.iv_async; - l_equal &= iv_fifo_mode == i_rhs.iv_fifo_mode; l_equal &= iv_pattern == i_rhs.iv_pattern; l_equal &= iv_thresholds == i_rhs.iv_thresholds; l_equal &= iv_data_rotate_cnfg == i_rhs.iv_data_rotate_cnfg; @@ -2259,9 +2267,6 @@ class program // True iff we want to run in asynchronous mode bool iv_async; - // True if we want to run in FIFO mode - defaults to true as this is needed for most MCBIST tests - bool iv_fifo_mode; - // The pattern for the pattern generator uint64_t iv_pattern; @@ -2846,8 +2851,16 @@ inline fapi2::ReturnCode load_random24b_seeds( const fapi2::Target& i_target, template< fapi2::TargetType T, typename TT = mcbistTraits > inline fapi2::ReturnCode load_fifo_mode( const fapi2::Target& i_target, const mcbist::program& i_program ) { - // if the FIFO load is not needed, just exit out - if(!i_program.iv_fifo_mode) + + // Checks if FIFO mode is required by checking all subtests + const auto l_subtest_it = std::find_if(i_program.iv_subtests.begin(), + i_program.iv_subtests.end(), []( const mss::mcbist::subtest_t& i_rhs) -> bool + { + return i_rhs.fifo_mode_required(); + }); + + // if the FIFO load is not needed (no subtest requiring it was found), just exit out + if(l_subtest_it == i_program.iv_subtests.end()) { return fapi2::FAPI2_RC_SUCCESS; } diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.H b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.H index c60d4a397..dafb88000 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.H @@ -108,9 +108,6 @@ class operation iv_const(i_const) { FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_IS_SIMULATION, fapi2::Target(), iv_is_sim) ); - - // Disables FIFO mode, so memdiags will run in mainline mode - iv_program.change_fifo_mode(false); return; fapi_try_exit: -- cgit v1.2.1