diff options
author | Joachim Fenkes <fenkes@de.ibm.com> | 2017-06-29 11:20:53 -0500 |
---|---|---|
committer | Prachi Gupta <pragupta@us.ibm.com> | 2017-07-26 10:55:43 -0400 |
commit | 2cbd9a34290f3ae6624daedece191545c939001a (patch) | |
tree | e9f69fad50da0adb740c406a6c4ce18d2e251be0 /src/tools | |
parent | e6705981ffde638e1285511a39f4492d5f6e4e43 (diff) | |
download | talos-sbe-2cbd9a34290f3ae6624daedece191545c939001a.tar.gz talos-sbe-2cbd9a34290f3ae6624daedece191545c939001a.zip |
parseAttributeInfo: Support inverted EC features
There are several EC feature attributes where matching the chip
specification actually indicates the _absence_ of a feature.
So far we had to either match on every other chip, adding new chips
as projects are added, or define the attribute as a negative attribute
and invert its value in procedure code (sometimes without indicating
in the attribute name that it's a negative attribute). Both approaches
are prone to causing mistakes down the road.
To fix this, introduce a new <falseIfMatch/> tag that indicates that
an EC feature is absent if the chip spec is matched, so the procedure
code will not have to remember to invert the attribute value.
Change-Id: I33dcf127b8f81729c9638d6648faf2c5adbcb470
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42608
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Santosh S. Puranik <santosh.puranik@in.ibm.com>
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Diffstat (limited to 'src/tools')
-rwxr-xr-x | src/tools/scripts/ppeParseAttributeInfo.pl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tools/scripts/ppeParseAttributeInfo.pl b/src/tools/scripts/ppeParseAttributeInfo.pl index 30635886..75550eb7 100755 --- a/src/tools/scripts/ppeParseAttributeInfo.pl +++ b/src/tools/scripts/ppeParseAttributeInfo.pl @@ -613,12 +613,16 @@ foreach my $entr (@{$entries->{entry}}) { # hasFeature with the attribute specific logic if (exists $attr->{chipEcFeature}) { - my $chipCount = 0; + my $chipCount = 0; + my $falseIfMatch = exists $attr->{chipEcFeature}->{falseIfMatch}; + my $noMatchValue = $falseIfMatch ? 1 : 0; + my $yesMatchValue = $falseIfMatch ? 0 : 1; + print ECHFILE " inline uint8_t hasFeature(int2Type<$attr->{id}>,\n"; print ECHFILE " fapi2::ATTR_NAME_Type i_name,\n"; print ECHFILE " fapi2::ATTR_EC_Type i_ec)\n"; print ECHFILE " {\n"; - print ECHFILE " uint8_t hasFeature = 0;\n\n"; + print ECHFILE " uint8_t hasFeature = $noMatchValue;\n\n"; print ECHFILE " if("; foreach my $chip (@{$attr->{chipEcFeature}->{chip}}) @@ -690,7 +694,7 @@ foreach my $entr (@{$entries->{entry}}) { } print ECHFILE ")\n"; print ECHFILE " {\n"; - print ECHFILE " hasFeature = 1;\n"; + print ECHFILE " hasFeature = $yesMatchValue;\n"; print ECHFILE " }\n"; print ECHFILE " return hasFeature;\n"; print ECHFILE " };\n"; |