From 0b49c736b9b34d793e2015359f6c0e088a41f955 Mon Sep 17 00:00:00 2001 From: Rose Thompson Date: Wed, 15 Nov 2023 22:35:33 -0600 Subject: [PATCH 1/4] Removed the size opt tests from the branch predictor analysis. --- bin/parseHPMC.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/parseHPMC.py b/bin/parseHPMC.py index 8e274a200..86326457a 100755 --- a/bin/parseHPMC.py +++ b/bin/parseHPMC.py @@ -180,9 +180,11 @@ def ExtractSelectedData(benchmarkFirstList): benchmarkDict = { } for benchmark in benchmarkFirstList: (name, opt, config, prefixName, entries, dataDict) = benchmark - if opt == 'bd_speedopt_speed': NewName = name+'Sp' - elif opt == 'bd_sizeopt_speed': NewName = name+'Sz' - else: NewName = name + # use this code to distinguish speed opt and size opt. + #if opt == 'bd_speedopt_speed': NewName = name+'Sp' + #elif opt == 'bd_sizeopt_speed': NewName = name+'Sz' + #else: NewName = name + NewName = name #print(NewName) #NewName = name+'_'+opt if NewName in benchmarkDict: From 38b327eaf8becc10349317588fb695da33a444d1 Mon Sep 17 00:00:00 2001 From: Rose Thompson Date: Fri, 17 Nov 2023 11:21:25 -0600 Subject: [PATCH 2/4] Fixed testbench so it runs with BPRED_LOGGER but not PrintHPMCounters. --- testbench/testbench.sv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testbench/testbench.sv b/testbench/testbench.sv index 186144839..070a6cad7 100644 --- a/testbench/testbench.sv +++ b/testbench/testbench.sv @@ -37,7 +37,7 @@ module testbench; parameter DEBUG=0; parameter TEST="none"; parameter PrintHPMCounters=0; - parameter BPRED_LOGGER=0; + parameter BPRED_LOGGER=1; parameter I_CACHE_ADDR_LOGGER=0; parameter D_CACHE_ADDR_LOGGER=0; @@ -434,7 +434,7 @@ module testbench; loggers (clk, reset, DCacheFlushStart, DCacheFlushDone, memfilename); // track the current function or global label - if (DEBUG == 1 | (PrintHPMCounters & P.ZICNTR_SUPPORTED)) begin : FunctionName + if (DEBUG == 1 | ((PrintHPMCounters | BPRED_LOGGER) & P.ZICNTR_SUPPORTED)) begin : FunctionName FunctionName #(P) FunctionName(.reset(reset_ext | TestBenchReset), .clk(clk), .ProgramAddrMapFile(ProgramAddrMapFile), .ProgramLabelMapFile(ProgramLabelMapFile)); end From d95d7130a35120c9dd9082ec984bcee51d28be14 Mon Sep 17 00:00:00 2001 From: Rose Thompson Date: Fri, 17 Nov 2023 12:05:22 -0600 Subject: [PATCH 3/4] Fixed bugs in paraseHPMC.py --- bin/parseHPMC.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/parseHPMC.py b/bin/parseHPMC.py index 86326457a..a11296b3e 100755 --- a/bin/parseHPMC.py +++ b/bin/parseHPMC.py @@ -244,7 +244,7 @@ def ReportAsText(benchmarkDict): def Inversion(lst): return [x if not args.invert else 100 - x for x in lst] -def BarGraph(seriesDict, xlabelList, BenchPerRow, FileName): +def BarGraph(seriesDict, xlabelList, BenchPerRow, FileName, IncludeLegend): index = 0 NumberInGroup = len(seriesDict) # Figure out width of bars. NumberInGroup bars + want 2 bar space @@ -262,8 +262,8 @@ def BarGraph(seriesDict, xlabelList, BenchPerRow, FileName): plt.xticks([r + barWidth*(NumberInGroup/2-0.5) for r in range(0, BenchPerRow)], xlabelList) plt.xlabel('Benchmark') if(not args.invert): plt.ylabel('Misprediction Rate (%)') - else: plt.ylabel('Prediction Accuracy (%)') - plt.legend(loc='upper left', ncol=2) + else: plt.ylabel('Prediction Accuracy (%)') + if(IncludeLegend): plt.legend(loc='upper right', ncol=2) plt.savefig(FileName) def SelectPartition(xlabelListBig, seriesDictBig, group, BenchPerRow): @@ -352,13 +352,13 @@ def ReportAsGraph(benchmarkDict, bar): # index += 1 if(not args.summary): - size = len(benchmarkDict) - sizeSqrt = math.sqrt(size) - isSquare = math.isclose(sizeSqrt, round(sizeSqrt)) - numCol = math.floor(sizeSqrt) + NumBenchmarks = len(benchmarkDict) + NumBenchmarksSqrt = math.sqrt(NumBenchmarks) + isSquare = math.isclose(NumBenchmarksSqrt, round(NumBenchmarksSqrt)) + numCol = math.floor(NumBenchmarksSqrt) numRow = numCol + (0 if isSquare else 1) index = 1 - BenchPerRow = 7 + BenchPerRow = 5 xlabelList = [] seriesDict = {} @@ -387,11 +387,11 @@ def ReportAsGraph(benchmarkDict, bar): #The next step will be to split the benchmarkDict into length BenchPerRow pieces then repeat the following code # on each piece. - for row in range(0, math.ceil(39 / BenchPerRow)): + for row in range(0, math.ceil(NumBenchmarks / BenchPerRow)): (xlabelListTrunk, seriesDictTrunk) = SelectPartition(xlabelListBig, seriesDictBig, row, BenchPerRow) FileName = 'barSegment%d.png' % row groupLen = len(xlabelListTrunk) - BarGraph(seriesDictTrunk, xlabelListTrunk, groupLen, FileName) + BarGraph(seriesDictTrunk, xlabelListTrunk, groupLen, FileName, (row == 0)) # main From 8cf2c404bf85865f261af5a06d30fa66c52b867c Mon Sep 17 00:00:00 2001 From: Rose Thompson Date: Fri, 17 Nov 2023 15:21:58 -0600 Subject: [PATCH 4/4] bpred-sim only simulates 12 jobs at once. --- sim/bpred-sim.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sim/bpred-sim.py b/sim/bpred-sim.py index 530fab70c..60af41298 100755 --- a/sim/bpred-sim.py +++ b/sim/bpred-sim.py @@ -102,7 +102,8 @@ def main(): if(args.direction): # for direction predictor size sweep bpdSize = [6, 8, 10, 12, 14, 16] - bpdType = ['twobit', 'gshare', 'global', 'gshare_basic', 'global_basic', 'local_basic'] + #bpdType = ['twobit', 'gshare', 'global', 'gshare_basic', 'global_basic', 'local_basic'] + bpdType = ['twobit', 'gshare'] for CurrBPType in bpdType: for CurrBPSize in bpdSize: name = CurrBPType+str(CurrBPSize)