blob: d3a3a235bcb92f737fab6e3ea34b2e75213d31e9 [file] [log] [blame]
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -05001/* IBM_PROLOG_BEGIN_TAG */
2/* This is an automatically generated prolog. */
3/* */
4/* $Source: src/usr/diag/prdf/common/framework/register/prdfScomRegisterAccess.H $ */
5/* */
6/* OpenPOWER HostBoot Project */
7/* */
8/* COPYRIGHT International Business Machines Corp. 2012,2014 */
9/* */
10/* Licensed under the Apache License, Version 2.0 (the "License"); */
11/* you may not use this file except in compliance with the License. */
12/* You may obtain a copy of the License at */
13/* */
14/* http://www.apache.org/licenses/LICENSE-2.0 */
15/* */
16/* Unless required by applicable law or agreed to in writing, software */
17/* distributed under the License is distributed on an "AS IS" BASIS, */
18/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
19/* implied. See the License for the specific language governing */
20/* permissions and limitations under the License. */
21/* */
22/* IBM_PROLOG_END_TAG */
23
24#ifndef __PRDF_REGISTER_
25#define __PRDF_REGISTER_
26
Zane Shelley52cb1a92019-08-21 14:38:31 -050027#include <register/hei_hardware_register.hpp>
28#include <util/hei_bit_string.hpp>
29
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050030#include <prdfPlatServices.H>
31
32/**
33 * @brief Models register.This model of register has target info
34 *
35 * In order to reduce the register objects required by PRD to do attention
36 * analysis, these are shared across all the RuleChip objects associated with
37 * target of same type.In order to realize this,target info is taken out of
38 * register object .RuleChip contains target info.During Analysis ,pointer to
39 * Rulechip under analysis is maintained in Service Data collector.During
40 * register Read and Write,target info is obtained by register from service data
41 * collector.This idea fails when getRegister is called for Register read and
42 * write.It may be called from plugin code which may use a RuleChip different
43 * from the one in SDC.We would like to avoid SDC getting updated from multiple
44 * places.To simplify solution for this use case, a wrapper register is required
45 * .This register model knows which rule chip it is associated with.When plugin
46 * code calls getRegister ,instead of returning targetless flyweight object,it
47 * returns an object of class ScomRegisterAccess.Since register Read Write is
48 * in parent class ,it's just a container for Rulechip pointer giving us a way
49 * to do scom without having to look for associated target/rule chip somewhere
50 * else.
51 */
52
53namespace PRDF
54{
55class ScomRegisterAccess : public ScomRegister
56{
57 public :
58 /**
59 * @brief constructor
60 * @param i_Register Reference to flyweight register
61 * @param i_pchip RuleChip associated with register
62 */
Zane Shelley23244cb2019-08-30 21:12:12 -050063 ScomRegisterAccess( const Register & i_Register,
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050064 ExtensibleChip* i_pchip );
65 /**
66 * @brief constructor
67 */
68 ScomRegisterAccess():ScomRegister( ),iv_containerChip ( NULL ){ };
69
70 /**
71 * @brief Destructor
72 */
73 ~ScomRegisterAccess(){ };
74 /**
75 * @brief Returns pointer to rulechip associated with register
76 * @return Returns rule chip pointer
77 */
78
79 virtual ExtensibleChip* getChip( ) const;
80 /**
81 * @brief compares two ScomRegisterAccess register for equality
82 * @param i_rightRegister register to be compared against
83 * @return Returns true if registers are equal false otherwise
84 */
85 bool operator == ( const ScomRegisterAccess & i_rightRegister ) const;
86 /**
87 * @brief defines < operation for ScomRegisterAccess
88 * @param i_rightRegister register to be compared against
89 * @return Returns false if i_rightRegisters is less and true otherwise
90 */
91 bool operator < ( const ScomRegisterAccess & i_rightRegister ) const;
92 /**
93 * @brief defines >= operation for ScomRegisterAccess
94 * @param i_right register to be compared against
95 * @return Returns true if registers is >= i_rightRegister false
96 * otherwise
97 */
98 bool operator >= ( const ScomRegisterAccess & i_right ) const;
99
100
101 private://Data
102
103 ExtensibleChip* iv_containerChip;
104
105
106};
107
108}//namepsace PRDF ends
109#endif
110