blob: 79d4ed3536341b72fcf908177cc3256225530338 [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) :
31 iv_chip(i_chip), iv_id(i_id), iv_instance(i_instance),
32 iv_bit(i_bit), iv_attnType(i_attnType)
Zane Shelley93b61ad2019-10-16 20:41:03 -050033 {}
34
35 /** @brief Destructor. */
36 ~Signature() = default;
37
38 /** @brief Copy constructor. */
Zane Shelleyfe27b652019-10-28 11:33:07 -050039 Signature(const Signature&) = default;
Zane Shelley93b61ad2019-10-16 20:41:03 -050040
41 /** @brief Assignment operator. */
Zane Shelleyfe27b652019-10-28 11:33:07 -050042 Signature& operator=(const Signature&) = default;
Zane Shelley93b61ad2019-10-16 20:41:03 -050043
44 private: // Instance variables.
45
46 Chip iv_chip; ///< Chip containing this register.
47 RegisterId_t iv_id; ///< Register ID.
48 RegisterInstance_t iv_instance; ///< Instance of this register.
49 RegisterBit_t iv_bit; ///< Target bit within this register.
50 AttentionType_t iv_attnType; ///< Attention type reported by this bit.
51
52 public: // Member functions
53
54 /** @return The chip containing this register. */
Zane Shelleyfe27b652019-10-28 11:33:07 -050055 const Chip& getChip() const { return iv_chip; }
Zane Shelley93b61ad2019-10-16 20:41:03 -050056
57 /** @return The register ID. */
58 RegisterId_t getId() const { return iv_id; }
59
60 /** @return The instance of this register. */
61 RegisterInstance_t getInstance() const { return iv_instance; }
62
63 /** @return The target bit within this register. */
64 RegisterBit_t getBit() const { return iv_bit; }
65
66 /** @return The attention type reported by this bit. */
67 AttentionType_t getAttnType() const { return iv_attnType; }
68};
69
70} // end namespace libhei