HAL  v4.5.0-283-g3f42a39fa
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
plugin_clock_tree_viewer.cpp
Go to the documentation of this file.
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 // Copyright (c) 2025-2026 Sascha Tommasone. All rights reserved.
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining a copy
10 // of this software and associated documentation files (the "Software"), to deal
11 // in the Software without restriction, including without limitation the rights
12 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 // copies of the Software, and to permit persons to whom the Software is
14 // furnished to do so, subject to the following conditions:
15 //
16 // The above copyright notice and this permission notice shall be included in all
17 // copies or substantial portions of the Software.
18 //
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 // SOFTWARE.
26 
28 
31 #include "gui/gui_globals.h"
32 #include "hal_core/utilities/log.h"
33 
34 #include <memory>
35 #include <set>
36 
37 namespace hal
38 {
39  extern std::unique_ptr<BasePluginInterface> create_plugin_instance()
40  {
41  return std::make_unique<ClockTreeViewerPlugin>();
42  }
43 
44  std::string ClockTreeViewerPlugin::get_name() const
45  {
46  return { "clock_tree_viewer" };
47  }
48 
50  {
51  return { "0.1" };
52  }
53 
55  {
56  return { "Interactive viewer for clock trees extracted by the clock_tree_extractor plugin. "
57  "Gates are drawn at their physical coordinates and can be zoomed into, and the gates selected in "
58  "HAL are highlighted." };
59  }
60 
61  std::set<std::string> ClockTreeViewerPlugin::get_dependencies() const
62  {
63  return { "hal_gui", "clock_tree_extractor" };
64  }
65 
67  {
69  get_name(),
71  "info" );
72 
74  ExternalContent::instance()->append( m_factory );
75 
76  // Without a netlist there is no content area yet, the factory is used as soon as one is opened.
77  if( gNetlist != nullptr )
78  {
79  gContentManager->addExternalWidget( m_factory );
80  }
81  }
82 
84  {
86 
87  delete m_factory;
88  m_factory = nullptr;
89  }
90 } // namespace hal
std::string get_name() const override
std::string get_description() const override
std::string get_version() const override
std::set< std::string > get_dependencies() const override
void addExternalWidget(ContentFactory *factory)
static ExternalContent * instance()
void removePlugin(const QString &pluginName)
std::shared_ptr< spdlog::logger > add_channel(const std::string &channel_name, const std::vector< std::shared_ptr< log_sink >> &sinks, const std::string &level="info")
Definition: log.cpp:100
static std::shared_ptr< log_sink > create_gui_sink()
Definition: log.cpp:274
static std::shared_ptr< log_sink > create_file_sink(const std::filesystem::path &file_name="", const bool truncate=false)
Definition: log.cpp:247
static std::shared_ptr< log_sink > create_stdout_sink(const bool colored=true)
Definition: log.cpp:216
static LogManager * get_instance(const std::filesystem::path &file_name="")
Definition: log.cpp:61
Definition: defines.h:45
ContentManager * gContentManager
Definition: plugin_gui.cpp:79
std::unique_ptr< BasePluginInterface > create_plugin_instance()
Netlist * gNetlist
Definition: gui_globals.h:69
void append(const T &value)
QString fromStdString(const std::string &str)