Updated branch predictor.

This commit is contained in:
Ross Thompson 2023-01-11 17:00:45 -06:00
parent d1bfdddd8c
commit 6999b4562e
2 changed files with 14 additions and 18 deletions

View File

@ -91,13 +91,24 @@ def ProcessFile(fileName):
HPMClist = { }
elif(len(lineToken) > 4 and lineToken[1][0:3] == 'Cnt'):
countToken = line.split('=')[1].split()
value = countToken[0]
value = int(countToken[0])
name = ' '.join(countToken[1:])
HPMClist[name] = value
elif ('is done' in line):
benchmarks.append((testName, opt, HPMClist))
return benchmarks
def ComputeAverage(benchmarks):
average = {}
for (testName, opt, HPMClist) in benchmarks:
for field in HPMClist:
value = HPMClist[field]
if field not in average:
average[field] = value
else:
average[field] += value
benchmarks.append(('All', '', average))
def FormatToPlot(currBenchmark):
names = []
values = []
@ -111,6 +122,7 @@ if(sys.argv[1] == '-b'):
configList = []
for config in sys.argv[2::]:
benchmarks = ProcessFile(config)
ComputeAverage(benchmarks)
ComputeAll(benchmarks)
configList.append((config.split('.')[0], benchmarks))
@ -152,6 +164,7 @@ if(sys.argv[1] == '-b'):
else:
# steps 1 and 2
benchmarks = ProcessFile(sys.argv[1])
ComputeAverage(benchmarks)
# 3 process into useful data
# cache hit rates
# cache fill time

View File

@ -103,29 +103,12 @@ module bpred (
.PCNextF, .PCM, .DirPredictionF, .DirPredictionWrongE,
.BranchInstrE(InstrClassE[0]), .BranchInstrM(InstrClassM[0]), .PCSrcE);
end else if (`BPTYPE == "BPFOLDEDGSHARE") begin:Predictor
foldedgshare #(16, 10) DirPredictor(.clk, .reset, .StallF, .StallD, .StallE, .StallM, .StallW, .FlushD, .FlushE, .FlushM, .FlushW,
.PCNextF, .PCF, .PCD, .PCE, .PCM, .DirPredictionF, .DirPredictionWrongE,
.BranchInstrF(BPInstrClassF[0]), .BranchInstrD(BPInstrClassD[0]), .BranchInstrE(InstrClassE[0]), .BranchInstrM(InstrClassM[0]),
.BranchInstrW(InstrClassW[0]), .PCSrcE);
end else if (`BPTYPE == "BPSPECULATIVEGSHARE") begin:Predictor
speculativegshare DirPredictor(.clk, .reset, .StallF, .StallD, .StallE, .StallM, .StallW, .FlushD, .FlushE, .FlushM, .FlushW,
.PCNextF, .PCF, .PCD, .PCE, .PCM, .DirPredictionF, .DirPredictionWrongE,
.BranchInstrF(BPInstrClassF[0]), .BranchInstrD(BPInstrClassD[0]), .BranchInstrE(InstrClassE[0]), .BranchInstrM(InstrClassM[0]),
.BranchInstrW(InstrClassW[0]), .PCSrcE);
end else if (`BPTYPE == "BPOLDGSHARE") begin:Predictor
oldgsharepredictor DirPredictor(.clk, .reset, .StallF, .StallD, .StallE, .StallM, .StallW, .FlushD, .FlushE, .FlushM, .FlushW,
.PCNextF, .PCF, .PCD, .PCE, .PCM, .DirPredictionF, .DirPredictionWrongE,
.BPInstrClassF, .BPInstrClassD, .BPInstrClassE,
.InstrClassE, .PCSrcE);
end else if (`BPTYPE == "BPOLDGSHARE2") begin:Predictor
oldgsharepredictor2 DirPredictor(.clk, .reset, .StallF, .StallD, .StallE, .StallM, .StallW, .FlushD, .FlushE, .FlushM, .FlushW,
.PCNextF, .PCF, .PCD, .PCE, .PCM, .DirPredictionF, .DirPredictionWrongE,
.BPInstrClassF, .BPInstrClassD, .BPInstrClassE,
.InstrClassE, .PCSrcE);
end else if (`BPTYPE == "BPLOCALPAg") begin:Predictor
// *** Fix me
/* -----\/----- EXCLUDED -----\/-----