7 py::class_<GateLibrary, RawPtrWrapper<GateLibrary>> py_gate_library(m,
"GateLibrary", R
"(
8 A gate library is a collection of gate types including their pins and Boolean functions.
11 py_gate_library.def(py::init<const std::filesystem::path&, const std::string&>(), py::arg("path"), py::arg(
"name"), R
"(
12 Construct a gate library by specifying its name and the path to the file that describes the library.
14 :param pathlib.Path path: The path to the gate library file.
15 :param str name: The name of the gate library.
19 The name of the gate library.
25 Get the name of the gate library.
27 :returns: The name of the gate library.
32 The path to the file describing the gate library.
38 Get the path to the file describing the gate library.
40 :returns: The path to the gate library file.
45 Set the data category of the gate location information.
47 :param str category: The data category.
51 Get the data category of the gate location information.
53 :returns: The data category.
58 Set the data identifiers of the gate location information for both the x- and y-coordinates.
60 :param str x_coordinate: The data identifier for the x-coordinate.
61 :param str y_coordinate: The data identifier for the y-coordinate.
65 Get the data identifiers of the gate location information for both the x- and y-coordinates.
67 :returns: A pair of data identifiers.
68 :rtype: tuple(str,str)
81 Check whether the given gate type is contained in this library.
83 :param hal_py.GateType gate_type: The gate type.
84 :returns: ``True`` if the gate type is part of this library, ``False`` otherwise.
89 Check by name whether the given gate type is contained in this library.
91 :param str name: The name of the gate type.
92 :returns: ``True`` if the gate type is part of this library, ``False`` otherwise.
97 Get the gate type corresponding to the given name if contained within the library. In case there is no gate type with that name, ``None`` is returned.
99 :param str name: The name of the gate type.
100 :returns: The gate type on success, ``None`` otherwise.
101 :rtype: hal_py.GateType or None
104 py_gate_library.def_property_readonly("gate_types", [](
const GateLibrary&
self) {
return self.get_gate_types(); }, R
"(
105 All gate types of the gate library as as dict from gate type names to gate types.
107 :type: dict[str,hal_py.GateType]
111 Get all gate types of the library.
112 In case a filter is applied, only the gate types matching the filter condition are returned.
114 :param lambda filter: The user-defined filter function.
115 :returns: A dict from gate type names to gate types.
116 :rtype: dict[str,hal_py.GateType]
120 Mark a gate type as a VCC gate type.
122 :param hal_py.GateType gate_type: The gate type.
123 :returns: ``True`` on success, ``False`` otherwise.
128 All VCC gate types of the gate library as as dict from gate type names to gate types.
130 :type: dict[str,hal_py.GateType]
134 Get all VCC gate types of the library.
136 :returns: A dict from VCC gate type names to gate type objects.
137 :rtype: dict[str,hal_py.GateType]
141 Mark a gate type as a GND gate type.
143 :param hal_py.GateType gate_type: The gate type.
144 :returns: ``True`` on success, ``False`` otherwise.
149 All GND gate types of the gate library as as dict from gate type names to gate types.
151 :type: dict[str,hal_py.GateType]
155 Get all GND gate types of the library.
157 :returns: A dict from GND gate type names to gate type objects.
158 :rtype: dict[str,hal_py.GateType]
162 Add an include required for parsing a corresponding netlist, e.g., VHDL libraries.
164 :param str include: The include to add.
168 A list of includes required for parsing a corresponding netlist, e.g., VHDL libraries.
174 Get a list of includes required for parsing a corresponding netlist, e.g., VHDL libraries.
176 :returns: A list of includes.
bool contains_gate_type_by_name(const std::string &name) const
const std::pair< std::string, std::string > & get_gate_location_data_identifiers() const
bool mark_vcc_gate_type(GateType *gate_type)
std::unordered_map< std::string, GateType * > get_gate_types(const std::function< bool(const GateType *)> &filter=nullptr) const
std::unordered_map< std::string, GateType * > get_vcc_gate_types() const
GateType * get_gate_type_by_name(const std::string &name) const
void set_gate_location_data_category(const std::string &category)
bool mark_gnd_gate_type(GateType *gate_type)
bool contains_gate_type(GateType *gate_type) const
std::vector< std::string > get_includes() const
void set_gate_location_data_identifiers(const std::string &x_coordinate, const std::string &y_coordinate)
std::unordered_map< std::string, GateType * > get_gnd_gate_types() const
void add_include(const std::string &include)
std::string get_name() const
const std::string & get_gate_location_data_category() const
void gate_library_init(py::module &m)
const Module * module(const Gate *g, const NodeBoxes &boxes)