Skip to content

Commit

Permalink
Adding Chiplet Num testcases for MC, MI and DMI in cumulus
Browse files Browse the repository at this point in the history
Change-Id: I2846800bf8b9b9e6df5dc3c1581bfd7eae80c306
RTC:190805
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60444
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>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
e-liner authored and dcrowell77 committed Jun 20, 2018
1 parent 3eddb7e commit 27fc2d9
Show file tree
Hide file tree
Showing 3 changed files with 260 additions and 2 deletions.
200 changes: 198 additions & 2 deletions src/usr/fapi2/test/fapi2GetChipletNumTest.H
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,199 @@ class Fapi2GetChipletNum : public CxxTest::TestSuite
FAPI_INF("Complete testVerifyMcaChipletNum");
}


void testVerifyMcChipletNum()
{
uint8_t l_chiplet_id = 0;
uint8_t l_exp_chiplet_id = 0;
uint8_t l_chip_unit = 0;

FAPI_INF("Start testVerifyMcChipletNum");

do
{
// find all MC units
TARGETING::Target * pSys;
TARGETING::targetService().getTopLevelTarget(pSys);
TARGETING::PredicateCTM predMc(TARGETING::CLASS_UNIT,
TARGETING::TYPE_MC);

TARGETING::Target* l_pMasterProcChip = nullptr;
TARGETING::targetService().masterProcChipTargetHandle(l_pMasterProcChip);

TARGETING::TargetHandleList l_TargetList;
TARGETING::targetService().getAssociated( l_TargetList, pSys,
TARGETING::TargetService::CHILD,
TARGETING::TargetService::ALL,
&predMc);

if (l_TargetList.empty())
{
if(TARGETING::MODEL_CUMULUS ==
l_pMasterProcChip->getAttr<TARGETING::ATTR_MODEL>())
{
TS_FAIL("testVerifyMcChipletNum: empty l_TargetList");
}
break;
}

// Iterate through all MC chiplets
for (auto & l_Target : l_TargetList)
{
// map Targeting Type to fapi2 Type
Target<fapi2::TARGET_TYPE_MC> fapi2_Target( l_Target);
l_chiplet_id = fapi2_Target.getChipletNumber();

FAPI_DBG("testVerifyMcChipletNum HUID: %.8X, ChipletId: %.8X",
TARGETING::get_huid(l_Target), l_chiplet_id);

// MC 0,1 maps to pervasive ids 0x07
l_chip_unit = l_Target->getAttr<TARGETING::ATTR_CHIP_UNIT>();
l_exp_chiplet_id = l_chip_unit / 4 + START_MC_CHIPLET_NUM;

if (l_chiplet_id != l_exp_chiplet_id)
{
TS_FAIL("testVerifyMcChipletNum: Mismatch HUID %.8X - Expected: %.8X:, Found: %.8X",
TARGETING::get_huid(l_Target),
l_exp_chiplet_id, l_chiplet_id);
break;
}
}

} while(0);

FAPI_INF("Complete testVerifyMcChipletNum");
}

void testVerifyMiChipletNum()
{
uint8_t l_chiplet_id = 0;
uint8_t l_exp_chiplet_id = 0;
uint8_t l_chip_unit = 0;

FAPI_INF("Start testVerifyMiChipletNum");

do
{
// find all MI units
TARGETING::Target * pSys;
TARGETING::targetService().getTopLevelTarget(pSys);
TARGETING::PredicateCTM predMi(TARGETING::CLASS_UNIT,
TARGETING::TYPE_MI);

TARGETING::Target* l_pMasterProcChip = nullptr;
TARGETING::targetService().masterProcChipTargetHandle(l_pMasterProcChip);

TARGETING::TargetHandleList l_TargetList;
TARGETING::targetService().getAssociated( l_TargetList, pSys,
TARGETING::TargetService::CHILD,
TARGETING::TargetService::ALL,
&predMi);

if (l_TargetList.empty())
{
if(TARGETING::MODEL_CUMULUS ==
l_pMasterProcChip->getAttr<TARGETING::ATTR_MODEL>())
{
TS_FAIL("testVerifyMiChipletNum: empty l_TargetList");
}
break;
}

// Iterate through all MI chiplets
for (auto & l_Target : l_TargetList)
{
// map Targeting Type to fapi2 Type
Target<fapi2::TARGET_TYPE_MI> fapi2_Target( l_Target);
l_chiplet_id = fapi2_Target.getChipletNumber();

FAPI_DBG("testVerifyMiChipletNum HUID: %.8X, ChipletId: %.8X",
TARGETING::get_huid(l_Target), l_chiplet_id);

// MI 0,1 maps to pervasive ids 0x07
l_chip_unit = l_Target->getAttr<TARGETING::ATTR_CHIP_UNIT>();
l_exp_chiplet_id = l_chip_unit / 4 + START_MI_CHIPLET_NUM;

if (l_chiplet_id != l_exp_chiplet_id)
{
TS_FAIL("testVerifyMiChipletNum: Mismatch HUID %.8X - Expected: %.8X:, Found: %.8X",
TARGETING::get_huid(l_Target),
l_exp_chiplet_id, l_chiplet_id);
break;
}
}


} while(0);

FAPI_INF("Complete testVerifyMiChipletNum");
}

void testVerifyDmiChipletNum()
{
uint8_t l_chiplet_id = 0;
uint8_t l_exp_chiplet_id = 0;
uint8_t l_chip_unit = 0;

FAPI_INF("Start testVerifyDmiChipletNum");

do
{
// find all DMI units
TARGETING::Target * pSys;
TARGETING::targetService().getTopLevelTarget(pSys);
TARGETING::PredicateCTM predDmi(TARGETING::CLASS_UNIT,
TARGETING::TYPE_DMI);

TARGETING::Target* l_pMasterProcChip = nullptr;
TARGETING::targetService().masterProcChipTargetHandle(l_pMasterProcChip);

TARGETING::TargetHandleList l_TargetList;
TARGETING::targetService().getAssociated( l_TargetList, pSys,
TARGETING::TargetService::CHILD,
TARGETING::TargetService::ALL,
&predDmi);

if (l_TargetList.empty())
{
if(TARGETING::MODEL_CUMULUS ==
l_pMasterProcChip->getAttr<TARGETING::ATTR_MODEL>())
{
TS_FAIL("testVerifyDmiChipletNum: empty l_TargetList");
}
break;
}

// Iterate through all DMI chiplets
for (auto & l_Target : l_TargetList)
{
// map Targeting Type to fapi2 Type
Target<fapi2::TARGET_TYPE_DMI> fapi2_Target( l_Target);
l_chiplet_id = fapi2_Target.getChipletNumber();

FAPI_DBG("testVerifyDmiChipletNum HUID: %.8X, ChipletId: %.8X",
TARGETING::get_huid(l_Target), l_chiplet_id);

// DMI 0..3, 4..7 maps to pervasive ids 0x07, 0x08
l_chip_unit = l_Target->getAttr<TARGETING::ATTR_CHIP_UNIT>();
l_exp_chiplet_id = l_chip_unit / 4 + START_DMI_CHIPLET_NUM;

if (l_chiplet_id != l_exp_chiplet_id)
{
TS_INFO("testVerifyDmiChipletNum: Mismatch HUID %.8X - Expected: %.8X:, Found: %.8X",
TARGETING::get_huid(l_Target),
l_exp_chiplet_id, l_chiplet_id);
break;
}
}


} while(0);

FAPI_INF("Complete testVerifyDmiChipletNum");

}

void testVerifyObusChipletNum()
{
uint8_t l_chiplet_id = 0;
Expand Down Expand Up @@ -825,8 +1018,11 @@ class Fapi2GetChipletNum : public CxxTest::TestSuite

testVerifyMcaChipletNum();

// @todo RTC 178802 Enable test cases turned off during bring up
// Need to add Cumulus specific tests here - MC/MI/DMI
testVerifyMcChipletNum();

testVerifyMiChipletNum();

testVerifyDmiChipletNum();

testVerifyCappChipletNum();

Expand Down
6 changes: 6 additions & 0 deletions src/usr/fapi2/test/fapi2TestUtils.H
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
#define START_XBUS_CHIPLET_NUM 0x06
// MCBIST (0, 1 => 0x07, 0x08)
#define START_MCBIST_CHIPLET_NUM 0x07
// MC (0, 1 => 0x07)
#define START_MC_CHIPLET_NUM 0x07
// MI (0, 1 => 0x07)
#define START_MI_CHIPLET_NUM 0x07
// DMI (0, 3 => 0x07, 0x08)
#define START_DMI_CHIPLET_NUM 0x07
// OBUS (0, 3 => 0x09, 0x0C)
#define START_OBUS_CHIPLET_NUM 0x09
// PEC (0, 1, 2 => 0x0D, 0x0E, 0x0F)
Expand Down
56 changes: 56 additions & 0 deletions src/usr/targeting/common/xmltohb/simics_CUMULUS.system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3284,6 +3284,10 @@
<id>CHIP_UNIT</id>
<default>0</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x07</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down Expand Up @@ -3364,6 +3368,10 @@
<id>CHIP_UNIT</id>
<default>1</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x07</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down Expand Up @@ -3449,6 +3457,10 @@
<id>CHIP_UNIT</id>
<default>2</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x07</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down Expand Up @@ -3534,6 +3546,10 @@
<id>CHIP_UNIT</id>
<default>3</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x07</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down Expand Up @@ -3619,6 +3635,10 @@
<id>CHIP_UNIT</id>
<default>4</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x08</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down Expand Up @@ -3698,6 +3718,10 @@
<id>CHIP_UNIT</id>
<default>5</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x08</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down Expand Up @@ -3777,6 +3801,10 @@
<id>CHIP_UNIT</id>
<default>6</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x08</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down Expand Up @@ -3856,6 +3884,10 @@
<id>CHIP_UNIT</id>
<default>7</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x08</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down Expand Up @@ -5347,6 +5379,10 @@
<id>CHIP_UNIT</id>
<default>0</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x07</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down Expand Up @@ -6191,6 +6227,10 @@
<id>CHIP_UNIT</id>
<default>1</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x07</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down Expand Up @@ -6269,6 +6309,10 @@
<id>CHIP_UNIT</id>
<default>0</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x07</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down Expand Up @@ -6337,6 +6381,10 @@
<id>CHIP_UNIT</id>
<default>1</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x07</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down Expand Up @@ -6405,6 +6453,10 @@
<id>CHIP_UNIT</id>
<default>2</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x07</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down Expand Up @@ -6473,6 +6525,10 @@
<id>CHIP_UNIT</id>
<default>3</default>
</attribute>
<attribute>
<id>CHIPLET_ID</id>
<default>0x07</default>
</attribute>
<attribute>
<id>CLASS</id>
<default>UNIT</default>
Expand Down

0 comments on commit 27fc2d9

Please sign in to comment.