dftlib.storage.dft.Dft¶
- class Dft(json='')¶
Bases:
object
DFT data structure.
Methods
Add element.
Compare two DFT.
Initialize from JSON.
Get element by id.
Get element by name.
Compute module of module_repr.
Check whether the given parameter is known.
Checks whether the DFT is cyclic.
Checks whether the DFT is valid, e.g. acyclic, has TLE, etc.
Get JSON string for DFT.
next_id
Get number of BEs.
Return whether the DFT contains parameters.
Remove element.
Set top level element.
Get number of elements (gates + BEs) :return: Number of elements.
Get general statistics about DFT.
Return the elements in topological sorting from top to bottom.
Update position bounds by also including bounds of given element.
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.