blob: 844aad6f9cd6dc96ba4e9c57f9f16784e70d28d0 [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.
Zane Shelley93b61ad2019-10-16 20:41:03 -050019 /**
20 * @brief Constructor from components.
21 * @param i_chip The chip containing this register.
22 * @param i_id The register ID.
23 * @param i_instance The instance of this register.
24 * @param i_bit The target bit within this register.
25 * @param i_attnType The attention type reported by this bit.
26 */
Zane Shelleyfe27b652019-10-28 11:33:07 -050027 Signature(const Chip& i_chip, RegisterId_t i_id,
Zane Shelley83da2452019-10-25 15:45:34 -050028 RegisterInstance_t i_instance, RegisterBit_t i_bit,
29 AttentionType_t i_attnType) :
Zane Shelley7f7a42d2019-10-28 13:28:31 -050030 iv_chip(i_chip),
31 iv_id(i_id), iv_instance(i_instance), iv_bit(i_bit),
32 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
Zane Shelley7c8faa12019-10-28 22:26:28 -050044 private:
45 Chip iv_chip; ///< Chip containing this register.
46 RegisterId_t iv_id; ///< Register ID.
Zane Shelley93b61ad2019-10-16 20:41:03 -050047 RegisterInstance_t iv_instance; ///< Instance of this register.
Zane Shelley7c8faa12019-10-28 22:26:28 -050048 RegisterBit_t iv_bit; ///< Target bit within this register.
49 AttentionType_t iv_attnType; ///< Attention type reported by this bit.
Zane Shelley93b61ad2019-10-16 20:41:03 -050050
51 public: // Member functions
Zane Shelley93b61ad2019-10-16 20:41:03 -050052 /** @return The chip containing this register. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050053 const Chip& getChip() const
54 {
55 return iv_chip;
56 }
Zane Shelley93b61ad2019-10-16 20:41:03 -050057
58 /** @return The register ID. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050059 RegisterId_t getId() const
60 {
61 return iv_id;
62 }
Zane Shelley93b61ad2019-10-16 20:41:03 -050063
64 /** @return The instance of this register. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050065 RegisterInstance_t getInstance() const
66 {
67 return iv_instance;
68 }
Zane Shelley93b61ad2019-10-16 20:41:03 -050069
70 /** @return The target bit within this register. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050071 RegisterBit_t getBit() const
72 {
73 return iv_bit;
74 }
Zane Shelley93b61ad2019-10-16 20:41:03 -050075
76 /** @return The attention type reported by this bit. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050077 AttentionType_t getAttnType() const
78 {
79 return iv_attnType;
80 }
Zane Shelley93b61ad2019-10-16 20:41:03 -050081};
82
83} // end namespace libhei