CIRCT 24.0.0git
Loading...
Searching...
No Matches
synth.LongestPathCollection Class Reference

Public Member Functions

 __init__ (self, collection)
int __len__ (self)
Union[DataflowPath, List[DataflowPath]] __getitem__ (self, Union[slice, int] index)
DataflowPath longest_path (self)
DataflowPath get_by_delay_ratio (self, float ratio)
None print_summary (self)
 merge (self, "LongestPathCollection" src)
 drop_non_critical_paths (self, bool per_end_point=True)

Public Attributes

 collection = collection
 length = self.collection.get_size()

Detailed Description

A collection of timing paths sorted by delay (longest first).
This class provides a Python wrapper around the C++ LongestPathCollection,
offering convenient access to timing paths with caching for performance.
The paths are pre-sorted by delay in descending order.
Attributes:
    collection: The underlying C++ collection object
    length: Number of paths in the collection

Definition at line 235 of file synth.py.

Constructor & Destructor Documentation

◆ __init__()

synth.LongestPathCollection.__init__ ( self,
collection )
Initialize the collection wrapper.
Args:
    collection: The underlying C++ LongestPathCollection object

Definition at line 246 of file synth.py.

Referenced by drop_non_critical_paths(), and merge().

Member Function Documentation

◆ __getitem__()

Union[DataflowPath, List[DataflowPath]] synth.LongestPathCollection.__getitem__ ( self,
Union[slice, int] index )
    Get a specific path from the collection by index.
    Supports both integer and slice indexing. Integer indices can be negative.

    Args:
        index: Integer index or slice object to access paths

    Returns:
        DataflowPath or list of DataflowPaths for slice access

    Raises:
        IndexError: If index is out of range

Definition at line 263 of file synth.py.

References circt::hw::InnerSymbolNamespaceCollection.collection, collection, and length.

◆ __len__()

int synth.LongestPathCollection.__len__ ( self)
Get the number of paths in the collection.

Definition at line 259 of file synth.py.

References length.

Referenced by om.List.__iter__().

◆ drop_non_critical_paths()

◆ get_by_delay_ratio()

DataflowPath synth.LongestPathCollection.get_by_delay_ratio ( self,
float ratio )
Get the path at the specified position in the delay-sorted collection.
Since paths are sorted by delay in descending order, higher ratios
correspond to paths with higher delays (closer to the critical path).
Args:
    ratio: Position ratio between 0.0 and 1.0
          (e.g., 1.0 = longest delay path, 0.0 = shortest delay path,
           0.95 = path among the top 5% slowest paths)
Returns:
    DataflowPath at the specified position ratio

Definition at line 299 of file synth.py.

◆ longest_path()

DataflowPath synth.LongestPathCollection.longest_path ( self)
Get the path with the maximum delay (first element since sorted).

Definition at line 295 of file synth.py.

◆ merge()

◆ print_summary()

None synth.LongestPathCollection.print_summary ( self)
Print a statistical summary of path delays in the collection.

Definition at line 315 of file synth.py.

References print().

Member Data Documentation

◆ collection

synth.LongestPathCollection.collection = collection

Definition at line 252 of file synth.py.

Referenced by __getitem__(), drop_non_critical_paths(), and merge().

◆ length

synth.LongestPathCollection.length = self.collection.get_size()

Definition at line 253 of file synth.py.

Referenced by __getitem__(), and __len__().


The documentation for this class was generated from the following file: