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
121 py_module.def_property_readonly(
123 The parent modules of this module.
125 :type: list[hal_py.Module]
128 py_module.def("get_parent_modules", &
Module::get_parent_modules, py::arg(
"filter") =
nullptr, py::arg(
"recursive") =
true, R
"(
129 Get all parents of this module.
130 If ``recursive`` is set to ``True``, all indirect parents are also included.
131 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
133 :param lambda filter: An optional filter.
134 :param bool recursive: Set ``True`` to include indirect parents as well, ``False`` otherwise.
135 :returns: A list of parent modules.
136 :rtype: list[hal_py.Module]
140 Set a new parent for this module.
141 If the new parent is a submodule of this module, the new parent is added as a direct submodule to the old parent first.
143 :param hal_py.Module new_parent: The new parent module.
144 :returns: ``True`` if the parent was changed, ``False`` otherwise.
149 Check if the module is a parent of the specified module.
151 :param hal_py.Module module: The module.
152 :param bool recursive: Set ``True`` to check recursively, ``False`` otherwise.
153 :returns: ``True`` if the module is a parent of the specified module, ``False`` otherwise.
157 py_module.def_property_readonly(
159 A list of all direct submodules of this module.
161 :type: list[hal_py.Module]
164 py_module.def("get_submodules", &
Module::get_submodules, py::arg(
"filter") =
nullptr, py::arg(
"recursive") =
false, R
"(
165 Get all direct submodules of this module.
166 If ``recursive`` is set to ``True``, all indirect submodules are also included.
167 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
169 :param lambda filter: An optional filter.
170 :param bool recursive: Set ``True`` to include indirect submodules as well, ``False`` otherwise.
171 :returns: A list of submodules.
172 :rtype: list[hal_py.Module]
175 py_module.def("is_submodule_of", &
Module::is_submodule_of, py::arg(
"module"), py::arg(
"recursive") =
false, R
"(
176 Check if the module is a submodule of the specified module.
178 :param hal_py.Module module: The module.
179 :param bool recursive: Set ``True`` to check recursively, ``False`` otherwise.
180 :returns: ``True`` if the module is a submodule of the specified module, ``False`` otherwise.
184 Checks whether another module is a submodule of this module.
185 If recursive is set to ``True``, all indirect submodules are also included.
187 :param hal_py.Module other: Other module to check for.
188 :param bool recursive: Set ``True`` to include indirect submodules as well, ``False`` otherwise.
189 :returns: ``True`` if the other module is a submodule, ``False`` otherwise.
194 True only if the module is the top module of the netlist.
200 Returns true only if the module is the top module of the netlist.
202 :returns: ``True`` if the module is the top module, ``False`` otherwise.
206 py_module.def_property_readonly(
208 The netlist this module is associated with.
210 :type: hal_py.Netlist
215 Get the netlist this module is associated with.
217 :returns: The netlist.
218 :rtype: hal_py.Netlist
222 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.
223 Has no effect on module pins.
225 WARNING: can only be used when automatic net checks have been disabled using hal_py.Netlist.enable_automatic_net_checks.
227 :returns: ``True`` on success, ``False`` otherwise.
231 py_module.def("contains_net", &
Module::contains_net, py::arg(
"net"), py::arg(
"recursive") =
false, R
"(
232 Check whether a net is contained in the module.
233 If ``recursive`` is set to ``True``, nets in submodules are considered as well.
235 :param hal_py.Net net: The net to check for.
236 :param bool recursive: ``True`` to also consider nets in submodules, ``False`` otherwise.
237 :returns: ``True`` if the net is contained in the module, ``False`` otherwise.
241 py_module.def_property_readonly("nets", py::overload_cast<>(&
Module::get_nets, py::const_), R
"(
242 An unordered set of all nets that have at least one source or one destination within the module.
244 :type: set[hal_py.Net]
247 py_module.def("get_nets", py::overload_cast<>(&
Module::get_nets, py::const_), R
"(
248 Get all nets that have at least one source or one destination within the module.
250 :returns: An unordered set of nets.
251 :rtype: set[hal_py.Net]
254 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
"(
255 Get all nets that have at least one source or one destination within the module.
256 The filter is evaluated on every candidate such that the result only contains those matching the specified condition.
257 If ``recursive`` is ``True``, nets in submodules are considered as well.
259 :param lambda filter: Filter function to be evaluated on each net.
260 :param bool recursive: ``True`` to also consider nets in submodules, ``False`` otherwise.
261 :returns: An unordered set of nets.
262 :rtype: set[hal_py.Net]
266 A set of all nets that are either a global input to the netlist or have at least one source outside of the module.
268 :type: set[hal_py.Net]
272 Get all nets that are either a global input to the netlist or have at least one source outside of the module.
274 :returns: A set of input nets.
275 :rtype: set[hal_py.Net]
279 A set of all nets that are either a global output to the netlist or have at least one destination outside of the module.
281 :type: set[hal_py.Net]
285 Get all nets that are either a global output to the netlist or have at least one destination outside of the module.
287 :returns: A set of output nets.
288 :rtype: set[hal_py.Net]
292 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.
294 :type: set[hal_py.Net]
298 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.
300 :returns: A set of internal nets.
301 :rtype: set[hal_py.Net]
305 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.
307 :param hal_py.Net net: The net.
308 :returns: ``True`` if the net is an input net, ``False`` otherwise.
313 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.
315 :param hal_py.Net net: The net.
316 :returns: ``True`` if the net is an output net, ``False`` otherwise.
321 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.
323 :param hal_py.Net net: The net.
324 :returns: ``True`` if the net is an internal net, ``False`` otherwise.
329 Assign a gate to the module.
330 The gate is removed from its previous module in the process.
332 :param hal_py.Gate gate: The gate to assign.
333 :returns: ``True`` on success, ``False`` otherwise.
338 Assign a list of gates to the module.
339 The gates are removed from their previous module in the process.
341 :param list[hal_py.Gate] gates: The gates to assign.
342 :returns: ``True`` on success, ``False`` otherwise.
347 Remove a gate from the module.
348 Automatically moves the gate to the top module of the netlist.
350 :param hal_py.Gate gate: The gate to remove.
351 :returns: ``True`` on success, ``False`` otherwise.
356 Remove a list of gates from the module.
357 Automatically moves the gates to the top module of the netlist.
359 :param list[hal_py.Gate] gates: The gates to remove.
360 :returns: ``True`` on success, ``False`` otherwise.
364 py_module.def("contains_gate", &
Module::contains_gate, py::arg(
"gate"), py::arg(
"recursive") =
false, R
"(
365 Check whether a gate is contained in the module.
366 If ``recursive`` is ``True``, gates in submodules are considered as well.
368 :param hal_py.Gate gate: The gate to check for.
369 :param bool recursive: ``True`` to also consider gates in submodules, ``False`` otherwise.
370 :returns: ``True`` if the gate is contained in the module, ``False`` otherwise.
375 Get a gate specified by the given ID.
376 If ``recursive`` is ``True``, gates in submodules are considered as well.
378 :param int id: The unique ID of the gate.
379 :param bool recursive: ``True`` to also consider gates in submodules, ``False`` otherwise.
380 :returns: The gate if found, None otherwise.
381 :rtype: hal_py.Gate or None
384 py_module.def_property_readonly("gates", py::overload_cast<>(&
Module::get_gates, py::const_), R
"(
385 The list of all gates contained within the module.
387 :type: list[hal_py.Gate]
390 py_module.def("get_gates", py::overload_cast<>(&
Module::get_gates, py::const_), R
"(
391 Get all gates contained within the module.
393 :returns: A list of gates.
394 :rtype: list[hal_py.Gate]
397 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
"(
398 Get all gates contained within the module.
399 The filter is evaluated on every candidate such that the result only contains those matching the specified condition.
400 If ``recursive`` is ``True``, gates in submodules are considered as well.
402 :param lambda filter: Filter function to be evaluated on each gate.
403 :param bool recursive: ``True`` to also consider gates in submodules, ``False`` otherwise. Defaults to ``False``.
404 :returns: A list of gates.
405 :rtype: list[hal_py.Gate]
410 The value of 0 is reserved and represents an invalid ID.
412 :returns: The pin ID.
417 Get a spare pin group ID.
418 The value of 0 is reserved and represents an invalid ID.
420 :returns: The pin group ID.
427 auto res =
self.create_pin(
id,
name,
net,
type, create_group, force_name);
434 log_error(
"python_context",
"error encountered while creating pin:\n{}", res.get_error().get());
442 py::arg(
"create_group") =
true,
443 py::arg(
"force_name") =
false,
445 Manually assign a module pin to a net.
446 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.
447 Hence, make sure to update the module nets beforehand using ``hal_py.Module.update_net``.
448 If ``create_group`` is set to ``False``, the pin will not be added to a pin group.
450 WARNING: can only be used when automatic net checks have been disabled using ``hal_py.Netlist.enable_automatic_net_checks``.
452 :param int id: The ID of the pin.
453 :param str name: The name of the pin.
454 :param hal_py.Net net: The net that the pin is being assigned to.
455 :param hal_py.PinType type: The type of the pin. Defaults to ``hal_py.PinType.none``.
456 :param bool create_group: Set ``True`` to automatically create a pin group and assign the pin, ``False`` otherwise. Defaults to ``True``.
457 :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``.
458 :returns: The module pin on success, ``None`` otherwise.
459 :rtype: hal_py.ModulePin or None
465 auto res =
self.create_pin(
name,
net,
type, create_group, force_name);
472 log_error(
"python_context",
"error encountered while creating pin:\n{}", res.get_error().get());
479 py::arg(
"create_group") =
true,
480 py::arg(
"force_name") =
false,
482 Manually assign a module pin to a net.
483 The ID of the pin is set automatically.
484 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.
485 Hence, make sure to update the module nets beforehand using ``hal_py.Module.update_net``.
486 If ``create_group`` is set to ``False``, the pin will not be added to a pin group.
488 WARNING: can only be used when automatic net checks have been disabled using ``hal_py.Netlist.enable_automatic_net_checks``.
490 :param str name: The name of the pin.
491 :param hal_py.Net net: The net that the pin is being assigned to.
492 :param hal_py.PinType type: The type of the pin. Defaults to ``hal_py.PinType.none``.
493 :param bool create_group: Set ``True`` to automatically create a pin group and assign the pin, ``False`` otherwise. Defaults to ``True``.
494 :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``.
495 :returns: The module pin on success, ``None`` otherwise.
496 :rtype: hal_py.ModulePin or None
500 The (ordered) pins of the module.
502 :type: list[hal_py.ModulePin]
505 py_module.def("get_pins", &
Module::get_pins, py::arg(
"filter") =
nullptr, R
"(
506 Get the (ordered) pins of the module.
507 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
509 :param lambda filter: An optional filter.
510 :returns: A list of pins.
511 :rtype: list[hal_py.ModulePin]
514 py_module.def_property_readonly(
516 [](
const Module&
self) -> std::vector<std::string> {
return self.get_pin_names(); },
518 An ordered list of the names of all pins of the module.
524 Get an ordered list of the names of all pins of the module.
525 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
527 :returns: A list of input pin names of the module.
528 :param lambda filter: An optional filter.
529 :returns: An ordered list of pins.
534 An ordered list of all input pins of the module (including inout pins).
536 :type: list[hal_py.ModulePin]
540 Get an ordered list of all input pins of the module (including inout pins).
542 :returns: An ordered list of input pins.
543 :rtype: list[hal_py.ModulePin]
547 An ordered list of the names of all input pins of the module (including inout pins).
553 Get an ordered list of the names of all input pins of the module (including inout pins).
555 :returns: An ordered list of input pin names.
560 An ordered list of all output pins of the module (including inout pins).
562 :type: list[hal_py.ModulePin]
566 Get an ordered list of all output pins of the module (including inout pins).
568 :returns: An ordered list of output pins.
569 :rtype: list[hal_py.ModulePin]
573 An ordered list of the names of all output pins of the module (including inout pins).
579 Get an ordered list of the names of all output pins of the module (including inout pins).
581 :returns: An ordered list of output pin names.
586 All pin_groups of the module.
588 :type: list[hal_py.ModulePinGroup]
592 Get all pin groups of the module.
593 The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
595 :param lambda filter: An optional filter.
596 :returns: A list of pin groups.
597 :rtype: list[hal_py.ModulePinGroup]
601 Get the pin corresponding to the given ID.
603 :param int id: The ID of the pin.
604 :returns: The pin on success, ``None`` otherwise.
605 :rtype: hal_py.ModulePin or None
609 Get the pin corresponding to the given name.
611 :param str name: The name of the pin.
612 :returns: The pin on success, ``None`` otherwise.
613 :rtype: hal_py.ModulePin or None
617 Get the pin that passes through the specified net.
619 :param hal_py.Net net: The net.
620 :returns: The pin on success, ``None`` otherwise.
621 :rtype: hal_py.ModulePin or None
625 Get the pin group corresponding to the given ID.
627 :param int id: The ID of the pin group.
628 :returns: The pin group on success, ``None`` otherwise.
629 :rtype: hal_py.ModulePinGroup or None
633 Get the pin group corresponding to the given name.
635 :param str name: The name of the pin group.
636 :returns: The pin group on success, ``None`` otherwise.
637 :rtype: hal_py.ModulePinGroup or None
640 py_module.def("set_pin_name", &
Module::set_pin_name, py::arg(
"pin"), py::arg(
"new_name"), py::arg(
"force_name") =
false, R
"(
641 Set the name of the given pin.
643 :param hal_py.ModulePin pin: The pin.
644 :param str new_name: The name to be assigned to the pin.
645 :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``.
646 :returns: ``True`` on success, ``False`` otherwise.
650 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
"(
651 Set the name of the given pin group.
653 :param hal_py.ModulePinGroup pin_group: The pin group.
654 :param str new_name: The name to be assigned to the pin group.
655 :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``.
656 :returns: ``True`` on success, ``False`` otherwise.
661 Set the type of the given pin.
663 :param hal_py.ModulePin pin: The pin.
664 :param hal_py.PinType new_type: The type to be assigned to the pin.
665 :returns: ``True`` on success, ``False`` otherwise.
670 Set the type of the given pin group.
672 :param hal_py.ModulePinGroup pin_group: The pin group.
673 :param hal_py.PinType new_type: The type to be assigned to the pin group.
674 :returns: ``True`` on success, ``False`` otherwise.
679 Set the direction of the given pin group.
681 :param hal_py.ModulePinGroup pin_group: The pin group.
682 :param hal_py.PinDirection new_direction: The direction to be assigned to the pin group.
683 :returns: ``True`` on success, ``False`` otherwise.
691 const std::string&
name,
692 const std::vector<ModulePin*>
pins = {},
697 bool delete_empty_groups =
true,
706 log_error(
"python_context",
"error encountered while creating pin group:\n{}", res.get_error().get());
715 py::arg(
"ascending") =
true,
716 py::arg(
"start_index") = 0,
717 py::arg(
"delete_empty_groups") =
true,
718 py::arg(
"force_name") =
false,
720 Create a new pin group with the given name.
721 All pins to be added to the pin group must have the same direction and type.
723 :param int id: The ID of the pin group.
724 :param str name: The name of the pin group.
725 :param list[hal_py.ModulePin] pins: The pins to be assigned to the pin group. Defaults to an empty list.
726 :param hal_py.PinDirection direction: The direction of the pin group, if any. Defaults to ``hal_py.PinDirection.none``.
727 :param hal_py.PinType type: The type of the pin group, if any. Defaults to ``hal_py.PinType.none``.
728 :param bool ascending: Set ``True`` for ascending pin order (from 0 to n-1), ``False`` otherwise (from n-1 to 0). Defaults to ``True``.
729 :param int start_index: The start index of the pin group. Defaults to ``0``.
730 :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``.
731 :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``.
732 :returns: The pin group on success, ``None`` otherwise.
733 :rtype: hal_py.ModulePinGroup or None
739 const std::string&
name,
740 const std::vector<ModulePin*>
pins = {},
745 bool delete_empty_groups =
true,
754 log_error(
"python_context",
"error encountered while creating pin group:\n{}", res.get_error().get());
762 py::arg(
"ascending") =
true,
763 py::arg(
"start_index") = 0,
764 py::arg(
"delete_empty_groups") =
true,
765 py::arg(
"force_name") =
false,
767 Create a new pin group with the given name.
768 All pins to be added to the pin group must have the same direction and type.
770 :param str name: The name of the pin group.
771 :param list[hal_py.ModulePin] pins: The pins to be assigned to the pin group. Defaults to an empty list.
772 :param hal_py.PinDirection direction: The direction of the pin group, if any. Defaults to ``hal_py.PinDirection.none``.
773 :param hal_py.PinType type: The type of the pin group, if any. Defaults to ``hal_py.PinType.none``.
774 :param bool ascending: Set ``True`` for ascending pin order (from 0 to n-1), ``False`` otherwise (from n-1 to 0). Defaults to ``True``.
775 :param int start_index: The start index of the pin group. Defaults to ``0``.
776 :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``.
777 :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``.
778 :returns: The pin group on success, ``None`` otherwise.
779 :rtype: hal_py.ModulePinGroup or None
785 if (
self.delete_pin_group(pin_group))
791 log_error(
"python_context",
"error encountered while deleting pin group.");
795 py::arg(
"pin_group"),
797 Delete the given pin group.
799 :param hal_py.ModulePinGroup pin_group: The pin group to be deleted.
800 :returns: ``True`` on success, ``False`` otherwise.
807 if (
self.move_pin_group(pin_group, new_index))
813 log_error(
"python_context",
"error encountered while moving pin group.");
817 py::arg(
"pin_group"),
818 py::arg(
"new_index"),
820 Move a pin group to another index within the module.
821 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.
823 :param hal_py.ModulePinGroup pin_group: The pin group to be moved.
824 :param int new_index: The index to which the pin group is moved.
825 :returns: ``True`` on success, ``False`` otherwise.
830 "assign_pin_to_group",
832 if (
self.assign_pin_to_group(pin_group, pin, delete_empty_groups))
838 log_error(
"python_context",
"error encountered while assigning pin to pin group.");
842 py::arg(
"pin_group"),
844 py::arg(
"delete_empty_groups") =
true,
846 Assign a pin to a pin group.
848 :param hal_py.ModulePinGroup pin_group: The new pin group.
849 :param hal_py.ModulePin pin: The pin to be added.
850 :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``.
851 :returns: ``True`` on success, ``False`` otherwise.
856 "move_pin_within_group",
858 if (
self.move_pin_within_group(pin_group, pin, new_index))
864 log_error(
"python_context",
"error encountered while moving pin within pin group.");
868 py::arg(
"pin_group"),
870 py::arg(
"new_index"),
872 Move a pin to another index within the given pin group.
873 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.
875 :param hal_py.ModulePinGroup pin_group: The pin group.
876 :param hal_py.ModulePin pin: The pin to be moved.
877 :param int new_index: The index to which the pin is moved.
878 :returns: ``True`` on success, ``False`` otherwise.
883 "remove_pin_from_group",
885 if (
self.remove_pin_from_group(pin_group, pin, delete_empty_groups))
891 log_error(
"python_context",
"error encountered while removing pin from pin group.");
895 py::arg(
"pin_group"),
897 py::arg(
"delete_empty_groups") =
true,
899 Remove a pin from a pin group.
900 The pin will be moved to a new group that goes by the pin's name.
902 :param hal_py.ModulePinGroup pin_group: The old pin group.
903 :param hal_py.ModulePin pin: The pin to be removed.
904 :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``.
905 :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