Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
1efeede
bpu:before compile and debug
ProgramGP Mar 4, 2026
5164f71
bpu: basic code complete
ProgramGP Mar 6, 2026
7e1c74d
bpu: perception pred basic code test
ProgramGP Mar 9, 2026
03a071e
bpu: update percep counter and baseline test
ProgramGP Mar 9, 2026
15528be
bpu: percep pred test with len of 1024
ProgramGP Mar 9, 2026
2e4b8cf
bpu: update counter and configs
ProgramGP Mar 9, 2026
ea4f22b
bpu:baseline test
ProgramGP Mar 9, 2026
634de18
bpu: update counter and configs to 128,1024,4,512
ProgramGP Mar 9, 2026
6d36aef
bpu: open perception
ProgramGP Mar 9, 2026
d159e4a
bpu: better param and change update logic
ProgramGP Mar 10, 2026
4fc86c3
bpu: simple XOR index for percep pred
ProgramGP Mar 10, 2026
112d9a5
bpu: try get index from folded gbhr and pc
ProgramGP Mar 10, 2026
d13d7fd
bpu: debug version1
ProgramGP Mar 10, 2026
9997f6e
bpu: find better logrithm to use percep pred
ProgramGP Mar 10, 2026
4f7dbc1
bpu:try solve inconsistent gbhr
ProgramGP Mar 11, 2026
e261932
bpu: try again solve inconsistent gbhr
ProgramGP Mar 11, 2026
b63fdf1
bpu: try solve gbhr inconsistent with s0History
ProgramGP Mar 11, 2026
5886afb
bpu: debug try again solve gbhr inconsistent with s0History
ProgramGP Mar 11, 2026
599e6e8
bpu: try third solve gbhr inconsistent with s0Hist
ProgramGP Mar 12, 2026
84777e0
bpu: new update counter
ProgramGP Mar 12, 2026
28c102c
bpu: percep on
ProgramGP Mar 13, 2026
539e490
bpu: comfirm baseline
ProgramGP Mar 13, 2026
855ba4e
bpu: try param
ProgramGP Mar 13, 2026
f9563f4
bpu: baseline
ProgramGP Mar 13, 2026
bd047bb
bpu: analyse perceptron
ProgramGP Mar 18, 2026
9139621
bpu: mgsc only bias on,percep off
ProgramGP Mar 19, 2026
112dba5
bpu: 90% accuracy percep
ProgramGP Mar 24, 2026
82be7fe
bpu: tage as part of percep
ProgramGP Mar 24, 2026
c8abef3
bpu: tage weight change test
ProgramGP Mar 26, 2026
4cdbb76
bpu: Ablation Study, no tage
ProgramGP Mar 30, 2026
cd6a6a3
bpu: no percep,bias and Gtable
ProgramGP Mar 30, 2026
98fa43d
bpu: percep 256-128-9-262-7
ProgramGP Mar 30, 2026
ed721c4
bpu: percep 256-256-10-508-8
ProgramGP Mar 30, 2026
cad8553
bpu: percep 256-10-508-8 true
ProgramGP Mar 31, 2026
d07c4dd
bpu: percep 256-128-9-262-7 true
ProgramGP Mar 31, 2026
1f4b846
bpu: percep 256-64-8-137-6
ProgramGP Mar 31, 2026
7769e83
bpu: percep 1024-128-9-262-7
ProgramGP Mar 31, 2026
9b9fe2a
bpu: 128-128-9-262-7
ProgramGP Mar 31, 2026
3928334
bpu: 256-32-7-75-3
ProgramGP Mar 31, 2026
0f88e79
bpu: 64-128-9-262-7
ProgramGP Mar 31, 2026
b325411
bpu: 32-128-9-262-7
ProgramGP Mar 31, 2026
dfc1b4d
bpu: 256-64-8-137-4
ProgramGP Apr 1, 2026
2602bca
bpu: 256-128-9-262-5
ProgramGP Apr 1, 2026
d44c492
bpu: 256-8-5-29-1
ProgramGP Apr 1, 2026
1cb1fb4
bpu:256-0-0-0-0
ProgramGP Apr 1, 2026
b2ae26e
bpu: no percep again
ProgramGP Apr 2, 2026
b9958be
bpu: tagepercep 256-4-5-21-1
ProgramGP Apr 2, 2026
997498b
bpu: thresPercep 256-8-5-29-1
ProgramGP Apr 2, 2026
8e40403
bpu: tagePercep 256-16-6-45-2
ProgramGP Apr 2, 2026
926ad47
bpu: thresPercep 256-1024-10-2100-6
ProgramGP Apr 2, 2026
7762fff
bpu: tagePercep 256-1024-10-2100-8
ProgramGP Apr 2, 2026
ece2668
bpu: tagepercep no-tage 1024-10-2100-8
ProgramGP Apr 3, 2026
c585c31
bpu: tagepercep 1024-10-2100-8
ProgramGP Apr 3, 2026
d2d60a6
bpu: tagepercep 256-7-5-27-1
ProgramGP Apr 3, 2026
f068052
bpu: tagepercep 1024-7-5-27-1
ProgramGP Apr 3, 2026
726932b
bpu: baseline all false
ProgramGP Apr 3, 2026
4f98b64
bpu: tagepercep 1024-7-5-27-1
ProgramGP Apr 3, 2026
f3b7b65
bpu: tagepercep 1024-1024-10-2100-8
ProgramGP Apr 4, 2026
b306fd0
bpu: 1024-8-5-30-1
ProgramGP Apr 4, 2026
74b1c41
bpu: xiaorong 1024-8-5-30-1
ProgramGP Apr 4, 2026
bb5d34b
bpu: threspercep 1024-8-5-30-1
ProgramGP Apr 4, 2026
7b1d597
bpu: threspercep 1024-8-5-30-1
ProgramGP Apr 4, 2026
b1b4f3c
bpu: baseline all false
ProgramGP Apr 4, 2026
5f11ef4
bpu: tagepercep 1024-7-5-27-1
ProgramGP Apr 4, 2026
2ae3a94
bpu: tagepercep 1024-32-7-75-3
ProgramGP Apr 4, 2026
d753738
bpu: all off baseline test1
ProgramGP Apr 4, 2026
e115dc4
bpu: tagepercep 1024-32-7-75-3 test
ProgramGP Apr 4, 2026
55c827d
bpu: baseline 2
ProgramGP Apr 5, 2026
3950d39
bpu: threspercep 1024-32-7-75-3
ProgramGP Apr 5, 2026
75eb0ca
bpu: tagepercep 1024-256-8-508-4
ProgramGP Apr 5, 2026
976f6fb
bpu: tagepercep 1024-256-8-508-4 true
ProgramGP Apr 5, 2026
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ AGENTS.md

microbench/build/
microbench/output/
microbench/dramsim3*
microbench/dramsim3*
NEMU

workrecord.txt
8 changes: 7 additions & 1 deletion configs/example/kmhv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,15 @@ def setKmhV3Params(args, system):
cpu.branchPred.mbtb.enabled = True
cpu.branchPred.tage.enabled = True
cpu.branchPred.ittage.enabled = True
cpu.branchPred.mgsc.enabled = False
cpu.branchPred.mgsc.enabled = True
cpu.branchPred.ras.enabled = True

# 64KB prediction
cpu.branchPred.mgsc.enablePerceptionPred = True
cpu.branchPred.mgsc.percepTableEntryNum = 128
cpu.branchPred.mgsc.percepTableWidth = 8
cpu.branchPred.mgsc.gbhrLen = 512
cpu.branchPred.mgsc.percepThres = 500
# l1 cache per core
if args.caches:
cpu.icache.size = '64kB'
Expand Down
9 changes: 9 additions & 0 deletions src/cpu/pred/BranchPredictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,7 @@ class BTBTAGE(TimedBaseBTBPredictor):
cxx_header = "cpu/pred/btb/btb_tage.hh"

needMoreHistories = Param.Bool(True, "BTBTAGE needs more histories")
needGBHR = Param.Bool(False,"BTBTAGE don't need GBHR")
enableSC = Param.Bool(False, "Enable SC or not") # TODO: BTBTAGE doesn't support SC
updateOnRead = Param.Bool(True, "Enable update on read, no need to save tage meta in FTQ")
numPredictors = Param.Unsigned(8, "Number of TAGE predictors")
Expand Down Expand Up @@ -1077,6 +1078,7 @@ class BTBITTAGE(TimedBaseBTBPredictor):
cxx_header = "cpu/pred/btb/btb_ittage.hh"

needMoreHistories = Param.Bool(True, "BTBITTAGE needs more histories")
needGBHR = Param.Bool(False,"BTBITTAGE don't need GBHR")
numPredictors = Param.Unsigned(5, "Number of TAGE predictors")
tableSizes = VectorParam.Unsigned([256]*2 + [512]*3, "the ITTAGE T0~Tn length")
TTagBitSizes = VectorParam.Unsigned([9]*5, "the T0~Tn entry's tag bit size")
Expand All @@ -1094,6 +1096,7 @@ class BTBMGSC(TimedBaseBTBPredictor):
cxx_header = "cpu/pred/btb/btb_mgsc.hh"

needMoreHistories = Param.Bool(True, "MGSC needs more histories")
needGBHR = Param.Bool(True,"MGSC needs GBHR")

bwTableNum = Param.Unsigned(2, "Num global backward branch GEHL tables")
bwHistLen = VectorParam.Int([4, 8], "Global backward branch GEHL history lengths")
Expand Down Expand Up @@ -1123,6 +1126,11 @@ class BTBMGSC(TimedBaseBTBPredictor):
biasTableNum = Param.Unsigned(1, "Num bias tables")
biasTableIdxWidth = Param.Unsigned(11, "Log number of bias entries")

percepTableEntryNum = Param.Unsigned(4096, "Num of entries in perception preditor weight table")
gbhrLen = Param.Unsigned(23, "Length of gbhr in perception predictor")
percepTableWidth = Param.Unsigned(8, "Width of weight in perception predictor table")
percepThres = Param.Unsigned(1472, "Threshold of perception predictor") # gbhrLen * (1<<(percepTableWidth - 2))

thresholdTablelogSize = Param.Unsigned(6,
"Log size of update threshold counters tables")

Expand Down Expand Up @@ -1152,6 +1160,7 @@ class BTBMGSC(TimedBaseBTBPredictor):
enablePTable = Param.Bool(True, "Enable P (path) table")
enableBiasTable = Param.Bool(True, "Enable Bias table")
enablePCThreshold = Param.Bool(False, "Enable PC-indexed threshold table")
enablePerceptionPred = Param.Bool(True, "Enable perception predictor")

numDelay = 2

Expand Down
5 changes: 3 additions & 2 deletions src/cpu/pred/btb/btb_ittage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "base/trace.hh"
#include "cpu/o3/dyn_inst.hh"
#include "debug/DecoupleBP.hh"
#include "debug/DecoupleBPVerbose.hh"
#include "debug/DecoupleBPUseful.hh"
#include "debug/DecoupleBPVerbose.hh"
#include "debug/ITTAGE.hh"
#include "debug/ITTAGEHistory.hh"

Expand All @@ -32,6 +32,7 @@ numTablesToAlloc(p.numTablesToAlloc),
ittageStats(this, p.numPredictors)
{
this->needMoreHistories = p.needMoreHistories;
this->needGBHR = p.needGBHR;
DPRINTF(ITTAGE, "BTBITTAGE constructor numBr=%d\n", numBr);
tageTable.resize(numPredictors);
tableIndexBits.resize(numPredictors);
Expand Down Expand Up @@ -242,7 +243,7 @@ BTBITTAGE::update(const FetchTarget &stream)
auto updateTagFoldedHist = meta->tagFoldedHist;
auto updateAltTagFoldedHist = meta->altTagFoldedHist;
auto updateIndexFoldedHist = meta->indexFoldedHist;

// update each branch
for (auto &btb_entry : all_entries_to_update) {
bool this_indirect_actual_taken = stream.exeTaken && stream.exeBranchInfo == btb_entry;
Expand Down
Loading
Loading