CIRCT 22.0.0git
|
Internal implementation for LongestPathAnalysis. More...
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 |
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 1486 of file LongestPathAnalysis.cpp.
aig.LongestPathAnalysis::Impl::Impl | ( | Operation * | module, |
mlir::AnalysisManager & | am, | ||
const LongestPathAnalysisOptions & | option | ||
) |
Definition at line 1708 of file LongestPathAnalysis.cpp.
References aig.LongestPathAnalysis::Impl::initializeAndRun().
LogicalResult aig.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 1614 of file LongestPathAnalysis.cpp.
References aig.LongestPathAnalysis::Impl::collectClosedPaths(), LocalVisitor::getInstancePathCache(), Context::getLocalVisitorMutable(), circt::igraph::InstanceGraphNode::getModule(), circt::igraph::InstancePathCache::getRelativePaths(), Context::instanceGraph, and circt::igraph::InstanceGraph::lookup().
Referenced by aig.LongestPathAnalysis::Impl::collectClosedPaths().
LogicalResult aig.LongestPathAnalysis::Impl::collectInputToInternalPaths | ( | StringAttr | moduleName, |
SmallVectorImpl< DataflowPath > & | results | ||
) | const |
Collect open paths from module input ports to internal sequential sinks.
Definition at line 1667 of file LongestPathAnalysis.cpp.
References aig.LongestPathAnalysis::Impl::collectInputToInternalPaths(), and Context::getLocalVisitor().
Referenced by aig.LongestPathAnalysis::Impl::collectInputToInternalPaths().
LogicalResult aig.LongestPathAnalysis::Impl::collectInternalToOutputPaths | ( | StringAttr | moduleName, |
SmallVectorImpl< DataflowPath > & | results | ||
) | const |
Collect open paths from internal sequential sources to module output ports.
Definition at line 1687 of file LongestPathAnalysis.cpp.
References aig.LongestPathAnalysis::Impl::collectInternalToOutputPaths(), and Context::getLocalVisitor().
Referenced by aig.LongestPathAnalysis::Impl::collectInternalToOutputPaths().
|
private |
Recursive helper for computeGlobalPaths.
Definition at line 1555 of file LongestPathAnalysis.cpp.
References assert(), aig.LongestPathAnalysis::Impl::computeGlobalPaths(), filterPaths(), Context::getLocalVisitorMutable(), Context::instanceGraph, and circt::igraph::InstanceGraph::lookup().
LogicalResult aig.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 1550 of file LongestPathAnalysis.cpp.
References aig.LongestPathAnalysis::Impl::computeGlobalPaths().
Referenced by aig.LongestPathAnalysis::Impl::computeGlobalPaths(), and aig.LongestPathAnalysis::Impl::computeGlobalPaths().
FailureOr< ArrayRef< OpenPath > > aig.LongestPathAnalysis::Impl::computeLocalPaths | ( | Value | value, |
size_t | bitPos | ||
) |
Compute local open paths to (value, bitPos).
Definition at line 1860 of file LongestPathAnalysis.cpp.
References assert(), aig.LongestPathAnalysis::Impl::computeLocalPaths(), Context::getLocalVisitorMutable(), LocalVisitor::getOrComputePaths(), and Context::localVisitors.
Referenced by aig.LongestPathAnalysis::Impl::computeLocalPaths().
FailureOr< int64_t > aig.LongestPathAnalysis::Impl::getAverageMaxDelay | ( | Value | value | ) |
Return average of per-bit max delays for a value.
Definition at line 1813 of file LongestPathAnalysis.cpp.
References aig.LongestPathAnalysis::Impl::getAverageMaxDelay(), circt::hw::getBitWidth(), and getMaxDelayInPaths().
Referenced by aig.LongestPathAnalysis::Impl::getAverageMaxDelay().
FailureOr< int64_t > aig.LongestPathAnalysis::Impl::getMaxDelay | ( | Value | value, |
int64_t | bitPos | ||
) |
Return the max delay for a value.
Definition at line 1832 of file LongestPathAnalysis.cpp.
References circt::hw::getBitWidth(), aig.LongestPathAnalysis::Impl::getMaxDelay(), and getMaxDelayInPaths().
Referenced by aig.LongestPathAnalysis::Impl::getMaxDelay().
|
inline |
Top modules inferred or specified for this analysis run.
Definition at line 1524 of file LongestPathAnalysis.cpp.
References aig.LongestPathAnalysis::Impl::topModules.
LogicalResult aig.LongestPathAnalysis::Impl::initializeAndRun | ( | hw::HWModuleOp | module | ) |
Initialize and run analysis for a single HW module (local scope).
Definition at line 1726 of file LongestPathAnalysis.cpp.
References assert(), aig.LongestPathAnalysis::Impl::initializeAndRun(), and Context::localVisitors.
LogicalResult aig.LongestPathAnalysis::Impl::initializeAndRun | ( | mlir::ModuleOp | module | ) |
Initialize and run analysis for a full MLIR module (hierarchical).
Definition at line 1736 of file LongestPathAnalysis.cpp.
References assert(), aig.LongestPathAnalysis::Impl::initializeAndRun(), Context::instanceGraph, Context::localVisitors, and circt::igraph::InstanceGraph::lookup().
Referenced by aig.LongestPathAnalysis::Impl::Impl(), aig.LongestPathAnalysis::Impl::initializeAndRun(), and aig.LongestPathAnalysis::Impl::initializeAndRun().
bool aig.LongestPathAnalysis::Impl::isAnalysisAvailable | ( | StringAttr | moduleName | ) | const |
Return true if we have a LocalVisitor for the given HW module.
Definition at line 1805 of file LongestPathAnalysis.cpp.
References aig.LongestPathAnalysis::Impl::isAnalysisAvailable(), and Context::localVisitors.
Referenced by aig.LongestPathAnalysis::Impl::isAnalysisAvailable().
|
friend |
Definition at line 1536 of file LongestPathAnalysis.cpp.
|
private |
Analysis context.
Definition at line 1545 of file LongestPathAnalysis.cpp.
|
private |
Top-level HW modules that seed hierarchical analysis.
Definition at line 1547 of file LongestPathAnalysis.cpp.
Referenced by aig.LongestPathAnalysis::Impl::getTopModules().