summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/plat/pegasus/prdfP8DataBundle.H
blob: cd0922cdbba2e473a50445457f00fae3d79ed0aa (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfP8DataBundle.H $    */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2013,2015                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

#ifndef __prdfP8DataBundle_H
#define __prdfP8DataBundle_H

/** @file  prdfP8DataBundle.H
 *  @brief Contains the data bundle for a P8 MCS object.
 */

#include <iipSystem.h>
#include <prdfExtensibleChip.H>
#include <prdfGlobal.H>
#include <prdfPlatServices.H>
#include <prdfThresholdUtils.H>

namespace PRDF
{

/**
 * @brief The P8 data bundle.
 */
class P8DataBundle : public DataBundle
{
  public: // functions

      /*
       * @brief  Proc PLL chiplet types
       */
      enum ChipletType
      {
          ABUS,
          EX,
          PB,
          NV,
      };

      /*
       * @brief  Proc PLL Error Reg data structure
       */
      struct PllErrReg
      {
          ExtensibleChip * chip;
          ChipletType type;
          SCAN_COMM_REGISTER_CLASS * errReg;
          SCAN_COMM_REGISTER_CLASS * configReg;
          PllErrReg() : chip(NULL), errReg(NULL), configReg(NULL) {}
      };

      typedef std::vector<PllErrReg>  ProcPllErrRegList;
      typedef ProcPllErrRegList::iterator ProcPllErrRegListIter;


    /**
     * @brief Constructor.
     * @param i_chip The P8 chip.
     */
    explicit P8DataBundle( ExtensibleChip * i_chip ) :
      iv_todIgnoreAnalysisThr( TimeBasedThreshold(
                                   32, ThresholdResolution::ONE_DAY)  )
    {}

    /**
     * @brief Destructor.
     */
    ~P8DataBundle() {}

    /**
     * @brief get a list of Proc PLL Error reg data
     * @return returns a list of Proc PLL Error reg data
     */
    ProcPllErrRegList & getProcPllErrRegList()
    {
        return iv_procPllErrRegList;
    }

    /**
     * @return get instance of TimeBasedThreshold meant for TOD error.
     * @note   This instance is meant to threshold all the TOD errors for an
     *         FSP based OPAL system. Once threshold is met, these errors
     *         are masked.
     */
    TimeBasedThreshold & getTodErrorIgnoreThr()
    {
        return iv_todIgnoreAnalysisThr;
    }

  private: // functions

    P8DataBundle( const P8DataBundle & );
    const P8DataBundle & operator=( const P8DataBundle & );

  private: // instance variables

    ProcPllErrRegList iv_procPllErrRegList;
    TimeBasedThreshold iv_todIgnoreAnalysisThr; ///< policy for masking TOD Err



};

//------------------------------------------------------------------------------

/**
 * @brief  Wrapper function for the P8DataBundle.
 * @param  i_chip The P8 chip.
 * @return This P8's data bundle.
 */
inline P8DataBundle * getDataBundle( ExtensibleChip * i_chip )
{
    return static_cast<P8DataBundle *>(i_chip->getDataBundle());
}

} // end namespace PRDF

#endif // __prdfP8DataBundle_H

OpenPOWER on IntegriCloud