Skip to content

Btb tage rtl useful sticky align#801

Open
jensen-yan wants to merge 11 commits intoxs-devfrom
btb-tage-rtl-useful-sticky-align
Open

Btb tage rtl useful sticky align#801
jensen-yan wants to merge 11 commits intoxs-devfrom
btb-tage-rtl-useful-sticky-align

Conversation

@jensen-yan
Copy link
Collaborator

@jensen-yan jensen-yan commented Mar 18, 2026

Summary by CodeRabbit

  • Improvements

    • RTL-aligned allocation policy: prefer invalid → weak-not-useful → strong-not-useful.
    • Usefulness moved to a small saturating counter with explicit increase/reset and at-most-one allocation per fetch block.
    • Tidied allocation tracing and debug log formatting.
  • Tests

    • Unit tests updated for counter-based usefulness, allocation gating, and new replacement behaviors.
  • Statistics

    • New allocation-related counters tracking probe outcomes and chosen candidate categories.
  • Documentation

    • Updated CI guidance and new alignment/process docs for RTL↔gem5 TAGE comparisons.

Change-Id: Id1b9d9e656ce068f27a04ec885344c5f325019d6
Change-Id: Id8ab7df0c0755c1a6d0b3069de9fa3f62c6a9687
Change-Id: I529d8a3c3ad50b95e5af19c0b16132c1173adabc
Change-Id: I375511ae4f9d7238e4baba61ed62bc55a7400526
@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Reworks BTB TAGE allocation and usefulness semantics: converts the useful flag to a small counter with helper APIs, aligns allocation priority to invalid → weak-not-useful → any-not-useful, consolidates allocation flow and stats, updates microTAGE allocation and tests, and adds allocation-related telemetry and docs.

Changes

Cohort / File(s) Summary
Core TAGE header & impl
src/cpu/pred/btb/btb_tage.hh, src/cpu/pred/btb/btb_tage.cc
Converted useful to a counter and added helpers usefulCtrIsSaturateNegative, usefulCtrIncrease, usefulCtrReset. Removed updateAllocFailureNoValidTable. Added allocation-related stats and adjusted debug logging and useful-reset semantics.
MicroTAGE allocation
src/cpu/pred/btb/microtage.cc
Replaced two-phase allocation with RTL-style priority: prefer invalid, then weak-not-useful, then any-not-useful. Consolidated selection into a single selected-way write path and unified bookkeeping and stat updates.
Tests
src/cpu/pred/btb/test/btb_tage.test.cc
Updated helpers to use uint8_t useful (0/1/3) instead of bool; tightened assertions and added tests for allocation/aging and replacement of strong-not-useful entries; adjusted stat expectations to new counters.
Docs & CI guidance
.codex/skills/ci-perf-analysis/SKILL.md, .codex/skills/rtl-tage-alignment/SKILL.md, docs/progress/TAGE-align.md, .github/workflows/gem5-ideal-btb-0.3c.yml
Added RTL-alignment guidance and CI slice guidance (--slice gcc12) and updated workflow benchmark_type to gcc15-spec06-0.3c. Added a TAGE alignment progress doc.
Logging / Telemetry
multiple src/cpu/pred/btb/... files
Added new allocation probe/failure stats: allocProbeNoEligibleVictim, allocBucketHasInvalid, allocBucketHasWeakNotUseful, allocBucketHasStrongNotUsefulButNoWeakNotUseful, allocBucketAllUsefulOrNoCandidate; adjusted stat updates and DPRINTF formatting.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

perf, align-kmhv3

Suggested Reviewers

  • CJ362ff
  • tastynoob
  • Yakkhini

Poem

🐰 I swapped one bit for a hopping score,
Counters nibble where flags did before,
I seek an empty burrow first,
Then gentle-hop the slightly worse,
Tails up — allocation lore!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Btb tage rtl useful sticky align' is vague and uses abbreviated/technical jargon without context, making it unclear what the main change is to someone unfamiliar with the codebase. Replace with a more descriptive title that clearly explains the primary change, such as 'Align BTB TAGE useful-bit semantics with RTL implementation' or 'Fix BTB TAGE allocation and useful-bit update logic for RTL alignment'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch btb-tage-rtl-useful-sticky-align
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d3ba69ccd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

usefulResetCnt++;
}

usefulResetCnt++;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate useful-reset counter on actual table probes

Incrementing usefulResetCnt unconditionally here means mispredictions whose provider is already in the longest-history table (start_table == numPredictors) still advance the global reset counter even though no allocation set is probed. After enough such events, the code resets usefulness for all entries spuriously, which can destabilize trained entries in unrelated tables and skew long-running performance results. The counter should only advance when at least one candidate table was examined and no victim was found.

Useful? React with 👍 / 👎.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/cpu/pred/btb/microtage.cc (2)

551-556: Potential asymmetry in usefulResetCnt update.

On successful allocation (line 551), the counter is decremented:

usefulResetCnt = usefulResetCnt <= 0 ? 0 : usefulResetCnt - 1;

On allocation failure (line 556), the counter is incremented:

usefulResetCnt++;

However, in btb_tage.cc (line 622), the counter is only incremented after all tables have been tried (outside the loop), and there's no decrement on success.

This behavioral difference means microtage will reset useful bits less frequently than btb_tage under similar allocation patterns. Please verify this asymmetry is intentional.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/cpu/pred/btb/microtage.cc` around lines 551 - 556, The update of
usefulResetCnt is asymmetric: in microtage.cc you decrement usefulResetCnt on a
successful allocation and increment it immediately on any allocation failure
(usefulResetCnt = usefulResetCnt <= 0 ? 0 : usefulResetCnt - 1; and
usefulResetCnt++ where tageStats.updateAllocFailure++), whereas btb_tage.cc only
increments that counter after all tables have been tried; decide which policy is
correct and make them consistent — either move the increment in microtage.cc to
the same post-loop spot (so usefulResetCnt++ occurs only after all tables fail)
or add a corresponding decrement in btb_tage.cc on success; update the code
paths around usefulResetCnt, the allocation success branch and the
tageStats.updateAllocFailure increment so both implementations follow the same
semantics.

564-568: Type inconsistency: using false for useful reset.

Line 566 assigns way.useful = false, which works because microtage's TageEntry.useful is still bool. However, this differs from btb_tage.cc which uses usefulCtrReset(way) to set useful = usefulCtrInit (uint8_t 0).

If microtage is intended to eventually migrate to the 2-bit counter semantics like btb_tage, consider:

  1. Using way.useful = 0 instead of way.useful = false for forward compatibility
  2. Or keeping as-is if microtage intentionally uses different useful semantics
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/cpu/pred/btb/microtage.cc` around lines 564 - 568, The loop currently
resets useful with a boolean (way.useful = false) which is inconsistent with
btb_tage's 2-bit counter semantics; change the reset to use the same
representation by assigning the integer zero (way.useful = 0) or call the
existing helper usefulCtrReset(way) so useful is initialized to usefulCtrInit
(uint8_t 0) — update the loop that iterates over table and way to use way.useful
= 0 or usefulCtrReset(way) to match btb_tage semantics.
🤖 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/btb/microtage.cc`:
- Around line 551-556: The update of usefulResetCnt is asymmetric: in
microtage.cc you decrement usefulResetCnt on a successful allocation and
increment it immediately on any allocation failure (usefulResetCnt =
usefulResetCnt <= 0 ? 0 : usefulResetCnt - 1; and usefulResetCnt++ where
tageStats.updateAllocFailure++), whereas btb_tage.cc only increments that
counter after all tables have been tried; decide which policy is correct and
make them consistent — either move the increment in microtage.cc to the same
post-loop spot (so usefulResetCnt++ occurs only after all tables fail) or add a
corresponding decrement in btb_tage.cc on success; update the code paths around
usefulResetCnt, the allocation success branch and the
tageStats.updateAllocFailure increment so both implementations follow the same
semantics.
- Around line 564-568: The loop currently resets useful with a boolean
(way.useful = false) which is inconsistent with btb_tage's 2-bit counter
semantics; change the reset to use the same representation by assigning the
integer zero (way.useful = 0) or call the existing helper usefulCtrReset(way) so
useful is initialized to usefulCtrInit (uint8_t 0) — update the loop that
iterates over table and way to use way.useful = 0 or usefulCtrReset(way) to
match btb_tage semantics.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 97e25ad5-5748-42c3-8016-7003ff53b07c

📥 Commits

Reviewing files that changed from the base of the PR and between 6b87b99 and 6d3ba69.

📒 Files selected for processing (4)
  • src/cpu/pred/btb/btb_tage.cc
  • src/cpu/pred/btb/btb_tage.hh
  • src/cpu/pred/btb/microtage.cc
  • src/cpu/pred/btb/test/btb_tage.test.cc

Change-Id: I2f26d847bf2978d83b7a3a1cc63ee887184e4fd2
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/cpu/pred/btb/btb_tage.cc (1)

573-624: Consider the allocation probe counting logic.

The allocProbeNoEligibleVictim stat is incremented inside the loop (line 624) for each table that has no eligible victim, but then also used to track "no allocation found" scenarios. However, when a successful allocation occurs, the function returns early (line 621), so the counter tracks per-table failures correctly.

One observation: when all ways in a table have useful > 0, the stat allocBucketAllUsefulOrNoCandidate is incremented (line 609), but then allocProbeNoEligibleVictim is also incremented (line 624). This double-counting might make the stats harder to interpret.

📊 Consider restructuring stats for clearer semantics

The current flow increments both allocBucketAllUsefulOrNoCandidate and allocProbeNoEligibleVictim when no victim is found. If these are meant to be mutually exclusive categories, consider:

         } else {
             tageStats.allocBucketAllUsefulOrNoCandidate++;
         }

         if (selected_way != -1) {
             // ... allocation success ...
             return true;
         }
-
-        tageStats.allocProbeNoEligibleVictim++;
     }
+
+    // Only count probes with no eligible victim after exhausting all tables
+    tageStats.allocProbeNoEligibleVictim++;

However, if the intent is to count per-table failures, the current logic is correct. A comment clarifying the semantic would help.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/cpu/pred/btb/btb_tage.cc` around lines 573 - 624, The per-table path
increments both tageStats.allocBucketAllUsefulOrNoCandidate and then later
tageStats.allocProbeNoEligibleVictim, causing double-counting when a table has
no eligible victim; change the logic so these are mutually exclusive by removing
the per-table increment of allocProbeNoEligibleVictim and only incrementing
allocProbeNoEligibleVictim once when the overall probe fails (i.e., after the
loop when selected_way == -1 and no allocation occurred), or alternatively stop
incrementing allocBucketAllUsefulOrNoCandidate and keep
allocProbeNoEligibleVictim per-table—update the code around the selected_way
decision (references: selected_way, allocBucketAllUsefulOrNoCandidate,
allocProbeNoEligibleVictim, allocated_table/allocated_index and the early return
true) to ensure only one counter is incremented for a table with no victim.
src/cpu/pred/btb/test/btb_tage.test.cc (1)

440-450: Verify the expected allocation behavior when provider is at highest table.

The test expects both updateAllocFailure and updateAllocSuccess to be 0 when the provider is at the highest table. This aligns with the RTL-gating logic at lines 523-526 of btb_tage.cc that suppresses allocation. However, the comment and assertion messages could be slightly clearer.

📝 Consider clarifying the test comment
-    // Update the predictor. With RTL-aligned highest-table gating, this should
-    // not even start allocation when the provider already comes from the
-    // highest table.
+    // Update the predictor. With RTL-aligned highest-table gating, allocation
+    // is completely suppressed when the provider already comes from the
+    // highest table (no allocation attempt is made, hence no success or failure).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/cpu/pred/btb/test/btb_tage.test.cc` around lines 440 - 450, The test
verifies that calling tage->update(stream) when the provider is from the highest
table does not trigger allocation; update the inline comment and the EXPECT_EQ
assertion messages to be more explicit about why both
tage->tageStats.updateAllocFailure and tage->tageStats.updateAllocSuccess should
remain zero (e.g., mention "RTL-aligned highest-table gating suppresses any
allocation attempt or failure when provider originates from highest table"), and
ensure the comment sits immediately above the tage->update(stream) call so
readers can easily correlate the behavior with the expectations.
🤖 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/btb/btb_tage.cc`:
- Around line 573-624: The per-table path increments both
tageStats.allocBucketAllUsefulOrNoCandidate and then later
tageStats.allocProbeNoEligibleVictim, causing double-counting when a table has
no eligible victim; change the logic so these are mutually exclusive by removing
the per-table increment of allocProbeNoEligibleVictim and only incrementing
allocProbeNoEligibleVictim once when the overall probe fails (i.e., after the
loop when selected_way == -1 and no allocation occurred), or alternatively stop
incrementing allocBucketAllUsefulOrNoCandidate and keep
allocProbeNoEligibleVictim per-table—update the code around the selected_way
decision (references: selected_way, allocBucketAllUsefulOrNoCandidate,
allocProbeNoEligibleVictim, allocated_table/allocated_index and the early return
true) to ensure only one counter is incremented for a table with no victim.

In `@src/cpu/pred/btb/test/btb_tage.test.cc`:
- Around line 440-450: The test verifies that calling tage->update(stream) when
the provider is from the highest table does not trigger allocation; update the
inline comment and the EXPECT_EQ assertion messages to be more explicit about
why both tage->tageStats.updateAllocFailure and
tage->tageStats.updateAllocSuccess should remain zero (e.g., mention
"RTL-aligned highest-table gating suppresses any allocation attempt or failure
when provider originates from highest table"), and ensure the comment sits
immediately above the tage->update(stream) call so readers can easily correlate
the behavior with the expectations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3e9a0ae3-3c03-4787-965d-f699b0484fe8

📥 Commits

Reviewing files that changed from the base of the PR and between 6d3ba69 and cac8553.

📒 Files selected for processing (3)
  • src/cpu/pred/btb/btb_tage.cc
  • src/cpu/pred/btb/btb_tage.hh
  • src/cpu/pred/btb/test/btb_tage.test.cc

Change-Id: I5c28f6c692b1b1e0d8c8581952353ac6974ab1ca
@github-actions
Copy link

🚀 Coremark Smoke Test Results

Branch IPC Change
Base (xs-dev) 2.2665 -
This PR 2.2850 📈 +0.0185 (+0.82%)

✅ Difftest smoke test passed!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/cpu/pred/btb/test/btb_tage.test.cc (1)

735-736: Minor style inconsistency with useful parameter.

The createManualTageEntry function takes a bool useful parameter (line 699), but callers now pass 0 instead of false. While this works due to implicit conversion, using false explicitly would be clearer and more consistent with the parameter type.

♻️ Suggested consistency fix
-    createManualTageEntry(tage, testTable, testIndex, 0, testTag1, 2, 0, 0x1000, 0); // Way 0: Strong taken
-    createManualTageEntry(tage, testTable, testIndex, 1, testTag2, -2, 0, 0x1004, 1); // Way 1: Strong not taken
+    createManualTageEntry(tage, testTable, testIndex, 0, testTag1, 2, false, 0x1000, 0); // Way 0: Strong taken
+    createManualTageEntry(tage, testTable, testIndex, 1, testTag2, -2, false, 0x1004, 1); // Way 1: Strong not taken
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/cpu/pred/btb/test/btb_tage.test.cc` around lines 735 - 736, The call
sites to createManualTageEntry (e.g., the two calls shown) pass the `useful`
argument as integer literals `0`; change those to the boolean literal `false` to
match the function signature (createManualTageEntry(..., bool useful)) and
improve readability/consistency—update any other callers that use `0`/`1` for
the `useful` parameter to `false`/`true` respectively.
src/cpu/pred/btb/btb_tage.cc (1)

573-596: Consider skipping invalid entries in the second loop.

The second loop (lines 582-596) searches for weak-not-useful and strong-not-useful candidates, but it doesn't skip entries where !set[way].valid. If an invalid entry has useful=false by default, it could be added to weak_not_useful_way or strong_not_useful_way redundantly.

While the priority logic at lines 599-610 correctly prefers invalid_way first, adding an early continue for invalid entries in the second loop would improve clarity and avoid redundant checks:

♻️ Suggested refinement
         for (unsigned way = 0; way < numWays; ++way) {
             auto &cand = set[way];
+            if (!cand.valid) {
+                continue;
+            }
             if (!usefulCtrIsSaturateNegative(cand)) {
                 continue;
             }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/cpu/pred/btb/btb_tage.cc` around lines 573 - 596, The second loop that
sets weak_not_useful_way and strong_not_useful_way should skip invalid entries
to avoid selecting an already-invalid way; inside the loop iterating over
set[way] (the same loop that uses usefulCtrIsSaturateNegative and computes
weakish from cand.counter) add an early check for set[way].valid (or
!set[way].valid) and continue if the entry is invalid so only valid candidates
are considered when setting weak_not_useful_way and strong_not_useful_way.
🤖 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/btb/btb_tage.cc`:
- Around line 573-596: The second loop that sets weak_not_useful_way and
strong_not_useful_way should skip invalid entries to avoid selecting an
already-invalid way; inside the loop iterating over set[way] (the same loop that
uses usefulCtrIsSaturateNegative and computes weakish from cand.counter) add an
early check for set[way].valid (or !set[way].valid) and continue if the entry is
invalid so only valid candidates are considered when setting weak_not_useful_way
and strong_not_useful_way.

In `@src/cpu/pred/btb/test/btb_tage.test.cc`:
- Around line 735-736: The call sites to createManualTageEntry (e.g., the two
calls shown) pass the `useful` argument as integer literals `0`; change those to
the boolean literal `false` to match the function signature
(createManualTageEntry(..., bool useful)) and improve
readability/consistency—update any other callers that use `0`/`1` for the
`useful` parameter to `false`/`true` respectively.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7dd7c2e0-313b-4df6-8064-a1b691219b48

📥 Commits

Reviewing files that changed from the base of the PR and between cac8553 and 51f151e.

📒 Files selected for processing (4)
  • .codex/skills/ci-perf-analysis/SKILL.md
  • src/cpu/pred/btb/btb_tage.cc
  • src/cpu/pred/btb/btb_tage.hh
  • src/cpu/pred/btb/test/btb_tage.test.cc
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/cpu/pred/btb/btb_tage.hh

@XiangShanRobot
Copy link

[Generated by GEM5 Performance Robot]
commit: 51f151e
workflow: gem5 Align BTB Performance Test(0.3c)

Align BTB Performance

Overall Score

PR Master Diff(%)
Score 18.10 18.25 -0.86 🔴

[Generated by GEM5 Performance Robot]
commit: 51f151e
workflow: gem5 Align BTB Performance Test(0.3c)

Align BTB Performance

Overall Score

PR Previous Commit Diff(%)
Score 18.10 18.11 -0.06 🔴

Change-Id: Ic4ebba4d7249d1cdbdd2b6a8121e3b400a41d75a
Change-Id: I66180a45246dad557df552c7d4c731ec9e1c2dc3
Change-Id: I31fe4c0da0cdaa4eb3cfba8ebd83a84e7db72d30
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/cpu/pred/btb/test/btb_tage.test.cc (1)

213-224: Consider updating useful parameter type for clarity.

The setupTageEntry helper still uses bool useful (line 214), but the underlying TageEntry::useful field appears to have been changed to a counter type based on the implementation changes. While bool assignment works (converting to 0/1), using uint8_t or the actual counter type would be clearer and prevent potential confusion.

The same applies to createManualTageEntry at line 745.

🔧 Optional: Update parameter type for consistency
 void setupTageEntry(BTBTAGE* tage, Addr pc, int table_idx,
-                    short counter, bool useful = false, int way = 0) {
+                    short counter, uint8_t useful = 0, int way = 0) {
 void createManualTageEntry(BTBTAGE* tage, int table, Addr index, int way,
-                          Addr tag, short counter, bool useful, Addr pc,
+                          Addr tag, short counter, uint8_t useful, Addr pc,
                           unsigned lruCounter = 0) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/cpu/pred/btb/test/btb_tage.test.cc` around lines 213 - 224, The helper
setupTageEntry uses a bool for the useful parameter but the underlying field
TageEntry::useful is a small counter type; change the parameter type from bool
useful to the actual counter type (e.g., uint8_t usefulCounter or the specific
typedef used by TageEntry) and update the assignment entry.useful =
usefulCounter so the conversion is explicit; do the same change for
createManualTageEntry (update its parameter name and type to match
TageEntry::useful's type) to keep signatures consistent and avoid implicit
bool-to-integer conversions.
🤖 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/btb/test/btb_tage.test.cc`:
- Around line 213-224: The helper setupTageEntry uses a bool for the useful
parameter but the underlying field TageEntry::useful is a small counter type;
change the parameter type from bool useful to the actual counter type (e.g.,
uint8_t usefulCounter or the specific typedef used by TageEntry) and update the
assignment entry.useful = usefulCounter so the conversion is explicit; do the
same change for createManualTageEntry (update its parameter name and type to
match TageEntry::useful's type) to keep signatures consistent and avoid implicit
bool-to-integer conversions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bb529c74-4212-47cf-8d68-41681848bcce

📥 Commits

Reviewing files that changed from the base of the PR and between 9170a91 and d970c5d.

📒 Files selected for processing (4)
  • .codex/skills/rtl-tage-alignment/SKILL.md
  • docs/progress/TAGE-align.md
  • src/cpu/pred/btb/btb_tage.cc
  • src/cpu/pred/btb/test/btb_tage.test.cc

@XiangShanRobot
Copy link

[Generated by GEM5 Performance Robot]
commit: d970c5d
workflow: gem5 Align BTB Performance Test(0.3c)

Align BTB Performance

Overall Score

PR Master Diff(%)
Score 18.16 18.25 -0.51 🔴

[Generated by GEM5 Performance Robot]
commit: d970c5d
workflow: gem5 Align BTB Performance Test(0.3c)

Align BTB Performance

Overall Score

PR Previous Commit Diff(%)
Score 18.16 18.11 +0.28 🟢

1 similar comment
@XiangShanRobot
Copy link

[Generated by GEM5 Performance Robot]
commit: d970c5d
workflow: gem5 Align BTB Performance Test(0.3c)

Align BTB Performance

Overall Score

PR Master Diff(%)
Score 18.16 18.25 -0.51 🔴

[Generated by GEM5 Performance Robot]
commit: d970c5d
workflow: gem5 Align BTB Performance Test(0.3c)

Align BTB Performance

Overall Score

PR Previous Commit Diff(%)
Score 18.16 18.11 +0.28 🟢

Change-Id: I72bf16c22105756a6cdd71bfbee2f1b203dcebd8
@XiangShanRobot
Copy link

[Generated by GEM5 Performance Robot]
commit: 409410a
workflow: gem5 Align BTB Performance Test(0.3c)

Align BTB Performance

Overall Score

PR Master Diff(%)
Score 18.16 18.25 -0.54 🔴

[Generated by GEM5 Performance Robot]
commit: 409410a
workflow: gem5 Align BTB Performance Test(0.3c)

Align BTB Performance

Overall Score

PR Previous Commit Diff(%)
Score 18.16 18.16 -0.02 🔴

1 similar comment
@XiangShanRobot
Copy link

[Generated by GEM5 Performance Robot]
commit: 409410a
workflow: gem5 Align BTB Performance Test(0.3c)

Align BTB Performance

Overall Score

PR Master Diff(%)
Score 18.16 18.25 -0.54 🔴

[Generated by GEM5 Performance Robot]
commit: 409410a
workflow: gem5 Align BTB Performance Test(0.3c)

Align BTB Performance

Overall Score

PR Previous Commit Diff(%)
Score 18.16 18.16 -0.02 🔴

Change-Id: I9f7d6f509712b0e8d42542725d7541df1669c13f
@XiangShanRobot
Copy link

[Generated by GEM5 Performance Robot]
commit: 1d02151
workflow: gem5 Align BTB Performance Test(0.3c)

Align BTB Performance

Overall Score

PR Master Diff(%)
Score 18.16 18.25 -0.51 🔴

[Generated by GEM5 Performance Robot]
commit: 1d02151
workflow: gem5 Align BTB Performance Test(0.3c)

Align BTB Performance

Overall Score

PR Previous Commit Diff(%)
Score 18.16 18.16 +0.02 🟢

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.

2 participants