Skip to content

[AIG] Add LongestPathAnalysis implementation #8529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion include/circt/Dialect/AIG/Analysis/LongestPathAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,20 @@ class DataflowPath {

void print(llvm::raw_ostream &os);
void setDelay(int64_t delay) { path.delay = delay; }
const llvm::ImmutableList<DebugPoint> &getHistory() const {
return path.history;
}

private:
Object fanOut;
OpenPath path;
hw::HWModuleOp root;
};

struct LongestPathAnalysisOption {
bool traceDebugPoints = false;
};

// This analysis finds the longest paths in the dataflow graph across modules.
// Also be aware of the lifetime of the analysis, the results would be
// invalid if the IR is modified. Currently there is no way to efficiently
Expand All @@ -122,7 +129,8 @@ class DataflowPath {
class LongestPathAnalysis {
public:
// Entry points for analysis.
LongestPathAnalysis(Operation *moduleOp, mlir::AnalysisManager &am);
LongestPathAnalysis(Operation *moduleOp, mlir::AnalysisManager &am,
const LongestPathAnalysisOption &option = {});
~LongestPathAnalysis();

// Return all longest paths to each Fanin for the given value and bit
Expand Down
Loading