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, e.g., from index ``0`` to ``n-1``, ``False`` otherwise.
160 Check whether the pin order of a pin group comprising n pins is ascending, e.g., from index ``0`` to ``n-1``.
162 :returns: ``True`` for ascending bit order, ``False`` otherwise.
167 ``True`` if the pin order of a pin group comprising n pins is descending, e.g., from index ``n-1`` to ``0``, ``False`` otherwise.
173 Check whether the pin order of a pin group comprising n pins is descending, e.g., from index ``n-1`` to ``0``.
175 :returns: ``True`` for descending bit order, ``False`` otherwise.
180 The numerically lowest index of the pin group.
186 Get the numerically lowest index of the pin group.
188 :returns: The lowest index.
193 The numerically highest index of the pin group.
199 Get the numerically highest index of the pin group.
201 :returns: The highest index.
206 The start index of the pin group.
207 For ascending pin groups, this index equals the lowest index of the pin group.
208 For descending pin groups, it is equal to the highest index of the pin group.
214 Get the start index of the pin group.
215 For ascending pin groups, this index equals the lowest index of the pin group.
216 For descending pin groups, it is equal to the highest index of the pin group.
218 :returns: The start index.
223 ``True`` if the pin group is inherently ordered, ``False`` otherwise.
229 Check whether the pin group features an inherent order.
231 :returns: ``True`` if the pin group is inherently ordered, ``False`` otherwise.
236 Set whether the pin group features an inherent order.
238 :param bool ordered: Set ``True`` if the pin group is inherently ordered, ``False`` otherwise. Defaults to ``True``.
242 Check whether the pin group is empty, i.e., contains no pins.
244 :returns: True if the pin group is empty, False otherwise.
249 Get the size, i.e., the number of pins, of the pin group.
251 :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)