8 A group of module pins made up of a name, the pins, a pin order, and a start index.
11 py_module_pin_group.def(py::self == py::self, R"(
12 Check whether two module pin groups are equal.
14 :returns: True if both module pin groups are equal, False otherwise.
18 py_module_pin_group.def(py::self != py::self, R"(
19 Check whether two module pin groups are unequal.
21 :returns: True if both module pin groups are unequal, False otherwise.
26 Python requires hash for set and dict container.
33 The ID of the module pin group. The ID is unique within a module.
39 Get the ID of the module pin group. The ID is unique within a module.
41 :returns: The ID of the pin.
46 The name of the pin group.
52 Get the name of the pin group.
54 :returns: The name of the pin group.
59 The direction of the pin group.
61 :type: hal_py.PinDirection
65 Get the direction of the pin group.
67 :returns: The direction of the pin.
68 :rtype: hal_py.PinDirection
72 The type of the pin group.
78 Get the type of the pin group.
80 :returns: The type of the pin.
81 :rtype: hal_py.PinType
84 py_module_pin_group.def_property_readonly("pins", [](
const PinGroup<ModulePin>&
self) -> std::vector<ModulePin*> {
return self.get_pins(
nullptr); }, R
"(
85 The (ordered) pins of the pin groups.
87 :type: list[hal_py.ModulePin]
91 Get the (ordered) pins of the pin groups.
92 The optional filter is evaluated on every pin such that the result only contains pins matching the specified condition.
94 :param lambda filter: Filter function to be evaluated on each pin.
95 :returns: The ordered pins.
96 :rtype: list[hal_py.ModulePin]
99 py_module_pin_group.def(
102 auto res =
self.get_pin_at_index(index);
109 log_error(
"python_context",
"{}", res.get_error().get());
115 Get the pin specified by the given index.
117 :param int index: The index of the pin within the pin group.
118 :returns: The pin on success, None otherwise.
119 :rtype: hal_py.ModulePin or None
122 py_module_pin_group.def(
125 auto res =
self.get_index(pin);
128 return (
i32)res.get();
132 log_error(
"python_context",
"{}", res.get_error().get());
138 Get the index within the pin group of the given pin.
140 :param hal_py.ModulePin pin: The pin
141 :returns: The index of the pin on success, -1 otherwise.
146 Check whether the pin group contaisn the given pin.
148 :param hal_py.ModulePin pin: The pin to check.
149 :returns: True if the pin group contains the pin, True otherwise.
154 True if the pin order of a pin group comprising n pins is ascending (from 0 to n-1), False if it is descending (from n-1 to 0).
160 Check whether the pin order of a pin group comprising n pins is ascending (from 0 to n-1) or descending (from n-1 to 0).
162 :returns: True for ascending bit order, False otherwise.
167 The start index of the pin group.
168 Commonly, pin groups start at index 0, but this may not always be the case.
169 Note that the start index for a pin group comprising n pins is 0 independent of whether it is ascending or descending.
175 Get the start index of the pin group.
176 Commonly, pin groups start at index 0, but this may not always be the case.
177 Note that the start index for a pin group comprising n pins is 0 independent of whether it is ascending or descending.
179 :returns: The start index.
184 ``True`` if the pin group is inherently ordered, ``False`` otherwise.
190 Check whether the pin group features an inherent order.
192 :returns: ``True`` if the pin group is inherently ordered, ``False`` otherwise.
197 Set whether the pin group features an inherent order.
199 :param bool ordered: Set ``True`` if the pin group is inherently ordered, ``False`` otherwise. Defaults to ``True``.
203 Check whether the pin group is empty, i.e., contains no pins.
205 :returns: True if the pin group is empty, False otherwise.
210 Get the size, i.e., the number of pins, of the pin group.
212 :returns: The size of the pin group.
std::unique_ptr< T, py::nodelete > RawPtrWrapper
void module_pin_group_init(py::module &m)
#define log_error(channel,...)
const Module * module(const Gate *g, const NodeBoxes &boxes)