Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 1 | |
Zane Shelley | 7bf1f6d | 2019-10-18 16:03:51 -0500 | [diff] [blame] | 2 | #include <isolator/hei_isolation_node.hpp> |
Zane Shelley | ca9f625 | 2019-10-25 21:17:30 -0500 | [diff] [blame] | 3 | #include <isolator/hei_isolator.hpp> |
Zane Shelley | 75e68e9 | 2019-10-18 16:16:23 -0500 | [diff] [blame] | 4 | #include <register/hei_hardware_register.hpp> |
Zane Shelley | fc7ab19 | 2019-09-27 15:45:16 -0500 | [diff] [blame] | 5 | #include <util/hei_flyweight.hpp> |
Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 6 | |
Zane Shelley | 75e68e9 | 2019-10-18 16:16:23 -0500 | [diff] [blame] | 7 | // BEGIN temporary code |
Zane Shelley | 11b8994 | 2019-11-07 11:07:28 -0600 | [diff] [blame] | 8 | #include <isolator/hei_isolation_node.hpp> |
Zane Shelley | b0559b9 | 2019-12-05 22:18:20 -0600 | [diff] [blame] | 9 | #include <register/hei_operator_register.hpp> |
Zane Shelley | 75e68e9 | 2019-10-18 16:16:23 -0500 | [diff] [blame] | 10 | #include <register/hei_scom_register.hpp> |
| 11 | // END temporary code |
| 12 | |
Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 13 | namespace libhei |
| 14 | { |
| 15 | |
Zane Shelley | dd109cc | 2020-04-30 21:41:41 -0500 | [diff] [blame] | 16 | void Isolator::initialize(void* i_buffer, size_t i_bufferSize) |
Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 17 | { |
Zane Shelley | 4c15552 | 2020-05-05 13:53:10 -0500 | [diff] [blame] | 18 | // TODO |
Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 19 | } |
| 20 | |
| 21 | void Isolator::uninitialize() |
| 22 | { |
Zane Shelley | 7bf1f6d | 2019-10-18 16:03:51 -0500 | [diff] [blame] | 23 | // Remove all of the IsolationNode objects stored in the flyweights. This |
| 24 | // must be done before removing the HardwareRegister objects |
| 25 | Flyweight<IsolationNode>::getSingleton().clear(); |
| 26 | |
Zane Shelley | d0af358 | 2019-09-19 10:48:59 -0500 | [diff] [blame] | 27 | // Must flush the hardware register cache before deleting any |
| 28 | // HardwareRegister objects. |
| 29 | HardwareRegister::flushAll(); |
| 30 | |
Zane Shelley | 7bf1f6d | 2019-10-18 16:03:51 -0500 | [diff] [blame] | 31 | // Remove all of the HardwareRegister objects stored in the flyweights. |
Zane Shelley | 8deb090 | 2019-10-14 15:52:27 -0500 | [diff] [blame] | 32 | Flyweight<ScomRegister>::getSingleton().clear(); |
| 33 | Flyweight<IdScomRegister>::getSingleton().clear(); |
Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 34 | } |
| 35 | |
Zane Shelley | 229c155 | 2020-05-04 22:44:15 -0500 | [diff] [blame] | 36 | void Isolator::isolate(const std::vector<Chip>& i_chipList, |
| 37 | IsolationData& o_isoData) const |
Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 38 | { |
Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 39 | // Flush the isolation data to ensure a clean slate. |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 40 | o_isoData.flush(); |
Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 41 | |
Zane Shelley | d0af358 | 2019-09-19 10:48:59 -0500 | [diff] [blame] | 42 | // Flush the hardware register cache to avoid using stale data. |
| 43 | HardwareRegister::flushAll(); |
| 44 | |
Zane Shelley | 61565dc | 2019-09-18 21:57:10 -0500 | [diff] [blame] | 45 | // Analyze active error on each chip. |
Zane Shelley | fe27b65 | 2019-10-28 11:33:07 -0500 | [diff] [blame] | 46 | for (const auto& chip : i_chipList) |
Zane Shelley | b406de4 | 2019-09-09 16:10:38 -0500 | [diff] [blame] | 47 | { |
Zane Shelley | 4c15552 | 2020-05-05 13:53:10 -0500 | [diff] [blame] | 48 | // TODO |
Zane Shelley | 83da245 | 2019-10-25 15:45:34 -0500 | [diff] [blame] | 49 | HEI_INF("Isolator::isolate(%p,%u)", chip.getChip(), chip.getType()); |
Zane Shelley | b406de4 | 2019-09-09 16:10:38 -0500 | [diff] [blame] | 50 | } |
Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | } // end namespace libhei |