7 m.def_submodule(
"NetlistFactory")
10 Create a new empty netlist using the specified gate library.
12 :param hal_py.GateLibrary gate_library: The gate library.
13 :returns: The netlist on success, ``None`` otherwise.
14 :rtype: hal_py.Netlist or None
19 [](
const std::filesystem::path& netlist_file,
const std::filesystem::path& gate_library_file = std::filesystem::path()) {
22 py::arg(
"netlist_file"),
23 py::arg(
"gate_library_file") = std::filesystem::path(),
25 Create a netlist from the given file using the specified gate library file.
26 Will either deserialize ``.hal`` file or call parser plugin for other formats.
27 In the latter case the specified gate library file is mandatory.
29 :param pathlib.Path netlist_file: Path to the file.
30 :param pathlib.Path gate_library_file: Path to the gate library file.
31 :returns: The netlist on success, ``None`` otherwise.
32 :rtype: hal_py.Netlist or None
38 py::arg(
"netlist_file"),
39 py::arg(
"gate_library"),
41 Create a netlist from the given file trying to parse it with the specified gate library.
42 Will either deserialize ``.hal`` file or call parser plugin for other formats.
44 :param pathlib.Path netlist_file: Path to the file.
45 :param hal_py.GateLibrary gate_library_file: Path to the gate library file.
46 :returns: The netlist on success, ``None`` otherwise.
47 :rtype: hal_py.Netlist or None
51 "load_netlist_from_string",
52 [](
const std::string& hdl_string,
const std::filesystem::path& gate_library_file) {
55 py::arg(
"hdl_string"),
56 py::arg(
"gate_library_file") =
"",
58 Create a netlist from the given string.
59 The string must contain a netlist in HAL-(JSON)-format.
61 :param pathlib.Path netlist_file: The string containing the netlist.
62 :param pathlib.Path gate_library_file: Path to the gate library file.
63 :returns: The netlist on success, ``None`` otherwise.
64 :rtype: hal_py.Netlist or None
68 "load_hal_project", [](
const std::filesystem::path& project_dir) {
return std::shared_ptr<Netlist>(
netlist_factory::load_hal_project(project_dir)); }, py::arg(
"project_dir"), R
"(
69 Create a netlist using information specified in command line arguments on startup.
70 Will either deserialize ``.hal`` file or call parser plugin for other formats.
72 :param pathlib.Path project_dir: Path to the hal project directory.
73 :returns: The netlist on success, ``None`` otherwise.
74 :rtype: hal_py.Netlist or None
79 [](
const std::filesystem::path& hal_file) {
80 std::vector<std::shared_ptr<Netlist>> result;
83 result.emplace_back(std::move(ptr));
87 py::arg(
"netlist_file"),
89 Create a netlist from a given file for each matching pre-loaded gate library.
91 :param pathlib.Path netlist_file: Path to the netlist file.
92 :returns: A list of netlists, one for each suitable gate library.
93 :rtype: list[hal_py.Netlist]
void netlist_factory_init(py::module &m)
const Module * module(const Gate *g, const NodeBoxes &boxes)
std::unique_ptr< Netlist > create_netlist(const GateLibrary *gate_library)
Create a new empty netlist using the specified gate library.
std::unique_ptr< Netlist > load_hal_project(const std::filesystem::path &project_dir)
Create a netlist from the given hal project.
std::unique_ptr< Netlist > load_netlist_from_string(const std::string &netlist_string, const std::filesystem::path &gate_library_file)
Create a netlist from the given string.
std::unique_ptr< Netlist > load_netlist(const std::filesystem::path &netlist_file, const std::filesystem::path &gate_library_file)
Create a netlist from the given file.
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.