summaryrefslogtreecommitdiffstats
path: root/import/hwpf/fapi2/include/target_types.H
blob: 4c15dee59bf53ae8ef84615c3b50ec32461128d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/* 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
 */

#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
///

/// 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

    // Compound target types
    TARGET_TYPE_CHIPS         = TARGET_TYPE_PROC_CHIP |
                                TARGET_TYPE_MEMBUF_CHIP,

    TARGET_TYPE_CHIPLETS      = TARGET_TYPE_EX     |
                                TARGET_TYPE_MBA    |
                                TARGET_TYPE_MCS    |
                                TARGET_TYPE_XBUS   |
                                TARGET_TYPE_ABUS   |
                                TARGET_TYPE_L4     |
                                TARGET_TYPE_CORE   |
                                TARGET_TYPE_EQ     |
                                TARGET_TYPE_MCA    |
                                TARGET_TYPE_MCBIST |
                                TARGET_TYPE_MI     |
                                TARGET_TYPE_DMI    |
                                TARGET_TYPE_OBUS   |
                                TARGET_TYPE_NV     |
                                TARGET_TYPE_SBE    |
                                TARGET_TYPE_PPE    |
                                TARGET_TYPE_PERV   |
                                TARGET_TYPE_PEC    |
                                TARGET_TYPE_PHB,

    // 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,
};

///
/// @brief Enumeration of chiplet filters
///
enum TargetFilter
{
    TARGET_FILTER_TP          = 0x80000000,  // Pervasive 1
    TARGET_FILTER_NEST_NORTH  = 0x40000000,  // Pervasive 2
    TARGET_FILTER_NEST_SOUTH  = 0x20000000,  // Pervasive 3
    TARGET_FILTER_NEST_EAST   = 0x10000000,  // Pervasive 4
    TARGET_FILTER_NEST_WEST   = 0x08000000,  // Pervasive 5
    TARGET_FILTER_XBUS        = 0x04000000,  // Pervasive 6
    TARGET_FILTER_MC_WEST     = 0x02000000,  // Pervasive 7
    TARGET_FILTER_MC_EAST     = 0x01000000,  // Pervasive 8
    TARGET_FILTER_OBUS0       = 0x00800000,  // Pervasive 9
    TARGET_FILTER_OBUS1       = 0x00400000,  // Pervasive 10
    TARGET_FILTER_OBUS2       = 0x00200000,  // Pervasive 11
    TARGET_FILTER_OBUS3       = 0x00100000,  // Pervasive 12
    TARGET_FILTER_PCI0        = 0x00080000,  // Pervasive 13
    TARGET_FILTER_PCI1        = 0x00040000,  // Pervasive 14
    TARGET_FILTER_PCI2        = 0x00020000,  // Pervasive 15

    // Composite filters follow

    // Pervasive 2-5 (eg N0-N3) < req'd
    TARGET_FILTER_ALL_NEST    = (TARGET_FILTER_NEST_NORTH |
                                 TARGET_FILTER_NEST_SOUTH | TARGET_FILTER_NEST_EAST |
                                 TARGET_FILTER_NEST_WEST),

    // Pervasive 2-4 (eg N0-N2) < req'd
    TARGET_FILTER_NEST_SLAVES =
        (TARGET_FILTER_NEST_NORTH | TARGET_FILTER_NEST_SOUTH |
         TARGET_FILTER_NEST_EAST),

    // Pervasive 5 (eg N32) < req'd
    TARGET_FILTER_NEST_MASTER = TARGET_FILTER_NEST_WEST,

    // Pervasive 7-8 (eg MC0-MC1)
    TARGET_FILTER_ALL_MC      =
        (TARGET_FILTER_MC_WEST | TARGET_FILTER_MC_EAST),

    // Pervasive 9-12 (OB0-OB3)
    TARGET_FILTER_ALL_OBUS    =
        (TARGET_FILTER_OBUS0 | TARGET_FILTER_OBUS1 | TARGET_FILTER_OBUS2 |
         TARGET_FILTER_OBUS3),

    // Pervasive 13-15 (PCI0-PCI2)
    TARGET_FILTER_ALL_PCI =
        (TARGET_FILTER_PCI0 | TARGET_FILTER_PCI1 | TARGET_FILTER_PCI2),

    // Sync mode filter = All NEST + All MCS
    TARGET_FILTER_SYNC_MODE_NEST =
        (TARGET_FILTER_ALL_NEST | TARGET_FILTER_ALL_MC),

    // All IO Targets except NEST
    TARGET_FILTER_ALL_IO_EXCEPT_NEST =
        (TARGET_FILTER_XBUS | TARGET_FILTER_ALL_PCI | TARGET_FILTER_ALL_OBUS),
};


/// @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
{
    public:
        // Don't use enums, too hard to compare
        static const uint8_t count = bitCount < (V >> 1) >::count + (V & 1);
};

template<>
class bitCount<0>
{
    public:
        static const uint8_t count = 0;
};
/// @endcond

}

#endif
OpenPOWER on IntegriCloud