CIRCT 24.0.0git
Loading...
Searching...
No Matches
synth.LongestPathAnalysis::Impl Struct Reference

Internal implementation for LongestPathAnalysis. More...

Collaboration diagram for synth.LongestPathAnalysis::Impl:

Public Member Functions

 Impl (Operation *module, mlir::AnalysisManager &am, const LongestPathAnalysisOptions &option)
LogicalResult initializeAndRun (mlir::ModuleOp module)
 Initialize and run analysis for a full MLIR module (hierarchical).
LogicalResult initializeAndRun (hw::HWModuleOp module)
 Initialize and run analysis for a single HW module (local scope).
bool isAnalysisAvailable (StringAttr moduleName) const
 Return true if we have a LocalVisitor for the given HW module.
LogicalResult computeGlobalPaths (Value value, size_t bitPos, SmallVectorImpl< DataflowPath > &results)
 Compute hierarchical timing paths to (value, bitPos) and append to results.
template<bool elaborate>
LogicalResult collectClosedPaths (StringAttr moduleName, SmallVectorImpl< DataflowPath > &results) const
 Collect register-to-register (closed) paths within the module.
LogicalResult collectInputToInternalPaths (StringAttr moduleName, SmallVectorImpl< DataflowPath > &results) const
 Collect open paths from module input ports to internal sequential sinks.
LogicalResult collectInternalToOutputPaths (StringAttr moduleName, SmallVectorImpl< DataflowPath > &results) const
 Collect open paths from internal sequential sources to module output ports.
llvm::ArrayRef< hw::HWModuleOp > getTopModules () const
 Top modules inferred or specified for this analysis run.
FailureOr< int64_t > getAverageMaxDelay (Value value)
 Return average of per-bit max delays for a value.
FailureOr< int64_t > getMaxDelay (Value value, int64_t bitPos)
 Return the max delay for a value.
FailureOr< ArrayRef< OpenPath > > computeLocalPaths (Value value, size_t bitPos)
 Compute local open paths to (value, bitPos).

Private Member Functions

LogicalResult computeGlobalPaths (const Object &originalObject, Value value, size_t bitPos, SmallVectorImpl< DataflowPath > &results)
 Recursive helper for computeGlobalPaths.

Private Attributes

Context ctx
 Analysis context.
SmallVector< hw::HWModuleOp > topModules
 Top-level HW modules that seed hierarchical analysis.

Friends

class IncrementalLongestPathAnalysis

Detailed Description

Internal implementation for LongestPathAnalysis.

This class owns per-module LocalVisitors, orchestrates initialization over the instance graph, and provides the concrete implementations for the public LongestPathAnalysis API.

Definition at line 1514 of file LongestPathAnalysis.cpp.

Constructor & Destructor Documentation

◆ Impl()

synth.LongestPathAnalysis::Impl::Impl ( Operation * module,
mlir::AnalysisManager & am,
const LongestPathAnalysisOptions & option )

Definition at line 1733 of file LongestPathAnalysis.cpp.

References ctx, and initializeAndRun().

Member Function Documentation

◆ collectClosedPaths()

template<bool elaborate>
LogicalResult synth.LongestPathAnalysis::Impl::collectClosedPaths ( StringAttr moduleName,
SmallVectorImpl< DataflowPath > & results ) const

Collect register-to-register (closed) paths within the module.

When 'elaborate' is true, paths are elaborated with instance paths from moduleName.

Definition at line 1642 of file LongestPathAnalysis.cpp.

References collectClosedPaths(), ctx, isAnalysisAvailable(), and success().

Referenced by collectClosedPaths().

◆ collectInputToInternalPaths()

LogicalResult synth.LongestPathAnalysis::Impl::collectInputToInternalPaths ( StringAttr moduleName,
SmallVectorImpl< DataflowPath > & results ) const

Collect open paths from module input ports to internal sequential sinks.

Definition at line 1692 of file LongestPathAnalysis.cpp.

References collectInputToInternalPaths(), ctx, failure(), and success().

Referenced by collectInputToInternalPaths().

◆ collectInternalToOutputPaths()

LogicalResult synth.LongestPathAnalysis::Impl::collectInternalToOutputPaths ( StringAttr moduleName,
SmallVectorImpl< DataflowPath > & results ) const

Collect open paths from internal sequential sources to module output ports.

Definition at line 1712 of file LongestPathAnalysis.cpp.

References collectInternalToOutputPaths(), ctx, failure(), and success().

Referenced by collectInternalToOutputPaths().

◆ computeGlobalPaths() [1/2]

LogicalResult synth.LongestPathAnalysis::Impl::computeGlobalPaths ( const Object & originalObject,
Value value,
size_t bitPos,
SmallVectorImpl< DataflowPath > & results )
private

Recursive helper for computeGlobalPaths.

Definition at line 1583 of file LongestPathAnalysis.cpp.

References assert(), computeGlobalPaths(), ctx, failure(), filterPaths(), and success().

◆ computeGlobalPaths() [2/2]

LogicalResult synth.LongestPathAnalysis::Impl::computeGlobalPaths ( Value value,
size_t bitPos,
SmallVectorImpl< DataflowPath > & results )

Compute hierarchical timing paths to (value, bitPos) and append to results.

Definition at line 1578 of file LongestPathAnalysis.cpp.

References computeGlobalPaths().

Referenced by computeGlobalPaths(), computeGlobalPaths(), getAverageMaxDelay(), and getMaxDelay().

◆ computeLocalPaths()

FailureOr< ArrayRef< OpenPath > > synth.LongestPathAnalysis::Impl::computeLocalPaths ( Value value,
size_t bitPos )

Compute local open paths to (value, bitPos).

Definition at line 1883 of file LongestPathAnalysis.cpp.

References assert(), computeLocalPaths(), and ctx.

Referenced by computeLocalPaths().

◆ getAverageMaxDelay()

FailureOr< int64_t > synth.LongestPathAnalysis::Impl::getAverageMaxDelay ( Value value)

Return average of per-bit max delays for a value.

Definition at line 1836 of file LongestPathAnalysis.cpp.

References computeGlobalPaths(), failure(), getAverageMaxDelay(), circt::hw::getBitWidth(), and getMaxDelayInPaths().

Referenced by getAverageMaxDelay().

◆ getMaxDelay()

FailureOr< int64_t > synth.LongestPathAnalysis::Impl::getMaxDelay ( Value value,
int64_t bitPos )

Return the max delay for a value.

Definition at line 1855 of file LongestPathAnalysis.cpp.

References computeGlobalPaths(), failure(), circt::hw::getBitWidth(), getMaxDelay(), and getMaxDelayInPaths().

Referenced by getMaxDelay().

◆ getTopModules()

llvm::ArrayRef< hw::HWModuleOp > synth.LongestPathAnalysis::Impl::getTopModules ( ) const
inline

Top modules inferred or specified for this analysis run.

Definition at line 1552 of file LongestPathAnalysis.cpp.

References topModules.

◆ initializeAndRun() [1/2]

LogicalResult synth.LongestPathAnalysis::Impl::initializeAndRun ( hw::HWModuleOp module)

Initialize and run analysis for a single HW module (local scope).

Definition at line 1751 of file LongestPathAnalysis.cpp.

References assert(), ctx, and initializeAndRun().

◆ initializeAndRun() [2/2]

LogicalResult synth.LongestPathAnalysis::Impl::initializeAndRun ( mlir::ModuleOp module)

Initialize and run analysis for a full MLIR module (hierarchical).

Definition at line 1761 of file LongestPathAnalysis.cpp.

References assert(), ctx, failure(), initializeAndRun(), and topModules.

Referenced by Impl(), initializeAndRun(), and initializeAndRun().

◆ isAnalysisAvailable()

bool synth.LongestPathAnalysis::Impl::isAnalysisAvailable ( StringAttr moduleName) const

Return true if we have a LocalVisitor for the given HW module.

Definition at line 1828 of file LongestPathAnalysis.cpp.

References ctx, and isAnalysisAvailable().

Referenced by collectClosedPaths(), and isAnalysisAvailable().

◆ IncrementalLongestPathAnalysis

friend class IncrementalLongestPathAnalysis
friend

Definition at line 1564 of file LongestPathAnalysis.cpp.

References IncrementalLongestPathAnalysis.

Referenced by IncrementalLongestPathAnalysis.

Member Data Documentation

◆ ctx

◆ topModules

SmallVector<hw::HWModuleOp> synth.LongestPathAnalysis::Impl::topModules
private

Top-level HW modules that seed hierarchical analysis.

Definition at line 1575 of file LongestPathAnalysis.cpp.

Referenced by getTopModules(), and initializeAndRun().


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