HAL
hal::gate_library_manager Namespace Reference

Functions

GateLibraryload (std::filesystem::path file_path, bool reload)
 
void load_all (bool reload)
 
std::vector< std::filesystem::path > get_all_path ()
 
bool save (std::filesystem::path file_path, GateLibrary *gate_lib, bool overwrite)
 
void remove (std::filesystem::path file_path)
 
GateLibraryget_gate_library (const std::string &file_path)
 
GateLibraryget_gate_library_by_name (const std::string &lib_name)
 
std::vector< GateLibrary * > get_gate_libraries ()
 

Detailed Description

The gate library manager keeps track of all gate libraries that are used within HAL. Further, it takes care of loading and saving gate libraries on demnand.

Function Documentation

◆ get_all_path()

NETLIST_API std::vector< std::filesystem::path > hal::gate_library_manager::get_all_path ( )

Lists all pathnames to gate libraries

Returns
Vector of path

Definition at line 134 of file gate_library_manager.cpp.

References hal::utils::get_gate_library_directories().

Referenced by hal::GateLibrarySelectionTable::GateLibrarySelectionTable(), and hal::NewProjectDialog::NewProjectDialog().

◆ get_gate_libraries()

NETLIST_API std::vector< GateLibrary * > hal::gate_library_manager::get_gate_libraries ( )

Get all loaded gate libraries.

Returns
A vector of gate libraries.

Definition at line 221 of file gate_library_manager.cpp.

Referenced by hal::gate_library_manager_init().

◆ get_gate_library()

NETLIST_API GateLibrary * hal::gate_library_manager::get_gate_library ( const std::string &  file_path)

Get a gate library by file path. If no library with the given name is loaded, loading the gate library from file will be attempted.

Parameters
[in]file_path- The input path.
Returns
The gate library on success, nullptr otherwise.

Definition at line 175 of file gate_library_manager.cpp.

References hal::utils::get_file(), hal::utils::get_gate_library_directories(), load(), and log_info.

Referenced by hal::gate_library_manager_init(), hal::netlist_parser_manager::parse(), and hal::TEST_F().

◆ get_gate_library_by_name()

NETLIST_API GateLibrary * hal::gate_library_manager::get_gate_library_by_name ( const std::string &  lib_name)

Get a gate library by name. If no library with the given name is loaded, a nullptr will be returned.

Parameters
[in]lib_name- The name of the gate library.
Returns
The gate library on success, nullptr otherwise.

Definition at line 209 of file gate_library_manager.cpp.

Referenced by hal::gate_library_manager_init().

◆ load()

NETLIST_API GateLibrary * hal::gate_library_manager::load ( std::filesystem::path  file_path,
bool  reload = false 
)

Load a gate library from file.

Parameters
[in]file_path- The input path.
[in]reload- If true, reloads the library in case it is already loaded.
Returns
The gate library on success, nullptr otherwise.

Definition at line 75 of file gate_library_manager.cpp.

References log_error, log_info, and hal::gate_library_parser_manager::parse().

Referenced by hal::gate_library_manager_init(), get_gate_library(), hal::GateLibraryManager::initialize(), load_all(), hal::netlist_factory::load_netlist(), hal::netlist_factory::load_netlist_from_string(), hal::FileManager::newProject(), and hal::VerilogWriterTest::SetUp().

◆ load_all()

NETLIST_API void hal::gate_library_manager::load_all ( bool  reload = false)

Load all gate libraries available in standard gate library directories.

Parameters
[in]reload- If true, reloads all libraries that have already been loaded.

Definition at line 114 of file gate_library_manager.cpp.

References hal::utils::get_gate_library_directories(), load(), and log_info.

Referenced by hal::gate_library_manager_init().

◆ remove()

NETLIST_API void hal::gate_library_manager::remove ( std::filesystem::path  file_path)

Remove a gate library.

Parameters
[in]file_path- The input path.

Definition at line 170 of file gate_library_manager.cpp.

Referenced by hal::GateLibraryManager::callUnsavedChangesWindow().

◆ save()

NETLIST_API bool hal::gate_library_manager::save ( std::filesystem::path  file_path,
GateLibrary gate_lib,
bool  overwrite = false 
)

Save a gate library to file.

Parameters
[in]file_path- The output path.
[in]gate_lib- The gate library.
[in]overwrite- If true, overwrites already existing files.
Returns
True on success, false otherwise.

Definition at line 147 of file gate_library_manager.cpp.

References log_error, log_info, and hal::gate_library_writer_manager::write().

Referenced by hal::gate_library_manager_init(), hal::GatelibraryContentWidget::handleSaveAction(), hal::GatelibraryContentWidget::handleSaveAsAction(), and hal::VerilogWriterTest::SetUp().