@@ -90,15 +90,15 @@ struct DebugPoint {
90
90
StringRef comment;
91
91
};
92
92
93
- // An OpenPath represents a path from a fan-in with an associated
93
+ // An OpenPath represents a path from a start point with an associated
94
94
// delay and history of debug points.
95
95
struct OpenPath {
96
96
OpenPath (circt::igraph::InstancePath path, Value value, size_t bitPos,
97
97
int64_t delay = 0 , llvm::ImmutableList<DebugPoint> history = {})
98
- : fanIn (path, value, bitPos), delay(delay), history(history) {}
98
+ : startPoint (path, value, bitPos), delay(delay), history(history) {}
99
99
OpenPath () = default ;
100
100
101
- const Object &getFanIn () const { return fanIn ; }
101
+ const Object &getStartPoint () const { return startPoint ; }
102
102
int64_t getDelay () const { return delay; }
103
103
const llvm::ImmutableList<DebugPoint> &getHistory () const { return history; }
104
104
@@ -108,54 +108,56 @@ struct OpenPath {
108
108
llvm::ImmutableListFactory<DebugPoint> *debugPointFactory,
109
109
circt::igraph::InstancePath path);
110
110
111
- Object fanIn ;
111
+ Object startPoint ;
112
112
int64_t delay;
113
113
// History of debug points represented by linked lists.
114
- // The head of the list is the farthest point from the fanIn .
114
+ // The head of the list is the farthest point from the start point .
115
115
llvm::ImmutableList<DebugPoint> history;
116
116
};
117
117
118
- // A DataflowPath represents a complete timing path from a fanout to a fanin
119
- // with associated delay information. This is the primary result type for
120
- // longest path analysis, containing both endpoints and path history.
118
+ // A DataflowPath represents a complete timing path from a end point to a
119
+ // start point with associated delay information. This is the primary result
120
+ // type for longest path analysis, containing both end points and path history.
121
121
class DataflowPath {
122
122
public:
123
- // FanOut can be either an internal circuit object or a module output port
123
+ // end point can be either an internal circuit object or a module output port
124
124
// This flexibility allows representing both closed paths
125
125
// (register-to-register) and open paths (register-to-output) in a unified way
126
126
using OutputPort = std::tuple<hw::HWModuleOp, size_t , size_t >;
127
- using FanOutType = std::variant<Object, OutputPort>;
127
+ using EndPointType = std::variant<Object, OutputPort>;
128
128
129
- // Constructor for paths with Object fanout (internal circuit nodes)
130
- DataflowPath (Object fanOut , OpenPath fanIn , hw::HWModuleOp root)
131
- : fanOut(fanOut ), path(fanIn ), root(root) {}
129
+ // Constructor for paths with Object end point (internal circuit nodes)
130
+ DataflowPath (Object endPoint , OpenPath startPoint , hw::HWModuleOp root)
131
+ : endPoint(endPoint ), path(startPoint ), root(root) {}
132
132
133
- // Constructor for paths with port fanout (module output ports)
134
- DataflowPath (OutputPort fanOut , OpenPath fanIn , hw::HWModuleOp root)
135
- : fanOut(fanOut ), path(fanIn ), root(root) {}
133
+ // Constructor for paths with port end point (module output ports)
134
+ DataflowPath (OutputPort endPoint , OpenPath startPoint , hw::HWModuleOp root)
135
+ : endPoint(endPoint ), path(startPoint ), root(root) {}
136
136
137
137
DataflowPath () = default ;
138
138
139
139
int64_t getDelay () const { return path.delay ; }
140
- const Object &getFanIn () const { return path.fanIn ; }
141
- const FanOutType &getFanOut () const { return fanOut; }
142
- const Object &getFanOutAsObject () const { return std::get<Object>(fanOut); }
143
- const OutputPort &getFanOutAsPort () const {
144
- return std::get<OutputPort>(fanOut);
140
+ const Object &getStartPoint () const { return path.startPoint ; }
141
+ const EndPointType &getEndPoint () const { return endPoint; }
142
+ const Object &getEndPointAsObject () const {
143
+ return std::get<Object>(endPoint);
144
+ }
145
+ const OutputPort &getEndPointAsPort () const {
146
+ return std::get<OutputPort>(endPoint);
145
147
}
146
148
hw::HWModuleOp getRoot () const { return root; }
147
149
const llvm::ImmutableList<DebugPoint> &getHistory () const {
148
150
return path.history ;
149
151
}
150
152
const OpenPath &getPath () const { return path; }
151
153
152
- // Get source location for the fanout point (for diagnostics)
153
- Location getFanOutLoc ();
154
+ // Get source location for the end point (for diagnostics)
155
+ Location getEndPointLoc ();
154
156
155
157
void setDelay (int64_t delay) { path.delay = delay; }
156
158
157
159
void print (llvm::raw_ostream &os);
158
- void printFanOut (llvm::raw_ostream &os);
160
+ void printEndPoint (llvm::raw_ostream &os);
159
161
160
162
// Path elaboration for hierarchical analysis
161
163
// Prepends instance path information to create full hierarchical paths
@@ -165,9 +167,9 @@ class DataflowPath {
165
167
circt::igraph::InstancePath path);
166
168
167
169
private:
168
- FanOutType fanOut; // Either Object or (port_index, bit_index)
169
- OpenPath path; // The actual timing path with history
170
- hw::HWModuleOp root; // Root module for this path
170
+ EndPointType endPoint; // Either Object or (port_index, bit_index)
171
+ OpenPath path; // The actual timing path with history
172
+ hw::HWModuleOp root; // Root module for this path
171
173
};
172
174
173
175
// JSON serialization for DataflowPath
@@ -198,7 +200,7 @@ struct LongestPathAnalysisOptions {
198
200
// / are queried. Disables parallel processing.
199
201
bool lazyComputation = false ;
200
202
201
- // / Keep only the maximum delay path per fanout point.
203
+ // / Keep only the maximum delay path per end point.
202
204
// / Focuses on finding maximum delays, discarding non-critical paths.
203
205
// / Significantly faster and uses less memory when only delay bounds
204
206
// / are needed rather than complete path enumeration.
@@ -225,7 +227,7 @@ class LongestPathAnalysis {
225
227
const LongestPathAnalysisOptions &option = {});
226
228
~LongestPathAnalysis ();
227
229
228
- // Return all longest paths to each Fanin for the given value and bit
230
+ // Return all longest paths to each start point for the given value and bit
229
231
// position.
230
232
LogicalResult computeGlobalPaths (Value value, size_t bitPos,
231
233
SmallVectorImpl<DataflowPath> &results);
@@ -248,7 +250,7 @@ class LongestPathAnalysis {
248
250
// typically register-to-register paths. A closed path is a path that starts
249
251
// and ends at sequential elements (registers/flip-flops), forming a complete
250
252
// timing path through combinational logic. The path may cross module
251
- // boundaries but both endpoints are sequential elements, not ports.
253
+ // boundaries but both end points are sequential elements, not ports.
252
254
LogicalResult getClosedPaths (StringAttr moduleName,
253
255
SmallVectorImpl<DataflowPath> &results,
254
256
bool elaboratePaths = false ) const ;
@@ -344,8 +346,8 @@ class LongestPathCollection {
344
346
// Sort the paths by delay in descending order.
345
347
void sortInDescendingOrder ();
346
348
347
- // Sort and drop all paths except the longest path per fanout point.
348
- void sortAndDropNonCriticalPathsPerFanOut ();
349
+ // Sort and drop all paths except the longest path per end point.
350
+ void sortAndDropNonCriticalPathsPerEndPoint ();
349
351
350
352
// Merge another collection into this one.
351
353
void merge (const LongestPathCollection &other);
0 commit comments