dftlib.storage.dft_gates.DftPor

class DftPor(element_id: int, name: str, inclusive: bool, children: list[DftElement], position: tuple[float, float])

Bases: DftPriorityGate

Priority OR gate (POR).

Methods

add_child

Add child.

check_valid

children

Get children.

compare

Compare elements.

compare_successors

Check whether two gates have the same successors.

get_json

Get JSON string.

is_be

Get whether the element is a BE.

is_dynamic

Get whether the element is dynamic.

is_gate

Get whether the element is a gate.

parents

Get parents.

remove_child

Remove child.

remove_parent

Remove parent.

replace_child

Replace given child with new element.

set_relevant

Set whether the element is relevant (and will not be set to 'Don't Care' for example).

add_child(element: DftElement) None

Add child. :param element: Child to add.

children() list[DftElement]

Get children. :return: Ordered list of children.

compare(other: DftElement, respect_ids: bool)

Compare elements. :param other: Other element. :param respect_ids: Whether the ids must be equal. :return: True iff both elements are equal.

compare_successors(other: DftGate, ordered: bool, respect_ids: bool) bool

Check whether two gates have the same successors. :param other: Other gate. :param ordered: Whether the order of successors should be respected. :param respect_ids: Whether the ids of the successors must be equal. :return: True iff both gates have the same successors.

get_json() dict

Get JSON string. :return: JSON string.

is_be() bool

Get whether the element is a BE. :return: True iff element is a BE.

is_dynamic() bool

Get whether the element is dynamic. :return: True iff element is dynamic.

is_gate() bool

Get whether the element is a gate. :return: True iff element is a gate.

parents() list[dftlib.storage.dft_gates.DftGate]

Get parents. :return: List of parents.

remove_child(element: DftElement) None

Remove child. This element is also removed as parent from the child. :param element: Child to remove.

remove_parent(element: DftElement) None

Remove parent. :param element: Parent to remove.

replace_child(child: DftElement, element: DftElement) None

Replace given child with new element. Maintains the order. :param child: Original child to be replaced. :param element: Element which will be the new child.

set_relevant(relevant: bool = True) None

Set whether the element is relevant (and will not be set to ‘Don’t Care’ for example). :param relevant: Whether the element is relevant.