Skip to content

Fix branch predictor performance counter reporting - #1917

Open
davidharrishmc wants to merge 1 commit into
openhwfoundation:mainfrom
davidharrishmc:dh/parsehpmc-fix
Open

davidharrishmc wants to merge 1 commit into
openhwfoundation:mainfrom
davidharrishmc:dh/parsehpmc-fix

Conversation

@davidharrishmc

Copy link
Copy Markdown
Contributor

Fixes #1379.

The testbench logger read the hpmcounters, which count only events that software enables in mhpmevent. Embench never enables them, so every counter above minstret reported 0 and parseHPMC.py divided by zero. The logger now counts the csrc counter events directly.

parseHPMC.py fixes:

  • Keep the speed- and size-optimized builds of each benchmark separate. Both were filed under one name, so per-benchmark tables and bar graphs mixed results from different predictors.
  • Exclude zero values from the geometric mean's count as well as its product.
  • Fix swapped entries/size columns in --table output.
  • Label the summary graph's y axis by the metric shown.
  • Regenerate the sim_bp reference data from the current embench build.

With these changes, the per-benchmark branch counts match the BPRED_LOGGER trace exactly. Wally's twobit and gshare mean misprediction rates track sim_bp at 64, 1K, and 64K entries (e.g. gshare 12.06/6.64/2.81% vs. 11.76/6.30/1.98%). The parsing script was at fault; the branch predictor was not.

🤖 Generated with Claude Code

…1379)

The testbench logger read the hpmcounters, which count only events that
software enables in mhpmevent. Embench never enables them, so every
counter above minstret reported 0 and parseHPMC.py divided by zero. The
logger now counts the csrc counter events directly.

parseHPMC.py fixes:
- Keep the speed- and size-optimized builds of each benchmark separate.
  They were filed under one name, so per-benchmark tables and bar graphs
  mixed results from different predictors.
- Exclude zero values from the geometric mean's count as well as its
  product.
- Fix swapped entries/size columns in --table output.
- Label the summary graph's y axis by the metric shown.
- Regenerate the sim_bp reference data from the current embench build.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ParseHPMC.py giving incorrect results

1 participant