dftlib.storage.dft.Dft

class Dft(json='')

Bases: object

DFT data structure.

Methods

add

Add element.

compare

Compare two DFT.

from_json

Initialize from JSON.

get_element

Get element by id.

get_element_by_name

Get element by name.

get_module

Compute module of module_repr.

has_parameter

Check whether the given parameter is known.

is_cyclic

Checks whether the DFT is cyclic.

is_valid

Checks whether the DFT is valid, e.g. acyclic, has TLE, etc.

json

Get JSON string for DFT.

next_id

number_of_be

Get number of BEs.

parametric

Return whether the DFT contains parameters.

remove

Remove element.

set_top_level_element

Set top level element.

size

Get number of elements (gates + BEs) :return: Number of elements.

statistics

Get general statistics about DFT.

topological_sort

Return the elements in topological sorting from top to bottom.

update_bounds

Update position bounds by also including bounds of given element.

verbose_str

Get verbose string containing information about all elements.

add(element)

Add element. :param element: Element.

compare(other, respect_ids)

Compare two DFT. Note that the comparison currently performs redundant work as for each element comparison the complete subtree is checked. :param other: Other DFT. :param respect_ids: Whether the ids must be equal. :return: True iff all elements, the top-level element and the structure are equal between the two DFTs.

from_json(json)

Initialize from JSON. :param json: JSON object.

get_element(element_id)

Get element by id. :param element_id: Id. :return: Element.

get_element_by_name(name)

Get element by name. :param name: Name. :return: Element.

get_module(module_repr)

Compute module of module_repr. :param module_repr: Module representative. :return: List of element ids which form the module for module_repr.

has_parameter(name)

Check whether the given parameter is known. :param name: Name of the parameter. :return: True iff parameter was defined before.

is_cyclic()

Checks whether the DFT is cyclic. DFTs should be acyclic. :return: True iff the DFT has a cycle (excluding dependencies and restrictors).

is_valid()

Checks whether the DFT is valid, e.g. acyclic, has TLE, etc. DFTs should be well-formed. :return: True iff the DFT is valid.

json()

Get JSON string for DFT. :return: JSON string.

number_of_be()

Get number of BEs. :return: Number of BEs.

parametric()

Return whether the DFT contains parameters. :return: True iff parameters are defined.

remove(element)

Remove element. :param element: Element.

set_top_level_element(element_id)

Set top level element. :param element_id: Id.

size()

Get number of elements (gates + BEs) :return: Number of elements.

statistics()

Get general statistics about DFT. :return: Tuple (number of BEs, number of static gates, number of dynamic gates, number of elements)

topological_sort()

Return the elements in topological sorting from top to bottom. :return: List of elements.

update_bounds(element)

Update position bounds by also including bounds of given element. :param element: Element.

verbose_str()

Get verbose string containing information about all elements. :return: Verbose string.