blob: b9a3b7599c207345dd4d2ca946a70ddf9881f762 [file] [log] [blame]
Zane Shelleya61f4c52019-08-01 13:58:49 -05001#pragma once
2
Zane Shelley5a266612019-08-15 16:23:53 -05003#include <hei_includes.hpp>
Zane Shelley93b61ad2019-10-16 20:41:03 -05004#include <isolator/hei_signature.hpp>
Zane Shelleya61f4c52019-08-01 13:58:49 -05005
6namespace libhei
7{
8
9/**
Zane Shelleyb406de42019-09-09 16:10:38 -050010 * @brief The main isolate() API is given a list of chips to analyze. This class
11 * will contain a list of all active hardware errors found on those
12 * chips, the contents of any registers associated with the active
13 * errors, and any other data that can be useful for debug.
Zane Shelleya61f4c52019-08-01 13:58:49 -050014 */
15class IsolationData
16{
Zane Shelley93b61ad2019-10-16 20:41:03 -050017 public: // Constructors, destructor, assignment, etc.
Zane Shelleyb406de42019-09-09 16:10:38 -050018 /** @brief Default constructor. */
19 IsolationData() = default;
Zane Shelley5a266612019-08-15 16:23:53 -050020
21 /** @brief Destructor. */
22 ~IsolationData() = default;
Zane Shelleya61f4c52019-08-01 13:58:49 -050023
24 /** @brief Copy constructor. */
Zane Shelleyfe27b652019-10-28 11:33:07 -050025 IsolationData(const IsolationData&) = default;
Zane Shelleya61f4c52019-08-01 13:58:49 -050026
27 /** @brief Assignment operator. */
Zane Shelleyfe27b652019-10-28 11:33:07 -050028 IsolationData& operator=(const IsolationData&) = default;
Zane Shelleya61f4c52019-08-01 13:58:49 -050029
Zane Shelley93b61ad2019-10-16 20:41:03 -050030 private: // Instance variables
Zane Shelley93b61ad2019-10-16 20:41:03 -050031 /** A list of all signatures found during isolation. */
32 std::vector<Signature> iv_sigLists;
Zane Shelleya61f4c52019-08-01 13:58:49 -050033
Zane Shelley93b61ad2019-10-16 20:41:03 -050034 // TODO: add register dump.
35
36 public: // Member functions
Zane Shelley93b61ad2019-10-16 20:41:03 -050037 /**
38 * @brief Adds a signature to the signature list.
39 * @param i_signature The target signature.
40 */
Zane Shelleyfe27b652019-10-28 11:33:07 -050041 void addSignature(const Signature& i_signature)
Zane Shelley93b61ad2019-10-16 20:41:03 -050042 {
Zane Shelley83da2452019-10-25 15:45:34 -050043 iv_sigLists.push_back(i_signature);
Zane Shelley93b61ad2019-10-16 20:41:03 -050044 }
45
46 /** @brief Allows access to the signature list. */
Zane Shelleyfe27b652019-10-28 11:33:07 -050047 const std::vector<Signature>& getSignatureList()
Zane Shelley93b61ad2019-10-16 20:41:03 -050048 {
49 return iv_sigLists;
50 }
51
52 /** @brief Flushes the data to ensure a clean slate for isolation. */
53 void flush()
54 {
55 iv_sigLists.clear();
56 }
Zane Shelley5a266612019-08-15 16:23:53 -050057
Zane Shelleya61f4c52019-08-01 13:58:49 -050058}; // end class IsolationData
59
60} // end namespace libhei