blob: f0c89c86b5b6629eac0a0e074822ab7f985c1e18 [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 Shelleya61f4c52019-08-01 13:58:49 -050018
Zane Shelleyb406de42019-09-09 16:10:38 -050019 /** @brief Default constructor. */
20 IsolationData() = default;
Zane Shelley5a266612019-08-15 16:23:53 -050021
22 /** @brief Destructor. */
23 ~IsolationData() = default;
Zane Shelleya61f4c52019-08-01 13:58:49 -050024
25 /** @brief Copy constructor. */
Zane Shelley83da2452019-10-25 15:45:34 -050026 IsolationData(const IsolationData &) = default;
Zane Shelleya61f4c52019-08-01 13:58:49 -050027
28 /** @brief Assignment operator. */
Zane Shelley83da2452019-10-25 15:45:34 -050029 IsolationData & operator=(const IsolationData &) = default;
Zane Shelleya61f4c52019-08-01 13:58:49 -050030
Zane Shelley93b61ad2019-10-16 20:41:03 -050031 private: // Instance variables
Zane Shelleya61f4c52019-08-01 13:58:49 -050032
Zane Shelley93b61ad2019-10-16 20:41:03 -050033 /** A list of all signatures found during isolation. */
34 std::vector<Signature> iv_sigLists;
Zane Shelleya61f4c52019-08-01 13:58:49 -050035
Zane Shelley93b61ad2019-10-16 20:41:03 -050036 // TODO: add register dump.
37
38 public: // Member functions
39
40 /**
41 * @brief Adds a signature to the signature list.
42 * @param i_signature The target signature.
43 */
Zane Shelley83da2452019-10-25 15:45:34 -050044 void addSignature(const Signature & i_signature)
Zane Shelley93b61ad2019-10-16 20:41:03 -050045 {
Zane Shelley83da2452019-10-25 15:45:34 -050046 iv_sigLists.push_back(i_signature);
Zane Shelley93b61ad2019-10-16 20:41:03 -050047 }
48
49 /** @brief Allows access to the signature list. */
50 const std::vector<Signature> & getSignatureList()
51 {
52 return iv_sigLists;
53 }
54
55 /** @brief Flushes the data to ensure a clean slate for isolation. */
56 void flush()
57 {
58 iv_sigLists.clear();
59 }
Zane Shelley5a266612019-08-15 16:23:53 -050060
Zane Shelleya61f4c52019-08-01 13:58:49 -050061}; // end class IsolationData
62
63} // end namespace libhei