summaryrefslogtreecommitdiffstats
path: root/src/include/arch
diff options
context:
space:
mode:
authorBill Hoffa <wghoffa@us.ibm.com>2016-05-17 11:01:25 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-05-24 17:58:42 -0400
commit7870b70cc8f8154ee3347d992ba86684baa19caf (patch)
treeae410d1ac773eef167234c48899c8b1affae569c /src/include/arch
parent421d6728e36657888908637d96f5e5b6f8d02a0f (diff)
downloadblackbird-hostboot-7870b70cc8f8154ee3347d992ba86684baa19caf.tar.gz
blackbird-hostboot-7870b70cc8f8154ee3347d992ba86684baa19caf.zip
Add testcases for pirformat helper functions
Change-Id: I10b2be1ea9d0dc4a46c6c473b03ee024c6bf0de6 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24801 Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/arch')
-rw-r--r--src/include/arch/pirformat.H34
1 files changed, 27 insertions, 7 deletions
diff --git a/src/include/arch/pirformat.H b/src/include/arch/pirformat.H
index 0085ccbf1..ec64b669a 100644
--- a/src/include/arch/pirformat.H
+++ b/src/include/arch/pirformat.H
@@ -113,7 +113,6 @@ struct PIR_t
};
// Some handy functions
- // TODO RTC 154162 Add testcases for the below functions
inline static uint32_t groupFromPir( uint32_t i_pir ) {
return (static_cast<PIR_t>(i_pir)).groupId;
}
@@ -127,6 +126,26 @@ struct PIR_t
return (static_cast<PIR_t>(i_pir)).threadId;
}
+ // Below is the right-justified portion of the PIR laid out in bits
+ // (normal core mode) along with chipId/coreId pictures
+ //
+ // - - - - - - - - - - - - - - - -
+ // | ^ | ^ | ^| ^ | ^
+ // | | | | |
+ // group chip | core thread
+ // reserved |
+ // | | }
+ // | | |
+ // | chipId | }
+ // __________________ |
+ // | |
+ // | coreId |
+ // |_________________________|
+ //
+ // A chipId contains just the group + chip bits. It is right justified.
+ //
+ // A coreId contains the group, chip, reserved, and core bits.
+ // It is also right justified.
inline static uint32_t groupFromChipId( uint32_t i_chipId ) {
return (i_chipId >> BITS_IN_CHIP);
}
@@ -135,14 +154,15 @@ struct PIR_t
(BITS_AFTER_CHIP)));
}
- inline static uint32_t groupFromCoreId( uint32_t i_chipId ) {
- return (i_chipId >> (BITS_AFTER_GROUP));
+ inline static uint32_t groupFromCoreId( uint32_t i_coreId ) {
+ return (i_coreId >> (BITS_IN_CHIP + BITS_IN_RESERVED1 + BITS_IN_CORE));
}
- inline static uint32_t chipFromCoreId( uint32_t i_chipId ) {
- return (i_chipId >> BITS_AFTER_CHIP);
+ inline static uint32_t chipFromCoreId( uint32_t i_coreId ) {
+ return ((i_coreId & (CHIP_MASK >> BITS_IN_THREAD))
+ >> (BITS_IN_CORE + BITS_IN_RESERVED1));
}
- inline static uint32_t coreFromCoreId( uint32_t i_chipId ) {
- return (i_chipId & (CORE_MASK >> BITS_IN_THREAD));
+ inline static uint32_t coreFromCoreId( uint32_t i_coreId ) {
+ return (i_coreId & (CORE_MASK >> BITS_AFTER_CORE));
}
inline static uint32_t createChipId( uint32_t i_groupId,
OpenPOWER on IntegriCloud