Skip to content

Commit 0d3acd5

Browse files
committed
cpu-o3: enable2Taken configure option
Change-Id: Id8896d4c28af5c11e71e3ef453068cd84231e468
1 parent b18e904 commit 0d3acd5

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

configs/example/idealkmhv3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def setKmhV3IdealParams(args, system):
8686
cpu.branchPred.ftq_size = 64
8787
cpu.branchPred.fsq_size = 64
8888
# cpu.branchPred.microtage.enabled = False
89+
cpu.branchPred.enable2Taken = True
8990
cpu.branchPred.enable2Fetch = True
9091

9192
# l1 cache per core

configs/example/kmhv3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def setKmhV3Params(args, system):
112112
cpu.branchPred.ittage.enabled = True
113113
cpu.branchPred.mgsc.enabled = True
114114
cpu.branchPred.ras.enabled = True
115+
cpu.branchPred.enable2Taken = True
115116
cpu.branchPred.enable2Fetch = True
116117

117118
# RTL alignment: only enable bias + path + IMLI tables, disable PC threshold

src/cpu/pred/BranchPredictor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,5 +1207,6 @@ class DecoupledBPUWithBTB(BranchPredictor):
12071207
bpDBSwitches = VectorParam.String([], "Enable which traces in the form of database")
12081208
resolveBlockThreshold = Param.Unsigned(8, "Consecutive resolve dequeue failures before blocking prediction once")
12091209

1210+
enable2Taken = Param.Bool(True, "Enable 2taken feature")
12101211
enable2Fetch = Param.Bool(False, "Enable 2fetch feature")
12111212
maxFetchBytesPerCycle = Param.Unsigned(64, "Maximum fetch bytes per cycle for 2fetch")

src/cpu/pred/btb/decoupled_bpred.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ DecoupledBPUWithBTB::DecoupledBPUWithBTB(const DecoupledBPUWithBTBParams &p)
4848
ftq(2, p.ftq_size),
4949
historyManager(16), // TODO: fix this
5050
resolveBlockThreshold(p.resolveBlockThreshold),
51+
enable2Taken(p.enable2Taken),
5152
enable2Fetch(p.enable2Fetch),
5253
maxFetchBytesPerCycle(p.maxFetchBytesPerCycle),
5354
dbpBtbStats(this, p.numStages, p.fsq_size, maxInstsNum)
@@ -145,7 +146,7 @@ DecoupledBPUWithBTB::tick()
145146
return;
146147
}
147148

148-
int predsRemainsToBeMade = enableTwoTaken ? 2 : 1;
149+
int predsRemainsToBeMade = enable2Taken ? 2 : 1;
149150
while (predsRemainsToBeMade > 0) {
150151
// 1. Request new prediction if FSQ not full and we are idle
151152
if (!threads[curTid].validprediction && !ftq.full(curTid)) {

src/cpu/pred/btb/decoupled_bpred.hh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,11 @@ class DecoupledBPUWithBTB : public BPredUnit
146146
const unsigned resolveBlockThreshold;
147147

148148
ThreadID scheduleThread() { return 0; }
149+
const bool enable2Taken;
149150
const bool enable2Fetch;
150151
const unsigned maxFetchBytesPerCycle;
151152

152153
void processNewPrediction(ThreadID tid);
153-
bool enableTwoTaken{true};
154-
155154
FetchTarget createFetchTargetEntry(ThreadID tid);
156155

157156
void updateHistoryForPrediction(FetchTarget &entry);

0 commit comments

Comments
 (0)