Skip to content

Commit

Permalink
Define Parent/Child Relationship for OMIC/OMI targets
Browse files Browse the repository at this point in the history
This commit puts in the plumbing to have xmltohb.pl  look for
ATTR_OMIC_PARENT attributes on the OMI targets and with the value
of that attribute define a bi-directional relationship between the
given OMI target and its defined OMIC parent. Each target in the binary
will have pointers to its associated parent/child. When getChildren<OMI>
or getParent<OMIC> is called in the FAPI2 api for a OMIC or OMI target
respectively, then the Hostboot platform implementation of these
functions will route to the new getParentOmicTargetsByState and
getChildOmiTargetsByState functions that were defined to perform lookups
in the targeting binary for this relationship.

Change-Id: I8cd901864a700c9fe575dfa0916d5e78760a7b0c
RTC: 172969
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68541
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
crgeddes authored and dcrowell77 committed Nov 27, 2018
1 parent 896f7a9 commit 63a9aa5
Show file tree
Hide file tree
Showing 11 changed files with 254 additions and 7 deletions.
25 changes: 25 additions & 0 deletions src/include/usr/fapi2/target.H
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,15 @@ inline Target<K_PARENT, V> Target<T_SELF, V>::getParent(void) const
requiredPType,
TARGETING::UTIL_FILTER_ALL);
}
else if(K_PARENT == fapi2::TARGET_TYPE_OMIC)
{
TARGETING::getParentOmicTargetsByState(
l_parentList,
static_cast<TARGETING::Target*>(this->get()),
TARGETING::CLASS_NA,
requiredPType,
TARGETING::UTIL_FILTER_ALL);
}
else
{
TARGETING::getParentAffinityTargetsByState(
Expand Down Expand Up @@ -957,6 +966,14 @@ inline std::vector<Target<K_CHILD, V> >
l_type,
TARGETING::UTIL_FILTER_ALL);
}
else if(T_SELF == fapi2::TARGET_TYPE_OMIC)
{
TARGETING::getChildOmiTargetsByState(l_childList,
static_cast<TARGETING::Target*>(this->get()),
TARGETING::CLASS_NA,
l_type,
TARGETING::UTIL_FILTER_ALL);
}
// DIMMs need to use PRESENT so that we don't report things
// that aren't installed
else if(K_CHILD == fapi2::TARGET_TYPE_DIMM)
Expand Down Expand Up @@ -988,6 +1005,14 @@ inline std::vector<Target<K_CHILD, V> >
l_type,
TARGETING::UTIL_FILTER_FUNCTIONAL);
}
else if(T_SELF == fapi2::TARGET_TYPE_OMIC)
{
TARGETING::getChildOmiTargetsByState(l_childList,
static_cast<TARGETING::Target*>(this->get()),
TARGETING::CLASS_NA,
l_type,
TARGETING::UTIL_FILTER_FUNCTIONAL);
}
else
{
TARGETING::getChildAffinityTargetsByState(l_childList,
Expand Down
5 changes: 3 additions & 2 deletions src/include/usr/targeting/common/target.H
Original file line number Diff line number Diff line change
Expand Up @@ -770,14 +770,15 @@ class Target
// Array of pointers to target handles. Currently there is one pointer
// for each supported association type. The currently supported
// association types are PARENT, CHILD, PARENT_BY_AFFINITY,
// CHILD_BY_AFFINTY, PERVASIVE_CHILD, and PARENT_PERVASIVE.
// CHILD_BY_AFFINTY, PERVASIVE_CHILD, PARENT_PERVASIVE,
// OMI_CHILD, and OMIC_PARENT.
// The number of pointers should exactly equal value
// of TargetService::MAX_ASSOCIATION_TYPES defined in
// targeting/common/targetservice.H. Due to the huge code changes
// necessary to directly use that enum value, a compile time assert in
// targeting/common/targetservice.C enforces that restriction.
TARGETING::AbstractPointer< AbstractPointer<Target> >
iv_ppAssociations[6];
iv_ppAssociations[8];

private: // Private CTORs/DTORs/Operators

Expand Down
2 changes: 2 additions & 0 deletions src/include/usr/targeting/common/targetservice.H
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ class TargetService
///< associated with a pervasive target
PARENT_PERVASIVE, ///< The result target should be a pervasive
///< target
OMI_CHILD, ///< The result target(s) should be an OMI target
OMIC_PARENT, ///< The result target should be an OMIC target
MAX_ASSOCIATION_TYPES, ///< Number of types, must always be last
};

Expand Down
42 changes: 42 additions & 0 deletions src/include/usr/targeting/common/utilFilter.H
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,48 @@ void getParentPervasiveTargetsByState (
TYPE i_type,
ResourceState i_state);

/**
* @brief Given an input target, finds all the targets linked to it via a
* OMIC_PARENT relationship and writes them to the output vector.
* The class, type, and resource state further filter the set of results.
* Note: It is expected that only 1 target will be added to the output
* vector for getParentOmicTargetsByState calls.
*
* @parm[out] o_vector, reference to vector of target pointers
* @parm[in] i_target, source target to search from
* @parm[in] i_class, class of the targets to be obtained
* @parm[in] i_type, type of the targets to be obtained
* @parm[in] i_state, specifies state the target should be in
*
* @return N/A
*/
void getParentOmicTargetsByState (
TARGETING::TargetHandleList& o_vector,
const Target* i_target,
CLASS i_class,
TYPE i_type,
ResourceState i_state);

/**
* @brief Given an input target, finds all the targets linked to it via a
* OMI_CHILD relationship and writes them to the output vector.
* The class, type, and resource state further filter the set of results.
*
* @parm[out] o_vector, reference to vector of target pointers
* @parm[in] i_target, source target to search from
* @parm[in] i_class, class of the targets to be obtained
* @parm[in] i_type, type of the targets to be obtained
* @parm[in] i_state, specifies state the target should be in
*
* @return N/A
*/
void getChildOmiTargetsByState (
TARGETING::TargetHandleList& o_vector,
const Target* i_target,
CLASS i_class,
TYPE i_type,
ResourceState i_state);

/**
* @brief Populate the o_vector with target object pointers which are
* affinity parents of the input target
Expand Down
19 changes: 19 additions & 0 deletions src/usr/fapi2/test/fapi2GetChildrenTest.H
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,25 @@ void test_fapi2GetChildren()
}
}

if (isHwValid(l_proc, MY_OMIC)
&& isHwValid(l_proc, MY_OMI))
{
l_childOMIs = fapi2_omicTarget.getChildren<fapi2::TARGET_TYPE_OMI>(TARGET_STATE_PRESENT);
l_targetHuid = TARGETING::get_huid(targeting_targets[MY_OMIC]);
l_actualSize = l_childOMIs.size();

//Set expected size to be the number of OMIs per proc
l_expectedSize = MAX_OMI_PER_OMIC;
numTests++;
if(l_actualSize != l_expectedSize)
{
FAPI_INF("fapi2TargetTest:: # OMIs foound for OMIC0 proc is %d and not %d",
l_actualSize, l_expectedSize);
numFails++;
break;
}
}

if (isHwValid(l_proc, MY_OMI)
&& isHwValid(l_proc, MY_OCMB))
{
Expand Down
5 changes: 5 additions & 0 deletions src/usr/fapi2/test/fapi2TestUtils.H
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
#define OCMB_PER_OMI 1
#define MEM_PORT_PER_OCMB 1

// Note that OMIC can either have 2 or 3 child OMI
// targets. There are 3 OMIC targets per MC, OMIC0
// and OMIC1 have 3 children, OMIC2 has 2 children
#define MAX_OMI_PER_OMIC 3

#define SIMULATED_GOOD_CORES 4

// non-core and non-cache chiplet ids
Expand Down
23 changes: 23 additions & 0 deletions src/usr/targeting/common/utilFilter.C
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,18 @@ void getPervasiveChildTargetsByState(
TargetService::PERVASIVE_CHILD);
}

void getChildOmiTargetsByState(
TARGETING::TargetHandleList& o_vector,
const Target* i_target,
CLASS i_class,
TYPE i_type,
ResourceState i_state )

{
getAffinityTargets(o_vector, i_target, i_class, i_type, i_state,
TargetService::OMI_CHILD);
}

void getParentAffinityTargetsByState(
TARGETING::TargetHandleList& o_vector,
const Target* i_target,
Expand All @@ -423,6 +435,17 @@ void getParentPervasiveTargetsByState(
TargetService::PARENT_PERVASIVE);
}

void getParentOmicTargetsByState(
TARGETING::TargetHandleList& o_vector,
const Target* i_target,
CLASS i_class,
TYPE i_type,
ResourceState i_state )
{
getAffinityTargets(o_vector, i_target, i_class, i_type, i_state,
TargetService::OMIC_PARENT);
}

const Target * getParentChip( const Target * i_pChiplet )
{

Expand Down
14 changes: 14 additions & 0 deletions src/usr/targeting/common/xmltohb/attribute_types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5070,6 +5070,20 @@
<no_export/>
</attribute>

<attribute>
<description>
Physical entity path an OMI's associated OMIC parent target
</description>
<id>OMIC_PARENT</id>
<nativeType>
<name>EntityPath</name>
</nativeType>
<persistency>non-volatile</persistency>
<readable/>
<virtual/>
<no_export/>
</attribute>

<attribute>
<description>Ordinal ID of a target</description>
<id>ORDINAL_ID</id>
Expand Down
64 changes: 64 additions & 0 deletions src/usr/targeting/common/xmltohb/simics_AXONE.system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7344,6 +7344,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-7</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-0/omic-2</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-0/mi-0/mcc-0/omi-0</default>
Expand Down Expand Up @@ -7406,6 +7410,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-7</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-0/omic-2</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-0/mi-0/mcc-0/omi-1</default>
Expand Down Expand Up @@ -7468,6 +7476,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-7</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-0/omic-1</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-0/mi-0/mcc-1/omi-0</default>
Expand Down Expand Up @@ -7530,6 +7542,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-7</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-0/omic-1</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-0/mi-0/mcc-1/omi-1</default>
Expand Down Expand Up @@ -7596,6 +7612,10 @@
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-0/mi-1/mcc-0/omi-0</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-0/omic-0</default>
</attribute>
<attribute>
<id>PRIMARY_CAPABILITIES</id>
<default>
Expand Down Expand Up @@ -7654,6 +7674,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-7</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-0/omic-0</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-0/mi-1/mcc-0/omi-1</default>
Expand Down Expand Up @@ -7716,6 +7740,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-7</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-0/omic-0</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-0/mi-1/mcc-1/omi-0</default>
Expand Down Expand Up @@ -7778,6 +7806,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-7</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-0/omic-1</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-0/mi-1/mcc-1/omi-1</default>
Expand Down Expand Up @@ -7840,6 +7872,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-8</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-1/omic-2</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-1/mi-0/mcc-0/omi-0</default>
Expand Down Expand Up @@ -7902,6 +7938,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-8</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-1/omic-2</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-1/mi-0/mcc-0/omi-1</default>
Expand Down Expand Up @@ -7964,6 +8004,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-8</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-1/omic-1</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-1/mi-0/mcc-1/omi-0</default>
Expand Down Expand Up @@ -8026,6 +8070,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-8</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-1/omic-1</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-1/mi-0/mcc-1/omi-11</default>
Expand Down Expand Up @@ -8088,6 +8136,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-8</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-1/omic-0</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-1/mi-1/mcc-0/omi-0</default>
Expand Down Expand Up @@ -8150,6 +8202,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-8</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-1/omic-0</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-1/mi-1/mcc-0/omi-1</default>
Expand Down Expand Up @@ -8212,6 +8268,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-8</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-1/omic-0</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-1/mi-1/mcc-1/omi-0</default>
Expand Down Expand Up @@ -8274,6 +8334,10 @@
<id>PARENT_PERVASIVE</id>
<default>physical:sys-0/node-0/proc-0/perv-8</default>
</attribute>
<attribute>
<id>OMIC_PARENT</id>
<default>physical:sys-0/node-0/proc-0/mc-1/omic-1</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
<default>physical:sys-0/node-0/proc-0/mc-1/mi-1/mcc-1/omi-1</default>
Expand Down

0 comments on commit 63a9aa5

Please sign in to comment.