dftlib.storage.dft_gates.DftVotingGate¶
- class DftVotingGate(element_id: int, name: str, voting_threshold: int, children: list[DftElement], position: tuple[float, float])¶
Bases:
DftGate
VOTing gate.
Methods
Add child.
check_valid
Get children.
Compare elements.
Check whether two gates have the same successors.
Get JSON string.
Get whether the element is a BE.
Get whether the element is dynamic.
Get whether the element is a gate.
Get parents.
Remove child.
Remove parent.
Replace given child with new element.
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) 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.