blob: 17e1032841d1711d794a1f34e11173a07a5a80d5 [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
27#include <prdfScomRegister.H>
28#include <prdfBitString.H>
29#include <prdfPlatServices.H>
30
31/**
32 * @brief Models register.This model of register has target info
33 *
34 * In order to reduce the register objects required by PRD to do attention
35 * analysis, these are shared across all the RuleChip objects associated with
36 * target of same type.In order to realize this,target info is taken out of
37 * register object .RuleChip contains target info.During Analysis ,pointer to
38 * Rulechip under analysis is maintained in Service Data collector.During
39 * register Read and Write,target info is obtained by register from service data
40 * collector.This idea fails when getRegister is called for Register read and
41 * write.It may be called from plugin code which may use a RuleChip different
42 * from the one in SDC.We would like to avoid SDC getting updated from multiple
43 * places.To simplify solution for this use case, a wrapper register is required
44 * .This register model knows which rule chip it is associated with.When plugin
45 * code calls getRegister ,instead of returning targetless flyweight object,it
46 * returns an object of class ScomRegisterAccess.Since register Read Write is
47 * in parent class ,it's just a container for Rulechip pointer giving us a way
48 * to do scom without having to look for associated target/rule chip somewhere
49 * else.
50 */
51
52namespace PRDF
53{
54class ScomRegisterAccess : public ScomRegister
55{
56 public :
57 /**
58 * @brief constructor
59 * @param i_Register Reference to flyweight register
60 * @param i_pchip RuleChip associated with register
61 */
62 ScomRegisterAccess( const SCAN_COMM_REGISTER_CLASS & i_Register,
63 ExtensibleChip* i_pchip );
64 /**
65 * @brief constructor
66 */
67 ScomRegisterAccess():ScomRegister( ),iv_containerChip ( NULL ){ };
68
69 /**
70 * @brief Destructor
71 */
72 ~ScomRegisterAccess(){ };
73 /**
74 * @brief Returns pointer to rulechip associated with register
75 * @return Returns rule chip pointer
76 */
77
78 virtual ExtensibleChip* getChip( ) const;
79 /**
80 * @brief compares two ScomRegisterAccess register for equality
81 * @param i_rightRegister register to be compared against
82 * @return Returns true if registers are equal false otherwise
83 */
84 bool operator == ( const ScomRegisterAccess & i_rightRegister ) const;
85 /**
86 * @brief defines < operation for ScomRegisterAccess
87 * @param i_rightRegister register to be compared against
88 * @return Returns false if i_rightRegisters is less and true otherwise
89 */
90 bool operator < ( const ScomRegisterAccess & i_rightRegister ) const;
91 /**
92 * @brief defines >= operation for ScomRegisterAccess
93 * @param i_right register to be compared against
94 * @return Returns true if registers is >= i_rightRegister false
95 * otherwise
96 */
97 bool operator >= ( const ScomRegisterAccess & i_right ) const;
98
99
100 private://Data
101
102 ExtensibleChip* iv_containerChip;
103
104
105};
106
107}//namepsace PRDF ends
108#endif
109