Commit a738234
committed
[AIG] Refactor AIG longest-path analysis with lazy mode and max-delay filtering.
Introduce LongestPathAnalysisOption with collectDebugInfo, lazyComputation, and keepOnlyMaxDelayPaths, replacing traceDebugPoints/incremental.
Add path filtering that deduplicates by fan-in and, when enabled, keeps only max-delay paths (with special handling for module inputs); apply in local and global scopes.
Rename and clarify APIs: getResults → computeGlobalPaths; getOrComputeResults/getResults → getOrComputePaths/getCachedPaths. getMaxDelay/getAverageMaxDelay now return FailureOr<int64_t> and support per-bit or all-bits queries.
Update IncrementalLongestPathAnalysis: defaults to lazyComputation=true and keepOnlyMaxDelayPaths=true; add options-based constructor.
Rework OperationAnalyzer to use its own analysis Context (lazy=true, keepOnlyMaxDelayPaths=false) for precise dependency discovery; rename getResults → analyzeOperation; cache by op signature.
Extend C API: new constructor flags; add getPaths(value, bitPos, elaborate) and collection merge. Extend Python bindings: expose new constructor options; add get_paths and LongestPathCollection.merge; update integration test.
Adjust DatapathToComb lowering to use analysis->getMaxDelay(...). Improve visitor concurrency: use getLocalVisitorMutable and wait only when running in parallel.
Breaking changes: C API constructor signature changed; LongestPathAnalysisWithTrace removed. Several C++ methods renamed and now return FailureOr. Python API constructor and new methods added; call sites may need updates.
This enables faster on-demand timing analysis, optional memory/time savings via max-delay filtering, and more flexible C/Python entry points.1 parent dc21c22 commit a738234
File tree
13 files changed
+546
-227
lines changed- include
- circt-c/Dialect
- circt/Dialect/AIG/Analysis
- integration_test/Bindings/Python/dialects
- lib
- Bindings/Python
- dialects
- CAPI/Dialect
- Conversion/DatapathToComb
- Dialect/AIG/Analysis
- test
- CAPI
- circt-synth
- unittests/Dialect/AIG
13 files changed
+546
-227
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
| |||
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
82 | 91 | | |
83 | 92 | | |
84 | 93 | | |
| |||
Lines changed: 64 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
176 | 188 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
183 | 213 | | |
184 | 214 | | |
185 | 215 | | |
| |||
197 | 227 | | |
198 | 228 | | |
199 | 229 | | |
200 | | - | |
201 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
202 | 236 | | |
203 | | - | |
204 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
205 | 240 | | |
206 | 241 | | |
207 | 242 | | |
208 | 243 | | |
209 | 244 | | |
210 | | - | |
| 245 | + | |
211 | 246 | | |
212 | 247 | | |
213 | 248 | | |
| |||
264 | 299 | | |
265 | 300 | | |
266 | 301 | | |
| 302 | + | |
267 | 303 | | |
268 | 304 | | |
269 | 305 | | |
| |||
272 | 308 | | |
273 | 309 | | |
274 | 310 | | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
280 | 322 | | |
281 | | - | |
282 | | - | |
| 323 | + | |
| 324 | + | |
283 | 325 | | |
284 | 326 | | |
285 | 327 | | |
| |||
288 | 330 | | |
289 | 331 | | |
290 | 332 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | 333 | | |
303 | 334 | | |
304 | 335 | | |
| |||
316 | 347 | | |
317 | 348 | | |
318 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
319 | 353 | | |
320 | 354 | | |
321 | 355 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
44 | 61 | | |
45 | 62 | | |
46 | 63 | | |
| |||
71 | 88 | | |
72 | 89 | | |
73 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
74 | 95 | | |
75 | 96 | | |
76 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
324 | 334 | | |
325 | 335 | | |
326 | 336 | | |
| |||
337 | 347 | | |
338 | 348 | | |
339 | 349 | | |
340 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
341 | 355 | | |
342 | 356 | | |
343 | 357 | | |
344 | 358 | | |
345 | | - | |
346 | | - | |
347 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
348 | 364 | | |
349 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
350 | 385 | | |
351 | 386 | | |
352 | 387 | | |
353 | 388 | | |
354 | 389 | | |
355 | | - | |
| 390 | + | |
| 391 | + | |
356 | 392 | | |
357 | 393 | | |
358 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
95 | 111 | | |
96 | 112 | | |
97 | 113 | | |
| |||
136 | 152 | | |
137 | 153 | | |
138 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
139 | 162 | | |
140 | 163 | | |
141 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
0 commit comments