From 5df2675372b378275cfe7e3b83d3663fed2fd21a Mon Sep 17 00:00:00 2001 From: Lateef Quraishi Date: Thu, 21 Jul 2016 13:27:17 -0500 Subject: Add getChipletNumber to Target Class Chiplet Ids are as follows: - EQ 0-5 Ids: 0x10 - 0x15 - EX 0-11 Ids: 0x10, 0x10, 0x11, 0x11, --- (parent's id) - Cores 0-23 Ids: 0x20 - 0x37 - Pervasive Id: 0x01 - Xbus Id: 0x06 - Mcbist 0-1 Ids: 0x07 - 0x08 - Mcs 0-3 Ids: 0x07, 0x07, 0x08, 0x08 (parent's id) - Mca 0-3 Ids: 0x07, 0x07, 0x07, 0x07 (parent's id) - Mca 4-7 Ids: 0x08, 0x08, 0x08, 0x08 (parent's id) - Obus0 Id: 0x09 - Obus3 Id: 0x0C Change-Id: I89be032654c191b8930fac07a1b64061e381fe14 RTC: 156120 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27339 Tested-by: Jenkins Server Reviewed-by: Christian R. Geddes Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/include/usr/fapi2/target.H | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/include') diff --git a/src/include/usr/fapi2/target.H b/src/include/usr/fapi2/target.H index 3aa7e9342..623783acc 100644 --- a/src/include/usr/fapi2/target.H +++ b/src/include/usr/fapi2/target.H @@ -1022,6 +1022,26 @@ inline Target getTarget(uint64_t Ordinal) return Target(Ordinal); } +/// +/// @brief Returns the chiplet number associated with the Target +/// @return The chiplet number for the Target. 0 is returned if the +/// Target does not have a chiplet number (for ex, the PROC_CHIP Target) +/// @note For logical targets such as the EX, the chiplet number of +/// their immediate parent chiplet is returned +/// +template< TargetType K, typename V > +inline uint8_t Target< K, V >::getChipletNumber(void) const +{ + const TARGETING::Target * l_pTarget = + static_cast(this->get()); + uint8_t l_chiplet_id = 0; + if(!l_pTarget->tryGetAttr(l_chiplet_id)) + { + FAPI_ERR("ERROR: getChipletNumber: Can not read CHIPLET_ID attribute"); + } + return l_chiplet_id; +} + } // End namespace fapi2 #endif // End __FAPI2_TARGET__ -- cgit v1.2.1