diff options
Diffstat (limited to 'src/import')
-rw-r--r-- | src/import/hwpf/fapi2/include/fapi2_hw_access.H | 5 | ||||
-rw-r--r-- | src/import/hwpf/fapi2/include/target_types.H | 136 | ||||
-rwxr-xr-x | src/import/hwpf/fapi2/tools/parseAttributeInfo.pl | 78 |
3 files changed, 122 insertions, 97 deletions
diff --git a/src/import/hwpf/fapi2/include/fapi2_hw_access.H b/src/import/hwpf/fapi2/include/fapi2_hw_access.H index e0b42c5eb..fe310df7d 100644 --- a/src/import/hwpf/fapi2/include/fapi2_hw_access.H +++ b/src/import/hwpf/fapi2/include/fapi2_hw_access.H @@ -363,6 +363,11 @@ template< TargetType K > inline ReturnCode putSpy(const Target<K>& i_target, const char* const i_spyId, const variable_buffer& i_data); + +template< TargetType K > +inline ReturnCode putSpy(const Target<K>& i_target, + const char* const i_spyId, + const char* i_enum); #endif /// @brief Writes spy data into a buffer holding ring data image diff --git a/src/import/hwpf/fapi2/include/target_types.H b/src/import/hwpf/fapi2/include/target_types.H index 7fd959f54..d75d5e45d 100644 --- a/src/import/hwpf/fapi2/include/target_types.H +++ b/src/import/hwpf/fapi2/include/target_types.H @@ -1,3 +1,21 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: hwpf/fapi2/include/target_types.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* EKB Project */ +/* */ +/* COPYRIGHT 2015 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* IBM_PROLOG_END_TAG */ /** * @file target_types.H * @brief definitions for fapi2 target types @@ -5,77 +23,79 @@ #ifndef __FAPI2_TARGET_TYPES__ #define __FAPI2_TARGET_TYPES__ - +#include <stdint.h> /// FAPI namespace namespace fapi2 { - /// - /// @enum fapi::TargetType - /// @brief Types, kinds, of targets - /// @note TYPE_NONE is used to represent empty/NULL targets in lists - /// or tables. TYPE_ALL is used to pass targets to methods which - /// can act generally on any type of target - /// +/// +/// @enum fapi::TargetType +/// @brief Types, kinds, of targets +/// @note TYPE_NONE is used to represent empty/NULL targets in lists +/// or tables. TYPE_ALL is used to pass targets to methods which +/// can act generally on any type of target +/// - /// Target Kind - enum TargetType - { - TARGET_TYPE_NONE = 0x00000000, ///< No type - TARGET_TYPE_SYSTEM = 0x00000001, ///< System type - TARGET_TYPE_DIMM = 0x00000002, ///< DIMM type - TARGET_TYPE_PROC_CHIP = 0x00000004, ///< Processor type - TARGET_TYPE_MEMBUF_CHIP = 0x00000008, ///< Membuf type - TARGET_TYPE_EX = 0x00000010, ///< EX - 2x Core, L2, L3 - can be deconfigured - TARGET_TYPE_MBA = 0x00000020, ///< MBA type - TARGET_TYPE_MCS = 0x00000040, ///< MCS type - TARGET_TYPE_XBUS = 0x00000080, ///< XBUS type - TARGET_TYPE_ABUS = 0x00000100, ///< ABUS type - TARGET_TYPE_L4 = 0x00000200, ///< L4 type - TARGET_TYPE_CORE = 0x00000400, ///< Core - 4x threads(?) - can be deconfigured - TARGET_TYPE_EQ = 0x00000800, ///< EQ - 4x core, 2x L2, 2x L3 - can be deconfigured - TARGET_TYPE_MCA = 0x00001000, ///< MCA type - TARGET_TYPE_MCBIST = 0x00002000, ///< MCBIST type - TARGET_TYPE_MI = 0x00004000, ///< MI Memory Interface (Cumulus) - TARGET_TYPE_CAPP = 0x00008000, ///< CAPP target - TARGET_TYPE_DMI = 0x00010000, ///< DMI type - TARGET_TYPE_OBUS = 0x00020000, ///< OBUS type - TARGET_TYPE_NV = 0x00040000, ///< NV bus type - TARGET_TYPE_SBE = 0x00080000, ///< SBE type - TARGET_TYPE_PPE = 0x00100000, ///< PPE type - TARGET_TYPE_PERV = 0x00200000, ///< Pervasive type - TARGET_TYPE_PEC = 0x00400000, ///< PEC type - TARGET_TYPE_PHB = 0x00800000, ///< PHB type +/// Target Kind +enum TargetType +{ + TARGET_TYPE_NONE = 0x00000000, ///< No type + TARGET_TYPE_SYSTEM = 0x00000001, ///< System type + TARGET_TYPE_DIMM = 0x00000002, ///< DIMM type + TARGET_TYPE_PROC_CHIP = 0x00000004, ///< Processor type + TARGET_TYPE_MEMBUF_CHIP = 0x00000008, ///< Membuf type + TARGET_TYPE_EX = 0x00000010, ///< EX - 2x Core, L2, L3 - can be deconfigured + TARGET_TYPE_MBA = 0x00000020, ///< MBA type + TARGET_TYPE_MCS = 0x00000040, ///< MCS type + TARGET_TYPE_XBUS = 0x00000080, ///< XBUS type + TARGET_TYPE_ABUS = 0x00000100, ///< ABUS type + TARGET_TYPE_L4 = 0x00000200, ///< L4 type + TARGET_TYPE_CORE = 0x00000400, ///< Core - 4x threads(?) - can be deconfigured + TARGET_TYPE_EQ = 0x00000800, ///< EQ - 4x core, 2x L2, 2x L3 - can be deconfigured + TARGET_TYPE_MCA = 0x00001000, ///< MCA type + TARGET_TYPE_MCBIST = 0x00002000, ///< MCBIST type + TARGET_TYPE_MI = 0x00004000, ///< MI Memory Interface (Cumulus) + TARGET_TYPE_CAPP = 0x00008000, ///< CAPP target + TARGET_TYPE_DMI = 0x00010000, ///< DMI type + TARGET_TYPE_OBUS = 0x00020000, ///< OBUS type + TARGET_TYPE_NV = 0x00040000, ///< NV bus type + TARGET_TYPE_SBE = 0x00080000, ///< SBE type + TARGET_TYPE_PPE = 0x00100000, ///< PPE type + TARGET_TYPE_PERV = 0x00200000, ///< Pervasive type + TARGET_TYPE_PEC = 0x00400000, ///< PEC type + TARGET_TYPE_PHB = 0x00800000, ///< PHB type - TARGET_TYPE_ALL = 0xFFFFFFFF, ///< Any/All types + TARGET_TYPE_ALL = 0xFFFFFFFF, ///< Any/All types - // Mappings to target types found in the error xml files - TARGET_TYPE_EX_CHIPLET = TARGET_TYPE_EX, - TARGET_TYPE_MBA_CHIPLET = TARGET_TYPE_MBA, - TARGET_TYPE_MCS_CHIPLET = TARGET_TYPE_MCS, - TARGET_TYPE_XBUS_ENDPOINT = TARGET_TYPE_XBUS, - TARGET_TYPE_ABUS_ENDPOINT = TARGET_TYPE_ABUS, - }; + // Mappings to target types found in the error xml files + TARGET_TYPE_EX_CHIPLET = TARGET_TYPE_EX, + TARGET_TYPE_MBA_CHIPLET = TARGET_TYPE_MBA, + TARGET_TYPE_MCS_CHIPLET = TARGET_TYPE_MCS, + TARGET_TYPE_XBUS_ENDPOINT = TARGET_TYPE_XBUS, + TARGET_TYPE_ABUS_ENDPOINT = TARGET_TYPE_ABUS, +}; - /// @cond - constexpr TargetType operator|(TargetType x, TargetType y) - { - return static_cast<TargetType>(static_cast<int>(x) | - static_cast<int>(y)); - } +/// @cond +constexpr TargetType operator|(TargetType x, TargetType y) +{ + return static_cast<TargetType>(static_cast<int>(x) | + static_cast<int>(y)); +} - template<uint64_t V> - class bitCount { +template<uint64_t V> +class bitCount +{ public: // Don't use enums, too hard to compare - static const uint8_t count = bitCount<(V >> 1)>::count + (V & 1); - }; + static const uint8_t count = bitCount < (V >> 1) >::count + (V & 1); +}; - template<> - class bitCount<0> { +template<> +class bitCount<0> +{ public: static const uint8_t count = 0; - }; - /// @endcond +}; +/// @endcond } diff --git a/src/import/hwpf/fapi2/tools/parseAttributeInfo.pl b/src/import/hwpf/fapi2/tools/parseAttributeInfo.pl index db40d0c53..3eb69b145 100755 --- a/src/import/hwpf/fapi2/tools/parseAttributeInfo.pl +++ b/src/import/hwpf/fapi2/tools/parseAttributeInfo.pl @@ -95,16 +95,16 @@ $etFile .= "/"; $etFile .= "attrEnumInfo.csv"; open(ETFILE, ">", $etFile); -# TODO: This for platform use only, will support later via RTC 128106 -##my $fmFile = $ARGV[0]; -#$fmFile .= "/"; -#$fmFile .= "fapi2AttrOverrideData.H"; -#open(FMFILE, ">", $fmFile); +# TODO: This for platform use only, will support later via RTC 128106 for HB +my $fmFile = $arg_output_dir; +$fmFile .= "/"; +$fmFile .= "fapi2AttrOverrideData.H"; +open(FMFILE, ">", $fmFile); -#my $feFile = $ARGV[0]; -#$feFile .= "/"; -#$feFile .= "fapi2AttrOverrideEnums.H"; -#open(FEFILE, ">", $feFile); +my $feFile = $arg_output_dir; +$feFile .= "/"; +$feFile .= "fapi2AttrOverrideEnums.H"; +open(FEFILE, ">", $feFile); #------------------------------------------------------------------------------ @@ -212,14 +212,14 @@ print ETFILE "# <ENUM-STR>,<ENUM-VAL>\n"; #------------------------------------------------------------------------------- # Print header of getFapiAttrData.C # ------------------------------------------------------------------------------ -#print FMFILE "const AttributeData g_FapiAttrs[] = {\n"; -#my %attrOverrideData = (); +print FMFILE "const AttributeData g_FapiAttrs[] = {\n"; +my %attrOverrideData = (); #------------------------------------------------------------------------------- # Print header of getFapiAttrEnumData.C # ------------------------------------------------------------------------------ -#print FEFILE "const AttributeEnum g_FapiEnums[] = {\n"; -#my @attrOverrideEnums = (); +print FEFILE "const AttributeEnum g_FapiEnums[] = {\n"; +my @attrOverrideEnums = (); my %attrIdHash; # Records which Attribute IDs have been used my %attrValHash; # Records which Attribute values have been used @@ -319,7 +319,7 @@ foreach my $argnum (0 .. $#ARGV) foreach my $attr (@{$attributes->{attribute}}) { -# my $attrOverride = ""; + my $attrOverride = ""; #---------------------------------------------------------------------- # Print a comment with the attribute ID attribute_ids.H #---------------------------------------------------------------------- @@ -342,8 +342,8 @@ foreach my $argnum (0 .. $#ARGV) #---------------------------------------------------------------------- # Print the assignment of each attribute to the local l_name #---------------------------------------------------------------------- -# $attrOverride .= "\t{\n"; -# $attrOverride .= "\t\t\"$attr->{id}\",\n"; + $attrOverride .= "\t{\n"; + $attrOverride .= "\t\t\"$attr->{id}\",\n"; #---------------------------------------------------------------------- # Figure out the attribute array dimensions (if array) @@ -381,10 +381,10 @@ foreach my $argnum (0 .. $#ARGV) print AIFILE "typedef uint8_t $attr->{id}_Type;\n"; print ITFILE "$attr->{id},$attr->{id},"; print ITFILE "0x$attrIdHash{$attr->{id}},u8\n"; -# $attrOverride .= "\t\t0x$attrIdHash{$attr->{id}},\n"; -# $attrOverride .= "\t\tsizeof(uint8_t),\n"; -# $attrOverride .= "\t\t{ $arrayDimString }\n"; -# $attrOverride .= "\t},\n"; + $attrOverride .= "\t\t0x$attrIdHash{$attr->{id}},\n"; + $attrOverride .= "\t\tsizeof(uint8_t),\n"; + $attrOverride .= "\t\t{ $arrayDimString }\n"; + $attrOverride .= "\t},\n"; } else { @@ -410,8 +410,8 @@ foreach my $argnum (0 .. $#ARGV) print AIFILE "typedef ${actualSize}_t $attr->{id}_Type$arrayDimensions;\n"; print ITFILE "$attr->{id},$attr->{id},0x$attrIdHash{$attr->{id}},u8" . "$arrayDimensions\n"; -# $attrOverride .= "\t\t0x$attrIdHash{$attr->{id}},\n"; -# $attrOverride .= "\t\tsizeof(${actualSize}_t),\n"; + $attrOverride .= "\t\t0x$attrIdHash{$attr->{id}},\n"; + $attrOverride .= "\t\tsizeof(${actualSize}_t),\n"; } else { @@ -419,8 +419,8 @@ foreach my $argnum (0 .. $#ARGV) print $attr->{valueType}, "\n"; exit(1); } -# $attrOverride .= "\t\t{ $arrayDimString }\n"; -# $attrOverride .= "\t},\n"; + $attrOverride .= "\t\t{ $arrayDimString }\n"; + $attrOverride .= "\t},\n"; } #---------------------------------------------------------------------- @@ -519,8 +519,8 @@ foreach my $argnum (0 .. $#ARGV) $value =~ s/\s+$//; } -# push @attrOverrideEnums, -# "\t{ \"$attr->{id}_$values[0]\", $values[1] },\n"; + push @attrOverrideEnums, + "\t{ \"$attr->{id}_$values[0]\", $values[1] },\n"; # Print the attribute enum to attribute_ids.H print AIFILE " ENUM_$attr->{id}_${val}"; @@ -678,7 +678,7 @@ foreach my $argnum (0 .. $#ARGV) #---------------------------------------------------------------------- # Add attribute override string to map. #---------------------------------------------------------------------- -# $attrOverrideData{$attr->{id}} = $attrOverride; + $attrOverrideData{$attr->{id}} = $attrOverride; }; } @@ -731,20 +731,20 @@ print ASFILE "</html>\n"; #------------------------------------------------------------------------------ # Print content for getFapiAttrData.C #------------------------------------------------------------------------------ -#foreach my $override (sort keys %attrOverrideData) -#{ -# print FMFILE $attrOverrideData{$override}; -#} -#print FMFILE "};\n"; +foreach my $override (sort keys %attrOverrideData) +{ + print FMFILE $attrOverrideData{$override}; +} +print FMFILE "};\n"; #------------------------------------------------------------------------------ # Print footer for getFapiAttrEnumData.C #------------------------------------------------------------------------------ -#foreach my $override (sort @attrOverrideEnums) -#{ -# print FEFILE $override; -#} -#print FEFILE "};\n"; +foreach my $override (sort @attrOverrideEnums) +{ + print FEFILE $override; +} +print FEFILE "};\n"; #------------------------------------------------------------------------------ # Close output files @@ -755,6 +755,6 @@ close(ACFILE); close(ASFILE); close(ITFILE); close(ETFILE); -#close(FMFILE); -#close(FEFILE); +close(FMFILE); +close(FEFILE); |