From 63a9aa53dcf3c7ddcff756e694ddcff246b5c9f2 Mon Sep 17 00:00:00 2001 From: Christian Geddes Date: Thu, 8 Nov 2018 11:06:47 -0600 Subject: Define Parent/Child Relationship for OMIC/OMI targets 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 or getParent 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 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Matt Derksen Reviewed-by: Nicholas E. Bofferding Reviewed-by: Daniel M. Crowell --- src/usr/fapi2/test/fapi2GetChildrenTest.H | 19 +++++++ src/usr/fapi2/test/fapi2TestUtils.H | 5 ++ src/usr/targeting/common/utilFilter.C | 23 ++++++++ .../targeting/common/xmltohb/attribute_types.xml | 14 +++++ .../common/xmltohb/simics_AXONE.system.xml | 64 ++++++++++++++++++++++ src/usr/targeting/common/xmltohb/target_types.xml | 3 + src/usr/targeting/common/xmltohb/xmltohb.pl | 59 ++++++++++++++++++-- 7 files changed, 182 insertions(+), 5 deletions(-) (limited to 'src/usr') diff --git a/src/usr/fapi2/test/fapi2GetChildrenTest.H b/src/usr/fapi2/test/fapi2GetChildrenTest.H index 6dbe88e86..04f3863ba 100644 --- a/src/usr/fapi2/test/fapi2GetChildrenTest.H +++ b/src/usr/fapi2/test/fapi2GetChildrenTest.H @@ -233,6 +233,25 @@ void test_fapi2GetChildren() } } + if (isHwValid(l_proc, MY_OMIC) + && isHwValid(l_proc, MY_OMI)) + { + l_childOMIs = fapi2_omicTarget.getChildren(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)) { diff --git a/src/usr/fapi2/test/fapi2TestUtils.H b/src/usr/fapi2/test/fapi2TestUtils.H index 2d51330c2..cb88a1d6e 100644 --- a/src/usr/fapi2/test/fapi2TestUtils.H +++ b/src/usr/fapi2/test/fapi2TestUtils.H @@ -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 diff --git a/src/usr/targeting/common/utilFilter.C b/src/usr/targeting/common/utilFilter.C index 3675dfb04..7f2c02074 100644 --- a/src/usr/targeting/common/utilFilter.C +++ b/src/usr/targeting/common/utilFilter.C @@ -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, @@ -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 ) { diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index b42bf793e..18e7b7588 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -5070,6 +5070,20 @@ + + + Physical entity path an OMI's associated OMIC parent target + + OMIC_PARENT + + EntityPath + + non-volatile + + + + + Ordinal ID of a target ORDINAL_ID diff --git a/src/usr/targeting/common/xmltohb/simics_AXONE.system.xml b/src/usr/targeting/common/xmltohb/simics_AXONE.system.xml index 6fdd560e5..e90a616e7 100644 --- a/src/usr/targeting/common/xmltohb/simics_AXONE.system.xml +++ b/src/usr/targeting/common/xmltohb/simics_AXONE.system.xml @@ -7344,6 +7344,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-7 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-0/omic-2 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-0/mi-0/mcc-0/omi-0 @@ -7406,6 +7410,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-7 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-0/omic-2 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-0/mi-0/mcc-0/omi-1 @@ -7468,6 +7476,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-7 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-0/omic-1 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-0/mi-0/mcc-1/omi-0 @@ -7530,6 +7542,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-7 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-0/omic-1 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-0/mi-0/mcc-1/omi-1 @@ -7596,6 +7612,10 @@ PHYS_PATH physical:sys-0/node-0/proc-0/mc-0/mi-1/mcc-0/omi-0 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-0/omic-0 + PRIMARY_CAPABILITIES @@ -7654,6 +7674,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-7 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-0/omic-0 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-0/mi-1/mcc-0/omi-1 @@ -7716,6 +7740,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-7 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-0/omic-0 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-0/mi-1/mcc-1/omi-0 @@ -7778,6 +7806,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-7 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-0/omic-1 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-0/mi-1/mcc-1/omi-1 @@ -7840,6 +7872,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-8 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-1/omic-2 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-1/mi-0/mcc-0/omi-0 @@ -7902,6 +7938,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-8 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-1/omic-2 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-1/mi-0/mcc-0/omi-1 @@ -7964,6 +8004,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-8 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-1/omic-1 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-1/mi-0/mcc-1/omi-0 @@ -8026,6 +8070,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-8 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-1/omic-1 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-1/mi-0/mcc-1/omi-11 @@ -8088,6 +8136,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-8 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-1/omic-0 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-1/mi-1/mcc-0/omi-0 @@ -8150,6 +8202,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-8 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-1/omic-0 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-1/mi-1/mcc-0/omi-1 @@ -8212,6 +8268,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-8 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-1/omic-0 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-1/mi-1/mcc-1/omi-0 @@ -8274,6 +8334,10 @@ PARENT_PERVASIVE physical:sys-0/node-0/proc-0/perv-8 + + OMIC_PARENT + physical:sys-0/node-0/proc-0/mc-1/omic-1 + PHYS_PATH physical:sys-0/node-0/proc-0/mc-1/mi-1/mcc-1/omi-1 diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index f1e95b9d4..9e8bc0bf8 100644 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -2514,6 +2514,9 @@ 0x00000033 HWAS_STATE_CHANGED_SUBSCRIPTION_MASK + + OMIC_PARENT + PARENT_PERVASIVE diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index a0be4e3e7..1d929a3a9 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -157,11 +157,14 @@ use constant PARENT_BY_AFFINITY => "ParentByAffinity"; use constant CHILD_BY_AFFINITY => "ChildByAffinity"; use constant PERVASIVE_CHILD => "PervasiveChild"; use constant PARENT_PERVASIVE => "ParentPervasive"; +use constant OMIC_PARENT => "OmicParent"; +use constant OMI_CHILD => "OmiChild"; my @associationTypes = ( PARENT_BY_CONTAINMENT, CHILD_BY_CONTAINMENT, PARENT_BY_AFFINITY, CHILD_BY_AFFINITY, - PERVASIVE_CHILD, PARENT_PERVASIVE ); + PERVASIVE_CHILD, PARENT_PERVASIVE, OMIC_PARENT, OMI_CHILD ); # Constants for attribute names (minus ATTR_ prefix) +use constant ATTR_OMIC_PARENT => "OMIC_PARENT"; use constant ATTR_PARENT_PERVASIVE => "PARENT_PERVASIVE"; use constant ATTR_PHYS_PATH => "PHYS_PATH"; use constant ATTR_AFFINITY_PATH => "AFFINITY_PATH"; @@ -6297,6 +6300,8 @@ sub generateTargetingImage { my $ptrToChildByAffinityAssociations = INVALID_POINTER; my $ptrToPervasiveChildAssociations = INVALID_POINTER; my $ptrToParentPervasiveAssociations = INVALID_POINTER; + my $ptrToOmiChildAssociations = INVALID_POINTER; + my $ptrToOmicParentAssociations = INVALID_POINTER; my $id = $targetInstance->{id}; $targetAddrHash{$id}{offsetToPtrToParentByContainmentAssociations} = @@ -6323,12 +6328,22 @@ sub generateTargetingImage { $offsetWithinTargets + length $data; $data .= pack8byte($ptrToParentPervasiveAssociations); + $targetAddrHash{$id}{offsetToPtrToOmiChildAssociations} = + $offsetWithinTargets + length $data; + $data .= pack8byte($ptrToOmiChildAssociations); + + $targetAddrHash{$id}{offsetToPtrToOmicParentAssociations} = + $offsetWithinTargets + length $data; + $data .= pack8byte($ptrToOmicParentAssociations); + $targetAddrHash{$id}{ParentByContainmentAssociations} = [@NullPtrArray]; $targetAddrHash{$id}{ChildByContainmentAssociations} = [@NullPtrArray]; $targetAddrHash{$id}{ParentByAffinityAssociations} = [@NullPtrArray]; $targetAddrHash{$id}{ChildByAffinityAssociations} = [@NullPtrArray]; $targetAddrHash{$id}{PervasiveChildAssociations} = [@NullPtrArray]; $targetAddrHash{$id}{ParentPervasiveAssociations} = [@NullPtrArray]; + $targetAddrHash{$id}{OmiChildAssociations} = [@NullPtrArray]; + $targetAddrHash{$id}{OmicParentAssociations} = [@NullPtrArray]; if($id =~/^sys\d+$/) { @@ -6358,6 +6373,10 @@ sub generateTargetingImage { . "$targetAddrHash{$id}{offsetToPtrToPervasiveChildAssociations}"); ASSOC_DBG("Offset within targets to ptr to parent pervasive list = " . "$targetAddrHash{$id}{offsetToPtrToParentPervasiveAssociations}"); + ASSOC_DBG("Offset within targets to ptr to omi child list = " + . "$targetAddrHash{$id}{offsetToPtrToOmiChildAssociations}"); + ASSOC_DBG("Offset within targets to ptr to omic parent list = " + . "$targetAddrHash{$id}{offsetToPtrToOmicParentAssociations}"); $attrAddr += $attributeListTypeHoH{$targetInstance->{type}}{elements} * (length pack8byte(0)); @@ -6498,7 +6517,8 @@ sub generateTargetingImage { # path for association processing later on if( ($attributeId eq ATTR_PHYS_PATH) || ($attributeId eq ATTR_AFFINITY_PATH) - || ($attributeId eq ATTR_PARENT_PERVASIVE)) + || ($attributeId eq ATTR_PARENT_PERVASIVE) + || ($attributeId eq ATTR_OMIC_PARENT)) { $targetAddrHash{$targetInstance->{id}}{$attributeId} = $attrhash{$attributeId}->{default}; @@ -6630,9 +6650,10 @@ sub generateTargetingImage { # Each target is 4 bytes # attributes, 8 bytes pointer # to attribute list, 8 bytes pointer to attribute pointer - # list, 6 x 8 byte pointers to association lists, for total - # of 20 + 48 = 68 bytes per target - $index *= (20 + 48); # length(N + quad + quad + 6x quad) + # list, num associations x 8 byte pointers to association lists + + # length(double + quad + quad + # associations x quad) + $index *= (20 + 8 * (scalar @associationTypes)); $attrhash{$attributeId}->{default} = $index + $firstTgtPtr; } @@ -6942,6 +6963,7 @@ sub generateTargetingImage { my $phys_attr = ATTR_PHYS_PATH; my $affn_attr = ATTR_AFFINITY_PATH; my $parent_pervasive = ATTR_PARENT_PERVASIVE; + my $omic_parent = ATTR_OMIC_PARENT; my $phys_path = $targetAddrHash{$id}{$phys_attr}; my $parent_phys_path = substr $phys_path, 0, (rindex $phys_path, "/"); @@ -6949,6 +6971,33 @@ sub generateTargetingImage { my $affn_path = $targetAddrHash{$id}{$affn_attr}; my $parent_affn_path = substr $affn_path, 0, (rindex $affn_path, "/"); + # If this target has an associated OMIC target, create a + # bidirectional relationship between this target and the specified + # OMIC target. This target will point to the OMIC target via + # a "OMIC_PARENT" association, and the pervasive target will + # point to this target via a "OMI_CHILD" association. + if(defined $targetAddrHash{$id}{$omic_parent}) + { + my $parent_omic_path = + $targetAddrHash{$id}{$omic_parent}; + + if(defined $targetPhysicalPath{$parent_omic_path}) + { + my $parent = $targetPhysicalPath{$parent_omic_path}; + unshift + @ { $targetAddrHash{$id} + {OmicParentAssociations} }, + $firstTgtPtr + $targetAddrHash{$parent} + {OffsetToTargetWithinTargetList}; + + unshift + @ { $targetAddrHash{$parent} + {OmiChildAssociations} }, + $firstTgtPtr + $targetAddrHash{$id} + {OffsetToTargetWithinTargetList}; + } + } + # If this target has an associated pervasive target, create a # bidirectional relationship between this target and the specified # pervasive target. This target will point to the pervasive target via -- cgit v1.2.1