Gate Type

class hal_py.GateType

A gate type contains information about its internals such as input and output pins as well as its Boolean functions.

__init__(*args, **kwargs)
add_boolean_function(self: hal_py.GateType, pin_name: str, function: hal::BooleanFunction) None

Add a Boolean function with the specified name to the gate type.

Parameters
add_boolean_functions(self: hal_py.GateType, functions: Dict[str, hal::BooleanFunction]) None

Add multiple boolean functions to the gate type.

Parameters

functions (dict[str,hal_py.BooleanFunction]) – A dict from names to Boolean functions.

assign_pin_to_group(self: hal_py.GateType, pin_group: hal::PinGroup<hal::GatePin>, pin: hal::GatePin, delete_empty_groups: bool = True) bool

Assign a pin to a pin group.

Parameters
  • pin_group (hal_py.GatePinGroup) – The new pin group.

  • pin (hal_py.GatePin) – The pin to be added.

  • delete_empty_groups (bool) – Set True to delete groups that are empty after the pin has been assigned to the new group, False to keep empty groups. Defaults to True.

Returns

True on success, False otherwise.

Return type

bool

assign_property(self: hal_py.GateType, property: hal_py.GateTypeProperty) None

Assign a new property to the gate type.

Parameters

property (hal_py.GateTypeProperty) – The property to assign.

property boolean_functions

All Boolean functions of the gate type as a dict from names to Boolean functions.

Type

dict[str,hal_py.BooleanFunction]

property components

All components of the gate type as a list.

Type

list[hal_py.GateTypeComponent]

create_pin(*args, **kwargs)

Overloaded function.

  1. create_pin(self: hal_py.GateType, id: int, name: str, direction: hal_py.PinDirection, type: hal_py.PinType = <PinType.none: 0>, create_group: bool = True) -> hal::GatePin

    Create a gate pin with the specified name.

    param int id

    The ID of the pin.

    param str name

    The name of the pin.

    param hal_py.PinDirection direction

    The direction of the pin.

    param hal_py.PinType type

    The type of the pin. Defaults to hal_py.PinType.none.

    param bool create_group

    Set True to automatically assign the pin to a new pin group, False otherwise. Defaults to True.

    returns

    The gate pin on success, None otherwise.

    rtype

    hal_py.GatePin or None

  2. create_pin(self: hal_py.GateType, name: str, direction: hal_py.PinDirection, type: hal_py.PinType = <PinType.none: 0>, create_group: bool = True) -> hal::GatePin

    Create a gate pin with the specified name. The ID of the pin is set automatically.

    param str name

    The name of the pin.

    param hal_py.PinDirection direction

    The direction of the pin.

    param hal_py.PinType type

    The type of the pin. Defaults to hal_py.PinType.none.

    param bool create_group

    Set True to automatically assign the pin to a new pin group, False otherwise. Defaults to True.

    returns

    The gate pin on success, None otherwise.

    rtype

    hal_py.GatePin or None

create_pin_group(*args, **kwargs)

Overloaded function.

  1. create_pin_group(self: hal_py.GateType, id: int, name: str, pins: List[hal::GatePin] = [], direction: hal_py.PinDirection = <PinDirection.none: 0>, type: hal_py.PinType = <PinType.none: 0>, ascending: bool = True, start_index: int = 0, delete_empty_groups: bool = True) -> hal::PinGroup<hal::GatePin>

    Create a gate pin group with the given name.

    param int id

    The ID of the pin group.

    param str name

    The name of the pin group.

    param list[hal_py.GatePin] pins

    The pins to be assigned to the pin group. Defaults to an empty list.

    param hal_py.PinDirection direction

    The direction of the pin group. Defaults to hal_py.PinDirection.none.

    param hal_py.PinType type

    The type of the pin group. Defaults to hal_py.PinType.none.

    param bool ascending

    Set True for ascending pin order (from 0 to n-1), False otherwise (from n-1 to 0). Defaults to True.

    param int start_index

    The start index of the pin group. Defaults to 0.

    param bool delete_empty_groups

    Set True to delete groups that are empty after the pins have been assigned to the new group, False to keep empty groups. Defaults to True.

    returns

    The pin group on success, None otherwise.

    rtype

    hal_py.GatePinGroup or None

  2. create_pin_group(self: hal_py.GateType, name: str, pins: List[hal::GatePin] = [], direction: hal_py.PinDirection = <PinDirection.none: 0>, type: hal_py.PinType = <PinType.none: 0>, ascending: bool = True, start_index: int = 0, delete_empty_groups: bool = True) -> hal::PinGroup<hal::GatePin>

    Create a gate pin group with the given name. The ID of the pin group is set automatically.

    param str name

    The name of the pin group.

    param list[hal_py.GatePin] pins

    The pins to be assigned to the pin group. Defaults to an empty list.

    param hal_py.PinDirection direction

    The direction of the pin group. Defaults to hal_py.PinDirection.none.

    param hal_py.PinType type

    The type of the pin group. Defaults to hal_py.PinType.none.

    param bool ascending

    Set True for ascending pin order (from 0 to n-1), False otherwise (from n-1 to 0). Defaults to True.

    param int start_index

    The start index of the pin group. Defaults to 0.

    param bool delete_empty_groups

    Set True to delete groups that are empty after the pins have been assigned to the new group, False to keep empty groups. Defaults to True.

    returns

    The pin group on success, None otherwise.

    rtype

    hal_py.GatePinGroup or None

delete_pin_group(self: hal_py.GateType, pin_group: hal::PinGroup<hal::GatePin>) bool

Delete the given pin group.

Parameters

pin_group (hal_py.GatePinGroup) – The pin group to be deleted.

Returns

True on success, False otherwise.

Return type

bool

property gate_library

The gate library this gate type is associated with.

Type

hal_py.GateLibrary

get_boolean_function(*args, **kwargs)

Overloaded function.

  1. get_boolean_function(self: hal_py.GateType, name: str) -> hal::BooleanFunction

    Get the Boolean function specified by the given name. This name can for example be an output pin of the gate or any other user-defined function name.

    param str name

    The name of the Boolean function.

    returns

    The Boolean function on success, an empty Boolean function otherwise.

    rtype

    hal_py.BooleanFunction

  2. get_boolean_function(self: hal_py.GateType, pin: hal::GatePin = None) -> hal::BooleanFunction

    Get the Boolean function corresponding to the given output pin. If pin is a None, the Boolean function of the first output pin is returned.

    param hal_py.GatePin pin

    The pin.

    returns

    The Boolean function on success, an empty Boolean function otherwise.

    rtype

    hal_py.BooleanFunction

get_boolean_functions(self: hal_py.GateType) Dict[str, hal::BooleanFunction]

Get all Boolean functions of the gate type.

Returns

A map from names to Boolean functions.

Return type

dict[str,hal_py.BooleanFunction]

get_component(self: hal_py.GateType, filter: Callable[[hal::GateTypeComponent], bool] = None) hal::GateTypeComponent

Get a single component matching the filter condition (if provided). Returns None if (i) the gate type does not contain any components, (ii) multiple components match the filter condition, or (iii) no component matches the filter condition.

Parameters

filter (lambda) – The filter applied to all candidate components.

Returns

The component or None.

Return type

hal_py.GateTypeComponent or None

get_components(self: hal_py.GateType, filter: Callable[[hal::GateTypeComponent], bool] = None) List[hal::GateTypeComponent]

Get all components matching the filter condition (if provided) as a list. Returns an empty list if (i) the gate type does not contain any components or (ii) no component matches the filter condition.

Parameters

filter (lambda) – The filter applied to all candidate components, disabled by default.

Returns

The components.

Return type

list[hal_py.GateTypeComponent]

get_gate_library(self: hal_py.GateType) hal::GateLibrary

Get the gate library this gate type is associated with.

Returns

The gate library.

Return type

hal_py.GateLibrary

get_id(self: hal_py.GateType) int

Get the unique ID of the gate type.

Returns

The unique ID of the gate type.

Return type

int

get_input_pin_names(self: hal_py.GateType) List[str]

Get an ordered list of the names of all input pins of the gate type (including inout pins).

Returns

An ordered list of input pin names.

Return type

list[str]

get_input_pins(self: hal_py.GateType) List[hal::GatePin]

Get an ordered list of all input pins of the gate type (including inout pins).

Returns

An ordered list of input pins.

Return type

list[hal_py.GatePin]

get_name(self: hal_py.GateType) str

Get the name of the gate type.

Returns

The name of the gate type.

Return type

str

get_output_pin_names(self: hal_py.GateType) List[str]

Get an ordered list of the names of all output pins of the gate type (including inout pins).

Returns

An ordered list of output pin names.

Return type

list[str]

get_output_pins(self: hal_py.GateType) List[hal::GatePin]

Get an ordered list of all output pins of the gate type (including inout pins).

Returns

An ordered list of output pins.

Return type

list[hal_py.GatePin]

get_pin_by_id(self: hal_py.GateType, id: int) hal::GatePin

Get the pin corresponding to the given ID.

Parameters

id (int) – The ID of the pin.

Returns

The pin on success, None otherwise.

Return type

hal_py.GatePin or None

get_pin_by_name(self: hal_py.GateType, name: str) hal::GatePin

Get the pin corresponding to the given name.

Parameters

name (str) – The name of the pin.

Returns

The pin on success, None otherwise.

Return type

hal_py.GatePin or None

get_pin_group_by_id(self: hal_py.GateType, id: int) hal::PinGroup<hal::GatePin>

Get the pin group corresponding to the given ID.

Parameters

id (int) – The ID of the pin group.

Returns

The pin group on success, None otherwise.

Return type

hal_py.GatePinGroup or None

get_pin_group_by_name(self: hal_py.GateType, name: str) hal::PinGroup<hal::GatePin>

Get the pin group corresponding to the given name.

Parameters

name (str) – The name of the pin group.

Returns

The pin group on success, None otherwise.

Return type

hal_py.GatePinGroup or None

get_pin_groups(self: hal_py.GateType, filter: Callable[[hal::PinGroup<hal::GatePin>], bool] = None) List[hal::PinGroup<hal::GatePin>]

Get an ordered list of all pin groups of the gate type. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.

Parameters

filter (lambda) – An optional filter.

Returns

An ordered list of pin groups.

Return type

list[hal_py.GatePinGroup]

get_pin_names(self: hal_py.GateType, filter: Callable[[hal::GatePin], bool] = None) List[str]

Get an ordered list of the names of all pins of the gate type. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.

Returns

A list of input pin names of the gate type.

Parameters

filter (lambda) – An optional filter.

Returns

An ordered list of pins.

Return type

list[str]

get_pins(self: hal_py.GateType, filter: Callable[[hal::GatePin], bool] = None) List[hal::GatePin]

Get an ordered list of all pins of the gate type. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.

Parameters

filter (lambda) – An optional filter.

Returns

An ordered list of pins.

Return type

list[hal_py.GatePin]

get_properties(self: hal_py.GateType) Set[hal_py.GateTypeProperty]

Get the properties assigned to the gate type.

Returns

The properties of the gate type.

Return type

set[hal_py.GateTypeProperty]

get_property_list(self: hal_py.GateType) List[hal_py.GateTypeProperty]

Get the properties assigned to the gate type as list where the most significant property stands at first position.

Returns

The properties of the gate type.

Return type

list[hal_py.GateTypeProperty]

has_component_of_type(self: hal_py.GateType, type: hal::GateTypeComponent::ComponentType) bool

Check if the gate type contains a component of the specified type.

Parameters

type (hal_py.GateTypeComponent.ComponentType) – The component type to check for.

Returns

True if the gate type contains a component of the speciifed type, False otherwise.

Return type

bool

has_property(self: hal_py.GateType, arg0: hal_py.GateTypeProperty) bool

Check whether the gate type has the specified property.

Parameters

type (hal_py.GateTypeProperty) – The property to check for.

Returns

True if the gate type has the specified property, false otherwise.

Return type

bool

property id
Type

The unique ID of the gate type.

property input_pin_names

An ordered list of the names of all input pins of the gate type (including inout pins).

Type

list[str]

property input_pins

An ordered list of all input pins of the gate type (including inout pins).

Type

list[hal_py.GatePin]

property name

The name of the gate type.

Type

str

property output_pin_names

An ordered list of the names of all output pins of the gate type (including inout pins).

Type

list[str]

property output_pins

An ordered list of all output pins of the gate type (including inout pins).

Type

list[hal_py.GatePin]

property pin_names

An ordered list of the names of all pins of the gate type.

Type

list[str]

property pins

An ordered list of all pins of the gate type.

Type

list[hal_py.GatePin]

property properties

The properties assigned to the gate type.

Type

set[hal_py.GateTypeProperty]

set_pin_group_direction(self: hal_py.GateType, pin_group: hal::PinGroup<hal::GatePin>, new_direction: hal_py.PinDirection) bool

Set the direction of the given pin group.

Parameters
Returns

True on success, False otherwise.

Return type

bool

set_pin_group_name(self: hal_py.GateType, pin_group: hal::PinGroup<hal::GatePin>, new_name: str) bool

Set the name of the given pin group.

Parameters
  • pin_group (hal_py.GatePinGroup) – The pin group.

  • new_name (str) – The name to be assigned to the pin group.

Returns

True on success, False otherwise.

Return type

bool

set_pin_group_type(self: hal_py.GateType, pin_group: hal::PinGroup<hal::GatePin>, new_type: hal_py.PinType) bool

Set the type of the given pin group.

Parameters
Returns

True on success, False otherwise.

Return type

bool