blob: ee1432d010400652a53f9f015632f4d6bd68bf3a [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. */
26 IsolationData( const IsolationData & ) = default;
27
28 /** @brief Assignment operator. */
29 IsolationData & operator=( const IsolationData & ) = default;
30
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 */
44 void addSignature( const Signature & i_signature )
45 {
46 iv_sigLists.push_back( i_signature );
47 }
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
64