Gate Library
- class hal_py.GateLibrary
A gate library is a collection of gate types including their pins and Boolean functions.
- __init__(self: hal_py.GateLibrary, path: os.PathLike, name: str) None
Construct a gate library by specifying its name and the path to the file that describes the library.
- Parameters
path (pathlib.Path) – The path to the gate library file.
name (str) – The name of the gate library.
- add_include(self: hal_py.GateLibrary, include: str) None
Add an include required for parsing a corresponding netlist, e.g., VHDL libraries.
- Parameters
inc (str) – The include to add.
- contains_gate_type(self: hal_py.GateLibrary, gate_type: hal_py.GateType) bool
Check whether the given gate type is contained in this library.
- Parameters
gate_type (hal_py.GateType) – The gate type.
- Returns
True if the gate type is part of this library, false otherwise.
- Return type
- contains_gate_type_by_name(self: hal_py.GateLibrary, name: str) bool
Check by name whether the given gate type is contained in this library.
- property gate_types
All gate types of the gate library as as dict from gate type names to gate types.
- Type
- get_gate_location_data_category(*args, **kwargs)
Overloaded function.
get_gate_location_data_category(self: hal_py.GateLibrary) -> str
Get the data category of the gate location information.
- returns
The data category.
- rtype
str
get_gate_location_data_category(self: hal_py.GateLibrary) -> str
Get the data identifiers of the gate location information for both the x- and y-coordinates.
- returns
A pair of data identifiers.
- rtype
tuple(str,str)
- get_gate_type_by_name(self: hal_py.GateLibrary, name: str) hal_py.GateType
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.
- Parameters
name (str) – The name of the gate type.
- Returns
The gate type on success, None otherwise.
- Return type
- get_gate_types(self: hal_py.GateLibrary, filter: Callable[[hal_py.GateType], bool] = None) Dict[str, hal_py.GateType]
Get all gate types of the library. In case a filter is applied, only the gate types matching the filter condition are returned.
- Parameters
filter (lambda) – The user-defined filter function.
- Returns
A dict from gate type names to gate types.
- Return type
- get_gnd_gate_types(self: hal_py.GateLibrary) Dict[str, hal_py.GateType]
Get all GND gate types of the library.
- Returns
A dict from GND gate type names to gate type objects.
- Return type
- get_includes(self: hal_py.GateLibrary) List[str]
Get a list of includes required for parsing a corresponding netlist, e.g., VHDL libraries.
- get_name(self: hal_py.GateLibrary) str
Get the name of the gate library.
- Returns
The name of the gate library.
- Return type
- get_path(self: hal_py.GateLibrary) str
Get the path to the file describing the gate library.
- Returns
The path to the gate library file.
- Return type
- get_vcc_gate_types(self: hal_py.GateLibrary) Dict[str, hal_py.GateType]
Get all VCC gate types of the library.
- Returns
A dict from VCC gate type names to gate type objects.
- Return type
- property gnd_gate_types
All GND gate types of the gate library as as dict from gate type names to gate types.
- Type
- property includes
A list of includes required for parsing a corresponding netlist, e.g., VHDL libraries.
- mark_gnd_gate_type(self: hal_py.GateLibrary, gate_type: hal_py.GateType) bool
Mark a gate type as a GND gate type.
- Parameters
gate_type (hal_py.GateType) – The gate type.
- Returns
True on success, false otherwise.
- Return type
- mark_vcc_gate_type(self: hal_py.GateLibrary, gate_type: hal_py.GateType) bool
Mark a gate type as a VCC gate type.
- Parameters
gate_type (hal_py.GateType) – The gate type.
- Returns
True on success, false otherwise.
- Return type
- property path
The path to the file describing the gate library.
- Type
- set_gate_location_data_category(self: hal_py.GateLibrary, category: str) None
Set the data category of the gate location information.
- Parameters
category (str) – The data category.
- set_gate_location_data_identifiers(self: hal_py.GateLibrary, x_coordinate: str, y_coordinate: str) None
Set the data identifiers of the gate location information for both the x- and y-coordinates.
- property vcc_gate_types
All VCC gate types of the gate library as as dict from gate type names to gate types.
- Type