HAL
hal::netlist_factory Namespace Reference

Functions

std::unique_ptr< Netlistcreate_netlist (const GateLibrary *gate_library)
 Create a new empty netlist using the specified gate library. More...
 
std::unique_ptr< Netlistload_netlist_from_string (const std::string &netlist_string, const std::filesystem::path &gate_library_file=std::filesystem::path())
 Create a netlist from the given string. More...
 
std::unique_ptr< Netlistload_netlist (const std::filesystem::path &netlist_file, const std::filesystem::path &gate_library_file=std::filesystem::path())
 Create a netlist from the given file. More...
 
std::unique_ptr< Netlistload_netlist (const std::filesystem::path &netlist_file, GateLibrary *gate_library)
 Create a netlist from the given file trying to parse it with the specified gate library. More...
 
std::unique_ptr< Netlistload_hal_project (const std::filesystem::path &project_dir)
 Create a netlist from the given hal project. More...
 
std::unique_ptr< Netlistload_netlist (const ProjectDirectory &pdir, const ProgramArguments &args)
 Create a netlist using information specified in command line arguments on startup. More...
 
std::vector< std::unique_ptr< Netlist > > load_netlists (const std::filesystem::path &netlist_file)
 Create a netlist from a given file for each matching pre-loaded gate library. More...
 

Function Documentation

◆ create_netlist()

NETLIST_API std::unique_ptr< Netlist > hal::netlist_factory::create_netlist ( const GateLibrary gate_library)

Create a new empty netlist using the specified gate library.

Parameters
[in]gate_library- The gate library.
Returns
The netlist on success, a nullptr otherwise.

Definition at line 19 of file netlist_factory.cpp.

References log_critical.

Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), hal::GateLibraryManager::initialize(), hal::VerilogParser::instantiate(), hal::VHDLParser::instantiate(), hal::netlist_factory_init(), and hal::FileManager::newProject().

◆ load_hal_project()

NETLIST_API std::unique_ptr< Netlist > hal::netlist_factory::load_hal_project ( const std::filesystem::path &  project_dir)

Create a netlist from the given hal project.

Parameters
[in]project_dir- Path to the hal project directory.
Returns
The netlist on success, a nullptr otherwise.

Definition at line 106 of file netlist_factory.cpp.

References hal::ProjectManager::get_netlist(), hal::ProjectManager::instance(), log_critical, and hal::ProjectManager::open_project().

Referenced by hal::netlist_factory_init().

◆ load_netlist() [1/3]

NETLIST_API std::unique_ptr< Netlist > hal::netlist_factory::load_netlist ( const ProjectDirectory pdir,
const ProgramArguments args 
)

Create a netlist using information specified in command line arguments on startup.

Will either deserialize .hal file or call parser plugin for other formats.

Parameters
[in]pdir- The HAL project directory.
[in]args- Command line arguments.
Returns
The netlist on success, a nullptr otherwise.

Definition at line 125 of file netlist_factory.cpp.

References control::args, hal::netlist_serializer::deserialize_from_file(), hal::ProjectDirectory::get_default_filename(), log_critical, and hal::netlist_parser_manager::parse().

◆ load_netlist() [2/3]

NETLIST_API std::unique_ptr< Netlist > hal::netlist_factory::load_netlist ( const std::filesystem::path &  netlist_file,
const std::filesystem::path &  gate_library_file = std::filesystem::path() 
)

Create a netlist from the given file.

Will either deserialize .hal file or call parser plugin for other formats. In the latter case the specified gate library file is mandatory.

Parameters
[in]netlist_file- Path to the netlist file.
[in]gate_library_file- Path to the gate library file. Optional argument for .hal file.
Returns
The netlist on success, a nullptr otherwise.

Definition at line 47 of file netlist_factory.cpp.

References hal::netlist_serializer::deserialize_from_file(), hal::gate_library_manager::load(), log_critical, and hal::netlist_parser_manager::parse().

Referenced by hal::FileManager::deprecatedOpenFile(), and hal::netlist_factory_init().

◆ load_netlist() [3/3]

NETLIST_API std::unique_ptr< Netlist > hal::netlist_factory::load_netlist ( const std::filesystem::path &  netlist_file,
GateLibrary gate_library 
)

Create a netlist from the given file trying to parse it with the specified gate library.

Will either deserialize .hal file or call parser plugin for other formats.

Parameters
[in]netlist_file- Path to the netlist file.
[in]gate_library- The gate library.
Returns
The netlist on success, a nullptr otherwise.

Definition at line 82 of file netlist_factory.cpp.

References hal::netlist_serializer::deserialize_from_file(), log_critical, and hal::netlist_parser_manager::parse().

◆ load_netlist_from_string()

NETLIST_API std::unique_ptr< Netlist > hal::netlist_factory::load_netlist_from_string ( const std::string &  netlist_string,
const std::filesystem::path &  gate_library_file = std::filesystem::path() 
)

Create a netlist from the given string.

The string must contain a netlist in HAL-(JSON)-format.

Parameters
[in]netlist_string- The string containing the netlist.
[in]gate_library_file- Path to the gate library file.
Returns
The netlist on success, a nullptr otherwise.

Definition at line 30 of file netlist_factory.cpp.

References hal::netlist_serializer::deserialize_from_string(), hal::gate_library_manager::load(), and log_critical.

Referenced by hal::netlist_factory_init().

◆ load_netlists()

NETLIST_API std::vector< std::unique_ptr< Netlist > > hal::netlist_factory::load_netlists ( const std::filesystem::path &  netlist_file)

Create a netlist from a given file for each matching pre-loaded gate library.

Parameters
[in]netlist_file- Path to the netlist file.
Returns
A vector of netlists, one for each suitable gate library.

Definition at line 145 of file netlist_factory.cpp.

References log_critical, and hal::netlist_parser_manager::parse_all().

Referenced by hal::FileManager::deprecatedOpenFile(), and hal::netlist_factory_init().