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:bool
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.

Parameters:name (str) – The name of the gate type.
Returns:True if the gate type is part of this library, false otherwise.
Return type:bool
gate_types

All gate types of the gate library as as dict from gate type names to gate types.

Type:dict[str,hal_py.GateType]
get_gate_location_data_category(*args, **kwargs)

Overloaded function.

  1. 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
  2. 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:hal_py.GateType or None
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:dict[str,hal_py.GateType]
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:dict[str,hal_py.GateType]
get_includes(self: hal_py.GateLibrary) → List[str]

Get a list of includes required for parsing a corresponding netlist, e.g., VHDL libraries.

Returns:A list of includes.
Return type:list[str]
get_name(self: hal_py.GateLibrary) → str

Get the name of the gate library.

Returns:The name of the gate library.
Return type:str
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:pathlib.Path
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:dict[str,hal_py.GateType]
gnd_gate_types

All GND gate types of the gate library as as dict from gate type names to gate types.

Type:dict[str,hal_py.GateType]
includes

A list of includes required for parsing a corresponding netlist, e.g., VHDL libraries.

Type:list[str]
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:bool
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:bool
name

The name of the gate library.

Type:str
path

The path to the file describing the gate library.

Type:pathlib.Path
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.

Parameters:
  • x_coordinate (str) – The data identifier for the x-coordinate.
  • y_coordinate (str) – The data identifier for the y-coordinate.
vcc_gate_types

All VCC gate types of the gate library as as dict from gate type names to gate types.

Type:dict[str,hal_py.GateType]