Skip to content

Commit

Permalink
Add OCMB_CHIP and MEM_PORT fapi2 test cases
Browse files Browse the repository at this point in the history
This commit adds test cases for new OCMB_CHIP and MEM_PORT target
types that are being added to support the new explorer memory buffer
used in Axone.
Also this commit fixed up the Axone target generation which was
missing a break on the inner loop and removed some changes that
were made in target.H which was allowing invalid parets to be
looked up for dimm targets.

RTC: 172970
Change-Id: I7564fbcfcdde2177ece934015fe40c79011f559f
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65511
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
crgeddes authored and dcrowell77 committed Sep 19, 2018
1 parent 5e3f78a commit bbad6ad
Show file tree
Hide file tree
Showing 9 changed files with 253 additions and 918 deletions.
61 changes: 14 additions & 47 deletions src/include/usr/fapi2/target.H
Original file line number Diff line number Diff line change
Expand Up @@ -445,27 +445,13 @@ inline Target<K_PARENT, V> Target<T_SELF, V>::getParent(void) const
// Specific parent checks for each TargetType

// valid parents for DIMM
// DIMM -> MEMPORT
// DIMM -> OCMB
// DIMM -> OMI
// DIMM -> OMIC
// DIMM -> MCC
// DIMM -> MI
// DIMM -> MC
// DIMM -> PROC_CHIP
// DIMM -> MCA
// DIMM -> MBA
// DIMM -> MEM_PORT
static_assert(!((T_SELF == fapi2::TARGET_TYPE_DIMM) &&
(K_PARENT != fapi2::TARGET_TYPE_MCA) &&
(K_PARENT != fapi2::TARGET_TYPE_MBA) &&
(K_PARENT != fapi2::TARGET_TYPE_OCMB_CHIP) &&
(K_PARENT != fapi2::TARGET_TYPE_SYSTEM) &&
(K_PARENT != fapi2::TARGET_TYPE_OMI) &&
(K_PARENT != fapi2::TARGET_TYPE_MCC) &&
(K_PARENT != fapi2::TARGET_TYPE_MI) &&
(K_PARENT != fapi2::TARGET_TYPE_MC) &&
(K_PARENT != fapi2::TARGET_TYPE_OMIC) &&
(K_PARENT != fapi2::TARGET_TYPE_PROC_CHIP)),
(K_PARENT != fapi2::TARGET_TYPE_MEM_PORT)),
"improper parent of fapi2::TARGET_TYPE_DIMM");

// valid parents for PROC
Expand All @@ -485,39 +471,15 @@ inline Target<K_PARENT, V> Target<T_SELF, V>::getParent(void) const
// valid parents for OCMB
// OCMB -> SYSTEM
// OCMB -> OMI
// OCMB -> MCC
// OCMB -> MI
// OCMB -> MC
// OCMB -> OMIC
// OCMB -> PROC_CHIP
static_assert(!((T_SELF == fapi2::TARGET_TYPE_OCMB_CHIP) &&
(K_PARENT != fapi2::TARGET_TYPE_SYSTEM) &&
(K_PARENT != fapi2::TARGET_TYPE_OMI) &&
(K_PARENT != fapi2::TARGET_TYPE_MCC) &&
(K_PARENT != fapi2::TARGET_TYPE_MI) &&
(K_PARENT != fapi2::TARGET_TYPE_MC) &&
(K_PARENT != fapi2::TARGET_TYPE_OMIC) &&
(K_PARENT != fapi2::TARGET_TYPE_PROC_CHIP)),
(K_PARENT != fapi2::TARGET_TYPE_OMI)),
"improper parent of fapi2::TARGET_TYPE_OCMB_CHIP");

// valid parents for MEM_PORT
// MEM_PORT -> SYSTEM
// MEM_PORT -> OCMB_CHIP
// MEM_PORT -> OMI
// MEM_PORT -> MCC
// MEM_PORT -> MI
// MEM_PORT -> MC
// MEM_PORT -> OMIC
// MEM_PORT -> PROC_CHIP
static_assert(!((T_SELF == fapi2::TARGET_TYPE_MEM_PORT) &&
(K_PARENT != fapi2::TARGET_TYPE_SYSTEM) &&
(K_PARENT != fapi2::TARGET_TYPE_OCMB_CHIP) &&
(K_PARENT != fapi2::TARGET_TYPE_OMI) &&
(K_PARENT != fapi2::TARGET_TYPE_MCC) &&
(K_PARENT != fapi2::TARGET_TYPE_MI) &&
(K_PARENT != fapi2::TARGET_TYPE_MC) &&
(K_PARENT != fapi2::TARGET_TYPE_OMIC) &&
(K_PARENT != fapi2::TARGET_TYPE_PROC_CHIP)),
(K_PARENT != fapi2::TARGET_TYPE_OCMB_CHIP)),
"improper parent of fapi2::TARGET_TYPE_MEM_PORT");

// valid parents for EX
Expand Down Expand Up @@ -845,10 +807,11 @@ inline std::vector<Target<K_CHILD, V> >
// valid children for system
// SYSTEM -> PROC
// SYSTEM -> MEMBUF
// SYSTEM -> DIMM ??? disabled for now
// SYSTEM -> OCMB_CHIP
static_assert(!((T_SELF == fapi2::TARGET_TYPE_SYSTEM) &&
(K_CHILD != fapi2::TARGET_TYPE_PROC_CHIP) &&
(K_CHILD != fapi2::TARGET_TYPE_MEMBUF_CHIP)),
(K_CHILD != fapi2::TARGET_TYPE_MEMBUF_CHIP) &&
(K_CHILD != fapi2::TARGET_TYPE_OCMB_CHIP)),
"improper child of fapi2::TARGET_TYPE_SYSTEM");

// valid children for EQ
Expand Down Expand Up @@ -917,6 +880,12 @@ inline std::vector<Target<K_CHILD, V> >
(K_CHILD != fapi2::TARGET_TYPE_OMI)),
"improper child of fapi2::TARGET_TYPE_MCC");

// valid children for OMI
// OMI -> OCMB
static_assert(!((T_SELF == fapi2::TARGET_TYPE_OMI) &&
(K_CHILD != fapi2::TARGET_TYPE_OCMB_CHIP)),
"improper child of fapi2::TARGET_TYPE_OMI");

// valid children for OMIC
// OMIC -> OMI
static_assert(!((T_SELF == fapi2::TARGET_TYPE_OMIC) &&
Expand All @@ -925,10 +894,8 @@ inline std::vector<Target<K_CHILD, V> >

// valid children for OCMB
// OCMB -> MEM_PORT
// OCMB -> DIMM
static_assert(!((T_SELF == fapi2::TARGET_TYPE_OCMB_CHIP) &&
(K_CHILD != fapi2::TARGET_TYPE_MEM_PORT) &&
(K_CHILD != fapi2::TARGET_TYPE_DIMM)),
(K_CHILD != fapi2::TARGET_TYPE_MEM_PORT)),
"improper child of fapi2::TARGET_TYPE_OCMB_CHIP");

// valid children for MEM_PORT
Expand Down
38 changes: 38 additions & 0 deletions src/usr/fapi2/test/fapi2GetChildrenTest.H
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ void test_fapi2GetChildren()
std::vector<Target<fapi2::TARGET_TYPE_XBUS> > l_childXBUSs;
std::vector<Target<fapi2::TARGET_TYPE_DMI> > l_childDMIs;
std::vector<Target<fapi2::TARGET_TYPE_OMI> > l_childOMIs;
std::vector<Target<fapi2::TARGET_TYPE_OCMB_CHIP> > l_childOCMBs;
std::vector<Target<fapi2::TARGET_TYPE_MEM_PORT> > l_childMEMPORTs;


if (isHwValid(l_proc, MY_MCA)
Expand Down Expand Up @@ -231,6 +233,42 @@ void test_fapi2GetChildren()
}
}

if (isHwValid(l_proc, MY_OMI)
&& isHwValid(l_proc, MY_OCMB))
{
l_childOCMBs = fapi2_omiTarget.getChildren<fapi2::TARGET_TYPE_OCMB_CHIP>(TARGET_STATE_PRESENT);
l_targetHuid = TARGETING::get_huid(targeting_targets[MY_OMI]);
l_actualSize = l_childOCMBs.size();

//Set expected size to be the number of OMIs per proc
l_expectedSize = OCMB_PER_OMI;
numTests++;
if(l_actualSize != l_expectedSize)
{
FAPI_INF("fapi2TargetTest:: OCMBs per proc mismatch");
numFails++;
break;
}
}

if (isHwValid(l_proc, MY_OCMB)
&& isHwValid(l_proc, MY_MEM_PORT))
{
l_childMEMPORTs = fapi2_ocmbTarget.getChildren<fapi2::TARGET_TYPE_MEM_PORT>(TARGET_STATE_PRESENT);
l_targetHuid = TARGETING::get_huid(targeting_targets[MY_OCMB]);
l_actualSize = l_childOCMBs.size();

//Set expected size to be the number of OMIs per proc
l_expectedSize = MEM_PORT_PER_OCMB;
numTests++;
if(l_actualSize != l_expectedSize)
{
FAPI_INF("fapi2TargetTest:: MEM_PORTs per proc mismatch");
numFails++;
break;
}
}


l_childCores = fapi2_exTarget.getChildren<fapi2::TARGET_TYPE_CORE>(TARGET_STATE_PRESENT);
l_targetHuid = TARGETING::get_huid(targeting_targets[MY_EX]) ;
Expand Down
21 changes: 18 additions & 3 deletions src/usr/fapi2/test/fapi2GetParentTest.H
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ void test_fapi2GetParent()
if(TARGETING::get_huid(targeting_targets[PARENT_TEST_TARGET_ID]) != \
TARGETING::get_huid(l_parent)) \
{ \
uint8_t l_instance = 0; \
targeting_targets[TEST_TARGET_ID]-> \
tryGetAttr<TARGETING::ATTR_CHIP_UNIT>(l_instance); \
TS_FAIL("fapi2TargetTest::Unable to find SRC_TYPE's" #PARENT_TYPE "parent!"); \
numFails++; \
} \
Expand Down Expand Up @@ -228,6 +225,24 @@ void test_fapi2GetParent()
GET_PARENT_TEST_MACRO(MY_OMI, TARGET_TYPE_OMI, MY_MC, TARGET_TYPE_MC)
}
}
// OCMB Parent Tests
if (isHwValid(l_proc, MY_OCMB))
{
if (isHwValid(l_proc, MY_OMI))
{
// Check parent OMI
GET_PARENT_TEST_MACRO(MY_OCMB, TARGET_TYPE_OCMB_CHIP, MY_OMI, TARGET_TYPE_OMI)
}
}
// MEM_PORT Parent Tests
if (isHwValid(l_proc, MY_MEM_PORT))
{
if (isHwValid(l_proc, MY_OCMB))
{
// Check parent OCMB
GET_PARENT_TEST_MACRO(MY_MEM_PORT, TARGET_TYPE_MEM_PORT, MY_OCMB, TARGET_TYPE_OCMB_CHIP)
}
}
// End Axone only targets

static pervasiveParentTestRec nimbusPervasiveParentTests [] = {
Expand Down
2 changes: 2 additions & 0 deletions src/usr/fapi2/test/fapi2HwpTest.H
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ void test_fapi2Hwp()
HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_omi, fapi2_omiTarget, MY_OMI)
HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_omic, fapi2_omicTarget, MY_OMIC)
HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_mcc, fapi2_mccTarget, MY_MCC)
HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_ocmb, fapi2_ocmbTarget, MY_OCMB)
HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_mem_port, fapi2_memportTarget, MY_MEM_PORT)

}while(0);
FAPI_INF("test_fapiHWP:: Test Complete. %d/%d fails", numFails,numTests);
Expand Down
2 changes: 2 additions & 0 deletions src/usr/fapi2/test/fapi2IsFunctionalTest.H
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class Fapi2IsFunctional : public CxxTest::TestSuite
IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_OMIC], fapi2_omicTarget)
IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_MCC], fapi2_mccTarget)
IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_PROC], fapi2_procTarget)
IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_OCMB], fapi2_ocmbTarget)
IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_MEM_PORT], fapi2_memportTarget)


} while(0);
Expand Down

0 comments on commit bbad6ad

Please sign in to comment.