Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
26 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
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
7 changes: 6 additions & 1 deletion configs/example/kmhv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,14 @@ 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

cpu.branchPred.mgsc.enablePerceptionPred = False
cpu.branchPred.mgsc.percepTableEntryNum = 128
cpu.branchPred.mgsc.percepTableWidth = 8
cpu.branchPred.mgsc.gbhrLen = 256
cpu.branchPred.mgsc.percepThres = 600
# 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