summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp
diff options
context:
space:
mode:
authorcrgeddes <crgeddes@us.ibm.com>2016-09-16 14:24:47 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2016-09-16 17:21:04 -0400
commit83ec59e9039de5f825b8932f4ce1631645f2a6e1 (patch)
tree739943aec9dd04820e3e17d5845ca0aa4e63457a /src/import/chips/p9/procedures/hwp
parent1597602794614bf97a61f68def280c8414ebf729 (diff)
downloadtalos-hostboot-83ec59e9039de5f825b8932f4ce1631645f2a6e1.tar.gz
talos-hostboot-83ec59e9039de5f825b8932f4ce1631645f2a6e1.zip
Remove EKB's unit test files
Somehow some of the HWP writer's unit tests got mirrored into the Hostboot repo and are causing mirror issues. We do not want these files and never will so I am removing them. Change-Id: Ibbeda099c963e50f3d6a5c1ce3526b5f0dc8e1e5 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29863 Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Tested-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/tests/mss_memdiags_ut.C842
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/tests/mss_rdimm_decoder_ut.C564
2 files changed, 0 insertions, 1406 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
deleted file mode 100644
index 547a3096a..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/tests/mss_memdiags_ut.C
+++ /dev/null
@@ -1,842 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/tests/mss_memdiags_ut.C $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
-/* [+] 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. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-
-///
-/// @file mss_memdiags_ut.C
-/// @brief Unit tests for memory MEMDIAGS functions
-///
-// *HWP HWP Owner: Brian Silver <bsilver@us.ibm.com>
-// *HWP FW Owner: Marc Gollub <gollub@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 4
-// *HWP Consumed by: CI
-//#pragma once
-
-#include <cstdarg>
-
-#include <mss.H>
-#include <catch.hpp>
-
-#include <lib/mcbist/mcbist.H>
-#include <lib/mcbist/memdiags.H>
-#include <lib/mcbist/address.H>
-#include <lib/mcbist/settings.H>
-#include <lib/eff_config/memory_size.H>
-#include <lib/fir/memdiags_fir.H>
-
-#include <lib/utils/poll.H>
-#include <lib/utils/count_dimm.H>
-#include <tests/target_fixture.H>
-
-using fapi2::FAPI2_RC_SUCCESS;
-using fapi2::TARGET_TYPE_MCBIST;
-using fapi2::TARGET_TYPE_MCA;
-using fapi2::TARGET_TYPE_MCS;
-using fapi2::TARGET_TYPE_DIMM;
-
-namespace mss
-{
-namespace test
-{
-
-/**
- * @brief Test Case for memdiags
- * @note mcbist_target_test_fixture is the fixture to use with this test case
- */
-TEST_CASE_METHOD(mss::test::mcbist_target_test_fixture, "memdiags", "[memdiags]")
-{
- // Don't count the invalid maint address - we know we're setting that.
- fapi2::buffer<uint64_t> l_fir_mask;
- l_fir_mask.setBit<MCBIST_MCBISTFIRQ_INVALID_MAINT_ADDRESS>().invert();
-
- // Loops over MCBIST targets that were defined in the associated config
- for_each_target([l_fir_mask](const fapi2::Target<TARGET_TYPE_MCBIST>& i_target)
- {
-
- uint8_t is_sim = 0;
- REQUIRE_FALSE( FAPI_ATTR_GET(fapi2::ATTR_IS_SIMULATION,
- fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(), is_sim) );
-
- SECTION("Test stop_condition structure")
- {
- // 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_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_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_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_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
- {
- 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_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_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 );
- }
-
- {
- l_t.set_pause_on_sce( mss::ON );
- REQUIRE( 0xffffffff80000000 == l_t );
- }
-
- {
- l_t.set_pause_on_mce( mss::ON );
- REQUIRE( 0xffffffffc0000000 == l_t );
- }
-
- {
- l_t.set_pause_on_mpe( mss::ON );
- REQUIRE( 0xffffffffe0000000 == l_t );
- }
-
- {
- l_t.set_pause_on_ue( mss::ON );
- REQUIRE( 0xfffffffff0000000 == l_t );
- }
-
- {
- l_t.set_pause_on_sue( mss::ON );
- REQUIRE( 0xfffffffff8000000 == l_t );
- }
-
- {
- l_t.set_pause_on_aue( mss::ON );
- REQUIRE( 0xfffffffffc000000 == l_t );
- }
-
- {
- l_t.set_pause_on_rcd( mss::ON );
- REQUIRE( 0xfffffffffe000000 == l_t );
- }
-
- {
- l_t.set_symbol_counter_mode( mss::mcbist::stop_conditions::DISABLE );
- REQUIRE( 0xfffffffffe000600 == l_t );
- }
-
- {
- l_t.set_nce_hard_symbol_count_enable( mss::ON );
- REQUIRE( 0xfffffffffe000640 == l_t );
- }
-
- {
- l_t.set_pause_mcb_error( mss::ON );
- REQUIRE( 0xfffffffffe000660 == l_t );
- }
-
- {
- l_t.set_pause_mcb_log_full( mss::ON );
- REQUIRE( 0xfffffffffe000670 == l_t );
- }
-
- {
- l_t.set_maint_rce_with_ce( mss::ON );
- REQUIRE( 0xfffffffffe000678 == l_t );
- }
-
- {
- l_t.set_mce_soft_symbol_count_enable( mss::ON );
- REQUIRE( 0xfffffffffe00067c == l_t );
- }
-
- {
- l_t.set_mce_inter_symbol_count_enable( mss::ON );
- REQUIRE( 0xfffffffffe00067e == l_t );
- }
-
- {
- l_t.set_mce_hard_symbol_count_enable( mss::ON );
- REQUIRE( 0xfffffffffe00067f == l_t );
- }
- }
-
-
- // If there are no DIMM we don't need to bother.
- if (mss::count_dimm(i_target) == 0)
- {
- return 0;
- }
-
-
- // Note that the testing of the memdiags operations leverages the helper directly
- // is it is more flexible allowing better control over simulation environments.
- SECTION("Test sf_init")
- {
- // Loading of patterns is tested in the mcbist unit test.
-
- mss::mcbist::constraints l_const(memdiags::PATTERN_5);
-
- FAPI_INF("\n\n\n start sf_init\n\n\n");
-
- // 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::init_subtest<TARGET_TYPE_MCBIST>(), l_const);
- REQUIRE_FALSE( l_bob.multi_port_init() );
- REQUIRE_FALSE( l_bob.execute() );
-
- // 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.
- {
- fapi2::buffer<uint64_t> l_read;
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBPARMQ, l_read) );
- REQUIRE( 0 == l_read );
- }
-
- // Load stop conditions - default state - already 0's from mcbist::program's ctor.
- {
- fapi2::buffer<uint64_t> l_read;
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBCFGQ, l_read) );
- REQUIRE( 0x0000000000000080 == l_read );
- }
-
- // 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( 0xffffffff00000000 == l_read );
- }
-
- // Enable maint addressing mode - enabled by default in the mcbist::program ctor
- {
- fapi2::buffer<uint64_t> l_read;
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBAGRAQ, l_read) );
- REQUIRE( 0x0020000000000000 == l_read );
- }
-
- // Check the address registers
- {
- fapi2::buffer<uint64_t> l_read;
-
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBSA0Q, l_read) );
- REQUIRE(l_read == 0x0);
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBEA0Q, l_read) );
- REQUIRE(l_read == 0x0000001ffc000000);
- }
-
- // Poll for the fir bit. We expect this to be set ...
- fapi2::buffer<uint64_t> l_status;
- fapi2::buffer<uint64_t> l_last_address;
-
- // A small vector of addresses to poll during the polling loop
- static const std::vector<mss::poll_probe<fapi2::TARGET_TYPE_MCBIST>> l_probes =
- {
- {i_target, "mcbist current address", MCBIST_MCBMCATQ},
- };
-
- 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
- {
- FAPI_DBG("mcbist firq 0x%llx, remaining: %d", stat_reg, poll_remaining);
- l_status = stat_reg;
- return l_status.getBit<MCBIST_MCBISTFIRQ_MCBIST_PROGRAM_COMPLETE>() == true;
- },
- l_probes);
-
- // Pass or fail output the current address. This is useful for debugging when we can get it.
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBMCATQ, l_last_address) );
- FAPI_INF("MCBIST last address: 0x%016lx", l_last_address);
-
- REQUIRE( l_poll_results == true );
-
- // Check for errors
- {
- fapi2::buffer<uint64_t> l_read;
-
- REQUIRE( 0x20000000000000 == (l_status & l_fir_mask) );
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBSTATQ, l_read) );
- REQUIRE(l_read == 0);
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MBSEC1Q, l_read) );
- REQUIRE(l_read == 0);
- }
-
- }
-
-
- SECTION("Test sf_read")
- {
- // Loading of patterns is tested in the mcbist unit test.
-
- 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);
- REQUIRE_FALSE( l_bob.multi_port_init() );
- REQUIRE_FALSE( l_bob.execute() );
-
- // 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.
- {
- fapi2::buffer<uint64_t> l_read;
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBPARMQ, l_read) );
- REQUIRE( 0 == l_read );
- }
-
- // Load stop conditions - default state - already 0's from mcbist::program's ctor.
- {
- fapi2::buffer<uint64_t> l_read;
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBCFGQ, l_read) );
- REQUIRE( 0x0000000000000080 == l_read );
- }
-
- // 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( 0xffffffff00000000 == l_read );
- }
-
- // Enable maint addressing mode - enabled by default in the mcbist::program ctor
- {
- fapi2::buffer<uint64_t> l_read;
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBAGRAQ, l_read) );
- REQUIRE( 0x0020000000000000 == l_read );
- }
-
- // Check the address registers
- {
- fapi2::buffer<uint64_t> l_read;
-
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBSA0Q, l_read) );
- REQUIRE(l_read == 0x0);
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBEA0Q, l_read) );
- REQUIRE(l_read == 0x0000001ffc000000);
- }
-
- // Poll for the fir bit. We expect this to be set ...
- fapi2::buffer<uint64_t> l_status;
- fapi2::buffer<uint64_t> l_last_address;
-
- // A small vector of addresses to poll during the polling loop
- static const std::vector<mss::poll_probe<fapi2::TARGET_TYPE_MCBIST>> l_probes =
- {
- {i_target, "mcbist current address", MCBIST_MCBMCATQ},
- };
-
- 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
- {
- FAPI_DBG("mcbist firq 0x%llx, remaining: %d", stat_reg, poll_remaining);
- l_status = stat_reg;
- return l_status.getBit<MCBIST_MCBISTFIRQ_MCBIST_PROGRAM_COMPLETE>() == true;
- },
- l_probes);
-
- // Pass or fail output the current address. This is useful for debugging when we can get it.
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBMCATQ, l_last_address) );
- FAPI_INF("MCBIST last address: 0x%016lx", l_last_address);
-
- REQUIRE( l_poll_results == true );
-
- // Check for errors
- {
- fapi2::buffer<uint64_t> l_read;
-
- REQUIRE( 0x20000000000000 == (l_status & l_fir_mask) );
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBSTATQ, l_read) );
- REQUIRE(l_read == 0);
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MBSEC1Q, l_read) );
- REQUIRE(l_read == 0);
- }
- }
-
-
- SECTION("Test sf_read to end of port")
- {
- // Loading of patterns is tested in the mcbist unit test.
-
- // 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 l_start;
- mss::mcbist::address().get_range<mss::mcbist::address::DIMM>(l_start);
- l_start.set_bank(0);
- l_start.set_bank_group(0);
- l_start.set_column(0);
-
- 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.
- {
- fapi2::buffer<uint64_t> l_read;
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBPARMQ, l_read) );
- REQUIRE( 0 == l_read );
- }
-
- // Load stop conditions - default state - already 0's from mcbist::program's ctor.
- {
- fapi2::buffer<uint64_t> l_read;
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBCFGQ, l_read) );
- REQUIRE( 0x00000000000000a0 == l_read );
- }
-
- // 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( 0xffffffff00000000 == l_read );
- }
-
- // Enable maint addressing mode - enabled by default in the mcbist::program ctor
- {
- fapi2::buffer<uint64_t> l_read;
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBAGRAQ, l_read) );
- REQUIRE( 0x0020000000000000 == l_read );
- }
-
- // Check the address registers
- {
- fapi2::buffer<uint64_t> l_read;
-
- // We use different address end boundaries if we're in sim or not.
- const uint64_t l_end_expect = is_sim ? 0x1fffffe07c000000 : 0x1ffffffffc000000;
-
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBSA0Q, l_read) );
- REQUIRE(l_read == 0x1fffffc000000000);
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBEA0Q, l_read) );
- REQUIRE(l_read == l_end_expect);
- }
-
- // Poll for the fir bit. We expect this to be set ...
- fapi2::buffer<uint64_t> l_status;
- fapi2::buffer<uint64_t> l_last_address;
-
- // A small vector of addresses to poll during the polling loop
- static const std::vector<mss::poll_probe<fapi2::TARGET_TYPE_MCBIST>> l_probes =
- {
- {i_target, "mcbist current address", MCBIST_MCBMCATQ},
- };
-
- 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
- {
- FAPI_DBG("mcbist firq 0x%llx, remaining: %d", stat_reg, poll_remaining);
- l_status = stat_reg;
- return l_status.getBit<MCBIST_MCBISTFIRQ_MCBIST_PROGRAM_COMPLETE>() == true;
- },
- l_probes);
-
- // Pass or fail output the current address. This is useful for debugging when we can get it.
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBMCATQ, l_last_address) );
- FAPI_INF("MCBIST last address: 0x%016lx", l_last_address);
-
- REQUIRE( l_poll_results == true );
-
- // Check for errors
- {
- fapi2::buffer<uint64_t> l_read;
-
- REQUIRE( 0x20000000000000 == (l_status & l_fir_mask) );
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBSTATQ, l_read) );
- REQUIRE(l_read == 0);
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MBSEC1Q, l_read) );
- REQUIRE(l_read == 0);
- }
-
- }
-
- SECTION("Test continuous scrub")
- {
- // How many DIMM do we have? This effects the subtests we create
- const auto l_dimm_count = mss::find_targets<TARGET_TYPE_DIMM>(i_target).size();
- FAPI_INF("seeing %d DIMM", l_dimm_count);
-
- // 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 l_start;
- mss::mcbist::address().get_range<mss::mcbist::address::DIMM>(l_start);
- l_start.set_bank(0);
- l_start.set_bank_group(0);
- l_start.set_column(0);
-
- REQUIRE_FALSE( memdiags::background_scrub(i_target, memdiags::stop_conditions(),
- memdiags::speed::BG_SCRUB, l_start) );
-
- // check the state of the mcbist engine
-
- // Check the iv_parameters
- {
- fapi2::buffer<uint64_t> l_read;
- uint64_t l_size;
- REQUIRE_FALSE( mss::eff_memory_size(i_target, l_size) );
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBPARMQ, l_read) );
-
- FAPI_INF("seeing memory size %d", l_size);
-
- switch (l_size)
- {
- case 128:
- REQUIRE(l_read == 0x0068000000000000);
- break;
-
- case 64:
- REQUIRE(l_read == 0x00C8000000000000);
- break;
-
- case 32:
- REQUIRE(l_read == 0x0198000000000000);
- break;
-
- default:
- FAIL("Memory size not supported");
- break;
- };
- }
-
- // Check the address registers
- {
- // Address config 0 should have the start and end for a complete DIMM (in sim)
- fapi2::buffer<uint64_t> l_read;
-
- // We use different address end boundaries if we're in sim or not.
- const uint64_t l_end_expect = is_sim ? 0x000000207C000000 : 0x1ffffffffc000000;
-
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBSA0Q, l_read) );
- REQUIRE(l_read == 0x0);
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBEA0Q, l_read) );
- REQUIRE(l_read == l_end_expect);
- }
- {
- // Address 1 should have the start we configured and an end which is the
- // real end of the DIMM address range
- fapi2::buffer<uint64_t> l_read;
-
- // We use different address end boundaries if we're in sim or not.
- const uint64_t l_end_expect = is_sim ? 0x1fffffe07c000000 : 0x1ffffffffc000000;
-
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBSA1Q, l_read) );
- REQUIRE(l_read == 0x1fffffc000000000);
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBEA1Q, l_read) );
- REQUIRE(l_read == l_end_expect);
- }
-
- // Check the subtests
- {
- if (l_dimm_count == 8)
- {
- fapi2::buffer<uint64_t> l_read;
-
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBMR0Q, l_read) );
- REQUIRE(l_read == 0x9009718090089208);
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBMR1Q, l_read) );
- REQUIRE(l_read == 0x9408960898089a08);
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBMR2Q, l_read) );
- REQUIRE(l_read == 0x9c089e0871040000);
- }
- }
-
- // Make sure continuous scrub doesn't set the FIR bit. More for verifying our actions than
- // anything else
- {
- fapi2::buffer<uint64_t> l_read;
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBISTFIRQ, l_read) );
- REQUIRE( l_read.getBit<MCBIST_MCBISTFIRQ_MCBIST_PROGRAM_COMPLETE>() == false );
- }
-
- // We should have the LEN64 bit turned off
- {
- fapi2::buffer<uint64_t> l_read;
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBCFGQ, l_read) );
- REQUIRE( 0x0000000000000000 == l_read );
- }
-
-
- }
-
- SECTION("Test targeted scrub")
- {
- // Test that passing in no-stop is a bug
- REQUIRE( memdiags::targeted_scrub(i_target, memdiags::stop_conditions(),
- memdiags::speed::LUDICROUS, mss::mcbist::address(),
- memdiags::end_boundary::NONE) );
-
- REQUIRE_FALSE( memdiags::targeted_scrub(i_target, memdiags::stop_conditions(),
- memdiags::speed::LUDICROUS, mss::mcbist::address(),
- memdiags::end_boundary::STOP_AFTER_MASTER_RANK) );
-
- // Make sure targeted scrub sets the FIR bit. More for verifying our actions than
- // anything else
- {
- fapi2::buffer<uint64_t> l_read;
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBISTFIRQ, l_read) );
- REQUIRE( l_read.getBit<MCBIST_MCBISTFIRQ_MCBIST_PROGRAM_COMPLETE>() == true );
- }
-
- // Check the address registers
- {
- // Address config 0 should have the start and end for a complete DIMM (in sim)
- fapi2::buffer<uint64_t> l_read;
-
- // We use different address end boundaries if we're in sim or not.
- const uint64_t l_end_expect = is_sim ? 0x000000207C000000 : 0x1ffffffffc000000;
-
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBSA0Q, l_read) );
- REQUIRE(l_read == 0x0);
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBEA0Q, l_read) );
- REQUIRE(l_read == l_end_expect);
- }
-
- // Check the subtests
- {
- fapi2::buffer<uint64_t> l_read;
-
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBMR0Q, l_read) );
- REQUIRE(l_read == 0x900c000000000000);
- }
-
- // We should have the LEN64 bit turned off but we turned on pause-on-rank boundary
- {
- fapi2::buffer<uint64_t> l_read;
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBCFGQ, l_read) );
- REQUIRE( 0x0000000020000040 == l_read );
- }
-
- }
-
- SECTION("Test what happens on stop-after-rank")
- {
- mss::mcbist::address l_start_address;
- mss::mcbist::address l_end_address;
- fapi2::ReturnCode l_rc;
-
- // Make our start be really close to the end of the rank an our end be the end so we
- // can check to see what happens at the end of the rank
- 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(), memdiags::speed::LUDICROUS,
- memdiags::end_boundary::STOP_AFTER_MASTER_RANK,
- l_start_address);
-
- l_const.iv_end_address = l_end_address;
-
- memdiags::targeted_scrub_operation<TARGET_TYPE_MCBIST> l_op(i_target, l_const, l_rc);
-
- REQUIRE_FALSE( l_rc );
-
- // Add a goto on to the end of this program so that if it stops we know it stopped because
- // of the rank boundary.
- l_op.get_program().iv_subtests.push_back(mss::mcbist::goto_subtest<TARGET_TYPE_MCBIST>(0));
-
- REQUIRE_FALSE( l_op.execute() );
-
- // A small vector of addresses to poll during the polling loop
- static const std::vector<mss::poll_probe<fapi2::TARGET_TYPE_MCBIST>> l_probes =
- {
- {i_target, "mcbist current address", MCBIST_MCBMCATQ},
- };
-
- poll_parameters l_poll_parameters;
- fapi2::buffer<uint64_t> l_status;
- 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
- {
- FAPI_DBG("mcbist firq 0x%llx, remaining: %d", stat_reg, poll_remaining);
- l_status = stat_reg;
- return l_status.getBit<MCBIST_MCBISTFIRQ_MCBIST_PROGRAM_COMPLETE>() == true;
- },
- l_probes);
-
- // Pass or fail output the current address. This is useful for debugging when we can get it.
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBMCATQ, l_last_address) );
- FAPI_INF("MCBIST last address: 0x%016lx", l_last_address);
-
- REQUIRE( l_poll_results == true );
-
- // Check for errors
- {
- fapi2::buffer<uint64_t> l_read;
-
- REQUIRE( 0x20000000000000 == (l_status & l_fir_mask) );
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBSTATQ, l_read) );
- REQUIRE(l_read == 0);
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MBSEC1Q, l_read) );
- REQUIRE(l_read == 0);
- }
-
- // 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::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::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
- {
- FAPI_DBG("mcbist firq 0x%llx, remaining: %d", stat_reg, poll_remaining);
- l_status = stat_reg;
- return l_status.getBit<MCBIST_MCBISTFIRQ_MCBIST_PROGRAM_COMPLETE>() == true;
- },
- l_probes);
-
- // Pass or fail output the current address. This is useful for debugging when we can get it.
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBMCATQ, l_last_address) );
- FAPI_INF("MCBIST last address: 0x%016lx", l_last_address);
-
- REQUIRE( l_poll_results == true );
- }
-
- // Reset and check that unmasking sets all the right bits
- {
- REQUIRE_FALSE( mss::putScom(i_target, MCBIST_MCBISTFIRACT0, 0) );
- REQUIRE_FALSE( mss::putScom(i_target, MCBIST_MCBISTFIRACT1, 0) );
- REQUIRE_FALSE( mss::putScom(i_target, MCBIST_MCBISTFIRMASK_AND, 0) );
-
- REQUIRE_FALSE( mss::unmask_memdiags_errors(i_target) );
-
- fapi2::buffer<uint64_t> l_mcbistfir_mask;
- fapi2::buffer<uint64_t> l_mcbistfir_action0;
- fapi2::buffer<uint64_t> l_mcbistfir_action1;
-
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBISTFIRACT0, l_mcbistfir_action0) );
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBISTFIRACT1, l_mcbistfir_action1) );
- REQUIRE_FALSE( mss::getScom(i_target, MCBIST_MCBISTFIRMASK_AND, l_mcbistfir_mask) );
-
- REQUIRE( 0x0020000000000000 == l_mcbistfir_action0);
- REQUIRE( 0x0000000000000000 == l_mcbistfir_action1);
- REQUIRE( 0xffdfffffffffffff == l_mcbistfir_mask);
- }
- return 0;
- });
-}
-
-} // ns test
-} // ns mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/tests/mss_rdimm_decoder_ut.C b/src/import/chips/p9/procedures/hwp/memory/tests/mss_rdimm_decoder_ut.C
deleted file mode 100644
index d6051d1b4..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/tests/mss_rdimm_decoder_ut.C
+++ /dev/null
@@ -1,564 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/tests/mss_rdimm_decoder_ut.C $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
-/* [+] 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. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-///
-/// @file mss_spd_ut.C
-/// @brief Unit tests for spd decoder api
-///
-// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com>
-// *HWP FW Owner: Brian Silver <bsilver@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 4
-// *HWP Consumed by: CI
-
-#include <cstdarg>
-#include <fapi2.H>
-
-#include <mss.H>
-#include <catch.hpp>
-
-#include <tests/target_fixture.H>
-#include <lib/utils/fake_spd.H>
-#include <lib/spd/spd_factory.H>
-#include <lib/spd/common/spd_decoder.H>
-
-using fapi2::TARGET_TYPE_MCBIST;
-using fapi2::TARGET_TYPE_MCS;
-using fapi2::TARGET_TYPE_MCA;
-using fapi2::TARGET_TYPE_DIMM;
-
-namespace mss
-{
-namespace test
-{
-
-// Blob of "bad" SPD data used for unit testing
-// Involves using key-byte values that are not in the SPD maps
-static constexpr uint8_t BAD_SPD[] =
-{
-
-// Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
- 0x35, 0xFF, 0x07, 0x45, 0xDA, 0x3F, 0x83, 0x3A,
-
-// Byte 8 Byte 9 Byte 10 Byte 11 Byte 12 Byte 13 Byte 14 Byte 15
- uint8_t(~0), 0xD0, 0xFF, 0x00, 0x04, 0x1F, 0x80, 0x01,
-
-// Byte 16 Byte 17 Byte 18 Byte 19 Byte 20 Byte 21 Byte 22 Byte 23
- uint8_t(~0), 0x0F, 0x00, 0x00, 0x01, 0x01, 0x01, 0x40,
-
-// Byte 24 Byte 25 Byte 26 Byte 27 Byte 28 Byte 29 Byte 30 Byte 31
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-// Byte 32 Byte 33 Byte 34 Byte 35 Byte 36 Byte 37 Byte 38 Byte 39
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-// Byte 40 Byte 41 Byte 42 Byte 43 Byte 44 Byte 45 Byte 46 Byte 47
- 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
-
-// Byte 48 Byte 49 Byte 50 Byte 51 Byte 52 Byte 53 Byte 54 Byte 55
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-// Byte 56 Byte 57 Byte 58 Byte 59 Byte 60 Byte 61 Byte 62 Byte 63
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-// Byte 64 Byte 65 Byte 66 Byte 67 Byte 68 Byte 69 Byte 70 Byte 71
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-// Byte 72 Byte 73 Byte 74 Byte 75 Byte 76 Byte 77 Byte 78 Byte 79
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-// Byte 80 Byte 81 Byte 82 Byte 83 Byte 84 Byte 85 Byte 86 Byte 87
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-// Byte 88 Byte 89 Byte 90 Byte 91 Byte 92 Byte 93 Byte 94 Byte 95
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-// Byte 96 Byte 97 Byte 98 Byte 99 Byte 100 Byte 101 Byte 102 Byte 103
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-// Byte 104 Byte 105 Byte 106 Byte 107 Byte 108 Byte 109 Byte 110 Byte 111
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-// Byte 112 Byte 113 Byte 114 Byte 115 Byte 116 Byte 117 Byte 118 Byte 119
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
-
-//Byte 120 Byte 121 Byte 122 Byte 123 Byte 124 Byte 125 Byte 126 Byte 127
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0xFE,
-
-//Byte 128 Byte 129 Byte 130 Byte 131 Byte 132 Byte 133 Byte 134 Byte 135
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0xFE,
-
-//Byte 136 Byte 137 Byte 138 Byte 139 Byte 140 Byte 141 Byte 142 Byte 143
- 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xC0, 0xFE,
-
-
- // add rest here
-};
-
-///
-/// @brief Unit test cases for SPD Decoder
-/// @param[in] test_fixture, description, tag
-/// @return void
-/// @note mcbist_target_test_fixture is the fixture to use with this test case
-///
-SCENARIO_METHOD(mcbist_target_test_fixture, "Verify RDIMM SPD Decoding", "[rdimm_decoder]")
-{
- //////////////////////////////
- // SPD Byte 128~191. Module-Specific Section
- /////////////////////////////
-
- GIVEN("Passing test cases w/valid VBU SPD data (rev 1.0)")
- {
- //Loops over MCBIST targets that were defined in the associated config
- for_each_target([](const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target)
- {
- for( const auto& l_dimm : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(i_target) )
- {
- size_t l_read_spd_size = 0;
- fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
- spd_type l_spd_type = spd_type::VBU_16GB_2RX4_2400_DDR4_RDIMM;
-
- // Enforce requirements
- REQUIRE( spd_type::VBU_16GB_2RX4_2400_DDR4_RDIMM == l_spd_type );
- REQUIRE(l_read_spd_size == 0);
- REQUIRE_FALSE(fapi2::current_err);
-
- // Get the SPD size
- REQUIRE_FALSE(getSPD(l_dimm, l_spd_type, nullptr, l_read_spd_size));
-
- // "Container" for SPD data
- std::vector<uint8_t> l_spd(l_read_spd_size, 0);
-
- // Retrive SPD data
- REQUIRE_FALSE(getSPD(l_dimm, l_spd_type, l_spd.data(), l_read_spd_size));
-
- // Create RDIMM decoder w/good VBU SPD Data
- mss::spd::rdimm_decoder_v1_0 l_decoder(l_dimm, l_spd);
-
- {
- //////////////////////////////
- /// SPD Byte 128 (Bits 4~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 17; // from VBU fake SPD
-
- REQUIRE_FALSE( l_decoder.max_module_nominal_height(l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 129 (Bits 3~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.front_module_max_thickness(l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 129 (Bits 7~4)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.back_module_max_thickness(l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 130 (Bits 7~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x23; // from VBU fake SPD
- REQUIRE_FALSE( spd::reference_raw_card(l_dimm, l_spd, l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 131 (Bits 1~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.num_registers_used(l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 131 (Bits 3~2)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.num_rows_of_drams(l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 132 (Bits 6~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x0; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.heat_spreader_thermal_char( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 132 (Bit 7)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x0; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.heat_spreader_solution( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 133 (Bits 6~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x0; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.num_continuation_codes( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 134 (Bits 7~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0xB3; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.manufacturer_id_code(l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 135 (Bits 7~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x30; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.register_rev_num( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 136 (Bit 0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.register_to_dram_addr_mapping( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 137 (Bits 1~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.cke_signal_output_driver( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 137 (Bits 3~2)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.odt_signal_output_driver( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 137 (Bits 5~4)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x2; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.ca_signal_output_driver( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 137 (Bits 7~6)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.cs_signal_output_driver( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 138 (Bits 1~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.b_side_clk_output_driver( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 138 (Bits 3~2)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.a_side_clk_output_driver( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- }// dimm
-
- return 0;
- });
-
- }// GIVEN
-
- GIVEN("FAILING test cases w/invalid SPD data (rev 1.0)")
- {
- //Loops over MCBIST targets that were defined in the associated config
- for_each_target([](const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target)
- {
- for( const auto& l_dimm : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(i_target) )
- {
- fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
- uint8_t l_decoder_output = 0;
- std::vector<uint8_t> l_spd( std::begin(BAD_SPD), std::end(BAD_SPD) );
-
- // Enforce requirements
- REQUIRE_FALSE(fapi2::current_err);
- REQUIRE(0 == l_decoder_output);
-
- // Create RDIMM decoder w/BAD VBU SPD Data
- mss::spd::rdimm_decoder_v1_0 l_decoder(l_dimm, l_spd);
-
- //////////////////////////////
- /// SPD Byte 128 - 136
- /////////////////////////////
-
- // All bits are used for encoding
- // All bit combinations are valid
- // Any errors will be caught in the previous test case
- // What this means is that I CAN'T inject invalid SPD
- // to make it fail
- //////////////////////////////
-
- {
- //////////////////////////////
- /// SPD Byte 137 (Bits 1~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- REQUIRE( l_decoder.cke_signal_output_driver( l_decoder_output) );
-
- // Output should never return JEDEC RESERVED encoding value
- REQUIRE( 0 == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 137 (Bits 3~2)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- REQUIRE( l_decoder.odt_signal_output_driver( l_decoder_output) );
-
- // Output should never return JEDEC RESERVED encoding value
- REQUIRE( 0 == l_decoder_output);
- }
-
- //////////////////////////////
- /// SPD Byte 137 (Bits 5~4)
- /////////////////////////////
-
- // All bits are used for encoding
- // All bit combinations are valid
- // Any errors will be caught in the previous test case
- // What this means is that I CAN'T inject invalid SPD
- // to make it fail
- //////////////////////////////
-
- {
- //////////////////////////////
- /// SPD Byte 137 (Bits 7~6)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- REQUIRE( l_decoder.cs_signal_output_driver( l_decoder_output) );
-
- // Output should remain unchanged
- REQUIRE( 0 == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 138 (Bits 1~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- REQUIRE( l_decoder.b_side_clk_output_driver( l_decoder_output) );
-
- // Output should remain unchanged
- REQUIRE( 0 == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 138 (Bits 3~2)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- REQUIRE( l_decoder.a_side_clk_output_driver( l_decoder_output) );
-
- // Output should remain unchanged
- REQUIRE( 0 == l_decoder_output);
- }
-
- }// dimm
-
- return 0;
- });
-
- }// GIVEN
-
- GIVEN("Passing test cases w/valid VBU SPD data (rev 1.1)")
- {
- //Loops over MCBIST targets that were defined in the associated config
- for_each_target([](const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target)
- {
- for( const auto& l_dimm : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(i_target) )
- {
- size_t l_read_spd_size = 0;
- fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
- spd_type l_spd_type = spd_type::VBU_16GB_2RX4_2400_DDR4_RDIMM;
-
- // Enforce requirements
- REQUIRE( spd_type::VBU_16GB_2RX4_2400_DDR4_RDIMM == l_spd_type );
- REQUIRE(l_read_spd_size == 0);
- REQUIRE_FALSE(fapi2::current_err);
-
- // Get the SPD size
- REQUIRE_FALSE(getSPD(l_dimm, l_spd_type, nullptr, l_read_spd_size));
-
- // "Container" for SPD data
- std::vector<uint8_t> l_spd(l_read_spd_size, 0);
-
- // Retrive SPD data
- REQUIRE_FALSE(getSPD(l_dimm, l_spd_type, l_spd.data(), l_read_spd_size));
-
- // Create RDIMM decoder w/good VBU SPD Data
- mss::spd::rdimm_decoder_v1_0 l_decoder(l_dimm, l_spd);
-
- //////////////////////////////
- /// SPD Byte 128 - 136
- /////////////////////////////
-
- // Remain unchanged from previous rev so
- // tests from rev 1.0 still valid due to inheritane
-
- {
- //////////////////////////////
- /// SPD Byte 137 (Bits 1~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.cke_signal_output_driver( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 137 (Bits 3~2)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.odt_signal_output_driver( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 137 (Bits 5~4)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x2; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.ca_signal_output_driver( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 137 (Bits 7~6)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x01; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.cs_signal_output_driver( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 138 (Bits 1~0)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.b_side_clk_output_driver( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- {
- //////////////////////////////
- /// SPD Byte 138 (Bits 3~2)
- /////////////////////////////
- uint8_t l_decoder_output = 0;
- uint8_t l_expected = 0x1; // from VBU fake SPD
- REQUIRE_FALSE( l_decoder.a_side_clk_output_driver( l_decoder_output) );
- REQUIRE( l_expected == l_decoder_output);
- }
-
- /////////////////////////////////
- // SPD Bytes 137 - 138 for rev 1.1
- /////////////////////////////////
- // All bits are used for encoding
- // All bit combinations are valid
- // Any errors will be caught in the previous test case
- // What this means is that I CAN'T inject invalid SPD
- // to make it fail
- //////////////////////////////
-
- }// dimm
-
- return 0;
- });
-
- }// GIVEN
-
-}//scenario
-
-} /* ns test */
-} /* ns mss */
OpenPOWER on IntegriCloud