diff options
author | Lateef Quraishi <lateef@us.ibm.com> | 2016-08-25 17:23:33 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-09-02 10:07:18 -0400 |
commit | d85d7b3c2deecb0bb717084edba4168f8094679d (patch) | |
tree | 79198bdf41843be410e989a6f5680b9aa6f68cfd /src/usr/hwas/test | |
parent | e4866856c7642d1ae8c6ec4b9cf9d2042ecef103 (diff) | |
download | talos-hostboot-d85d7b3c2deecb0bb717084edba4168f8094679d.tar.gz talos-hostboot-d85d7b3c2deecb0bb717084edba4168f8094679d.zip |
Drive PERV target existence based on blueprint, not PG
Corrected wrong Proc 1 PERV HUIDs
Change-Id: I030585f9cc11fbd76d5a0d5fd2926a31090f3f76
RTC: 159350
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28821
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/hwas/test')
-rw-r--r-- | src/usr/hwas/test/hwas1test.H | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/src/usr/hwas/test/hwas1test.H b/src/usr/hwas/test/hwas1test.H index 1f24dadd0..4ad8e49a8 100644 --- a/src/usr/hwas/test/hwas1test.H +++ b/src/usr/hwas/test/hwas1test.H @@ -1303,6 +1303,96 @@ public: TS_TRACE( "testHWASrestrictECunits exit" ); } + /** + * @brief test pervStates + */ + void testHWASpervStates() + { + using namespace HWAS; + using namespace TARGETING; + + // find top level target + Target * pSys; + targetService().getTopLevelTarget(pSys); + + PredicateCTM predChip(CLASS_CHIP); + PredicateCTM predPerv(CLASS_UNIT, TYPE_PERV); + PredicatePostfixExpr checkExpr; + checkExpr.push(&predChip).Or().push(&predPerv).Or(); + + TargetHandleList pPervList; + // get list of all PERV targets + targetService().getAssociated( pPervList, pSys, + TargetService::CHILD, + TargetService::ALL, + &predPerv ); + // sort the list by ATTR_HUID to ensure that we + // start at the same place each time + std::sort(pPervList.begin(), pPervList.end(), + compareTargetHuid); + do + { + if (pPervList.empty()) + { + TS_FAIL("testHWASpervStates: empty pPervList"); + break; + } + // Iterate through all PERV chiplets + for (TargetHandleList::const_iterator + l_pervIter = pPervList.begin(); + l_pervIter != pPervList.end(); + ++l_pervIter) + { + Target * l_target = *l_pervIter; + + // The chip unit number of the perv target + // is the index into the PG data + ATTR_CHIP_UNIT_type chip_unit = + l_target->getAttr<ATTR_CHIP_UNIT>(); + + // get the HW State of the target + HwasState hwasState = l_target->getAttr<ATTR_HWAS_STATE>(); + + // get parent target and the HW state + const Target * l_ptarget; + l_ptarget = getParentChip(l_target); + HwasState phwasState = l_ptarget->getAttr<ATTR_HWAS_STATE>(); + + if (phwasState.present == true) + { + if (hwasState.present == false) + { + TS_FAIL("testHWASpervStates: PERV[%d] HUID: %.8X - is NOT Present", + chip_unit, + l_target->getAttr<ATTR_HUID>()); + break; + } + HWAS_DBG("PERV[%d]: HUID: %.8X - %spresent, %sfunctional", + chip_unit, + l_target->getAttr<ATTR_HUID>(), + hwasState.present ? "" : "NOT ", + hwasState.functional ? "" : "NOT "); + } + else + { + if (hwasState.present == true) + { + TS_FAIL("testHWASpervStates: PERV[%d] HUID: %.8X - is Present and Parent is NOT", + chip_unit, + l_target->getAttr<ATTR_HUID>()); + break; + } + HWAS_DBG("PERV[%d]: HUID: %.8X - %spresent, %sfunctional", + chip_unit, + l_target->getAttr<ATTR_HUID>(), + hwasState.present ? "" : "NOT ", + hwasState.functional ? "" : "NOT "); + } + } + } while(0); + + TS_TRACE( "testHWASpervStates exit" ); + } }; #endif // |