blob: 23b3f7cc435f059eb3342cf06cc0d6f1aa82095d [file] [log] [blame]
Zane Shelley93b61ad2019-10-16 20:41:03 -05001#pragma once
2
3#include <hei_includes.hpp>
4
5namespace libhei
6{
7
8/**
9 * @brief A signature represents an active attention from a single bit on a
10 * register within a chip.
11 *
12 * The isolator will gather a list of all active attentions on a chip and return
13 * a list of signatures to the user application. The user application should be
14 * able to determine what actions to take based on these signatures.
15 */
16class Signature
17{
18 public: // Constructors, destructor, assignment, etc.
19
20 /**
21 * @brief Constructor from components.
22 * @param i_chip The chip containing this register.
23 * @param i_id The register ID.
24 * @param i_instance The instance of this register.
25 * @param i_bit The target bit within this register.
26 * @param i_attnType The attention type reported by this bit.
27 */
Zane Shelleyfe27b652019-10-28 11:33:07 -050028 Signature(const Chip& i_chip, RegisterId_t i_id,
Zane Shelley83da2452019-10-25 15:45:34 -050029 RegisterInstance_t i_instance, RegisterBit_t i_bit,
30 AttentionType_t i_attnType) :
Zane Shelley7f7a42d2019-10-28 13:28:31 -050031 iv_chip(i_chip),
32 iv_id(i_id), iv_instance(i_instance), iv_bit(i_bit),
33 iv_attnType(i_attnType)
Zane Shelley93b61ad2019-10-16 20:41:03 -050034 {}
35
36 /** @brief Destructor. */
37 ~Signature() = default;
38
39 /** @brief Copy constructor. */
Zane Shelleyfe27b652019-10-28 11:33:07 -050040 Signature(const Signature&) = default;
Zane Shelley93b61ad2019-10-16 20:41:03 -050041
42 /** @brief Assignment operator. */
Zane Shelleyfe27b652019-10-28 11:33:07 -050043 Signature& operator=(const Signature&) = default;
Zane Shelley93b61ad2019-10-16 20:41:03 -050044
45 private: // Instance variables.
46
47 Chip iv_chip; ///< Chip containing this register.
48 RegisterId_t iv_id; ///< Register ID.
49 RegisterInstance_t iv_instance; ///< Instance of this register.
50 RegisterBit_t iv_bit; ///< Target bit within this register.
51 AttentionType_t iv_attnType; ///< Attention type reported by this bit.
52
53 public: // Member functions
54
55 /** @return The chip containing this register. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050056 const Chip& getChip() const
57 {
58 return iv_chip;
59 }
Zane Shelley93b61ad2019-10-16 20:41:03 -050060
61 /** @return The register ID. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050062 RegisterId_t getId() const
63 {
64 return iv_id;
65 }
Zane Shelley93b61ad2019-10-16 20:41:03 -050066
67 /** @return The instance of this register. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050068 RegisterInstance_t getInstance() const
69 {
70 return iv_instance;
71 }
Zane Shelley93b61ad2019-10-16 20:41:03 -050072
73 /** @return The target bit within this register. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050074 RegisterBit_t getBit() const
75 {
76 return iv_bit;
77 }
Zane Shelley93b61ad2019-10-16 20:41:03 -050078
79 /** @return The attention type reported by this bit. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050080 AttentionType_t getAttnType() const
81 {
82 return iv_attnType;
83 }
Zane Shelley93b61ad2019-10-16 20:41:03 -050084};
85
86} // end namespace libhei