Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3d3031d
cpu-o3: pred: functional implementation of 2-taken.
boran-xu Jun 18, 2025
3de33af
cpu-o3: pred: implemented realistic 2-taken.
boran-xu Jun 23, 2025
7d4da8b
cpu-o3: pred: add performance counter for 2taken.
boran-xu Jun 25, 2025
a6a3761
cpu-o3: pred: clear ubtb during squashing:
boran-xu Jun 25, 2025
845e030
cpu-o3: pred: update ras predictor during second FB prediction
boran-xu Jun 26, 2025
5b698bf
ci: modify ci for testing purpose of this branch
boran-xu Jun 27, 2025
f23f3eb
cpu-o3: pred: statistics for 2 taken training condition
boran-xu Jun 27, 2025
bbe9e90
test: the upperbound of 2taken when ubtb is large enough
boran-xu Jun 27, 2025
b84ba79
cpu-o3: pred: allow alwaysTaken branch as 2nd pred of 2taken.
boran-xu Jun 30, 2025
e60e6ff
cpu-o3: Enable mBTB updates for 2nd prediction fetch blocks
boran-xu Jul 1, 2025
26c0814
cpu-o3: Restore ABTB accuracy under 2-taken
boran-xu Jul 1, 2025
8d972ae
cpu-o3: pred: check histInfo match in ubtb replacement.
boran-xu Jul 2, 2025
a676b77
cpu-o3: pred: added ratio stats for 2 taken
boran-xu Jul 3, 2025
995a626
cpu-o3: pred: give more intuitive name to methods
boran-xu Jul 4, 2025
5d0b801
cpu-o3: pred: add ubtb training perf counters
boran-xu Jul 4, 2025
e222f42
cpu-o3: pred: dff buffer stores s3_pred instead of finalPred
boran-xu Jul 4, 2025
efe74b2
cpu-o3: pred: fixed bug where 2taken training gets skipped
boran-xu Jul 4, 2025
bb8a86f
Revert "test: the upperbound of 2taken when ubtb is large enough"
boran-xu Jul 4, 2025
24f38a2
cpu-o3: pred: 2taken support pt_2nd
boran-xu Jul 8, 2025
976d7fb
ci: for testing purpose, remember to revert
boran-xu Aug 15, 2025
be558d5
cpu-o3: pred: refactor, add 2taken stats.
boran-xu Aug 18, 2025
a032b26
cpu-o3: pred: reduce the frequency of clearing ubtb 2ndBrInfo
boran-xu Aug 18, 2025
1564af5
cpu-o3: pred: update 2 taken doc
boran-xu Aug 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: gem5 Performance Test
name: gem5 Ideal BTB Performance Test (2Taken)

on:
push:
branches: [ xs-dev ]
pull_request:
branches: [ xs-dev ]
branches: [ 2-taken-v8 ]

jobs:
perf_test:
uses: ./.github/workflows/gem5-perf-template.yml
with:
script_path: ../kmh_6wide.sh
script_path: ../kmh_v3_btb_2taken.sh
benchmark_type: "spec06-0.8c"
29 changes: 0 additions & 29 deletions .github/workflows/gem5-ideal-btb-perf-weekly.yml

This file was deleted.

4 changes: 1 addition & 3 deletions .github/workflows/gem5-ideal-btb-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: gem5 Ideal BTB Performance Test

on:
push:
branches: [ xs-dev ]
pull_request:
branches: [ xs-dev ]
branches: [ 2-taken-v8 ]

jobs:
perf_test:
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/gem5-ideal-rvv-simple-perf.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/gem5-vector.yml

This file was deleted.

239 changes: 0 additions & 239 deletions .github/workflows/gem5.yml

This file was deleted.

2 changes: 2 additions & 0 deletions configs/common/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ def addCommonOptions(parser, configure_xiangshan=False):
"available subdatabase: basic, tage, ras, loop")
parser.add_argument("--disable-sc", default=False, action="store_true",
help="disable SC (enabled by default, only for FTBTAGE)")
parser.add_argument("--disable-2taken", default=False, action="store_true",
help="disable 2-taken feature (enabled by default for DecoupledBPUWithBTB)")
parser.add_argument("--enable-loop-buffer", default=False, action="store_true",
help="enable loop buffer (only for ftb branch predictor)")
parser.add_argument("--enable-loop-predictor", default=False, action="store_true",
Expand Down
1 change: 1 addition & 0 deletions configs/example/xiangshan.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ def setKmhV3IdealParams(args, system):
cpu.branchPred.btb.numEntries = 16384
# TODO: BTB TAGE do not bave base table, do not support SC
cpu.branchPred.tage.tableSizes = [2048] * 14 # 2ways, 2048 sets
cpu.branchPred.enable2Taken = not args.disable_2taken
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for both attribute names to understand their usage and declarations
rg -nP --type=cc --type=hh --type=py -C3 '\b(enable2Taken|enableTwoTaken)\b'

Repository: OpenXiangShan/GEM5

Length of output: 180


🏁 Script executed:

#!/bin/bash
# First, check what files exist and find xiangshan.py
find . -name "xiangshan.py" -type f 2>/dev/null | head -5

Repository: OpenXiangShan/GEM5

Length of output: 92


🏁 Script executed:

#!/bin/bash
# Search for both attribute names in all file types
rg -n '\b(enable2Taken|enableTwoTaken)\b' -C 3

Repository: OpenXiangShan/GEM5

Length of output: 9501


Unify attribute naming for 2-taken prediction across FTB and BTB.

enableTwoTaken (FTB, line 373) and enable2Taken (BTB, line 385) are separate attributes in different classes serving the same semantic purpose. The inconsistent naming—one spelling out "Two" and the other using the digit "2"—risks confusion during maintenance and development. Consider standardizing to a single naming convention across both implementations.

🤖 Prompt for AI Agents
In @configs/example/xiangshan.py around line 385, The config uses two different
attribute names for the same feature—cpu.ftb.enableTwoTaken and
cpu.branchPred.enable2Taken—causing inconsistency; pick one canonical name
(e.g., enableTwoTaken) and rename the other to match across both classes (update
cpu.branchPred.enable2Taken -> cpu.branchPred.enableTwoTaken or vice versa),
then update any code references (including the assignment using
args.disable_2taken and any docs/tests) to the chosen name so all consumers use
the same attribute.


cpu.branchPred.tage.enableSC = False # TODO(bug): When numBr changes, enabling SC will trigger an assert
cpu.branchPred.ftq_size = 256
Expand Down
Loading
Loading