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.
182 Checks whether another module is a submodule of this module.
183 If recursive is set to ``True``, all indirect submodules are also included.
185 :param hal_py.Module other: Other module to check for.
186 :param bool recursive: Set ``True`` to include indirect submodules as well, ``False`` otherwise.
187 :returns: ``True`` if the other module is a submodule, ``False`` otherwise.
192 True only if the module is the top module of the netlist.
198 Returns true only if the module is the top module of the netlist.
200 :returns: ``True`` if the module is the top module, ``False`` otherwise.
205 The netlist this module is associated with.
207 :type: hal_py.Netlist
211 Get the netlist this module is associated with.
213 :returns: The netlist.
214 :rtype: hal_py.Netlist
218 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.
219 Has no effect on module pins.
221 WARNING: can only be used when automatic net checks have been disabled using hal_py.Netlist.enable_automatic_net_checks.
223 :returns: ``True`` on success, ``False`` otherwise.
227 py_module.def("contains_net", &
Module::contains_net, py::arg(
"net"), py::arg(
"recursive") =
false, R
"(
228 Check whether a net is contained in the module.
229 If ``recursive`` is set to ``True``, nets in submodules are considered as well.
231 :param hal_py.Net net: The net to check for.
232 :param bool recursive: ``True`` to also consider nets in submodules, ``False`` otherwise.
233 :returns: ``True`` if the net is contained in the module, ``False`` otherwise.
237 py_module.def_property_readonly("nets", py::overload_cast<>(&
Module::get_nets, py::const_), R
"(
238 An unordered set of all nets that have at least one source or one destination within the module.
240 :type: set[hal_py.Net]
243 py_module.def("get_nets", py::overload_cast<>(&
Module::get_nets, py::const_), R
"(
244 Get all nets that have at least one source or one destination within the module.
246 :returns: An unordered set of nets.
247 :rtype: set[hal_py.Net]
250 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
"(
251 Get all nets that have at least one source or one destination within the module.
252 The filter is evaluated on every candidate such that the result only contains those matching the specified condition.
253 If ``recursive`` is ``True``, nets in submodules are considered as well.
255 :param lambda filter: Filter function to be evaluated on each net.
256 :param bool recursive: ``True`` to also consider nets in submodules, ``False`` otherwise.
257 :returns: An unordered set of nets.
258 :rtype: set[hal_py.Net]
262 A set of all nets that are either a global input to the netlist or have at least one source outside of the module.
264 :type: set[hal_py.Net]
268 Get all nets that are either a global input to the netlist or have at least one source outside of the module.
270 :returns: A set of input nets.
271 :rtype: set[hal_py.Net]
275 A set of all nets that are either a global output to the netlist or have at least one destination outside of the module.
277 :type: set[hal_py.Net]
281 Get all nets that are either a global output to the netlist or have at least one destination outside of the module.
283 :returns: A set of output nets.
284 :rtype: set[hal_py.Net]
288 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.
290 :type: set[hal_py.Net]
294 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.
296 :returns: A set of internal nets.
297 :rtype: set[hal_py.Net]
301 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.
303 :param hal_py.Net net: The net.
304 :returns: ``True`` if the net is an input net, ``False`` otherwise.
309 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.
311 :param hal_py.Net net: The net.
312 :returns: ``True`` if the net is an output net, ``False`` otherwise.
317 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.
319 :param hal_py.Net net: The net.
320 :returns: ``True`` if the net is an internal net, ``False`` otherwise.
325 Assign a gate to the module.
326 The gate is removed from its previous module in the process.
328 :param hal_py.Gate gate: The gate to assign.
329 :returns: ``True`` on success, ``False`` otherwise.
334 Assign a list of gates to the module.
335 The gates are removed from their previous module in the process.
337 :param list[hal_py.Gate] gates: The gates to assign.
338 :returns: ``True`` on success, ``False`` otherwise.
343 Remove a gate from the module.
344 Automatically moves the gate to the top module of the netlist.
346 :param hal_py.Gate gate: The gate to remove.
347 :returns: ``True`` on success, ``False`` otherwise.
352 Remove a list of gates from the module.
353 Automatically moves the gates to the top module of the netlist.
355 :param list[hal_py.Gate] gates: The gates to remove.
356 :returns: ``True`` on success, ``False`` otherwise.
360 py_module.def("contains_gate", &
Module::contains_gate, py::arg(
"gate"), py::arg(
"recursive") =
false, R
"(
361 Check whether a gate is contained in the module.
362 If ``recursive`` is ``True``, gates in submodules are considered as well.
364 :param hal_py.Gate gate: The gate to check for.
365 :param bool recursive: ``True`` to also consider gates in submodules, ``False`` otherwise.
366 :returns: ``True`` if the gate is contained in the module, ``False`` otherwise.
371 Get a gate specified by the given ID.
372 If ``recursive`` is ``True``, gates in submodules are considered as well.
374 :param int id: The unique ID of the gate.
375 :param bool recursive: ``True`` to also consider gates in submodules, ``False`` otherwise.
376 :returns: The gate if found, None otherwise.
377 :rtype: hal_py.Gate or None
380 py_module.def_property_readonly("gates", py::overload_cast<>(&
Module::get_gates, py::const_), R
"(
381 The list of all gates contained within the module.
383 :type: list[hal_py.Gate]
386 py_module.def("get_gates", py::overload_cast<>(&
Module::get_gates, py::const_), R
"(
387 Get all gates contained within the module.
389 :returns: A list of gates.
390 :rtype: list[hal_py.Gate]
393 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
"(
394 Get all gates contained within the module.
395 The filter is evaluated on every candidate such that the result only contains those matching the specified condition.
396 If ``recursive`` is ``True``, gates in submodules are considered as well.
398 :param lambda filter: Filter function to be evaluated on each gate.
399 :param bool recursive: ``True`` to also consider gates in submodules, ``False`` otherwise. Defaults to ``False``.
400 :returns: A list of gates.
401 :rtype: list[hal_py.Gate]
406 The value of 0 is reserved and represents an invalid ID.
408 :returns: The pin ID.
413 Get a spare pin group ID.
414 The value of 0 is reserved and represents an invalid ID.
416 :returns: The pin group ID.
423 auto res =
self.create_pin(
id,
name,
net,
type, create_group, force_name);
430 log_error(
"python_context",
"error encountered while creating pin:\n{}", res.get_error().get());
438 py::arg(
"create_group") =
true,
439 py::arg(
"force_name") =
false,
441 Manually assign a module pin to a net.
442 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.
443 Hence, make sure to update the module nets beforehand using ``hal_py.Module.update_net``.
444 If ``create_group`` is set to ``False``, the pin will not be added to a pin group.
446 WARNING: can only be used when automatic net checks have been disabled using ``hal_py.Netlist.enable_automatic_net_checks``.
448 :param int id: The ID of the pin.
449 :param str name: The name of the pin.
450 :param hal_py.Net net: The net that the pin is being assigned to.
451 :param hal_py.PinType type: The type of the pin. Defaults to ``hal_py.PinType.none``.
452 :param bool create_group: Set ``True`` to automatically create a pin group and assign the pin, ``False`` otherwise. Defaults to ``True``.
453 :param bool force_name: Set ``True`` to enforce the name, ``False`` otherwise. If a pin with the same name already exists, the existing pin will be renamed. Defaults to ``False``.
454 :returns: The module pin on success, ``None`` otherwise.
455 :rtype: hal_py.ModulePin or None
461 auto res =
self.create_pin(
name,
net,
type, create_group, force_name);
468 log_error(
"python_context",
"error encountered while creating pin:\n{}", res.get_error().get());
475 py::arg(
"create_group") =
true,
476 py::arg(
"force_name") =
false,
478 Manually assign a module pin to a net.
479 The ID of the pin is set automatically.
480 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.
481 Hence, make sure to update the module nets beforehand using ``hal_py.Module.update_net``.
482 If ``create_group`` is set to ``False``, the pin will not be added to a pin group.
484 WARNING: can only be used when automatic net checks have been disabled using ``hal_py.Netlist.enable_automatic_net_checks``.
486 :param str name: The name of the pin.
487 :param hal_py.Net net: The net that the pin is being assigned to.
488 :param hal_py.PinType type: The type of the pin. Defaults to ``hal_py.PinType.none``.
489 :param bool create_group: Set ``True`` to automatically create a pin group and assign the pin, ``False`` otherwise. Defaults to ``True``.
490 :param bool force_name: Set ``True`` to enforce the name, ``False`` otherwise. If a pin with the same name already exists, the existing pin will be renamed. Defaults to ``False``.
491 :returns: The module pin on success, ``None`` otherwise.
492 :rtype: hal_py.ModulePin or None
496 The (ordered) pins of the module.
498 :type: list[hal_py.ModulePin]
501 py_module.def("get_pins", &
Module::get_pins, py::arg(
"filter") =
nullptr, R
"(
502 Get the (ordered) pins of the module.
503 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
505 :param lambda filter: An optional filter.
506 :returns: A list of pins.
507 :rtype: list[hal_py.ModulePin]
510 py_module.def_property_readonly(
512 [](
const Module&
self) -> std::vector<std::string> {
return self.get_pin_names(); },
514 An ordered list of the names of all pins of the module.
520 Get an ordered list of the names of all pins of the module.
521 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
523 :returns: A list of input pin names of the module.
524 :param lambda filter: An optional filter.
525 :returns: An ordered list of pins.
530 An ordered list of all input pins of the module (including inout pins).
532 :type: list[hal_py.ModulePin]
536 Get an ordered list of all input pins of the module (including inout pins).
538 :returns: An ordered list of input pins.
539 :rtype: list[hal_py.ModulePin]
543 An ordered list of the names of all input pins of the module (including inout pins).
549 Get an ordered list of the names of all input pins of the module (including inout pins).
551 :returns: An ordered list of input pin names.
556 An ordered list of all output pins of the module (including inout pins).
558 :type: list[hal_py.ModulePin]
562 Get an ordered list of all output pins of the module (including inout pins).
564 :returns: An ordered list of output pins.
565 :rtype: list[hal_py.ModulePin]
569 An ordered list of the names of all output pins of the module (including inout pins).
575 Get an ordered list of the names of all output pins of the module (including inout pins).
577 :returns: An ordered list of output pin names.
582 All pin_groups of the module.
584 :type: list[hal_py.ModulePinGroup]
588 Get all pin groups of the module.
589 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
591 :param lambda filter: An optional filter.
592 :returns: A list of pin groups.
593 :rtype: list[hal_py.ModulePinGroup]
597 Get the pin corresponding to the given ID.
599 :param int id: The ID of the pin.
600 :returns: The pin on success, ``None`` otherwise.
601 :rtype: hal_py.ModulePin or None
605 Get the pin corresponding to the given name.
607 :param str name: The name of the pin.
608 :returns: The pin on success, ``None`` otherwise.
609 :rtype: hal_py.ModulePin or None
613 Get the pin that passes through the specified net.
615 :param hal_py.Net net: The net.
616 :returns: The pin on success, ``None`` otherwise.
617 :rtype: hal_py.ModulePin or None
621 Get the pin group corresponding to the given ID.
623 :param int id: The ID of the pin group.
624 :returns: The pin group on success, ``None`` otherwise.
625 :rtype: hal_py.ModulePinGroup or None
629 Get the pin group corresponding to the given name.
631 :param str name: The name of the pin group.
632 :returns: The pin group on success, ``None`` otherwise.
633 :rtype: hal_py.ModulePinGroup or None
636 py_module.def("set_pin_name", &
Module::set_pin_name, py::arg(
"pin"), py::arg(
"new_name"), py::arg(
"force_name") =
false, R
"(
637 Set the name of the given pin.
639 :param hal_py.ModulePin pin: The pin.
640 :param str new_name: The name to be assigned to the pin.
641 :param bool force_name: Set ``True`` to enforce the name, ``False`` otherwise. If a pin with the same name already exists, the existing pin will be renamed. Defaults to ``False``.
642 :returns: ``True`` on success, ``False`` otherwise.
646 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
"(
647 Set the name of the given pin group.
649 :param hal_py.ModulePinGroup pin_group: The pin group.
650 :param str new_name: The name to be assigned to the pin group.
651 :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``.
652 :returns: ``True`` on success, ``False`` otherwise.
657 Set the type of the given pin.
659 :param hal_py.ModulePin pin: The pin.
660 :param hal_py.PinType new_type: The type to be assigned to the pin.
661 :returns: ``True`` on success, ``False`` otherwise.
666 Set the type of the given pin group.
668 :param hal_py.ModulePinGroup pin_group: The pin group.
669 :param hal_py.PinType new_type: The type to be assigned to the pin group.
670 :returns: ``True`` on success, ``False`` otherwise.
675 Set the direction of the given pin group.
677 :param hal_py.ModulePinGroup pin_group: The pin group.
678 :param hal_py.PinDirection new_direction: The direction to be assigned to the pin group.
679 :returns: ``True`` on success, ``False`` otherwise.
687 const std::string&
name,
688 const std::vector<ModulePin*>
pins = {},
693 bool delete_empty_groups =
true,
702 log_error(
"python_context",
"error encountered while creating pin group:\n{}", res.get_error().get());
708 py::arg(
"pins") = std::vector<ModulePin*>(),
711 py::arg(
"ascending") =
true,
712 py::arg(
"start_index") = 0,
713 py::arg(
"delete_empty_groups") =
true,
714 py::arg(
"force_name") =
false,
716 Create a new pin group with the given name.
717 All pins to be added to the pin group must have the same direction and type.
719 :param int id: The ID of the pin group.
720 :param str name: The name of the pin group.
721 :param list[hal_py.ModulePin] pins: The pins to be assigned to the pin group. Defaults to an empty list.
722 :param hal_py.PinDirection direction: The direction of the pin group, if any. Defaults to ``hal_py.PinDirection.none``.
723 :param hal_py.PinType type: The type of the pin group, if any. Defaults to ``hal_py.PinType.none``.
724 :param bool ascending: Set ``True`` for ascending pin order (from 0 to n-1), ``False`` otherwise (from n-1 to 0). Defaults to ``True``.
725 :param int start_index: The start index of the pin group. Defaults to ``0``.
726 :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``.
727 :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``.
728 :returns: The pin group on success, ``None`` otherwise.
729 :rtype: hal_py.ModulePinGroup or None
735 const std::string&
name,
736 const std::vector<ModulePin*>
pins = {},
741 bool delete_empty_groups =
true,
750 log_error(
"python_context",
"error encountered while creating pin group:\n{}", res.get_error().get());
755 py::arg(
"pins") = std::vector<ModulePin*>(),
758 py::arg(
"ascending") =
true,
759 py::arg(
"start_index") = 0,
760 py::arg(
"delete_empty_groups") =
true,
761 py::arg(
"force_name") =
false,
763 Create a new pin group with the given name.
764 All pins to be added to the pin group must have the same direction and type.
766 :param str name: The name of the pin group.
767 :param list[hal_py.ModulePin] pins: The pins to be assigned to the pin group. Defaults to an empty list.
768 :param hal_py.PinDirection direction: The direction of the pin group, if any. Defaults to ``hal_py.PinDirection.none``.
769 :param hal_py.PinType type: The type of the pin group, if any. Defaults to ``hal_py.PinType.none``.
770 :param bool ascending: Set ``True`` for ascending pin order (from 0 to n-1), ``False`` otherwise (from n-1 to 0). Defaults to ``True``.
771 :param int start_index: The start index of the pin group. Defaults to ``0``.
772 :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``.
773 :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``.
774 :returns: The pin group on success, ``None`` otherwise.
775 :rtype: hal_py.ModulePinGroup or None
781 if (
self.delete_pin_group(pin_group))
787 log_error(
"python_context",
"error encountered while deleting pin group.");
791 py::arg(
"pin_group"),
793 Delete the given pin group.
795 :param hal_py.ModulePinGroup pin_group: The pin group to be deleted.
796 :returns: ``True`` on success, ``False`` otherwise.
803 if (
self.move_pin_group(pin_group, new_index))
809 log_error(
"python_context",
"error encountered while moving pin group.");
813 py::arg(
"pin_group"),
814 py::arg(
"new_index"),
816 Move a pin group to another index within the module.
817 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.
819 :param hal_py.ModulePinGroup pin_group: The pin group to be moved.
820 :param int new_index: The index to which the pin group is moved.
821 :returns: ``True`` on success, ``False`` otherwise.
826 "assign_pin_to_group",
828 if (
self.assign_pin_to_group(pin_group, pin, delete_empty_groups))
834 log_error(
"python_context",
"error encountered while assigning pin to pin group.");
838 py::arg(
"pin_group"),
840 py::arg(
"delete_empty_groups") =
true,
842 Assign a pin to a pin group.
844 :param hal_py.ModulePinGroup pin_group: The new pin group.
845 :param hal_py.ModulePin pin: The pin to be added.
846 :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``.
847 :returns: ``True`` on success, ``False`` otherwise.
852 "move_pin_within_group",
854 if (
self.move_pin_within_group(pin_group, pin, new_index))
860 log_error(
"python_context",
"error encountered while moving pin within pin group.");
864 py::arg(
"pin_group"),
866 py::arg(
"new_index"),
868 Move a pin to another index within the given pin group.
869 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.
871 :param hal_py.ModulePinGroup pin_group: The pin group.
872 :param hal_py.ModulePin pin: The pin to be moved.
873 :param int new_index: The index to which the pin is moved.
874 :returns: ``True`` on success, ``False`` otherwise.
879 "remove_pin_from_group",
881 if (
self.remove_pin_from_group(pin_group, pin, delete_empty_groups))
887 log_error(
"python_context",
"error encountered while removing pin from pin group.");
891 py::arg(
"pin_group"),
893 py::arg(
"delete_empty_groups") =
true,
895 Remove a pin from a pin group.
896 The pin will be moved to a new group that goes by the pin's name.
898 :param hal_py.ModulePinGroup pin_group: The old pin group.
899 :param hal_py.ModulePin pin: The pin to be removed.
900 :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``.
901 :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