7 py::class_<Module, DataContainer, RawPtrWrapper<Module>> py_module(m,
"Module", R
"(
8 A module is a container for gates and their associated nets that enables hierarchization within the netlist.
9 Each gate can only be in one module at a time. Nets are only loosely associated with modules.
12 py_module.def(py::self == py::self, R"(
13 Check whether two modules are equal.
14 Does not check for parent module.
16 :returns: ``True`` if both modules are equal, ``False`` otherwise.
20 py_module.def(py::self != py::self, R"(
21 Check whether two modules are unequal.
22 Does not check for parent module.
24 :returns: ``True`` if both modules are unequal, ``False`` otherwise.
29 Python requires hash for set and dict container.
36 The unique ID of the module.
42 Get the unique ID of the module.
44 :returns: The unique id.
49 The name of the module.
55 Get the name of the module.
62 Set the name of the module.
64 :param str name: The new name.
68 The type of the module.
74 Get the type of the module.
81 Set the type of the module.
83 :param str type: The new type.
87 Get the grouping in which this module is contained.
89 :returns: The grouping.
90 :rtype: hal_py.Grouping
94 The depth of the module within the module hierarchie (0 = top module, 1 = direct child of top module, ...).
100 Get the depth of the module within the module hierarchie (0 = top module, 1 = direct child of top module, ...).
102 :returns: The depth within the module hierarchie.
107 The parent module of this module.
108 Is set to ``None`` for the top module, but cannot be set to ``None`` by the user.
110 :type: hal_py.Module or None
114 Get the parent module of this module.
115 For the top module, ``None`` is returned.
117 :returns: The parent module.
118 :rtype: hal_py.Module or None
122 The parent modules of this module.
124 :type: list[hal_py.Module]
127 py_module.def("get_parent_modules", &
Module::get_parent_modules, py::arg(
"filter") =
nullptr, py::arg(
"recursive") =
true, R
"(
128 Get all parents of this module.
129 If ``recursive`` is set to ``True``, all indirect parents are also included.
130 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
132 :param lambda filter: An optional filter.
133 :param bool recursive: Set ``True`` to include indirect parents as well, ``False`` otherwise.
134 :returns: A list of parent modules.
135 :rtype: list[hal_py.Module]
139 Set a new parent for this module.
140 If the new parent is a submodule of this module, the new parent is added as a direct submodule to the old parent first.
142 :param hal_py.Module new_parent: The new parent module.
143 :returns: ``True`` if the parent was changed, ``False`` otherwise.
148 Check if the module is a parent of the specified module.
150 :param hal_py.Module module: The module.
151 :param bool recursive: Set ``True`` to check recursively, ``False`` otherwise.
152 :returns: ``True`` if the module is a parent of the specified module, ``False`` otherwise.
156 py_module.def_property_readonly("submodules", [](
Module* mod) {
return mod->
get_submodules(); }, R
"(
157 A list of all direct submodules of this module.
159 :type: list[hal_py.Module]
162 py_module.def("get_submodules", &
Module::get_submodules, py::arg(
"filter") =
nullptr, py::arg(
"recursive") =
false, R
"(
163 Get all direct submodules of this module.
164 If ``recursive`` is set to ``True``, all indirect submodules are also included.
165 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
167 :param lambda filter: An optional filter.
168 :param bool recursive: Set ``True`` to include indirect submodules as well, ``False`` otherwise.
169 :returns: A list of submodules.
170 :rtype: list[hal_py.Module]
173 py_module.def("is_submodule_of", &
Module::is_submodule_of, py::arg(
"module"), py::arg(
"recursive") =
false, R
"(
174 Check if the module is a submodule of the specified module.
176 :param hal_py.Module module: The module.
177 :param bool recursive: Set ``True`` to check recursively, ``False`` otherwise.
178 :returns: ``True`` if the module is a submodule of the specified module, ``False`` otherwise.
183 Checks whether another module is a submodule of this module.
184 If recursive is set to ``True``, all indirect submodules are also included.
186 :param hal_py.Module other: Other module to check for.
187 :param bool recursive: Set ``True`` to include indirect submodules as well, ``False`` otherwise.
188 :returns: ``True`` if the other module is a submodule, ``False`` otherwise.
193 ``True`` only if the module is the top module of the netlist.
199 Returns ``True`` only if the module is the top module of the netlist.
201 :returns: ``True`` if the module is the top module, ``False`` otherwise.
206 The netlist this module is associated with.
208 :type: hal_py.Netlist
212 Get the netlist this module is associated with.
214 :returns: The netlist.
215 :rtype: hal_py.Netlist
219 Iterates over all nets connected to at least one gate of the module to update the nets, internal nets, input nets, and output nets of the module.
220 Has no effect on module pins.
222 WARNING: can only be used when automatic net checks have been disabled using hal_py.Netlist.enable_automatic_net_checks.
225 py_module.def("contains_net", &
Module::contains_net, py::arg(
"net"), py::arg(
"recursive") =
false, R
"(
226 Check whether a net is contained in the module.
227 If ``recursive`` is set to ``True``, nets in submodules are considered as well.
229 :param hal_py.Net net: The net to check for.
230 :param bool recursive: ``True`` to also consider nets in submodules, ``False`` otherwise.
231 :returns: ``True`` if the net is contained in the module, ``False`` otherwise.
235 py_module.def_property_readonly("nets", py::overload_cast<>(&
Module::get_nets, py::const_), R
"(
236 An unordered set of all nets that have at least one source or one destination within the module.
238 :type: set[hal_py.Net]
241 py_module.def("get_nets", py::overload_cast<>(&
Module::get_nets, py::const_), R
"(
242 Get all nets that have at least one source or one destination within the module.
244 :returns: An unordered set of nets.
245 :rtype: set[hal_py.Net]
248 py_module.def("get_nets", py::overload_cast<
const std::function<
bool(
Net*)>&,
bool>(&
Module::get_nets, py::const_), py::arg(
"filter"), py::arg(
"recursive") =
false, R
"(
249 Get all nets that have at least one source or one destination within the module.
250 The filter is evaluated on every candidate such that the result only contains those matching the specified condition.
251 If ``recursive`` is ``True``, nets in submodules are considered as well.
253 :param lambda filter: Filter function to be evaluated on each net.
254 :param bool recursive: ``True`` to also consider nets in submodules, ``False`` otherwise.
255 :returns: An unordered set of nets.
256 :rtype: set[hal_py.Net]
260 A set of all nets that are either a global input to the netlist or have at least one source outside of the module.
262 :type: set[hal_py.Net]
266 Get all nets that are either a global input to the netlist or have at least one source outside of the module.
268 :returns: A set of input nets.
269 :rtype: set[hal_py.Net]
273 A set of all nets that are either a global output to the netlist or have at least one destination outside of the module.
275 :type: set[hal_py.Net]
279 Get all nets that are either a global output to the netlist or have at least one destination outside of the module.
281 :returns: A set of output nets.
282 :rtype: set[hal_py.Net]
286 A set of all nets that have at least one source and one destination within the module, including its submodules. The result may contain nets that are also regarded as input or output nets.
288 :type: set[hal_py.Net]
292 Get all nets that have at least one source and one destination within the module, including its submodules. The result may contain nets that are also regarded as input or output nets.
294 :returns: A set of internal nets.
295 :rtype: set[hal_py.Net]
299 Check whether the given net is an input of the module, i.e., whether the net is a global input to the netlist or has at least one source outside of the module.
301 :param hal_py.Net net: The net.
302 :returns: ``True`` if the net is an input net, ``False`` otherwise.
307 Check whether the given net is an output of the module, i.e., whether the net is a global output to the netlist or has at least one destination outside of the module.
309 :param hal_py.Net net: The net.
310 :returns: ``True`` if the net is an output net, ``False`` otherwise.
315 Check whether the given net is an internal net of the module, i.e. whether the net has at least one source and one destination within the module.
317 :param hal_py.Net net: The net.
318 :returns: ``True`` if the net is an internal net, ``False`` otherwise.
323 Assign a gate to the module.
324 The gate is removed from its previous module in the process.
326 :param hal_py.Gate gate: The gate to assign.
327 :returns: ``True`` on success, ``False`` otherwise.
332 Assign a list of gates to the module.
333 The gates are removed from their previous module in the process.
335 :param list[hal_py.Gate] gates: The gates to assign.
336 :returns: ``True`` on success, ``False`` otherwise.
341 Remove a gate from the module.
342 Automatically moves the gate to the top module of the netlist.
344 :param hal_py.Gate gate: The gate to remove.
345 :returns: ``True`` on success, ``False`` otherwise.
350 Remove a list of gates from the module.
351 Automatically moves the gates to the top module of the netlist.
353 :param list[hal_py.Gate] gates: The gates to remove.
354 :returns: ``True`` on success, ``False`` otherwise.
358 py_module.def("contains_gate", &
Module::contains_gate, py::arg(
"gate"), py::arg(
"recursive") =
false, R
"(
359 Check whether a gate is contained in the module.
360 If ``recursive`` is ``True``, gates in submodules are considered as well.
362 :param hal_py.Gate gate: The gate to check for.
363 :param bool recursive: ``True`` to also consider gates in submodules, ``False`` otherwise.
364 :returns: ``True`` if the gate is contained in the module, ``False`` otherwise.
369 Get a gate specified by the given ID.
370 If ``recursive`` is ``True``, gates in submodules are considered as well.
372 :param int id: The unique ID of the gate.
373 :param bool recursive: ``True`` to also consider gates in submodules, ``False`` otherwise.
374 :returns: The gate if found, ``None`` otherwise.
375 :rtype: hal_py.Gate or None
378 py_module.def_property_readonly("gates", py::overload_cast<>(&
Module::get_gates, py::const_), R
"(
379 The list of all gates contained within the module.
381 :type: list[hal_py.Gate]
384 py_module.def("get_gates", py::overload_cast<>(&
Module::get_gates, py::const_), R
"(
385 Get all gates contained within the module.
387 :returns: A list of gates.
388 :rtype: list[hal_py.Gate]
391 py_module.def("get_gates", py::overload_cast<
const std::function<
bool(
Gate*)>&,
bool>(&
Module::get_gates, py::const_), py::arg(
"filter") =
nullptr, py::arg(
"recursive") =
false, R
"(
392 Get all gates contained within the module.
393 The filter is evaluated on every candidate such that the result only contains those matching the specified condition.
394 If ``recursive`` is ``True``, gates in submodules are considered as well.
396 :param lambda filter: Filter function to be evaluated on each gate.
397 :param bool recursive: ``True`` to also consider gates in submodules, ``False`` otherwise. Defaults to ``False``.
398 :returns: A list of gates.
399 :rtype: list[hal_py.Gate]
404 The value of 0 is reserved and represents an invalid ID.
406 :returns: The pin ID.
411 Get a spare pin group ID.
412 The value of 0 is reserved and represents an invalid ID.
414 :returns: The pin group ID.
421 auto res =
self.create_pin(
id,
name,
net,
type, create_group, force_name);
428 log_error(
"python_context",
"error encountered while creating pin:\n{}", res.get_error().get());
436 py::arg(
"create_group") =
true,
437 py::arg(
"force_name") =
false,
439 Manually create a module pin and assign it to a net.
440 Checks whether the given direction matches the actual properties of the net, i.e., checks whether the net actually is an input and/or output to the module.
441 Hence, make sure to update the module nets beforehand using ``hal_py.Module.update_nets``.
442 If ``create_group`` is set to ``False``, the pin will not be added to a pin group.
444 WARNING: can only be used when automatic net checks have been disabled using ``hal_py.Netlist.enable_automatic_net_checks``.
446 :param int id: The ID of the pin.
447 :param str name: The name of the pin.
448 :param hal_py.Net net: The net that the pin is being assigned to.
449 :param hal_py.PinType type: The type of the pin. Defaults to ``hal_py.PinType.none``.
450 :param bool create_group: Set ``True`` to automatically create a pin group and assign the pin, ``False`` otherwise. Defaults to ``True``.
451 :param bool force_name: Set ``True`` to enforce the name, ``False`` otherwise. If a pin with the same name already exists, that existing pin will be renamed. Defaults to ``False``.
452 :returns: The module pin on success, ``None`` otherwise.
453 :rtype: hal_py.ModulePin or None
459 auto res =
self.create_pin(
name,
net,
type, create_group, force_name);
466 log_error(
"python_context",
"error encountered while creating pin:\n{}", res.get_error().get());
473 py::arg(
"create_group") =
true,
474 py::arg(
"force_name") =
false,
476 Manually create a module pin and assign it to a net.
477 The ID of the pin is set automatically.
478 Checks whether the given direction matches the actual properties of the net, i.e., checks whether the net actually is an input and/or output to the module.
479 Hence, make sure to update the module nets beforehand using ``hal_py.Module.update_nets``.
480 If ``create_group`` is set to ``False``, the pin will not be added to a pin group.
482 WARNING: can only be used when automatic net checks have been disabled using ``hal_py.Netlist.enable_automatic_net_checks``.
484 :param str name: The name of the pin.
485 :param hal_py.Net net: The net that the pin is being assigned to.
486 :param hal_py.PinType type: The type of the pin. Defaults to ``hal_py.PinType.none``.
487 :param bool create_group: Set ``True`` to automatically create a pin group and assign the pin, ``False`` otherwise. Defaults to ``True``.
488 :param bool force_name: Set ``True`` to enforce the name, ``False`` otherwise. If a pin with the same name already exists, that existing pin will be renamed. Defaults to ``False``.
489 :returns: The module pin on success, ``None`` otherwise.
490 :rtype: hal_py.ModulePin or None
494 The (ordered) pins of the module.
496 :type: list[hal_py.ModulePin]
499 py_module.def("get_pins", &
Module::get_pins, py::arg(
"filter") =
nullptr, R
"(
500 Get an ordered list of all pins of the module.
501 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
503 :param lambda filter: An optional filter.
504 :returns: An ordered list of pins.
505 :rtype: list[hal_py.ModulePin]
508 py_module.def_property_readonly(
510 [](
const Module&
self) -> std::vector<std::string> {
return self.get_pin_names(); },
512 An ordered list of the names of all pins of the module.
518 Get an ordered list of the names of all pins of the module.
519 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
521 :returns: A list of input pin names of the module.
522 :param lambda filter: An optional filter.
523 :returns: An ordered list of pin names.
528 An ordered list of all input pins of the module (including inout pins).
530 :type: list[hal_py.ModulePin]
534 Get an ordered list of all input pins of the module (including inout pins).
536 :returns: An ordered list of input pins.
537 :rtype: list[hal_py.ModulePin]
541 An ordered list of the names of all input pins of the module (including inout pins).
547 Get an ordered list of the names of all input pins of the module (including inout pins).
549 :returns: An ordered list of input pin names.
554 An ordered list of all output pins of the module (including inout pins).
556 :type: list[hal_py.ModulePin]
560 Get an ordered list of all output pins of the module (including inout pins).
562 :returns: An ordered list of output pins.
563 :rtype: list[hal_py.ModulePin]
567 An ordered list of the names of all output pins of the module (including inout pins).
573 Get an ordered list of the names of all output pins of the module (including inout pins).
575 :returns: An ordered list of output pin names.
580 All pin_groups of the module.
582 :type: list[hal_py.ModulePinGroup]
586 Get all pin groups of the module.
587 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
589 :param lambda filter: An optional filter.
590 :returns: A list of pin groups.
591 :rtype: list[hal_py.ModulePinGroup]
595 Get the pin corresponding to the given ID.
597 :param int id: The ID of the pin.
598 :returns: The pin on success, ``None`` otherwise.
599 :rtype: hal_py.ModulePin or None
603 Get the pin corresponding to the given name.
605 :param str name: The name of the pin.
606 :returns: The pin on success, ``None`` otherwise.
607 :rtype: hal_py.ModulePin or None
611 Get the pin that passes through the specified net.
613 :param hal_py.Net net: The net.
614 :returns: The pin on success, ``None`` otherwise.
615 :rtype: hal_py.ModulePin or None
619 Get the pin group corresponding to the given ID.
621 :param int id: The ID of the pin group.
622 :returns: The pin group on success, ``None`` otherwise.
623 :rtype: hal_py.ModulePinGroup or None
627 Get the pin group corresponding to the given name.
629 :param str name: The name of the pin group.
630 :returns: The pin group on success, ``None`` otherwise.
631 :rtype: hal_py.ModulePinGroup or None
634 py_module.def("set_pin_name", &
Module::set_pin_name, py::arg(
"pin"), py::arg(
"new_name"), py::arg(
"force_name") =
false, R
"(
635 Set the name of the given pin.
637 :param hal_py.ModulePin pin: The pin.
638 :param str new_name: The name to be assigned to the pin.
639 :param bool force_name: Set ``True`` to enforce the name, ``False`` otherwise. If a pin with the same name already exists, that existing pin will be renamed. Defaults to ``False``.
640 :returns: ``True`` on success, ``False`` otherwise.
644 py_module.def("set_pin_group_name", &
Module::set_pin_group_name, py::arg(
"pin_group"), py::arg(
"new_name"), py::arg(
"force_name") =
false, R
"(
645 Set the name of the given pin group.
647 :param hal_py.ModulePinGroup pin_group: The pin group.
648 :param str new_name: The name to be assigned to the pin group.
649 :param bool force_name: Set ``True`` to enforce the name, ``False`` otherwise. If a pin group with the same name already exists, the existing pin group will be renamed. Defaults to ``False``.
650 :returns: ``True`` on success, ``False`` otherwise.
655 Set the type of the given pin.
657 :param hal_py.ModulePin pin: The pin.
658 :param hal_py.PinType new_type: The type to be assigned to the pin.
659 :returns: ``True`` on success, ``False`` otherwise.
664 Set the type of the given pin group.
666 :param hal_py.ModulePinGroup pin_group: The pin group.
667 :param hal_py.PinType new_type: The type to be assigned to the pin group.
668 :returns: ``True`` on success, ``False`` otherwise.
673 Set the direction of the given pin group.
675 :param hal_py.ModulePinGroup pin_group: The pin group.
676 :param hal_py.PinDirection new_direction: The direction to be assigned to the pin group.
677 :returns: ``True`` on success, ``False`` otherwise.
685 const std::string&
name,
686 const std::vector<ModulePin*>
pins = {},
691 bool delete_empty_groups =
true,
707 log_error(
"python_context",
"error encountered while creating pin group:\n{}", res.get_error().get());
713 py::arg(
"pins") = std::vector<ModulePin*>(),
716 py::arg(
"ascending") =
false,
717 py::arg(
"start_index") = UINT_MAX,
718 py::arg(
"delete_empty_groups") =
true,
719 py::arg(
"force_name") =
false,
721 Create a new pin group with the given name.
722 All pins to be added to the pin group must have the same direction and type.
724 :param int id: The ID of the pin group.
725 :param str name: The name of the pin group.
726 :param list[hal_py.ModulePin] pins: The pins to be assigned to the pin group. Defaults to an empty list.
727 :param hal_py.PinDirection direction: The direction of the pin group, if any. Defaults to ``hal_py.PinDirection.none``.
728 :param hal_py.PinType type: The type of the pin group, if any. Defaults to ``hal_py.PinType.none``.
729 :param bool ascending: Set ``True`` for ascending pin order (from 0 to n-1), ``False`` otherwise (from n-1 to 0). Defaults to ``True``.
730 :param int start_index: The start index of the pin group. Defaults to ``0``.
731 :param bool delete_empty_groups: Set ``True`` to delete groups that are empty after the pins have been assigned to the new group, ``False`` to keep empty groups. Defaults to ``True``.
732 :param bool force_name: Set ``True`` to enforce the name, ``False`` otherwise. If a pin group with the same name already exists, the existing pin group will be renamed. Defaults to ``False``.
733 :returns: The pin group on success, ``None`` otherwise.
734 :rtype: hal_py.ModulePinGroup or None
740 const std::string&
name,
741 const std::vector<ModulePin*>
pins = {},
746 bool delete_empty_groups =
true,
762 log_error(
"python_context",
"error encountered while creating pin group:\n{}", res.get_error().get());
767 py::arg(
"pins") = std::vector<ModulePin*>(),
770 py::arg(
"ascending") =
false,
771 py::arg(
"start_index") = UINT_MAX,
772 py::arg(
"delete_empty_groups") =
true,
773 py::arg(
"force_name") =
false,
775 Create a new pin group with the given name.
776 All pins to be added to the pin group must have the same direction and type.
778 :param str name: The name of the pin group.
779 :param list[hal_py.ModulePin] pins: The pins to be assigned to the pin group. Defaults to an empty list.
780 :param hal_py.PinDirection direction: The direction of the pin group, if any. Defaults to ``hal_py.PinDirection.none``.
781 :param hal_py.PinType type: The type of the pin group, if any. Defaults to ``hal_py.PinType.none``.
782 :param bool ascending: Set ``True`` for ascending pin order (from 0 to n-1), ``False`` otherwise (from n-1 to 0). Defaults to ``True``.
783 :param int start_index: The start index of the pin group. Defaults to ``0``.
784 :param bool delete_empty_groups: Set ``True``` to delete groups that are empty after the pins have been assigned to the new group, ```False``` to keep empty groups. Defaults to ```True```.
785 :param bool force_name: Set ``True`` to enforce the name, ``False`` otherwise. If a pin group with the same name already exists, the existing pin group will be renamed. Defaults to ``False``.
786 :returns: The pin group on success, ``None`` otherwise.
787 :rtype: hal_py.ModulePinGroup or None
793 if (
self.delete_pin_group(pin_group))
799 log_error(
"python_context",
"error encountered while deleting pin group.");
803 py::arg(
"pin_group"),
805 Delete the given pin group.
807 :param hal_py.ModulePinGroup pin_group: The pin group to be deleted.
808 :returns: ``True`` on success, ``False`` otherwise.
815 if (
self.move_pin_group(pin_group, new_index))
821 log_error(
"python_context",
"error encountered while moving pin group.");
825 py::arg(
"pin_group"),
826 py::arg(
"new_index"),
828 Move a pin group to another index within the module.
829 The indices of some other pin groups will be incremented or decremented to make room for the moved pin group to be inserted at the desired position.
831 :param hal_py.ModulePinGroup pin_group: The pin group to be moved.
832 :param int new_index: The index to which the pin group is moved.
833 :returns: ``True`` on success, ``False`` otherwise.
838 "assign_pin_to_group",
840 if (
self.assign_pin_to_group(pin_group, pin, delete_empty_groups))
846 log_error(
"python_context",
"error encountered while assigning pin to pin group.");
850 py::arg(
"pin_group"),
852 py::arg(
"delete_empty_groups") =
true,
854 Assign a pin to a pin group.
856 :param hal_py.ModulePinGroup pin_group: The new pin group.
857 :param hal_py.ModulePin pin: The pin to be added.
858 :param bool delete_empty_groups: Set ``True`` to delete groups that are empty after the pin has been assigned to the new group, ``False`` to keep empty groups. Defaults to ``True``.
859 :returns: ``True`` on success, ``False`` otherwise.
864 "move_pin_within_group",
866 if (
self.move_pin_within_group(pin_group, pin, new_index))
872 log_error(
"python_context",
"error encountered while moving pin within pin group.");
876 py::arg(
"pin_group"),
878 py::arg(
"new_index"),
880 Move a pin to another index within the given pin group.
881 The indices of some other pins within the group will be incremented or decremented to make room for the moved pin to be inserted at the desired position.
883 :param hal_py.ModulePinGroup pin_group: The pin group.
884 :param hal_py.ModulePin pin: The pin to be moved.
885 :param int new_index: The index to which the pin is moved.
886 :returns: ``True`` on success, ``False`` otherwise.
891 "remove_pin_from_group",
893 if (
self.remove_pin_from_group(pin_group, pin, delete_empty_groups))
899 log_error(
"python_context",
"error encountered while removing pin from pin group.");
903 py::arg(
"pin_group"),
905 py::arg(
"delete_empty_groups") =
true,
907 Remove a pin from a pin group.
908 The pin will be moved to a new group that goes by the pin's name.
910 :param hal_py.ModulePinGroup pin_group: The old pin group.
911 :param hal_py.ModulePin pin: The pin to be removed.
912 :param bool delete_empty_groups: Set ``True`` to delete the group of it is empty after the pin has been removed, ``False`` to keep the empty group. Defaults to ``True``.
913 :returns: ``True`` on success, ``False`` otherwise.
bool is_input_net(Net *net) const
void set_name(const std::string &name)
const std::unordered_set< Net * > & get_nets() const
std::vector< std::string > get_pin_names(const std::function< bool(ModulePin *)> &filter=nullptr) const
PinGroup< ModulePin > * get_pin_group_by_name(const std::string &name) const
Module * get_parent_module() const
bool is_parent_module_of(const Module *module, bool recursive=false) const
std::vector< ModulePin * > get_output_pins() const
bool set_parent_module(Module *new_parent)
bool remove_gate(Gate *gate)
std::vector< ModulePin * > get_pins(const std::function< bool(ModulePin *)> &filter=nullptr) const
std::vector< ModulePin * > get_input_pins() const
bool assign_gates(const std::vector< Gate * > &gates)
bool contains_net(Net *net, bool recursive=false) const
Gate * get_gate_by_id(const u32 id, bool recursive=false) const
const std::unordered_set< Net * > & get_internal_nets() const
ModulePin * get_pin_by_name(const std::string &name) const
int get_submodule_depth() const
bool is_top_module() const
bool remove_gates(const std::vector< Gate * > &gates)
ModulePin * get_pin_by_id(const u32 id) const
bool set_pin_group_type(PinGroup< ModulePin > *pin_group, PinType new_type)
bool set_pin_type(ModulePin *pin, PinType new_type)
bool assign_gate(Gate *gate)
bool is_output_net(Net *net) const
const std::vector< Gate * > & get_gates() const
bool set_pin_name(ModulePin *pin, const std::string &new_name, bool force_name=false)
std::string get_name() const
Grouping * get_grouping() const
const std::unordered_set< Net * > & get_input_nets() const
std::vector< std::string > get_input_pin_names() const
bool set_pin_group_direction(PinGroup< ModulePin > *pin_group, PinDirection new_direction)
void set_type(const std::string &type)
bool contains_module(const Module *other, bool recursive=false) const
std::vector< Module * > get_parent_modules(const std::function< bool(Module *)> &filter=nullptr, bool recursive=true) const
Netlist * get_netlist() const
ModulePin * get_pin_by_net(Net *net) const
bool set_pin_group_name(PinGroup< ModulePin > *pin_group, const std::string &new_name, bool force_name=false)
std::vector< PinGroup< ModulePin > * > get_pin_groups(const std::function< bool(PinGroup< ModulePin > *)> &filter=nullptr) const
PinGroup< ModulePin > * get_pin_group_by_id(const u32 id) const
std::vector< Module * > get_submodules(const std::function< bool(Module *)> &filter=nullptr, bool recursive=false) const
std::vector< std::string > get_output_pin_names() const
bool contains_gate(Gate *gate, bool recursive=false) const
std::string get_type() const
bool is_internal_net(Net *net) const
bool is_submodule_of(const Module *module, bool recursive=false) const
const std::unordered_set< Net * > & get_output_nets() const
u32 get_unique_pin_group_id()
std::unique_ptr< T, py::nodelete > RawPtrWrapper
void module_init(py::module &m)
#define log_error(channel,...)
const Module * module(const Gate *g, const NodeBoxes &boxes)
std::vector< PinInformation > pins