Commit 9599839
committed
feat(pipeline): per-type stall counters, branch accuracy, speculative Gantt, FU stall fix
Four improvements to the pipeline simulator:
1. Per-type stall breakdown — stall_by_type[5] tracks RAW, Load-Use, Branch,
FU, and MemLatency stall cycles separately. The Execution panel now shows a
second stats line: "Stalls — RAW:N Load-Use:N Branch:N FU:N Mem:N".
2. Branch prediction accuracy — branches_executed counter added; the stats
panel now shows "branches:N mispred:N (X%)" so misprediction rate is
immediately visible.
3. Speculative Gantt cells — instructions fetched while a branch is unresolved
now show in orange in the timing diagram (GanttCell::Speculative) instead of
the same color as committed instructions. Flushed speculative instructions
still show ◀FL.
4. FU stall not counted — FunctionalUnits mode stalls were never incremented
in stall_count; fixed by adding the increment to the FU early-return path.
Also cleaned up the outdated FMA "WORKAROUND" comments in stage_ex.1 parent 07f28a6 commit 9599839
4 files changed
Lines changed: 92 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
351 | 354 | | |
352 | 355 | | |
353 | 356 | | |
| |||
359 | 362 | | |
360 | 363 | | |
361 | 364 | | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
362 | 378 | | |
363 | 379 | | |
364 | 380 | | |
| |||
540 | 556 | | |
541 | 557 | | |
542 | 558 | | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
548 | 565 | | |
549 | 566 | | |
550 | 567 | | |
| |||
746 | 763 | | |
747 | 764 | | |
748 | 765 | | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
749 | 769 | | |
| 770 | + | |
| 771 | + | |
750 | 772 | | |
751 | 773 | | |
752 | 774 | | |
| |||
802 | 824 | | |
803 | 825 | | |
804 | 826 | | |
| 827 | + | |
805 | 828 | | |
| 829 | + | |
806 | 830 | | |
807 | 831 | | |
808 | 832 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
434 | 437 | | |
435 | 438 | | |
436 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
437 | 443 | | |
438 | 444 | | |
439 | 445 | | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | 446 | | |
449 | 447 | | |
450 | 448 | | |
| |||
1481 | 1479 | | |
1482 | 1480 | | |
1483 | 1481 | | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
1484 | 1485 | | |
1485 | 1486 | | |
1486 | 1487 | | |
| |||
2087 | 2088 | | |
2088 | 2089 | | |
2089 | 2090 | | |
| 2091 | + | |
| 2092 | + | |
2090 | 2093 | | |
2091 | 2094 | | |
2092 | 2095 | | |
| |||
2145 | 2148 | | |
2146 | 2149 | | |
2147 | 2150 | | |
| 2151 | + | |
2148 | 2152 | | |
2149 | 2153 | | |
2150 | 2154 | | |
| |||
2303 | 2307 | | |
2304 | 2308 | | |
2305 | 2309 | | |
| 2310 | + | |
2306 | 2311 | | |
2307 | 2312 | | |
2308 | 2313 | | |
| |||
2317 | 2322 | | |
2318 | 2323 | | |
2319 | 2324 | | |
2320 | | - | |
2321 | | - | |
2322 | | - | |
2323 | | - | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
2324 | 2335 | | |
2325 | | - | |
| 2336 | + | |
2326 | 2337 | | |
2327 | | - | |
2328 | | - | |
| 2338 | + | |
2329 | 2339 | | |
2330 | 2340 | | |
2331 | 2341 | | |
| |||
2340 | 2350 | | |
2341 | 2351 | | |
2342 | 2352 | | |
2343 | | - | |
2344 | | - | |
2345 | | - | |
2346 | | - | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
2347 | 2356 | | |
2348 | 2357 | | |
2349 | 2358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
941 | 941 | | |
942 | 942 | | |
943 | 943 | | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
944 | 947 | | |
945 | 948 | | |
946 | 949 | | |
947 | 950 | | |
948 | 951 | | |
949 | 952 | | |
950 | 953 | | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
951 | 959 | | |
952 | 960 | | |
953 | 961 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
179 | 191 | | |
180 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
181 | 196 | | |
182 | 197 | | |
183 | 198 | | |
| 199 | + | |
184 | 200 | | |
185 | 201 | | |
186 | 202 | | |
| |||
189 | 205 | | |
190 | 206 | | |
191 | 207 | | |
192 | | - | |
| 208 | + | |
193 | 209 | | |
194 | 210 | | |
195 | 211 | | |
| |||
0 commit comments