From 6b8b5cd3fd404afa693358125c1659a74f21b7e3 Mon Sep 17 00:00:00 2001 From: Greg Still Date: Tue, 18 Aug 2015 22:55:42 -0500 Subject: Support TARGET_TYPE_SYSTEM PPE attributes - Add support for SYSTEM types - Fix attribute "setting" bug for scalar attributes only; array attributes untested - Add nest_attributes.xml - Reduce extra whitespace per Gerrit comments (more) - Added debug switch to ppeParseAtteibuteInfo.pl - Add system attributes to merged .fixed section (base_ppe_header.S, proc_sbe_fixed.H, topfiles.mk) - Fixed FAPI2 regression setup based on newest SEEPROM and PIBMEM (SBE) linker layout. This implicates the Makefile (eg new "seeprom" rule). - Fix rebase issues with new commits. Added necessary dependent files and missing attribute enablement - Rebased with the merged "Fix compile" commit which moves the definition and setting of the global variables associated with attributes to target.C Change-Id: Iadbe080dec1558079ca6fe9c8fa711b098ba1e0b Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/20078 Tested-by: Jenkins Server Reviewed-by: Gregory S. Still --- tools/image/ppeSetFixed.pl | 125 +++++++++++++++++++++------------------------ 1 file changed, 59 insertions(+), 66 deletions(-) (limited to 'tools/image/ppeSetFixed.pl') diff --git a/tools/image/ppeSetFixed.pl b/tools/image/ppeSetFixed.pl index 8d781d23..def03f5f 100755 --- a/tools/image/ppeSetFixed.pl +++ b/tools/image/ppeSetFixed.pl @@ -26,7 +26,8 @@ if ($numArgs < 3) print ("$attrpath/attribute_info/proc_attributes.xml \\\n" ); print ("$attrpath/attribute_info/ex_attributes.xml \\\n" ); print ("$attrpath/attribute_info/eq_attributes.xml \\\n" ); - print ("$attrpath/attribute_info/core_attributes.xml \n"); + print ("$attrpath/attribute_info/core_attributes.xml \\ \n"); + print ("$attrpath/attribute_info/nest_attributes.xml \n"); exit(1); } @@ -40,6 +41,7 @@ my $xml = new XML::Simple (KeyAttr=>[]); my $xmlFiles = 0; my $attCount = 0; my $numIfAttrFiles = 0; +my @attrSystemIds; my @attrChipIds; my @attrExIds; my @attrCoreIds; @@ -83,54 +85,54 @@ foreach my $entr (@{$entries->{entry}}) { #-------------------------------------------------------------------------- foreach my $attr (@{$attributes->{attribute}}) { - if($attr->{id} eq $inname) { - #------------------------------------------------------------------ - # Check that the AttributeId exists - #------------------------------------------------------------------ - if (! exists $attr->{id}) - { - print ("ppeSbeFixed.pl ERROR. Att 'id' missing\n"); - exit(1); - } + #------------------------------------------------------------------ + # Check that the AttributeId exists + #------------------------------------------------------------------ + if (! exists $attr->{id}) + { + print ("ppeSbeFixed.pl ERROR. Att 'id' missing\n"); + exit(1); + } + if($attr->{targetType} eq "TARGET_TYPE_SYSTEM") { - if($attr->{targetType} eq "TARGET_TYPE_PROC_CHIP") { + push(@attrSystemIds, $entr); - push(@attrChipIds, $entr); + } elsif($attr->{targetType} eq "TARGET_TYPE_PROC_CHIP") { - } elsif($attr->{targetType} eq "TARGET_TYPE_CORE") { + push(@attrChipIds, $entr); - push(@attrCoreIds, $entr); - - } elsif($attr->{targetType} eq "TARGET_TYPE_EQ") { + } elsif($attr->{targetType} eq "TARGET_TYPE_CORE") { - push(@attrEqIds, $entr); + push(@attrCoreIds, $entr); - } elsif($attr->{targetType} eq "TARGET_TYPE_EX") { + } elsif($attr->{targetType} eq "TARGET_TYPE_EQ") { - push(@attrExIds, $entr); + push(@attrEqIds, $entr); - } elsif($attr->{targetType} eq "TARGET_TYPE_PERV") { + } elsif($attr->{targetType} eq "TARGET_TYPE_EX") { - push(@attrPervIds, $entr); + push(@attrExIds, $entr); - } else { + } elsif($attr->{targetType} eq "TARGET_TYPE_PERV") { - print ("ppeSetFixed.pl ERROR. Wrong attribute type: $attr->{targetType}\n"); - exit(1); + push(@attrPervIds, $entr); - } + } else { + + print ("ppeSetFixed.pl ERROR. Wrong attribute type: $attr->{targetType}\n"); + exit(1); + } } } } - } - +setFixed("TARGET_TYPE_SYSTEM", @attrSystemIds); setFixed("TARGET_TYPE_PROC_CHIP", @attrChipIds); setFixed("TARGET_TYPE_CORE", @attrCoreIds); setFixed("TARGET_TYPE_EQ", @attrEqIds); @@ -143,68 +145,59 @@ sub setFixed { my ($string, @entries) = @_; -foreach my $attr (@entries) -{ - - my $inname = $attr->{name}; - - my @values = $attr->{value}; - - - if(scalar @values > 0) { - - foreach my $val (@values) + foreach my $attr (@entries) { - if(defined $val && ref($val) eq "") { + my $inname = $attr->{name}; - if ($val =~ /(0x)?[0-9a-fA-F]+/) { - - my $systemRc = system("$sbedefaultpath/sbe_default_tool $image $inname $val $string 0"); - - if ($systemRc) { - print "sbe_default_tool: error in execution\n"; - exit 1; - } - - } else { - print ("ppeSetFixed.pl ERROR. not hex\n"); - exit(1); - } + my @values = $attr->{value}; - } elsif(defined $val && ref($val) eq "ARRAY") { - my $index = 0; + if(scalar @values > 0) { + foreach my $val (@values) + { - foreach my $arr (@{$val}) { + if(defined $val && ref($val) eq "") { - if(defined $arr && ref($arr) eq "") { - if ($arr =~ /(0x)?[0-9a-fA-F]+/) { + if ($val =~ /(0x)?[0-9a-fA-F]+/) { - my $systemRc = system("$sbedefaultpath/sbe_default_tool $image $inname $arr $string $index"); + my $systemRc = system("$sbedefaultpath/sbe_default_tool $image $inname $val $string 0"); if ($systemRc) { print "sbe_default_tool: error in execution\n"; exit 1; } - + } else { + print ("ppeSetFixed.pl ERROR. not hex\n"); + exit(1); } - } - $index++; - } + } elsif(defined $val && ref($val) eq "ARRAY") { + my $index = 0; - } + foreach my $arr (@{$val}) { + if(defined $arr && ref($arr) eq "") { + if ($arr =~ /(0x)?[0-9a-fA-F]+/) { - } - } + my $systemRc = system("$sbedefaultpath/sbe_default_tool $image $inname $arr $string $index"); + if ($systemRc) { + print "sbe_default_tool: error in execution\n"; + exit 1; + } -} + } + } + $index++; + } + } + } + } + } } -- cgit v1.2.1