From fe3a5bea6fcadd8ef33dbd155ffc90add0c71aba Mon Sep 17 00:00:00 2001 From: Lateef Quraishi Date: Tue, 13 Sep 2016 09:18:54 -0500 Subject: getChipletNumber support for more target types - Types added: CAPP, PEC, PHB, and NV Change-Id: I10effd492331b0439ca27df8c6ea80f6581b5899 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29587 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: William G. Hoffa Reviewed-by: Daniel M. Crowell --- src/usr/fapi2/test/fapi2GetChipletNumTest.H | 505 ++++++++++++++------- src/usr/fapi2/test/fapi2TestUtils.H | 13 +- src/usr/targeting/common/genHwsvMrwXml.pl | 30 ++ .../common/xmltohb/simics_NIMBUS.system.xml | 166 ++++++- .../targeting/common/xmltohb/vbu_NIMBUS.system.xml | 48 ++ 5 files changed, 606 insertions(+), 156 deletions(-) diff --git a/src/usr/fapi2/test/fapi2GetChipletNumTest.H b/src/usr/fapi2/test/fapi2GetChipletNumTest.H index 970b5bcf0..01c65c0bc 100644 --- a/src/usr/fapi2/test/fapi2GetChipletNumTest.H +++ b/src/usr/fapi2/test/fapi2GetChipletNumTest.H @@ -35,51 +35,276 @@ class Fapi2GetChipletNum : public CxxTest::TestSuite { public: + void testVerifyiPhbChipletNum() + { + uint8_t l_chiplet_id = 0; + uint8_t l_exp_chiplet_id = 0; + uint8_t l_chip_unit = 0; + + FAPI_INF ("Start testVerifyiPhbChipletNum"); + do + { + // find all PHB units + TARGETING::Target * pSys; + TARGETING::targetService().getTopLevelTarget(pSys); + TARGETING::PredicateCTM predPhb(TARGETING::CLASS_UNIT, + TARGETING::TYPE_PHB); + + TARGETING::TargetHandleList l_TargetList; + TARGETING::targetService().getAssociated( l_TargetList, pSys, + TARGETING::TargetService::CHILD, + TARGETING::TargetService::ALL, + &predPhb); + + if (l_TargetList.empty()) + { + TS_FAIL("testVerifyiPhbChipletNum: empty l_TargetList"); + break; + } + + // Iterate through all PHB chiplets + for (auto & l_Target : l_TargetList) + { + // map Targeting Type to fapi2 Type + Target fapi2_Target( l_Target); + l_chiplet_id = fapi2_Target.getChipletNumber(); + + FAPI_DBG("testVerifyiPhbChipletNum HUID: %.8X, ChipletId: %.8X", + TARGETING::get_huid(l_Target), l_chiplet_id); + + l_chip_unit = l_Target->getAttr(); + + // PEC-0 PBH-0 maps to pervasive id 0x0D + if (l_chip_unit == 0) + { + l_exp_chiplet_id = START_PEC_0_CHIPLET_NUM; + } + // PEC-1 PBH-0 maps to pervasive id 0x0E + // PEC-1 PBH-1 maps to pervasive id 0x0E + else if ((l_chip_unit >= 1) && (l_chip_unit <= 2)) + { + l_exp_chiplet_id = START_PEC_1_CHIPLET_NUM; + } + // PEC-2 PBH-0 maps to pervasive id 0x0F + // PEC-2 PBH-1 maps to pervasive id 0x0F + // PEC-2 PBH-2 maps to pervasive id 0x0F + else if ((l_chip_unit >= 3) && (l_chip_unit <= 5)) + { + l_exp_chiplet_id = START_PEC_2_CHIPLET_NUM; + } + + if (l_chiplet_id != l_exp_chiplet_id) + { + TS_FAIL("testVerifyiPhbChipletNum: Mismatch - Expected: %.8X:, Found: %.8X", + l_exp_chiplet_id, l_chiplet_id); + break; + } + } + } while(0); + FAPI_INF("Complete testVerifyiPhbChipletNum"); + } + + void testVerifyNvChipletNum() + { + uint8_t l_chiplet_id = 0; + uint8_t l_exp_chiplet_id = 0; + + FAPI_INF ("Start testVerifyNvChipletNum"); + do + { + // find the all NV units + TARGETING::Target * pSys; + TARGETING::targetService().getTopLevelTarget(pSys); + TARGETING::PredicateCTM predNv(TARGETING::CLASS_UNIT, + TARGETING::TYPE_NV); + + TARGETING::TargetHandleList l_TargetList; + TARGETING::targetService().getAssociated( l_TargetList, pSys, + TARGETING::TargetService::CHILD, + TARGETING::TargetService::ALL, + &predNv); + + if (l_TargetList.empty()) + { + TS_FAIL("testVerifyNvChipletNum: empty l_TargetList"); + break; + } + + // Iterate through all NV chiplets + for (auto & l_Target : l_TargetList) + { + // map Targeting Type to fapi2 Type + Target fapi2_Target( l_Target); + l_chiplet_id = fapi2_Target.getChipletNumber(); + + FAPI_DBG("testVerifyNvChipletNum HUID: %.8X, ChipletId: %.8X", + TARGETING::get_huid(l_Target), l_chiplet_id); + + // NV 0,1 maps to pervasive id 0x05 + l_exp_chiplet_id = START_NV_CHIPLET_NUM; + + if (l_chiplet_id != l_exp_chiplet_id) + { + TS_FAIL("testVerifyNvChipletNum: Mismatch - Expected: %.8X:, Found: %.8X", + l_exp_chiplet_id, l_chiplet_id); + break; + } + } + } while(0); + FAPI_INF("Complete testVerifyNvChipletNum"); + } + + void testVerifyPecChipletNum() + { + uint8_t l_chiplet_id = 0; + uint8_t l_exp_chiplet_id = 0; + uint8_t l_chip_unit = 0; + + FAPI_INF ("Start testVerifyPecChipletNum"); + do + { + // find all PEC units + TARGETING::Target * pSys; + TARGETING::targetService().getTopLevelTarget(pSys); + TARGETING::PredicateCTM predPec(TARGETING::CLASS_UNIT, + TARGETING::TYPE_PEC); + + TARGETING::TargetHandleList l_TargetList; + TARGETING::targetService().getAssociated( l_TargetList, pSys, + TARGETING::TargetService::CHILD, + TARGETING::TargetService::ALL, + &predPec); + + if (l_TargetList.empty()) + { + TS_FAIL("testVerifyPecChipletNum: empty l_TargetList"); + break; + } + + // Iterate through all PEC chiplets + for (auto & l_Target : l_TargetList) + { + // map Targeting Type to fapi2 Type + Target fapi2_Target( l_Target); + l_chiplet_id = fapi2_Target.getChipletNumber(); + + FAPI_DBG("testVerifyPecChipletNum HUID: %.8X, ChipletId: %.8X", + TARGETING::get_huid(l_Target), l_chiplet_id); + + // PEC 0,1,2 maps to pervasive ids 0x0D, 0x0E, 0x0F + l_chip_unit = l_Target->getAttr(); + l_exp_chiplet_id = l_chip_unit + START_PEC_0_CHIPLET_NUM; + + if (l_chiplet_id != l_exp_chiplet_id) + { + TS_FAIL("testVerifyPecChipletNum: Mismatch - Expected: %.8X:, Found: %.8X", + l_exp_chiplet_id, l_chiplet_id); + break; + } + } + } while(0); + FAPI_INF("Complete testVerifyPecChipletNum"); + } + + void testVerifyCappChipletNum() + { + uint8_t l_chiplet_id = 0; + uint8_t l_exp_chiplet_id = 0; + uint8_t l_chip_unit = 0; + + FAPI_INF ("Start testVerifyCappChipletNum"); + do + { + // find all CAPP units + TARGETING::Target * pSys; + TARGETING::targetService().getTopLevelTarget(pSys); + TARGETING::PredicateCTM predCapp(TARGETING::CLASS_UNIT, + TARGETING::TYPE_CAPP); + + TARGETING::TargetHandleList l_TargetList; + TARGETING::targetService().getAssociated( l_TargetList, pSys, + TARGETING::TargetService::CHILD, + TARGETING::TargetService::ALL, + &predCapp); + + if (l_TargetList.empty()) + { + TS_FAIL("testVerifyCappChipletNum: empty l_TargetList"); + break; + } + + // Iterate through all CAPP chiplets + for (auto & l_Target : l_TargetList) + { + // map Targeting Type to fapi2 Type + Target fapi2_Target( l_Target); + l_chiplet_id = fapi2_Target.getChipletNumber(); + + FAPI_DBG("testVerifyCappChipletNum HUID: %.8X, ChipletId: %.8X", + TARGETING::get_huid(l_Target), l_chiplet_id); + + // CAPP 0,1 maps to pervasive ids 0x02, 0x04 + l_chip_unit = l_Target->getAttr(); + if (l_chip_unit == 0 ) + { + l_exp_chiplet_id = START_CAPP_CHIPLET_NUM; + } + else + { + l_exp_chiplet_id = START_CAPP_CHIPLET_NUM + 2; + } + + if (l_chiplet_id != l_exp_chiplet_id) + { + TS_FAIL("testVerifyCappChipletNum: Mismatch - Expected: %.8X:, Found: %.8X", + l_exp_chiplet_id, l_chiplet_id); + break; + } + } + } while(0); + FAPI_INF("Complete testVerifyCappChipletNum"); + } + void testVerifyMcbistChipletNum() { uint8_t l_chiplet_id = 0; uint8_t l_exp_chiplet_id = 0; - uint8_t chipUnit = 0; + uint8_t l_chip_unit = 0; FAPI_INF ("Start testVerifyMcbistChipletNum"); do { - // find the unit + // find all MCBIST units TARGETING::Target * pSys; TARGETING::targetService().getTopLevelTarget(pSys); TARGETING::PredicateCTM predMcbist(TARGETING::CLASS_UNIT, TARGETING::TYPE_MCBIST); - TARGETING::TargetHandleList pMcbistList; - TARGETING::targetService().getAssociated( pMcbistList, pSys, + TARGETING::TargetHandleList l_TargetList; + TARGETING::targetService().getAssociated( l_TargetList, pSys, TARGETING::TargetService::CHILD, TARGETING::TargetService::ALL, &predMcbist); - if (pMcbistList.empty()) + if (l_TargetList.empty()) { - TS_FAIL("testVerifyMcbistChipletNum: empty pMcbistList"); + TS_FAIL("testVerifyMcbistChipletNum: empty l_TargetList"); break; } - // Iterate through present procs - for (TARGETING::TargetHandleList::const_iterator - l_mcbistIter = pMcbistList.begin(); - l_mcbistIter != pMcbistList.end(); - ++l_mcbistIter) + // Iterate through all MCBIST chiplets + for (auto & l_Target : l_TargetList) { - - TARGETING::Target * pTarTarget = *l_mcbistIter; - // map Targeting Type to fapi2 Type - Target fapi2_Target( pTarTarget); + Target fapi2_Target( l_Target); l_chiplet_id = fapi2_Target.getChipletNumber(); FAPI_DBG("testVerifyMcbistChipletNum HUID: %.8X, ChipletId: %.8X", - TARGETING::get_huid(pTarTarget), l_chiplet_id); + TARGETING::get_huid(l_Target), l_chiplet_id); - chipUnit = pTarTarget->getAttr(); - l_exp_chiplet_id = chipUnit + START_MCBIST_CHIPLET_NUM; + // MCBIST 0,1 maps to pervasive ids 0x07, 0x08 + l_chip_unit = l_Target->getAttr(); + l_exp_chiplet_id = l_chip_unit + START_MCBIST_CHIPLET_NUM; if (l_chiplet_id != l_exp_chiplet_id) { @@ -100,51 +325,47 @@ class Fapi2GetChipletNum : public CxxTest::TestSuite FAPI_INF("Start testVerifyMcsChipletNum"); do { - // find the unit + // find all MCS units TARGETING::Target * pSys; TARGETING::targetService().getTopLevelTarget(pSys); TARGETING::PredicateCTM predMcs(TARGETING::CLASS_UNIT, TARGETING::TYPE_MCS); - TARGETING::TargetHandleList pMcsList; - TARGETING::targetService().getAssociated( pMcsList, pSys, + TARGETING::TargetHandleList l_TargetList; + TARGETING::targetService().getAssociated( l_TargetList, pSys, TARGETING::TargetService::CHILD, TARGETING::TargetService::ALL, &predMcs); - if (pMcsList.empty()) + if (l_TargetList.empty()) { - TS_FAIL("testVerifyMcsChipletNum: empty pMcsList"); + TS_FAIL("testVerifyMcsChipletNum: empty l_TargetList"); break; } - // Iterate through present procs - for (TARGETING::TargetHandleList::const_iterator - l_mcsIter = pMcsList.begin(); - l_mcsIter != pMcsList.end(); - ++l_mcsIter) + // Iterate through all MCS chiplets + for (auto & l_Target : l_TargetList) { - TARGETING::Target * pTarTarget = *l_mcsIter; - // map Targeting Type to fapi2 Type - Target fapi2_Target(pTarTarget); + Target fapi2_Target(l_Target); l_chiplet_id = fapi2_Target.getChipletNumber(); FAPI_DBG("testVerifyMcsChipletNum HUID: %.8X, ChipletId: %.8X", - TARGETING::get_huid(pTarTarget), + TARGETING::get_huid(l_Target), l_chiplet_id); ReturnCode l_rc; - fapi2::ATTR_CHIP_UNIT_POS_Type chipPos = 0; + fapi2::ATTR_CHIP_UNIT_POS_Type l_chipPos = 0; l_rc = FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, - pTarTarget,chipPos); + l_Target, l_chipPos); if( l_rc ) { TS_FAIL("testVerifyMcsChipletNum: Error getting fapi::ATTR_CHIP_UNIT_POS"); break; } - l_exp_chiplet_id = (chipPos/2) + START_MCBIST_CHIPLET_NUM; + // MCS 0..1, 2..3 maps to pervasive ids 0x07, 0x08 + l_exp_chiplet_id = (l_chipPos/2) + START_MCBIST_CHIPLET_NUM; if (l_chiplet_id != l_exp_chiplet_id) { @@ -161,47 +382,42 @@ class Fapi2GetChipletNum : public CxxTest::TestSuite { uint8_t l_chiplet_id = 0; uint8_t l_exp_chiplet_id = 0; - uint8_t chipUnit = 0; + uint8_t l_chip_unit = 0; FAPI_INF("Start testVerifyMcaChipletNum"); do { - // find the unit + // find all MCA units TARGETING::Target * pSys; TARGETING::targetService().getTopLevelTarget(pSys); TARGETING::PredicateCTM predMca(TARGETING::CLASS_UNIT, TARGETING::TYPE_MCA); - TARGETING::TargetHandleList pMcaistList; - TARGETING::targetService().getAssociated( pMcaistList, pSys, + TARGETING::TargetHandleList l_TargetList; + TARGETING::targetService().getAssociated( l_TargetList, pSys, TARGETING::TargetService::CHILD, TARGETING::TargetService::ALL, &predMca); - if (pMcaistList.empty()) + if (l_TargetList.empty()) { TS_FAIL("testVerifyMcaChipletNum: empty pMcbistList"); break; } - // Iterate through present procs - for (TARGETING::TargetHandleList::const_iterator - l_mcaistIter = pMcaistList.begin(); - l_mcaistIter != pMcaistList.end(); - ++l_mcaistIter) + // Iterate through all MCA chiplets + for (auto & l_Target : l_TargetList) { - - TARGETING::Target * pTarTarget = *l_mcaistIter; - // map Targeting Type to fapi2 Type - Target fapi2_Target( pTarTarget); + Target fapi2_Target( l_Target); l_chiplet_id = fapi2_Target.getChipletNumber(); FAPI_DBG("testVerifyMcaChipletNum HUID: %.8X, ChipletId: %.8X", - TARGETING::get_huid(pTarTarget), l_chiplet_id); + TARGETING::get_huid(l_Target), l_chiplet_id); - chipUnit = pTarTarget->getAttr(); - l_exp_chiplet_id = chipUnit / 4 + START_MCBIST_CHIPLET_NUM; + // MCA 0..3, 4..7 maps to pervasive ids 0x07, 0x08 + l_chip_unit = l_Target->getAttr(); + l_exp_chiplet_id = l_chip_unit / 4 + START_MCBIST_CHIPLET_NUM; if (l_chiplet_id != l_exp_chiplet_id) { @@ -218,58 +434,53 @@ class Fapi2GetChipletNum : public CxxTest::TestSuite { uint8_t l_chiplet_id = 0; uint8_t l_exp_chiplet_id = 0; - uint8_t chipUnit = 0; + uint8_t l_chip_unit = 0; FAPI_INF("Start testVerifyObusChipletNum"); do { - // find the unit + // find all OBUS units TARGETING::Target * pSys; TARGETING::targetService().getTopLevelTarget(pSys); TARGETING::PredicateCTM predObus(TARGETING::CLASS_UNIT, TARGETING::TYPE_OBUS); - TARGETING::TargetHandleList pObusList; - TARGETING::targetService().getAssociated( pObusList, pSys, + TARGETING::TargetHandleList l_TargetList; + TARGETING::targetService().getAssociated( l_TargetList, pSys, TARGETING::TargetService::CHILD, TARGETING::TargetService::ALL, &predObus); - if (pObusList.empty()) + if (l_TargetList.empty()) { - TS_FAIL("testVerifyObusChipletNum: empty pObusList"); + TS_FAIL("testVerifyObusChipletNum: empty l_TargetList"); break; } - // Iterate through present procs - for (TARGETING::TargetHandleList::const_iterator - l_obusIter = pObusList.begin(); - l_obusIter != pObusList.end(); - ++l_obusIter) + // Iterate through all OBUS chiplets + for (auto & l_Target : l_TargetList) { - TARGETING::Target * pTarTarget = *l_obusIter; - // map Targeting Type to fapi2 Type - Target fapi2_Target( pTarTarget); + Target fapi2_Target( l_Target); l_chiplet_id = fapi2_Target.getChipletNumber(); FAPI_DBG("testVerifyObusChipletNum HUID: %.8X, ChipletId: %.8X", - TARGETING::get_huid(pTarTarget), + TARGETING::get_huid(l_Target), l_chiplet_id); ReturnCode l_rc; - fapi2::ATTR_CHIP_UNIT_POS_Type chipPos = 0; + fapi2::ATTR_CHIP_UNIT_POS_Type l_chipPos = 0; l_rc = FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, - pTarTarget,chipPos); + l_Target, l_chipPos); if( l_rc ) { TS_FAIL("testVerifyObusChipletNum: Error getting fapi::ATTR_CHIP_UNIT_POS"); break; } - // Nimbus has two obuses 0 & 3 - chipUnit = pTarTarget->getAttr(); - l_exp_chiplet_id = chipUnit + START_OBUS_CHIPLET_NUM; + // OBUS 0,3 maps to pervasive ids 0x09, 0x0C + l_chip_unit = l_Target->getAttr(); + l_exp_chiplet_id = l_chip_unit + START_OBUS_CHIPLET_NUM; if (l_chiplet_id != l_exp_chiplet_id) { @@ -289,40 +500,36 @@ class Fapi2GetChipletNum : public CxxTest::TestSuite FAPI_INF("Start testVerifyXbusChipletNum"); do { - // find the unit + // find all XBUS units TARGETING::Target * pSys; TARGETING::targetService().getTopLevelTarget(pSys); TARGETING::PredicateCTM predXbus(TARGETING::CLASS_UNIT, TARGETING::TYPE_XBUS); - TARGETING::TargetHandleList pXbusList; - TARGETING::targetService().getAssociated( pXbusList, pSys, + TARGETING::TargetHandleList l_TargetList; + TARGETING::targetService().getAssociated( l_TargetList, pSys, TARGETING::TargetService::CHILD, TARGETING::TargetService::ALL, &predXbus); - if (pXbusList.empty()) + if (l_TargetList.empty()) { - TS_FAIL("testVerifyXbusChipletNum: empty pXbusList"); + TS_FAIL("testVerifyXbusChipletNum: empty l_TargetList"); break; } - // Iterate through present procs - for (TARGETING::TargetHandleList::const_iterator - l_xbusIter = pXbusList.begin(); - l_xbusIter != pXbusList.end(); - ++l_xbusIter) + // Iterate through all XBUS chiplets + for (auto & l_Target : l_TargetList) { - TARGETING::Target * pTarTarget = *l_xbusIter; - // map Targeting Type to fapi2 Type - Target fapi2_Target( pTarTarget); + Target fapi2_Target( l_Target); l_chiplet_id = fapi2_Target.getChipletNumber(); FAPI_DBG("testVerifyXbusChipletNum HUID: %.8X, ChipletId: %.8X", - TARGETING::get_huid(pTarTarget), + TARGETING::get_huid(l_Target), l_chiplet_id); + // XBUS 0,1 maps to pervasive id 0x06 if (l_chiplet_id != START_XBUS_CHIPLET_NUM) { TS_FAIL("testVerifyXbusChipletNum: Mismatch - Expected: %.8X:, Found: %.8X", @@ -336,51 +543,47 @@ class Fapi2GetChipletNum : public CxxTest::TestSuite void testVerifyPervChipletNum() { uint8_t l_chiplet_id = 0; - uint8_t chipUnit = 0; + uint8_t l_chip_unit = 0; FAPI_INF("Start testVerifyPervChipletNum"); do { - // find the unit + // find all PERV units TARGETING::Target * pSys; TARGETING::targetService().getTopLevelTarget(pSys); TARGETING::PredicateCTM predPerv(TARGETING::CLASS_UNIT, TARGETING::TYPE_PERV); - TARGETING::TargetHandleList pPervList; - TARGETING::targetService().getAssociated( pPervList, pSys, + TARGETING::TargetHandleList l_TargetList; + TARGETING::targetService().getAssociated( l_TargetList, pSys, TARGETING::TargetService::CHILD, TARGETING::TargetService::ALL, &predPerv ); - if (pPervList.empty()) + if (l_TargetList.empty()) { - TS_FAIL("testVerifyPervChipletNum: empty pPervList"); + TS_FAIL("testVerifyPervChipletNum: empty l_TargetList"); break; } - // Iterate through present procs - for (TARGETING::TargetHandleList::const_iterator - l_pervIter = pPervList.begin(); - l_pervIter != pPervList.end(); - ++l_pervIter) + // Iterate through all PERV chiplets + for (auto & l_Target : l_TargetList) { - TARGETING::Target * pTarTarget = *l_pervIter; - // map Targeting Type to fapi2 Type - Target fapi2_Target( pTarTarget); + Target fapi2_Target( l_Target); l_chiplet_id = fapi2_Target.getChipletNumber(); FAPI_DBG("testVerifyPervChipletNum HUID: %.8X, ChipletId: %.8X", - TARGETING::get_huid(pTarTarget), + TARGETING::get_huid(l_Target), l_chiplet_id); - chipUnit = pTarTarget->getAttr(); + // PERV units and chiplet ids are same + l_chip_unit = l_Target->getAttr(); - if (l_chiplet_id != chipUnit) + if (l_chiplet_id != l_chip_unit) { TS_FAIL("testVerifyPervChipletNum: Mismatch - Expected: %.8X:, Found: %.8X", - chipUnit, l_chiplet_id); + l_chip_unit, l_chiplet_id); break; } } @@ -392,47 +595,43 @@ class Fapi2GetChipletNum : public CxxTest::TestSuite { uint8_t l_chiplet_id = 0; uint8_t l_exp_chiplet_id = 0; - uint8_t chipUnit = 0; + uint8_t l_chip_unit = 0; FAPI_INF("Start testVerifyEQChipletNum"); do { - // find the unit + // find all EQ units` TARGETING::Target * pSys; TARGETING::targetService().getTopLevelTarget(pSys); TARGETING::PredicateCTM predEq(TARGETING::CLASS_UNIT, TARGETING::TYPE_EQ); - TARGETING::TargetHandleList pEqList; - TARGETING::targetService().getAssociated( pEqList, pSys, + TARGETING::TargetHandleList l_TargetList; + TARGETING::targetService().getAssociated( l_TargetList, pSys, TARGETING::TargetService::CHILD, TARGETING::TargetService::ALL, &predEq ); - if (pEqList.empty()) + if (l_TargetList.empty()) { - TS_FAIL("testVerifyEQChipletNum: empty pEqList"); + TS_FAIL("testVerifyEQChipletNum: empty l_TargetList"); break; } - // Iterate through present procs - for (TARGETING::TargetHandleList::const_iterator - l_eqIter = pEqList.begin(); - l_eqIter != pEqList.end(); - ++l_eqIter) + // Iterate through all EQ chiplets + for (auto & l_Target : l_TargetList) { - TARGETING::Target * pTarTarget = *l_eqIter; - // map Targeting Type to fapi2 Type - Target fapi2_Target( pTarTarget); + Target fapi2_Target( l_Target); l_chiplet_id = fapi2_Target.getChipletNumber(); FAPI_DBG("testVerifyEQChipletNum HUID: %.8X, ChipletId: %.8X", - TARGETING::get_huid(pTarTarget), + TARGETING::get_huid(l_Target), l_chiplet_id); - chipUnit = pTarTarget->getAttr(); - l_exp_chiplet_id = chipUnit + START_EQ_CHIPLET_NUM; + // EQ 0..5 maps to pervasive ids 0x10..0x15 + l_chip_unit = l_Target->getAttr(); + l_exp_chiplet_id = l_chip_unit + START_EQ_CHIPLET_NUM; if (l_chiplet_id != l_exp_chiplet_id) { @@ -453,50 +652,46 @@ class Fapi2GetChipletNum : public CxxTest::TestSuite FAPI_INF("Start testVerifyEXChipletNum"); do { - // find the unit + // find all EX units TARGETING::Target * pSys; TARGETING::targetService().getTopLevelTarget(pSys); TARGETING::PredicateCTM predEx(TARGETING::CLASS_UNIT, TARGETING::TYPE_EX); - TARGETING::TargetHandleList pExList; - TARGETING::targetService().getAssociated( pExList, pSys, + TARGETING::TargetHandleList l_TargetList; + TARGETING::targetService().getAssociated( l_TargetList, pSys, TARGETING::TargetService::CHILD, TARGETING::TargetService::ALL, &predEx ); - if (pExList.empty()) + if (l_TargetList.empty()) { - TS_FAIL("testVerifyEXChipletNum: empty pExList"); + TS_FAIL("testVerifyEXChipletNum: empty l_TargetList"); break; } - // Iterate through present procs - for (TARGETING::TargetHandleList::const_iterator - l_exIter = pExList.begin(); - l_exIter != pExList.end(); - ++l_exIter) + // Iterate through all EXs + for (auto & l_Target : l_TargetList) { - TARGETING::Target * pTarTarget = *l_exIter; - // map Targeting Type to fapi2 Type - Target fapi2_Target( pTarTarget); + Target fapi2_Target( l_Target); l_chiplet_id = fapi2_Target.getChipletNumber(); FAPI_DBG("testVerifyEXChipletNum HUID: %.8X, ChipletId: %.8X", - TARGETING::get_huid(pTarTarget), + TARGETING::get_huid(l_Target), l_chiplet_id); ReturnCode l_rc; fapi2::ATTR_CHIP_UNIT_POS_Type chipPos = 0; l_rc = FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, - pTarTarget,chipPos); + l_Target,chipPos); if( l_rc ) { TS_FAIL("testVerifyEXChipletNum: Error getting fapi::ATTR_CHIP_UNIT_POS"); break; } + // EXs maps to pervasive id of their parents 0x10..0x15 l_exp_chiplet_id = (chipPos/2) + START_EQ_CHIPLET_NUM; if (l_chiplet_id != l_exp_chiplet_id) @@ -516,46 +711,42 @@ class Fapi2GetChipletNum : public CxxTest::TestSuite uint8_t l_chiplet_id = 0; uint8_t l_exp_chiplet_id = 0; - uint8_t chipUnit = 0; + uint8_t l_chip_unit = 0; do { - // find the unit + // find all cpu COREs TARGETING::Target * pSys; TARGETING::targetService().getTopLevelTarget(pSys); TARGETING::PredicateCTM predCore(TARGETING::CLASS_UNIT, TARGETING::TYPE_CORE); - TARGETING::TargetHandleList pCoreList; - TARGETING::targetService().getAssociated( pCoreList, pSys, + TARGETING::TargetHandleList l_TargetList; + TARGETING::targetService().getAssociated( l_TargetList, pSys, TARGETING::TargetService::CHILD, TARGETING::TargetService::ALL, &predCore ); - if (pCoreList.empty()) + if (l_TargetList.empty()) { - TS_FAIL("testVerifyCoreChipletNum: empty pCoreList"); + TS_FAIL("testVerifyCoreChipletNum: empty l_TargetList"); break; } - // Iterate through present cores - for (TARGETING::TargetHandleList::const_iterator - l_coreIter = pCoreList.begin(); - l_coreIter != pCoreList.end(); - ++l_coreIter) + // Iterate through all cores + for (auto & l_Target : l_TargetList) { - TARGETING::Target * pTarTarget = *l_coreIter; - // map Targeting Type to fapi2 Type - Target fapi2_Target( pTarTarget); + Target fapi2_Target( l_Target); l_chiplet_id = fapi2_Target.getChipletNumber(); FAPI_DBG("testVerifyCoreChipletNum HUID: %.8X, ChipletId: %.8X", - TARGETING::get_huid(pTarTarget), + TARGETING::get_huid(l_Target), l_chiplet_id); - chipUnit = pTarTarget->getAttr(); - l_exp_chiplet_id = chipUnit + START_CORE_CHIPLET_NUM; + // Processor Core 0..23 maps to pervasive ids 0x20..0x37 + l_chip_unit = l_Target->getAttr(); + l_exp_chiplet_id = l_chip_unit + START_CORE_CHIPLET_NUM; if (l_chiplet_id != l_exp_chiplet_id) { @@ -596,6 +787,14 @@ class Fapi2GetChipletNum : public CxxTest::TestSuite testVerifyMcaChipletNum(); + testVerifyCappChipletNum(); + + testVerifyNvChipletNum(); + + testVerifyPecChipletNum(); + + testVerifyiPhbChipletNum(); + } while(0); FAPI_DBG("test_fapi2ChipletNum Test Complete."); } // end test_fapi2ChipletNum() diff --git a/src/usr/fapi2/test/fapi2TestUtils.H b/src/usr/fapi2/test/fapi2TestUtils.H index ccc90146d..937af56f3 100644 --- a/src/usr/fapi2/test/fapi2TestUtils.H +++ b/src/usr/fapi2/test/fapi2TestUtils.H @@ -48,9 +48,20 @@ // non-core and non-cache chiplet ids #define START_PERV_CHIPLET_NUM 0x01 +// CAPI Unit(0,1 => 0x02, 0x04) +#define START_CAPP_CHIPLET_NUM 0x02 +// NV (0, 1 => 0x05) +#define START_NV_CHIPLET_NUM 0x05 +// XBUS (0, 1 => 0x6) #define START_XBUS_CHIPLET_NUM 0x06 +// MCBIST (0, 1 => 0x07, 0x08) #define START_MCBIST_CHIPLET_NUM 0x07 +// OBUS (0, 3 => 0x09, 0x0C) #define START_OBUS_CHIPLET_NUM 0x09 +// PEC (0, 1, 2 => 0x0D, 0x0E, 0x0F) +#define START_PEC_0_CHIPLET_NUM 0x0D +#define START_PEC_1_CHIPLET_NUM 0x0E +#define START_PEC_2_CHIPLET_NUM 0x0F // All Cache Chiplets #define START_EQ_CHIPLET_NUM 0x10 @@ -93,7 +104,7 @@ enum PERVASIVE_CHILDREN { PERV_XBUS_CHILDREN = 2, PERV_OBUS_CHILDREN = 1, PERV_CAPP_CHILDREN = 1, - PERV_NV_CHILDREN = 1, + PERV_NV_CHILDREN = 2, PERV_MCBIST_CHILDREN = 1, PERV_MCS_CHILDREN = 2, PERV_MCA_CHILDREN = 4, diff --git a/src/usr/targeting/common/genHwsvMrwXml.pl b/src/usr/targeting/common/genHwsvMrwXml.pl index 3dfb06d6f..632ec4f4b 100755 --- a/src/usr/targeting/common/genHwsvMrwXml.pl +++ b/src/usr/targeting/common/genHwsvMrwXml.pl @@ -4605,6 +4605,9 @@ sub generate_pec my $affinityPath = "affinity:sys-$sys/node-$node/proc-$proc/pec-$pec"; + #Chiplet IDs for pec 0,1,2 => 0xd, 0xe, 0xf + my $chipletId = sprintf("0x%X",($pec + 0xd)); + print " sys${sys}node${node}proc${proc}pec$pec @@ -4634,6 +4637,10 @@ sub generate_pec CHIP_UNIT $pec + + + CHIPLET_ID + $chipletId "; addPervasiveParentLink($sys,$node,$proc,$pec,"pec"); @@ -4667,6 +4674,11 @@ sub generate_phb_chiplet $phb = $phb - 3; } + #Chiplet IDs for pec0phb0 => 0xd + #Chiplet IDs for pec1phb1, pec1phb2 => 0xe + #Chiplet IDs for pec2phb3, pec2phb4, pec2phb5 => 0xf + my $chipletId = sprintf("0x%X",($pec + 0xd)); + my $lognode; my $logid; for (my $j = 0; $j <= $#chipIDs; $j++) @@ -4713,6 +4725,10 @@ sub generate_phb_chiplet CHIP_UNIT $phbChipUnit + + + CHIPLET_ID + $chipletId "; addPervasiveParentLink($sys,$node,$proc,$phbChipUnit,"phb"); @@ -5067,6 +5083,9 @@ sub generate_capp my $fapi_name = sprintf("pu.capp:k0:n%d:s0:p%02d:c%d", $node, $proc,$capp); my $affinityPath = "affinity:sys-$sys/node-$node/proc-$proc/capp-$capp"; + #Chiplet IDs for capp 0 => 0x2 and capp 1 => 0x4 + my $chipletId = sprintf("0x%X",(($capp + 1) * 2)); + print " sys${sys}node${node}proc${proc}capp$capp @@ -5096,6 +5115,10 @@ sub generate_capp CHIP_UNIT $capp + + + CHIPLET_ID + $chipletId "; addPervasiveParentLink($sys,$node,$proc,$capp,"capp"); @@ -5224,6 +5247,9 @@ sub generate_a_nv my $fapi_name = "NA"; # NV not FAPI target + #Chiplet IDs for nv 0,1 => 0x5 + my $chipletId = sprintf("0x%X",(0x5)); + print " sys${sys}node${node}proc${proc}nv${nv} @@ -5249,6 +5275,10 @@ sub generate_a_nv CHIP_UNIT $nv + + + CHIPLET_ID + $chipletId "; addPervasiveParentLink($sys,$node,$proc,$nv,"nv"); diff --git a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml index 79e84e306..4b923a599 100644 --- a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml +++ b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml @@ -2536,6 +2536,10 @@ CHIP_UNIT 0 + + CHIPLET_ID + 0xD + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-13 @@ -2569,6 +2573,10 @@ CHIP_UNIT 1 + + CHIPLET_ID + 0xE + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-14 @@ -2602,6 +2610,10 @@ CHIP_UNIT 2 + + CHIPLET_ID + 0xF + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-15 @@ -2636,6 +2648,10 @@ CHIP_UNIT 0 + + CHIPLET_ID + 0xD + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-13 @@ -2670,6 +2686,10 @@ CHIP_UNIT 1 + + CHIPLET_ID + 0xE + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-14 @@ -2703,6 +2723,10 @@ CHIP_UNIT 2 + + CHIPLET_ID + 0xE + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-14 @@ -2737,6 +2761,10 @@ CHIP_UNIT 3 + + CHIPLET_ID + 0xF + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-15 @@ -2770,6 +2798,10 @@ CHIP_UNIT 4 + + CHIPLET_ID + 0xF + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-15 @@ -2803,6 +2835,10 @@ CHIP_UNIT 5 + + CHIPLET_ID + 0xF + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-15 @@ -2908,6 +2944,43 @@ CHIP_UNIT 0 + + CHIPLET_ID + 0x05 + + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-5 + + + + + sys0node0proc0nv1 + unit-nv-nimbus + HUID0x00290001 + + FAPI_NAMENA + + + PHYS_PATH + physical:sys-0/node-0/proc-0/nv-1 + + + AFFINITY_PATH + affinity:sys-0/node-0/proc-0/nv-1 + + + ORDINAL_ID + 1 + + + CHIP_UNIT + 1 + + + CHIPLET_ID + 0x05 + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-5 @@ -4679,6 +4752,10 @@ CHIP_UNIT 0 + + CHIPLET_ID + 2 + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-2 @@ -4712,6 +4789,10 @@ CHIP_UNIT 1 + + CHIPLET_ID + 4 + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-4 @@ -7576,6 +7657,10 @@ CHIP_UNIT 0 + + CHIPLET_ID + 0xD + @@ -7613,6 +7698,10 @@ CHIP_UNIT 1 + + CHIPLET_ID + 0xE + @@ -7650,6 +7739,10 @@ CHIP_UNIT 2 + + CHIPLET_ID + 0xF + @@ -7687,6 +7780,10 @@ CHIP_UNIT 0 + + CHIPLET_ID + 0xD + @@ -7724,6 +7821,10 @@ CHIP_UNIT 1 + + CHIPLET_ID + 0xE + @@ -7761,6 +7862,10 @@ CHIP_UNIT 2 + + CHIPLET_ID + 0xE + @@ -7798,6 +7903,10 @@ CHIP_UNIT 3 + + CHIPLET_ID + 0xF + @@ -7835,6 +7944,10 @@ CHIP_UNIT 4 + + CHIPLET_ID + 0xF + @@ -7872,6 +7985,10 @@ CHIP_UNIT 5 + + CHIPLET_ID + 0xF + @@ -8050,7 +8167,7 @@ sys0node0proc1nv0 unit-nv-nimbus - HUID0x00290001 + HUID0x00290002 FAPI_NAMENA @@ -8064,12 +8181,49 @@ ORDINAL_ID - 1 + 2 CHIP_UNIT 0 + + CHIPLET_ID + 0x05 + + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-1/perv-5 + + + + + sys0node0proc1nv1 + unit-nv-nimbus + HUID0x00290003 + + FAPI_NAMENA + + + PHYS_PATH + physical:sys-0/node-0/proc-1/nv-1 + + + AFFINITY_PATH + affinity:sys-0/node-0/proc-1/nv-1 + + + ORDINAL_ID + 3 + + + CHIP_UNIT + 1 + + + CHIPLET_ID + 0x05 + PARENT_PERVASIVE physical:sys-0/node-0/proc-1/perv-5 @@ -10311,6 +10465,10 @@ CHIP_UNIT 0 + + CHIPLET_ID + 2 + @@ -10348,6 +10506,10 @@ CHIP_UNIT 1 + + CHIPLET_ID + 4 + diff --git a/src/usr/targeting/common/xmltohb/vbu_NIMBUS.system.xml b/src/usr/targeting/common/xmltohb/vbu_NIMBUS.system.xml index 78fee6d6c..3e037c87e 100644 --- a/src/usr/targeting/common/xmltohb/vbu_NIMBUS.system.xml +++ b/src/usr/targeting/common/xmltohb/vbu_NIMBUS.system.xml @@ -2431,6 +2431,10 @@ CHIP_UNIT 0 + + CHIPLET_ID + 0x0D + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-13 @@ -2464,6 +2468,10 @@ CHIP_UNIT 1 + + CHIPLET_ID + 0x0E + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-14 @@ -2497,6 +2505,10 @@ CHIP_UNIT 2 + + CHIPLET_ID + 0x0F + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-15 @@ -2531,6 +2543,10 @@ CHIP_UNIT 0 + + CHIPLET_ID + 0x0D + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-13 @@ -2565,6 +2581,10 @@ CHIP_UNIT 1 + + CHIPLET_ID + 0x0E + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-14 @@ -2598,6 +2618,10 @@ CHIP_UNIT 2 + + CHIPLET_ID + 0x0E + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-14 @@ -2632,6 +2656,10 @@ CHIP_UNIT 3 + + CHIPLET_ID + 0x0F + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-15 @@ -2665,6 +2693,10 @@ CHIP_UNIT 4 + + CHIPLET_ID + 0x0F + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-15 @@ -2698,6 +2730,10 @@ CHIP_UNIT 5 + + CHIPLET_ID + 0x0F + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-15 @@ -2803,6 +2839,10 @@ CHIP_UNIT 0 + + CHIPLET_ID + 0x05 + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-5 @@ -4574,6 +4614,10 @@ CHIP_UNIT 0 + + CHIPLET_ID + 0x2 + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-2 @@ -4607,6 +4651,10 @@ CHIP_UNIT 1 + + CHIPLET_ID + 0x4 + PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-4 -- cgit v1.2.3