diff options
author | Elizabeth Liner <eliner@us.ibm.com> | 2018-06-12 19:35:04 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-06-20 10:07:05 -0400 |
commit | 27fc2d9695a406874efec5de955a3b3ea8dcc1f7 (patch) | |
tree | cb2735fa699fc196533adda3364c8e2744ad58eb /src/usr | |
parent | 3eddb7eaa9945ec30d8777b9c8872fcfd8280e57 (diff) | |
download | talos-hostboot-27fc2d9695a406874efec5de955a3b3ea8dcc1f7.tar.gz talos-hostboot-27fc2d9695a406874efec5de955a3b3ea8dcc1f7.zip |
Adding Chiplet Num testcases for MC, MI and DMI in cumulus
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>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/fapi2/test/fapi2GetChipletNumTest.H | 200 | ||||
-rw-r--r-- | src/usr/fapi2/test/fapi2TestUtils.H | 6 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/simics_CUMULUS.system.xml | 56 |
3 files changed, 260 insertions, 2 deletions
diff --git a/src/usr/fapi2/test/fapi2GetChipletNumTest.H b/src/usr/fapi2/test/fapi2GetChipletNumTest.H index 59c9acd4b..ce50757d9 100644 --- a/src/usr/fapi2/test/fapi2GetChipletNumTest.H +++ b/src/usr/fapi2/test/fapi2GetChipletNumTest.H @@ -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; @@ -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(); diff --git a/src/usr/fapi2/test/fapi2TestUtils.H b/src/usr/fapi2/test/fapi2TestUtils.H index 7b9a37ee3..9036a4ead 100644 --- a/src/usr/fapi2/test/fapi2TestUtils.H +++ b/src/usr/fapi2/test/fapi2TestUtils.H @@ -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) diff --git a/src/usr/targeting/common/xmltohb/simics_CUMULUS.system.xml b/src/usr/targeting/common/xmltohb/simics_CUMULUS.system.xml index fbd313174..65f27bebc 100644 --- a/src/usr/targeting/common/xmltohb/simics_CUMULUS.system.xml +++ b/src/usr/targeting/common/xmltohb/simics_CUMULUS.system.xml @@ -3285,6 +3285,10 @@ <default>0</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x07</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> @@ -3365,6 +3369,10 @@ <default>1</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x07</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> @@ -3450,6 +3458,10 @@ <default>2</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x07</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> @@ -3535,6 +3547,10 @@ <default>3</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x07</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> @@ -3620,6 +3636,10 @@ <default>4</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x08</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> @@ -3699,6 +3719,10 @@ <default>5</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x08</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> @@ -3778,6 +3802,10 @@ <default>6</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x08</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> @@ -3857,6 +3885,10 @@ <default>7</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x08</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> @@ -5348,6 +5380,10 @@ <default>0</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x07</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> @@ -6192,6 +6228,10 @@ <default>1</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x07</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> @@ -6270,6 +6310,10 @@ <default>0</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x07</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> @@ -6338,6 +6382,10 @@ <default>1</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x07</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> @@ -6406,6 +6454,10 @@ <default>2</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x07</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> @@ -6474,6 +6526,10 @@ <default>3</default> </attribute> <attribute> + <id>CHIPLET_ID</id> + <default>0x07</default> + </attribute> + <attribute> <id>CLASS</id> <default>UNIT</default> </attribute> |