blob: 93ec5b8d27dfa709c7030257fe0ec393609d99ae [file] [log] [blame]
Zane Shelleya61f4c52019-08-01 13:58:49 -05001#pragma once
2
Zane Shelley3a02e242020-05-08 16:25:36 -05003#include <hei_signature.hpp>
4
5#include <vector>
Zane Shelleya61f4c52019-08-01 13:58:49 -05006
7namespace libhei
8{
9
10/**
Zane Shelleyb406de42019-09-09 16:10:38 -050011 * @brief The main isolate() API is given a list of chips to analyze. This class
12 * will contain a list of all active hardware errors found on those
13 * chips, the contents of any registers associated with the active
14 * errors, and any other data that can be useful for debug.
Zane Shelleya61f4c52019-08-01 13:58:49 -050015 */
16class IsolationData
17{
Zane Shelley93b61ad2019-10-16 20:41:03 -050018 public: // Constructors, destructor, assignment, etc.
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 Shelleyfe27b652019-10-28 11:33:07 -050026 IsolationData(const IsolationData&) = default;
Zane Shelleya61f4c52019-08-01 13:58:49 -050027
28 /** @brief Assignment operator. */
Zane Shelleyfe27b652019-10-28 11:33:07 -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 Shelley93b61ad2019-10-16 20:41:03 -050032 /** A list of all signatures found during isolation. */
33 std::vector<Signature> iv_sigLists;
Zane Shelleya61f4c52019-08-01 13:58:49 -050034
Zane Shelley93b61ad2019-10-16 20:41:03 -050035 // TODO: add register dump.
36
37 public: // Member functions
Zane Shelley93b61ad2019-10-16 20:41:03 -050038 /**
39 * @brief Adds a signature to the signature list.
40 * @param i_signature The target signature.
41 */
Zane Shelleyfe27b652019-10-28 11:33:07 -050042 void addSignature(const Signature& i_signature)
Zane Shelley93b61ad2019-10-16 20:41:03 -050043 {
Zane Shelley83da2452019-10-25 15:45:34 -050044 iv_sigLists.push_back(i_signature);
Zane Shelley93b61ad2019-10-16 20:41:03 -050045 }
46
47 /** @brief Allows access to the signature list. */
Zane Shelley2e38ae52020-11-05 22:21:30 -060048 const std::vector<Signature>& getSignatureList() const
Zane Shelley93b61ad2019-10-16 20:41:03 -050049 {
50 return iv_sigLists;
51 }
52
53 /** @brief Flushes the data to ensure a clean slate for isolation. */
54 void flush()
55 {
56 iv_sigLists.clear();
57 }
Zane Shelley5a266612019-08-15 16:23:53 -050058
Zane Shelleya61f4c52019-08-01 13:58:49 -050059}; // end class IsolationData
60
61} // end namespace libhei