Skip to content

Commit

Permalink
Fix OMIC MRW processing
Browse files Browse the repository at this point in the history
Missing a few things in our mrw xml processing for OMIC
targets.
- Added a maxInstance value for the OMIC targets.  This
prevents the HUIDs from repeating the same value behind each proc.
- Modified OMIC_PARENT calculation to use existing PATHs
instead of calculating (incorrectly) from FAPI_POS.
- Added correct unit_pos calculation

Change-Id: I4e0dee4ec1aa9a080f2ce49922659c4c7b5ca548
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82629
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: Chen Du <duchen@us.ibm.com>
Reviewed-by: William G Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Nicholas E Bofferding <bofferdn@us.ibm.com>
  • Loading branch information
dcrowell77 authored and Nicholas E Bofferding committed Aug 23, 2019
1 parent 4ea0824 commit 4b8fb56
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 36 deletions.
6 changes: 6 additions & 0 deletions src/usr/targeting/common/Targets.pm
Expand Up @@ -89,6 +89,7 @@ my %maxInstance = (
"NX" => 1,
"MEMBUF" => 8,
"SMPGROUP" => 8,
"OMIC" => 6,
);
sub new
{
Expand Down Expand Up @@ -1626,6 +1627,11 @@ sub setCommonAttrForChiplet
$self->setAttribute($target, "INSTANCE_PATH", $target);
$unit_pos = $pos%2;
}
elsif ($tgt_type eq "OMIC")
{
# There are 3 OMICs per MC parent
$unit_pos = $pos % 3;
}

my $parent_affinity = $self->getAttribute(
$self->getTargetParent($target),"AFFINITY_PATH");
Expand Down
73 changes: 37 additions & 36 deletions src/usr/targeting/common/processMrw.pl
Expand Up @@ -48,22 +48,22 @@
my $output_filename = "";

# Map the OMI instance to its corresponding OMIC parent
my %omi_map = (4 => "mc-0/omic-0",
5 => "mc-0/omic-0",
6 => "mc-0/omic-0",
7 => "mc-0/omic-1",
2 => "mc-0/omic-1",
3 => "mc-0/omic-1",
0 => "mc-0/omic-2",
1 => "mc-0/omic-2",
12 => "mc-1/omic-0",
13 => "mc-1/omic-0",
14 => "mc-1/omic-0",
15 => "mc-1/omic-1",
10 => "mc-1/omic-1",
11 => "mc-1/omic-1",
8 => "mc-1/omic-2",
9 => "mc-1/omic-2");
my %omi_map = (4 => "omic-0",
5 => "omic-0",
6 => "omic-0",
7 => "omic-1",
2 => "omic-1",
3 => "omic-1",
0 => "omic-2",
1 => "omic-2",
12 => "omic-0",
13 => "omic-0",
14 => "omic-0",
15 => "omic-1",
10 => "omic-1",
11 => "omic-1",
8 => "omic-2",
9 => "omic-2");

# TODO RTC:170860 - Remove this after dimm connector defines VDDR_ID
my $num_voltage_rails_per_proc = 1;
Expand Down Expand Up @@ -1662,9 +1662,9 @@ sub processMcbist
##
sub processMc
{
# NOTE: OMI_INBAND_BAR_BASE_ADDR_OFFSET will be set for the MC
# targets via a specific child OMI Target. View the
# processOmi function for further details.
# NOTE: OMI_INBAND_BAR_BASE_ADDR_OFFSET will be set for the MC
# targets via a specific child OMI Target. View the
# processOmi function for further details.
my $targetObj = shift;
my $target = shift;
Expand Down Expand Up @@ -1741,31 +1741,32 @@ sub processMcc
##
sub processOmi
{
my $targetObj = shift;
my $target = shift;
my $mrwObj = shift;
my $omitarg = shift;
use integer;
# There are a total of eight OMI units on an MC unit. So, to
# determine which MC an OMI belongs to, the CHIP_UNIT of the OMI can
# be divided by the number of units per MC to arrive at the correct
# offset to add to the pervasive OMI parent offset.
my $numberOfOmiPerMc = 8;
my $chip_unit = $targetObj->getAttribute($target, "CHIP_UNIT");
my $fapi_pos = $targetObj->getAttribute($target, "FAPI_POS");
my $chip_unit = $mrwObj->getAttribute($omitarg, "CHIP_UNIT");
my $fapi_pos = $mrwObj->getAttribute($omitarg, "FAPI_POS");
my $value = sprintf("0x%x",
Targets::PERVASIVE_PARENT_MI_OFFSET
+ ($chip_unit / $numberOfOmiPerMc));
$targetObj->setAttribute($target, "CHIPLET_ID", $value);
$mrwObj->setAttribute($omitarg, "CHIPLET_ID", $value);
my $numberOfOmiPerProc = 16;
my $proc_num = $fapi_pos / $numberOfOmiPerProc;
# Mod by numberOfOmiPerProc to get the relative position to the proc
my $num = $fapi_pos % $numberOfOmiPerProc;
$value = "physical:sys-0/node-0/proc-$proc_num/" . $omi_map{$num};
$targetObj->setAttribute($target, "OMIC_PARENT", $value);
# Start with our affinity path "sys-a/node-b/proc-c/mc-d/mi-e/mcc-f/omi-g"
# then snip off everything before the mi
my $phys_path = $mrwObj->getAttribute($omitarg, "PHYS_PATH");
my $up_to_mi = index($phys_path,"mi-");
my $omic_parent = substr($phys_path,0,$up_to_mi);
$omic_parent = $omic_parent.$omi_map{$chip_unit};
$mrwObj->setAttribute($omitarg, "OMIC_PARENT", $omic_parent);
my $omi = Math::BigInt->new($targetObj->getAttribute($target,"CHIP_UNIT"));
my $omi = Math::BigInt->new($mrwObj->getAttribute($omitarg,"FAPI_POS"));
# Base omi bar offset
# We use this base address in simics_AXONE.system.xml and want our
# addresses to match the ones in that xml
Expand All @@ -1784,16 +1785,16 @@ sub processOmi
}
$value = sprintf("0x%016s", substr(($value)->as_hex(),2));
$targetObj->setAttribute($target, "OMI_INBAND_BAR_BASE_ADDR_OFFSET",
$mrwObj->setAttribute($omitarg, "OMI_INBAND_BAR_BASE_ADDR_OFFSET",
$value);
# Set the parent MC BAR value to value of first OMI unit
if ($omi % 8 eq 0)
{
my $parent_mcc = $targetObj->getTargetParent($target);
my $parent_mi = $targetObj->getTargetParent($parent_mcc);
my $parent_mc = $targetObj->getTargetParent($parent_mi);
$targetObj->setAttribute($parent_mc, "OMI_INBAND_BAR_BASE_ADDR_OFFSET",
my $parent_mcc = $mrwObj->getTargetParent($omitarg);
my $parent_mi = $mrwObj->getTargetParent($parent_mcc);
my $parent_mc = $mrwObj->getTargetParent($parent_mi);
$mrwObj->setAttribute($parent_mc, "OMI_INBAND_BAR_BASE_ADDR_OFFSET",
$value);
}
}
Expand Down

0 comments on commit 4b8fb56

Please sign in to comment.