|
| 1 | +// MIT License |
| 2 | +// |
| 3 | +// Copyright (c) 2019 Ruhr University Bochum, Chair for Embedded Security. All Rights reserved. |
| 4 | +// Copyright (c) 2019 Marc Fyrbiak, Sebastian Wallat, Max Hoffmann ("ORIGINAL AUTHORS"). All rights reserved. |
| 5 | +// Copyright (c) 2021 Max Planck Institute for Security and Privacy. All Rights reserved. |
| 6 | +// Copyright (c) 2021 Jörn Langheinrich, Julian Speith, Nils Albartus, René Walendy, Simon Klix ("ORIGINAL AUTHORS"). All Rights reserved. |
| 7 | +// |
| 8 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
| 9 | +// of this software and associated documentation files (the "Software"), to deal |
| 10 | +// in the Software without restriction, including without limitation the rights |
| 11 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 12 | +// copies of the Software, and to permit persons to whom the Software is |
| 13 | +// furnished to do so, subject to the following conditions: |
| 14 | +// |
| 15 | +// The above copyright notice and this permission notice shall be included in all |
| 16 | +// copies or substantial portions of the Software. |
| 17 | +// |
| 18 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 21 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 22 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 23 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 24 | +// SOFTWARE. |
| 25 | + |
| 26 | +#pragma once |
| 27 | +#include "hal_core/plugin_system/gui_extension_interface.h" |
| 28 | +#include "hal_core/plugin_system/plugin_interface_base.h" |
| 29 | + |
| 30 | +#define SECRET_PASSWORD "test12345" |
| 31 | + |
| 32 | +/** |
| 33 | + * @brief Header file for the cross probing plugin. This plugin is used by to control some HAL GUI features from external tool |
| 34 | + * |
| 35 | + */ |
| 36 | + |
| 37 | +namespace hal |
| 38 | +{ |
| 39 | + extern Netlist* gNetlist; |
| 40 | + |
| 41 | + class GuiExtensionCrossProbing; |
| 42 | + class CrossProbingServer; |
| 43 | + |
| 44 | + class PLUGIN_API CrossProbingPlugin : public BasePluginInterface |
| 45 | + { |
| 46 | + GuiExtensionCrossProbing* m_gui_extension; |
| 47 | + CrossProbingServer* m_server; |
| 48 | + |
| 49 | + public: |
| 50 | + std::string get_name() const override; |
| 51 | + std::string get_version() const override; |
| 52 | + void initialize() override; |
| 53 | + |
| 54 | + CrossProbingPlugin(); |
| 55 | + |
| 56 | + void on_load() override; |
| 57 | + void on_unload() override; |
| 58 | + |
| 59 | + std::set<std::string> get_dependencies() const override; |
| 60 | + |
| 61 | + void open_popup(); |
| 62 | + }; |
| 63 | + |
| 64 | + class GuiExtensionCrossProbing : public GuiExtensionInterface |
| 65 | + { |
| 66 | + public: |
| 67 | + CrossProbingPlugin* m_parent; |
| 68 | + |
| 69 | + GuiExtensionCrossProbing(); |
| 70 | + |
| 71 | + std::vector<ContextMenuContribution> get_context_contribution(const Netlist* nl, const std::vector<u32>& mods, const std::vector<u32>& gates, const std::vector<u32>& nets) override; |
| 72 | + |
| 73 | + std::vector<PluginParameter> get_parameter() const override; |
| 74 | + |
| 75 | + void set_parameter(const std::vector<PluginParameter>& params) override; |
| 76 | + |
| 77 | + /** |
| 78 | + * Register function to indicate work progress when busy |
| 79 | + * @param pif Progress Indicator Function to register |
| 80 | + */ |
| 81 | + static std::function<void(int, const std::string&)> s_progress_indicator_function; |
| 82 | + virtual void register_progress_indicator(std::function<void(int, const std::string&)> pif) override; |
| 83 | + }; |
| 84 | +} // namespace hal |
0 commit comments