HAL
base_pin.cpp
Go to the documentation of this file.
2 
3 namespace hal
4 {
6  {
7  py::class_<BasePin<GatePin>, RawPtrWrapper<BasePin<GatePin>>> py_gate_base_pin(m, "GateBasePin", R"(
8  Base class for gate pins.
9  )");
10 
11  py_gate_base_pin.def(py::self == py::self, R"(
12  Check whether two pins are equal.
13 
14  :returns: True if both pins are equal, False otherwise.
15  :rtype: bool
16  )");
17 
18  py_gate_base_pin.def(py::self != py::self, R"(
19  Check whether two pins are unequal.
20 
21  :returns: True if both pins are unequal, False otherwise.
22  :rtype: bool
23  )");
24 
25  py_gate_base_pin.def("__hash__", &BasePin<GatePin>::get_hash, R"(
26  Python requires hash for set and dict container.
27 
28  :returns: The hash.
29  :rtype: Py_hash_t
30  )");
31 
32  py_gate_base_pin.def_property_readonly("id", &BasePin<GatePin>::get_id, R"(
33  The ID of the gate pin. The ID is unique within a gate type.
34 
35  :type: int
36  )");
37 
38  py_gate_base_pin.def("get_id", &BasePin<GatePin>::get_id, R"(
39  Get the ID of the gate pin. The ID is unique within a gate type.
40 
41  :returns: The ID of the pin.
42  :rtype: int
43  )");
44 
45  py_gate_base_pin.def_property_readonly("name", &BasePin<GatePin>::get_name, R"(
46  The name of the pin.
47 
48  :type: str
49  )");
50 
51  py_gate_base_pin.def("get_name", &BasePin<GatePin>::get_name, R"(
52  Get the name of the pin.
53 
54  :returns: The name of the pin.
55  :rtype: str
56  )");
57 
58  py_gate_base_pin.def_property_readonly("direction", &BasePin<GatePin>::get_direction, R"(
59  The direction of the pin.
60 
61  :type: hal_py.PinDirection
62  )");
63 
64  py_gate_base_pin.def("get_direction", &BasePin<GatePin>::get_direction, R"(
65  Get the direction of the pin.
66 
67  :returns: The direction of the pin.
68  :rtype: hal_py.PinDirection
69  )");
70 
71  py_gate_base_pin.def_property_readonly("type", &BasePin<GatePin>::get_type, R"(
72  The type of the pin.
73 
74  :type: hal_py.PinType
75  )");
76 
77  py_gate_base_pin.def("get_type", &BasePin<GatePin>::get_type, R"(
78  Get the type of the pin.
79 
80  :returns: The type of the pin.
81  :rtype: hal_py.PinType
82  )");
83 
84  py_gate_base_pin.def_property_readonly("group", &BasePin<GatePin>::get_group, R"(
85  A tuple comprising the group of the pin as well as the index of the pin within the group.
86 
87  :type: tuple(hal_py.GatePinGroup,int)
88  )");
89 
90  py_gate_base_pin.def("get_group", &BasePin<GatePin>::get_group, R"(
91  Get the group of the pin as well as the index of the pin within the group.
92 
93  :returns: The group and the index of the pin.
94  :rtype: tuple(hal_py.GatePinGroup,int)
95  )");
96 
97  py::class_<BasePin<ModulePin>, RawPtrWrapper<BasePin<ModulePin>>> py_module_base_pin(m, "ModuleBasePin", R"(
98  Base class for module pins.
99  )");
100 
101  py_module_base_pin.def(py::self == py::self, R"(
102  Check whether two pins are equal.
103 
104  :returns: True if both pins are equal, False otherwise.
105  :rtype: bool
106  )");
107 
108  py_module_base_pin.def(py::self != py::self, R"(
109  Check whether two pins are unequal.
110 
111  :returns: True if both pins are unequal, False otherwise.
112  :rtype: bool
113  )");
114 
115  py_module_base_pin.def("__hash__", &BasePin<ModulePin>::get_hash, R"(
116  Python requires hash for set and dict container.
117 
118  :returns: The hash.
119  :rtype: Py_hash_t
120  )");
121 
122  py_module_base_pin.def_property_readonly("id", &BasePin<ModulePin>::get_id, R"(
123  The ID of the module pin. The ID is unique within a module.
124 
125  :type: int
126  )");
127 
128  py_module_base_pin.def("get_id", &BasePin<ModulePin>::get_id, R"(
129  Get the ID of the module pin. The ID is unique within a module.
130 
131  :returns: The ID of the pin.
132  :rtype: int
133  )");
134 
135  py_module_base_pin.def_property_readonly("name", &BasePin<ModulePin>::get_name, R"(
136  The name of the pin.
137 
138  :type: str
139  )");
140 
141  py_module_base_pin.def("get_name", &BasePin<ModulePin>::get_name, R"(
142  Get the name of the pin.
143 
144  :returns: The name of the pin.
145  :rtype: str
146  )");
147 
148  py_module_base_pin.def_property_readonly("direction", &BasePin<ModulePin>::get_direction, R"(
149  The direction of the pin.
150 
151  :type: hal_py.PinDirection
152  )");
153 
154  py_module_base_pin.def("get_direction", &BasePin<ModulePin>::get_direction, R"(
155  Get the direction of the pin.
156 
157  :returns: The direction of the pin.
158  :rtype: hal_py.PinDirection
159  )");
160 
161  py_module_base_pin.def_property_readonly("type", &BasePin<ModulePin>::get_type, R"(
162  The type of the pin.
163 
164  :type: hal_py.PinType
165  )");
166 
167  py_module_base_pin.def("get_type", &BasePin<ModulePin>::get_type, R"(
168  Get the type of the pin.
169 
170  :returns: The type of the pin.
171  :rtype: hal_py.PinType
172  )");
173 
174  py_module_base_pin.def_property_readonly("group", &BasePin<ModulePin>::get_group, R"(
175  A tuple comprising the group of the pin as well as the index of the pin within the group.
176 
177  :type: tuple(hal_py.ModulePinGroup,int)
178  )");
179 
180  py_module_base_pin.def("get_group", &BasePin<ModulePin>::get_group, R"(
181  Get the group of the pin as well as the index of the pin within the group.
182 
183  :returns: The group and the index of the pin.
184  :rtype: tuple(hal_py.ModulePinGroup,int)
185  )");
186  }
187 } // namespace hal
void base_pin_init(py::module &m)
Definition: base_pin.cpp:5
std::unique_ptr< T, py::nodelete > RawPtrWrapper
const Module * module(const Gate *g, const NodeBoxes &boxes)