Add execution-driven CPI attribution framework#294
Open
sagar-h007 wants to merge 3 commits intoriscv-software-src:masterfrom
Open
Add execution-driven CPI attribution framework#294sagar-h007 wants to merge 3 commits intoriscv-software-src:masterfrom
sagar-h007 wants to merge 3 commits intoriscv-software-src:masterfrom
Conversation
klingaard
requested changes
Feb 8, 2026
klingaard
reviewed
Feb 8, 2026
klingaard
reviewed
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR is about
This PR adds a CPI (Cycles Per Instruction) attribution framework to Olympia so it’s easier to understand where execution time is actually being spent in the pipeline.
Until now, we had IPC and a few aggregate stall counters, but no clear way to tie stalls back to retiring instructions. This change fills that gap by tracking CPI at the instruction level and aggregating it at retirement.
⸻
What’s included
⸻
How it works (high level)
Each pipeline stage records when an instruction enters it.
When the instruction retires, CPI components are computed as differences between these timestamps and accumulated into ROB counters.
This keeps the implementation simple, execution-driven, and easy to extend.
⸻
Design notes
⸻
Why this is useful
This makes it possible to answer questions like:
⸻
Scope
⸻
Fixes: #293
If this direction looks good, I’m happy to iterate on naming, attribution granularity, or validation strategy based on feedback.