diff options
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/tests/mss_memdiags_ut.C')
-rw-r--r-- | src/import/chips/p9/procedures/hwp/memory/tests/mss_memdiags_ut.C | 166 |
1 files changed, 123 insertions, 43 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/tests/mss_memdiags_ut.C b/src/import/chips/p9/procedures/hwp/memory/tests/mss_memdiags_ut.C index 1e20269fb..afd81a6bd 100644 --- a/src/import/chips/p9/procedures/hwp/memory/tests/mss_memdiags_ut.C +++ b/src/import/chips/p9/procedures/hwp/memory/tests/mss_memdiags_ut.C @@ -71,45 +71,122 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" REQUIRE_FALSE( FAPI_ATTR_GET(fapi2::ATTR_IS_SIMULATION, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(), is_sim) ); - SECTION("Test thresholds structure") + SECTION("Test stop_condition structure") { - mss::mcbist::thresholds l_t; - REQUIRE( 0 == l_t ); + // Stops default to all conditions off and all thresholded conditions disabled + mss::mcbist::stop_conditions l_t; + REQUIRE( 0xffffffff00000000 == l_t ); { - l_t.set_thresh_mag_nce_int( mss::mcbist::thresholds::DISABLE ); - REQUIRE( 0xf000000000000000 == l_t ); + l_t.set_thresh_nce_int( 0 ); + REQUIRE( 0xffffffff00000000 == l_t ); + + l_t.set_thresh_nce_int( 1 ); + REQUIRE( 0x0fffffff00000000 == l_t ); + + l_t.set_thresh_nce_int( 2 ); + REQUIRE( 0x1fffffff00000000 == l_t ); + + // Because 2^3 is 8 which is the exponent of the nearest rounded down power of 2 (12 - 4 == 8) + l_t.set_thresh_nce_int( 12 ); + REQUIRE( 0x3fffffff00000000 == l_t ); + + l_t.set_thresh_nce_int( mss::mcbist::stop_conditions::DISABLE ); + REQUIRE( 0xffffffff00000000 == l_t ); } { - l_t.set_thresh_mag_nce_soft( mss::mcbist::thresholds::DISABLE ); - REQUIRE( 0xff00000000000000 == l_t ); + l_t.set_thresh_nce_soft( 0 ); + REQUIRE( 0xffffffff00000000 == l_t ); + + l_t.set_thresh_nce_soft( 1 ); + REQUIRE( 0xf0ffffff00000000 == l_t ); + + l_t.set_thresh_nce_soft( 2 ); + REQUIRE( 0xf1ffffff00000000 == l_t ); + + // Because 2^3 is 8 which is the exponent of the nearest rounded down power of 2 (12 - 4 == 8) + l_t.set_thresh_nce_soft( 12 ); + REQUIRE( 0xf3ffffff00000000 == l_t ); + + l_t.set_thresh_nce_soft( mss::mcbist::stop_conditions::DISABLE ); + REQUIRE( 0xffffffff00000000 == l_t ); } { - l_t.set_thresh_mag_nce_hard( mss::mcbist::thresholds::DISABLE ); - REQUIRE( 0xfff0000000000000 == l_t ); + l_t.set_thresh_nce_hard( 0 ); + REQUIRE( 0xffffffff00000000 == l_t ); + + l_t.set_thresh_nce_hard( 1 ); + REQUIRE( 0xff0fffff00000000 == l_t ); + + l_t.set_thresh_nce_hard( 2 ); + REQUIRE( 0xff1fffff00000000 == l_t ); + + l_t.set_thresh_nce_hard( 10 ); + REQUIRE( 0xff3fffff00000000 == l_t ); + + l_t.set_thresh_nce_hard( mss::mcbist::stop_conditions::DISABLE ); + REQUIRE( 0xffffffff00000000 == l_t ); } { - l_t.set_thresh_mag_rce( mss::mcbist::thresholds::DISABLE ); - REQUIRE( 0xffff000000000000 == l_t ); + l_t.set_thresh_rce( 0 ); + REQUIRE( 0xffffffff00000000 == l_t ); + + l_t.set_thresh_rce( 1 ); + REQUIRE( 0xfff0ffff00000000 == l_t ); + + l_t.set_thresh_rce( 2 ); + REQUIRE( 0xfff1ffff00000000 == l_t ); + + l_t.set_thresh_rce( 5 ); + REQUIRE( 0xfff2ffff00000000 == l_t ); + + l_t.set_thresh_rce( mss::mcbist::stop_conditions::DISABLE ); + REQUIRE( 0xffffffff00000000 == l_t ); } // Little method chaining check { - l_t.set_thresh_mag_ice( mss::mcbist::thresholds::DISABLE ) - .set_thresh_mag_mce_int( mss::mcbist::thresholds::DISABLE ); - REQUIRE( 0xffffff0000000000 == l_t ); + memdiags::stop_conditions l_t(0); + l_t.set_thresh_ice( mss::mcbist::stop_conditions::DISABLE ) + .set_thresh_mce_int( mss::mcbist::stop_conditions::DISABLE ); + REQUIRE( 0x0000ff0000000000 == l_t ); } { - l_t.set_thresh_mag_mce_soft( mss::mcbist::thresholds::DISABLE ); - REQUIRE( 0xfffffff000000000 == l_t ); + l_t.set_thresh_mce_soft( 0 ); + REQUIRE( 0xffffffff00000000 == l_t ); + + l_t.set_thresh_mce_soft( 1 ); + REQUIRE( 0xffffff0f00000000 == l_t ); + + l_t.set_thresh_mce_soft( 2 ); + REQUIRE( 0xffffff1f00000000 == l_t ); + + l_t.set_thresh_mce_soft( 10 ); + REQUIRE( 0xffffff3f00000000 == l_t ); + + l_t.set_thresh_mce_soft( mss::mcbist::stop_conditions::DISABLE ); + REQUIRE( 0xffffffff00000000 == l_t ); + } { - l_t.set_thresh_mag_mce_hard( mss::mcbist::thresholds::DISABLE ); + l_t.set_thresh_mce_hard( 0 ); + REQUIRE( 0xffffffff00000000 == l_t ); + + l_t.set_thresh_mce_hard( 1 ); + REQUIRE( 0xfffffff000000000 == l_t ); + + l_t.set_thresh_mce_hard( 2 ); + REQUIRE( 0xfffffff100000000 == l_t ); + + l_t.set_thresh_mce_hard( 7 ); + REQUIRE( 0xfffffff200000000 == l_t ); + + l_t.set_thresh_mce_hard( mss::mcbist::stop_conditions::DISABLE ); REQUIRE( 0xffffffff00000000 == l_t ); } @@ -149,7 +226,7 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" } { - l_t.set_symbol_counter_mode( mss::mcbist::thresholds::DISABLE ); + l_t.set_symbol_counter_mode( mss::mcbist::stop_conditions::DISABLE ); REQUIRE( 0xfffffffffe000600 == l_t ); } @@ -222,11 +299,11 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" REQUIRE( 0x0000000000000081 == l_read ); } - // Load thresholds - default state (expecting 0's) + // Load thresholds - default state (expecting default threshold register state) { fapi2::buffer<uint64_t> l_read; REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MBSTRQ, l_read) ); - REQUIRE( 0x0 == l_read ); + REQUIRE( 0xffffffff00000000 == l_read ); } // Enable maint addressing mode - enabled by default in the mcbist::program ctor @@ -290,13 +367,15 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" { // Loading of patterns is tested in the mcbist unit test. - mss::mcbist::constraints l_const(memdiags::stop_conditions::NO_STOP_ON_ERROR, memdiags::thresholds()); + memdiags::stop_conditions l_stops; + mss::mcbist::constraints l_const(l_stops); // The addresses here are calculated so that we get a few iterations // of polling on an AWAN, but not so much that we run the risk of timing out mss::mcbist::address().get_range<mss::mcbist::address::COL>(l_const.iv_end_address); l_const.iv_end_address.set_column(0b111111); - memdiags::operation<TARGET_TYPE_MCBIST> l_bob(i_target, mss::mcbist::read_subtest<TARGET_TYPE_MCBIST>(), l_const); + memdiags::operation<TARGET_TYPE_MCBIST> l_bob(i_target, mss::mcbist::read_subtest<TARGET_TYPE_MCBIST>(), + l_const); REQUIRE_FALSE( l_bob.multi_port_init() ); REQUIRE_FALSE( l_bob.execute() ); @@ -315,11 +394,11 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" REQUIRE( 0x0000000000000081 == l_read ); } - // Load thresholds - default state (expecting 0's) + // Load thresholds - default state (expecting default threshold register state) { fapi2::buffer<uint64_t> l_read; REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MBSTRQ, l_read) ); - REQUIRE( 0x0 == l_read ); + REQUIRE( 0xffffffff00000000 == l_read ); } // Enable maint addressing mode - enabled by default in the mcbist::program ctor @@ -390,8 +469,7 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" l_start.set_bank_group(0); l_start.set_column(0); - REQUIRE_FALSE( memdiags::sf_read(i_target, mss::mcbist::stop_conditions::STOP_AFTER_ADDRESS, - mss::mcbist::thresholds(), l_start) ); + REQUIRE_FALSE( memdiags::sf_read(i_target, mss::mcbist::stop_conditions(), l_start) ); // Check the things we default to so that we have a canary in case the defaults change // Zero out cmd timebase - mcbist::program constructor does that for us. @@ -405,14 +483,14 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" { fapi2::buffer<uint64_t> l_read; REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBCFGQ, l_read) ); - REQUIRE( 0x00000000000000a9 == l_read ); + REQUIRE( 0x00000000000000a1 == l_read ); } - // Load thresholds - default state (expecting 0's) + // Load thresholds - default state (expecting default threshold register state) { fapi2::buffer<uint64_t> l_read; REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MBSTRQ, l_read) ); - REQUIRE( 0x0 == l_read ); + REQUIRE( 0xffffffff00000000 == l_read ); } // Enable maint addressing mode - enabled by default in the mcbist::program ctor @@ -447,7 +525,8 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" poll_parameters l_poll_parameters; bool l_poll_results = mss::poll(i_target, MCBIST_MCBISTFIRQ, l_poll_parameters, - [&l_status](const size_t poll_remaining, const fapi2::buffer<uint64_t>& stat_reg) -> bool + [&l_status](const size_t poll_remaining, + const fapi2::buffer<uint64_t>& stat_reg) -> bool { FAPI_DBG("mcbist firq 0x%llx, remaining: %d", stat_reg, poll_remaining); l_status = stat_reg; @@ -488,7 +567,7 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" l_start.set_bank_group(0); l_start.set_column(0); - REQUIRE_FALSE( memdiags::background_scrub(i_target, memdiags::stop_conditions::NO_STOP_ON_ERROR, memdiags::thresholds(), + REQUIRE_FALSE( memdiags::background_scrub(i_target, memdiags::stop_conditions(), memdiags::speed::BG_SCRUB, l_start) ); // check the state of the mcbist engine @@ -581,13 +660,13 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" SECTION("Test targeted scrub") { // Test that passing in no-stop is a bug - REQUIRE( memdiags::targeted_scrub(i_target, memdiags::stop_conditions::DONT_STOP, memdiags::thresholds(), + REQUIRE( memdiags::targeted_scrub(i_target, memdiags::stop_conditions(), memdiags::speed::LUDICROUS, mss::mcbist::address(), - memdiags::end_boundary::MASTER_RANK) ); + memdiags::end_boundary::NONE) ); - REQUIRE_FALSE( memdiags::targeted_scrub(i_target, memdiags::stop_conditions::STOP_AFTER_RANK, memdiags::thresholds(), + REQUIRE_FALSE( memdiags::targeted_scrub(i_target, memdiags::stop_conditions(), memdiags::speed::LUDICROUS, mss::mcbist::address(), - memdiags::end_boundary::MASTER_RANK) ); + memdiags::end_boundary::STOP_AFTER_MASTER_RANK) ); // Make sure targeted scrub sets the FIR bit. More for verifying our actions than // anything else @@ -623,7 +702,7 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" { fapi2::buffer<uint64_t> l_read; REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBCFGQ, l_read) ); - REQUIRE( 0x0000000020000021 == l_read ); + REQUIRE( 0x0000000020000041 == l_read ); } } @@ -639,8 +718,8 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" l_start_address.get_range<mss::mcbist::address::MRANK>(l_end_address); l_start_address = l_end_address - 10; - memdiags::constraints l_const(memdiags::stop_conditions::STOP_AFTER_RANK, memdiags::thresholds(), - memdiags::speed::LUDICROUS, memdiags::end_boundary::MASTER_RANK, + memdiags::constraints l_const(memdiags::stop_conditions(), memdiags::speed::LUDICROUS, + memdiags::end_boundary::STOP_AFTER_MASTER_RANK, l_start_address); l_const.iv_end_address = l_end_address; @@ -666,7 +745,8 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" fapi2::buffer<uint64_t> l_last_address; bool l_poll_results = mss::poll(i_target, MCBIST_MCBISTFIRQ, l_poll_parameters, - [&l_status](const size_t poll_remaining, const fapi2::buffer<uint64_t>& stat_reg) -> bool + [&l_status](const size_t poll_remaining, + const fapi2::buffer<uint64_t>& stat_reg) -> bool { FAPI_DBG("mcbist firq 0x%llx, remaining: %d", stat_reg, poll_remaining); l_status = stat_reg; @@ -692,14 +772,14 @@ TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]" } // We asked to stop at the end of a rank, so we should not be able to continue to the end of the rank - REQUIRE( memdiags::continue_cmd(i_target, memdiags::end_boundary::MRANK, memdiags::stop_conditions::STOP_AFTER_RANK) ); + REQUIRE( memdiags::continue_cmd(i_target, memdiags::end_boundary::STOP_AFTER_MASTER_RANK) ); // Continue but ask to stop at the end of the subtest - REQUIRE_FALSE( memdiags::continue_cmd(i_target, memdiags::end_boundary::NONE, - memdiags::stop_conditions::STOP_AFTER_SUBTEST) ); + REQUIRE_FALSE( memdiags::continue_cmd(i_target, memdiags::end_boundary::STOP_AFTER_SUBTEST) ); l_poll_results = mss::poll(i_target, MCBIST_MCBISTFIRQ, l_poll_parameters, - [&l_status](const size_t poll_remaining, const fapi2::buffer<uint64_t>& stat_reg) -> bool + [&l_status](const size_t poll_remaining, + const fapi2::buffer<uint64_t>& stat_reg) -> bool { FAPI_DBG("mcbist firq 0x%llx, remaining: %d", stat_reg, poll_remaining); l_status = stat_reg; |