|
HAL
v4.5.0-124-g47ab54673
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|
Classes | |
| struct | PluginFeature |
Functions | |
| void | add_existing_options_description (const ProgramOptions &existing_options) |
| std::set< std::string > | get_plugin_names () |
| std::filesystem::path | get_plugin_path (std::string plugin_name) |
| std::unordered_map< std::string, std::string > | get_cli_plugin_flags () |
| std::unordered_map< std::string, std::string > | get_ui_plugin_flags () |
| ProgramOptions | get_cli_plugin_options () |
| bool | load_all_plugins (const std::vector< std::filesystem::path > &directory_names={}) |
| bool | load (const std::string &plugin_name, const std::filesystem::path &file_path=std::filesystem::path()) |
| bool | unload_all_plugins () |
| bool | unload (const std::string &plugin_name) |
| BasePluginInterface * | get_plugin_instance (const std::string &plugin_name, bool initialize=true, bool silent=false) |
| template<typename T > | |
| T * | get_plugin_instance (const std::string &plugin_name, bool initialize=true) |
| UIPluginInterface * | get_ui_plugin () |
| template<typename T > | |
| T * | get_first_extension (const std::string &plugin_name, bool initialize=true) |
| u64 | add_model_changed_callback (std::function< void(bool, std::string const &, std::string const &)> callback) |
| void | remove_model_changed_callback (u64 id) |
| bool | has_valid_file_extension (std::filesystem::path file_name) |
| std::vector< PluginFeature > | get_plugin_features (std::string name) |
The plugin manager takes care of loading and unloading plugins at runtime.
| void hal::plugin_manager::add_existing_options_description | ( | const ProgramOptions & | existing_options | ) |
Register existing program options to avoid reuse by plugins.
| [in] | existing_options | - The program options. |
Definition at line 501 of file plugin_manager.cpp.
Referenced by hal::plugin_manager_init().
| u64 hal::plugin_manager::add_model_changed_callback | ( | std::function< void(bool, std::string const &, std::string const &)> | callback | ) |
Add a callback to notify the GUI about loaded or unloaded plugins.
| [in] | callback | - The callback function. Parameters are:
|
Definition at line 486 of file plugin_manager.cpp.
References log_error.
Referenced by hal::plugin_manager_init(), and hal::PluginRelay::PluginRelay().
| std::unordered_map< std::string, std::string > hal::plugin_manager::get_cli_plugin_flags | ( | ) |
Get a mapping of flags pointing to their corresponding CLI plugin.
Definition at line 175 of file plugin_manager.cpp.
Referenced by hal::plugin_manager_init().
| ProgramOptions hal::plugin_manager::get_cli_plugin_options | ( | ) |
Get command line interface options for all plugins.
Definition at line 185 of file plugin_manager.cpp.
Referenced by hal::plugin_manager_init().
| T* hal::plugin_manager::get_first_extension | ( | const std::string & | plugin_name, |
| bool | initialize = true |
||
| ) |
Get first plugin extension of given type T.
| [in] | plugin_name | - The name of the plugin. |
| [in] | initialize | - If false, the plugin's initialize function is not called. |
nullptr if no such extension exists. Definition at line 169 of file plugin_manager.h.
References hal::BasePluginInterface::get_first_extension(), get_plugin_instance(), hal::initialize(), and hal::T.
| std::vector< PluginFeature > hal::plugin_manager::get_plugin_features | ( | std::string | name | ) |
Returns list of features for plugin identified by file name stem
| name | file name stem |
Definition at line 168 of file plugin_manager.cpp.
References name.
Referenced by hal::plugin_manager_init(), and hal::GuiPluginEntry::updateFromLoaded().
| T* hal::plugin_manager::get_plugin_instance | ( | const std::string & | plugin_name, |
| bool | initialize = true |
||
| ) |
Gets a specific interface for a plugin specified by name. By default calls the initialize() function of the plugin.
| [in] | plugin_name | - The name of the plugin. |
| [in] | initialize | - If false, the plugin's initialize function is not called. |
Definition at line 146 of file plugin_manager.h.
References get_plugin_instance(), hal::initialize(), and hal::T.
| BasePluginInterface * hal::plugin_manager::get_plugin_instance | ( | const std::string & | plugin_name, |
| bool | initialize = true, |
||
| bool | silent = false |
||
| ) |
Gets the basic interface for a plugin specified by name. By default calls the initialize() function of the plugin.
| [in] | plugin_name | - The name of the plugin. |
| [in] | initialize | - If false, the plugin's initialize function is not called. |
| [in] | silent | - If true error message gets omitted if plugin not found |
Definition at line 456 of file plugin_manager.cpp.
References hal::initialize(), instance, and log_error.
Referenced by get_first_extension(), get_plugin_instance(), hal::GuiPluginManager::getGuiExtensions(), hal::GuiPluginTable::load(), hal::dataflow::Result::open_dot_in_viewer(), hal::plugin_manager_init(), hal::SimulatorSerializer::restore(), and hal::WaveformViewer::restoreFromProject().
| std::set< std::string > hal::plugin_manager::get_plugin_names | ( | ) |
Get the names of all loaded plugins.
Definition at line 158 of file plugin_manager.cpp.
Referenced by hal::GuiPluginManager::getGuiExtensions(), hal::GexfWriter::GexfWriter(), hal::plugin_manager_init(), and unload_all_plugins().
| std::filesystem::path hal::plugin_manager::get_plugin_path | ( | std::string | plugin_name | ) |
Get the full path for plugin. Will probe several possible extension on MAC
Definition at line 127 of file plugin_manager.cpp.
References ALTERNATE_LIBRARY_FILE_EXTENSION, hal::utils::get_file(), and LIBRARY_FILE_EXTENSION.
Referenced by hal::GuiPluginEntry::GuiPluginEntry(), load(), and hal::plugin_manager_init().
| UIPluginInterface * hal::plugin_manager::get_ui_plugin | ( | ) |
Gets the user interface plugin, i.e., the first loaded plugin implementing the UIPluginInterface.
Does not initialize the plugin and does not log an error if no such plugin is loaded, as running without a user interface is the normal case for scripts and for the command line.
nullptr if none is loaded. Definition at line 474 of file plugin_manager.cpp.
Referenced by hal::user_feedback::report_progress().
| std::unordered_map< std::string, std::string > hal::plugin_manager::get_ui_plugin_flags | ( | ) |
Get a mapping of flags pointing to their corresponding UI plugin.
Definition at line 180 of file plugin_manager.cpp.
Referenced by hal::plugin_manager_init().
| bool hal::plugin_manager::has_valid_file_extension | ( | std::filesystem::path | file_name | ) |
Returns whether file has an extension which is legal for plugins in OS
| file_name |
false if extension indicated that this file cannot be a plugin, true otherwise Definition at line 138 of file plugin_manager.cpp.
References ALTERNATE_LIBRARY_FILE_EXTENSION, hal::utils::ends_with(), and LIBRARY_FILE_EXTENSION.
Referenced by load_all_plugins(), and hal::plugin_manager_init().
| bool hal::plugin_manager::load | ( | const std::string & | plugin_name, |
| const std::filesystem::path & | file_path = std::filesystem::path() |
||
| ) |
Load a single plugin by specifying its name and file path.
| [in] | plugin_name | - The desired name that is unique in the framework. |
| [in] | file_path | - The path to the plugin file. |
true on success, false otherwise. Definition at line 216 of file plugin_manager.cpp.
References hal::FacExtensionInterface::FacGatelibParser, hal::FacExtensionInterface::FacGatelibWriter, hal::FacExtensionInterface::FacNetlistParser, hal::FacExtensionInterface::FacNetlistWriter, hal::FacExtensionInterface::factory_provider, hal::FacExtensionInterface::FacUnknown, hal::CliExtensionInterface::get_cli_options(), hal::FacExtensionInterface::get_description(), hal::FacExtensionInterface::get_feature(), hal::BasePluginInterface::get_name(), get_plugin_path(), hal::FacExtensionInterface::get_supported_file_extensions(), instance, log_debug, log_error, log_info, hal::FacFactoryProvider< T >::m_factory, hal::gate_library_parser_manager::register_parser(), hal::netlist_parser_manager::register_parser(), hal::gate_library_writer_manager::register_writer(), and hal::netlist_writer_manager::register_writer().
Referenced by hal::GuiPluginTable::handleButtonPressed(), hal::GuiPluginTable::load(), load_all_plugins(), and hal::plugin_manager_init().
| bool hal::plugin_manager::load_all_plugins | ( | const std::vector< std::filesystem::path > & | directory_names = {} | ) |
Load all plugins in the specified directories.
If directory_names is empty, the default directories will be searched.
| [in] | directory_names | - A vector of directory paths. |
true on success, false otherwise. Definition at line 190 of file plugin_manager.cpp.
References has_valid_file_extension(), load(), and log_debug.
Referenced by hal::plugin_manager_init().
| void hal::plugin_manager::remove_model_changed_callback | ( | u64 | id | ) |
Remove a registered callback.
| [in] | id | - The id of the registered callback. |
Definition at line 496 of file plugin_manager.cpp.
Referenced by hal::plugin_manager_init(), and hal::PluginRelay::~PluginRelay().
| bool hal::plugin_manager::unload | ( | const std::string & | plugin_name | ) |
Releases a single plugin and its associated ressources.
| [in] | plugin_name | - The name of the plugin to unload. |
true on success, false otherwise. Definition at line 381 of file plugin_manager.cpp.
References hal::FacExtensionInterface::FacGatelibParser, hal::FacExtensionInterface::FacGatelibWriter, hal::FacExtensionInterface::FacNetlistParser, hal::FacExtensionInterface::FacNetlistWriter, hal::FacExtensionInterface::get_description(), hal::FacExtensionInterface::get_feature(), log_debug, log_info, name, hal::gate_library_parser_manager::unregister_parser(), hal::netlist_parser_manager::unregister_parser(), hal::gate_library_writer_manager::unregister_writer(), and hal::netlist_writer_manager::unregister_writer().
Referenced by hal::GuiPluginTable::handleButtonPressed(), hal::plugin_manager_init(), and unload_all_plugins().
| bool hal::plugin_manager::unload_all_plugins | ( | ) |
Releases all plugins and their associated resources.
true on success, false otherwise. Definition at line 362 of file plugin_manager.cpp.
References get_plugin_names(), log_debug, log_error, log_info, name, and unload().
Referenced by hal::plugin_manager_init().