cpu-o3: Refactor numWays to support per-table configuration#793
cpu-o3: Refactor numWays to support per-table configuration#793
Conversation
📝 WalkthroughWalkthroughThe BTBTAGE branch predictor is refactored to support per-table numbers of ways instead of a global value, and enhanced with final provider tracking to record whether predictions originate from the base predictor or specific TAGE tables. Configuration parameters are made explicit in Python declarations. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present. |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/cpu/pred/BranchPredictor.py (2)
1047-1050: Minor formatting inconsistency in list literals.Line 1048 has
2048,2048]missing a space before the last element, while other list literals in this file use consistent spacing.🧹 Suggested formatting fix
tableSizes = VectorParam.Unsigned( - [2048, 2048, 2048, 2048, 2048, 2048, 2048,2048], + [2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048], "the TAGE T0~Tn length")🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/cpu/pred/BranchPredictor.py` around lines 1047 - 1050, The list literal for tableSizes has a minor spacing inconsistency; update the VectorParam.Unsigned call that defines tableSizes so the last two elements are separated with a space (change "...,2048]" to "..., 2048]") to match the file's list formatting style; verify the related VectorParam.Unsigned for TTagBitSizes remains unchanged and consistent.
1054-1056: Same formatting inconsistency in histLengths.Line 1055 has
211,397]missing a space before the last element.🧹 Suggested formatting fix
histLengths = VectorParam.Unsigned( - [4, 9, 17, 29, 56, 109, 211,397], + [4, 9, 17, 29, 56, 109, 211, 397], "the BTB TAGE T0~Tn history length")🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/cpu/pred/BranchPredictor.py` around lines 1054 - 1056, The histLengths VectorParam.Unsigned list in BranchPredictor.py contains a formatting inconsistency ("211,397") — update the histLengths definition (the VectorParam.Unsigned call) so there is a space after the comma between 211 and 397 (i.e., "211, 397") to match the surrounding formatting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/cpu/pred/BranchPredictor.py`:
- Around line 1047-1050: The list literal for tableSizes has a minor spacing
inconsistency; update the VectorParam.Unsigned call that defines tableSizes so
the last two elements are separated with a space (change "...,2048]" to "...,
2048]") to match the file's list formatting style; verify the related
VectorParam.Unsigned for TTagBitSizes remains unchanged and consistent.
- Around line 1054-1056: The histLengths VectorParam.Unsigned list in
BranchPredictor.py contains a formatting inconsistency ("211,397") — update the
histLengths definition (the VectorParam.Unsigned call) so there is a space after
the comma between 211 and 397 (i.e., "211, 397") to match the surrounding
formatting.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 20cc153f-4d0a-43c3-a800-425d32be70f6
📒 Files selected for processing (4)
src/cpu/pred/BranchPredictor.pysrc/cpu/pred/btb/btb_tage.ccsrc/cpu/pred/btb/btb_tage.hhsrc/cpu/pred/btb/test/btb_tage.test.cc
|
[Generated by GEM5 Performance Robot] Align BTB PerformanceOverall Score
|
1 similar comment
|
[Generated by GEM5 Performance Robot] Align BTB PerformanceOverall Score
|
* Reapply "cpu-o3: Refactor numWays to support per-table configuration (#793)" (#795) This reverts commit 6b87b99. * cpu-o3: Update numWays references to support per-table Change-Id: Ieda3140c914857d771b53248b3670a2d97cef87c * cpu-o3: Enhance update logic for new BTB entries without prediction metadata --------- Co-authored-by: Cao Jiaming <caojiaming@bosc.ac.cn>
Summary by CodeRabbit