mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Merge branch 'main' of github.com:ross144/cvw
This commit is contained in:
		
						commit
						efcd09c6cd
					
				@ -180,9 +180,11 @@ def ExtractSelectedData(benchmarkFirstList):
 | 
				
			|||||||
    benchmarkDict = { }
 | 
					    benchmarkDict = { }
 | 
				
			||||||
    for benchmark in benchmarkFirstList:
 | 
					    for benchmark in benchmarkFirstList:
 | 
				
			||||||
        (name, opt, config, prefixName, entries, dataDict) = benchmark
 | 
					        (name, opt, config, prefixName, entries, dataDict) = benchmark
 | 
				
			||||||
        if opt == 'bd_speedopt_speed': NewName = name+'Sp'
 | 
					        # use this code to distinguish speed opt and size opt.
 | 
				
			||||||
        elif opt == 'bd_sizeopt_speed': NewName = name+'Sz'
 | 
					        #if opt == 'bd_speedopt_speed': NewName = name+'Sp'
 | 
				
			||||||
        else: NewName = name
 | 
					        #elif opt == 'bd_sizeopt_speed': NewName = name+'Sz'
 | 
				
			||||||
 | 
					        #else: NewName = name
 | 
				
			||||||
 | 
					        NewName = name
 | 
				
			||||||
        #print(NewName)
 | 
					        #print(NewName)
 | 
				
			||||||
        #NewName = name+'_'+opt
 | 
					        #NewName = name+'_'+opt
 | 
				
			||||||
        if NewName in benchmarkDict:
 | 
					        if NewName in benchmarkDict:
 | 
				
			||||||
@ -242,7 +244,7 @@ def ReportAsText(benchmarkDict):
 | 
				
			|||||||
def Inversion(lst):
 | 
					def Inversion(lst):
 | 
				
			||||||
    return [x if not args.invert else 100 - x for x in 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
 | 
					    index = 0
 | 
				
			||||||
    NumberInGroup = len(seriesDict)
 | 
					    NumberInGroup = len(seriesDict)
 | 
				
			||||||
    # Figure out width of bars.  NumberInGroup bars + want 2 bar space
 | 
					    # Figure out width of bars.  NumberInGroup bars + want 2 bar space
 | 
				
			||||||
@ -261,7 +263,7 @@ def BarGraph(seriesDict, xlabelList, BenchPerRow, FileName):
 | 
				
			|||||||
    plt.xlabel('Benchmark')
 | 
					    plt.xlabel('Benchmark')
 | 
				
			||||||
    if(not args.invert): plt.ylabel('Misprediction Rate (%)')
 | 
					    if(not args.invert): plt.ylabel('Misprediction Rate (%)')
 | 
				
			||||||
    else:  plt.ylabel('Prediction Accuracy (%)')
 | 
					    else:  plt.ylabel('Prediction Accuracy (%)')
 | 
				
			||||||
    plt.legend(loc='upper left', ncol=2)
 | 
					    if(IncludeLegend): plt.legend(loc='upper right', ncol=2)
 | 
				
			||||||
    plt.savefig(FileName)
 | 
					    plt.savefig(FileName)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def SelectPartition(xlabelListBig, seriesDictBig, group, BenchPerRow):
 | 
					def SelectPartition(xlabelListBig, seriesDictBig, group, BenchPerRow):
 | 
				
			||||||
@ -350,13 +352,13 @@ def ReportAsGraph(benchmarkDict, bar):
 | 
				
			|||||||
    #         index += 1
 | 
					    #         index += 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if(not args.summary):
 | 
					    if(not args.summary):
 | 
				
			||||||
        size = len(benchmarkDict)
 | 
					        NumBenchmarks = len(benchmarkDict)
 | 
				
			||||||
        sizeSqrt = math.sqrt(size)
 | 
					        NumBenchmarksSqrt = math.sqrt(NumBenchmarks)
 | 
				
			||||||
        isSquare = math.isclose(sizeSqrt, round(sizeSqrt))
 | 
					        isSquare = math.isclose(NumBenchmarksSqrt, round(NumBenchmarksSqrt))
 | 
				
			||||||
        numCol = math.floor(sizeSqrt)
 | 
					        numCol = math.floor(NumBenchmarksSqrt)
 | 
				
			||||||
        numRow = numCol + (0 if isSquare else 1)
 | 
					        numRow = numCol + (0 if isSquare else 1)
 | 
				
			||||||
        index = 1
 | 
					        index = 1
 | 
				
			||||||
        BenchPerRow = 7
 | 
					        BenchPerRow = 5
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        xlabelList = []
 | 
					        xlabelList = []
 | 
				
			||||||
        seriesDict = {}
 | 
					        seriesDict = {}
 | 
				
			||||||
@ -385,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
 | 
					        #The next step will be to split the benchmarkDict into length BenchPerRow pieces then repeat the following code
 | 
				
			||||||
        # on each piece.
 | 
					        # 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)
 | 
					            (xlabelListTrunk, seriesDictTrunk) = SelectPartition(xlabelListBig, seriesDictBig, row, BenchPerRow)
 | 
				
			||||||
            FileName = 'barSegment%d.png' % row
 | 
					            FileName = 'barSegment%d.png' % row
 | 
				
			||||||
            groupLen = len(xlabelListTrunk)
 | 
					            groupLen = len(xlabelListTrunk)
 | 
				
			||||||
            BarGraph(seriesDictTrunk, xlabelListTrunk, groupLen, FileName)
 | 
					            BarGraph(seriesDictTrunk, xlabelListTrunk, groupLen, FileName, (row == 0))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# main
 | 
					# main
 | 
				
			||||||
 | 
				
			|||||||
@ -102,7 +102,8 @@ def main():
 | 
				
			|||||||
    if(args.direction):
 | 
					    if(args.direction):
 | 
				
			||||||
        # for direction predictor size sweep
 | 
					        # for direction predictor size sweep
 | 
				
			||||||
        bpdSize = [6, 8, 10, 12, 14, 16]
 | 
					        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 CurrBPType in bpdType:
 | 
				
			||||||
            for CurrBPSize in bpdSize:
 | 
					            for CurrBPSize in bpdSize:
 | 
				
			||||||
                name = CurrBPType+str(CurrBPSize)
 | 
					                name = CurrBPType+str(CurrBPSize)
 | 
				
			||||||
 | 
				
			|||||||
@ -37,7 +37,7 @@ module testbench;
 | 
				
			|||||||
  parameter DEBUG=0;
 | 
					  parameter DEBUG=0;
 | 
				
			||||||
  parameter TEST="none";
 | 
					  parameter TEST="none";
 | 
				
			||||||
  parameter PrintHPMCounters=0;
 | 
					  parameter PrintHPMCounters=0;
 | 
				
			||||||
  parameter BPRED_LOGGER=0;
 | 
					  parameter BPRED_LOGGER=1;
 | 
				
			||||||
  parameter I_CACHE_ADDR_LOGGER=0;
 | 
					  parameter I_CACHE_ADDR_LOGGER=0;
 | 
				
			||||||
  parameter D_CACHE_ADDR_LOGGER=0;
 | 
					  parameter D_CACHE_ADDR_LOGGER=0;
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
@ -434,7 +434,7 @@ module testbench;
 | 
				
			|||||||
  loggers (clk, reset, DCacheFlushStart, DCacheFlushDone, memfilename);
 | 
					  loggers (clk, reset, DCacheFlushStart, DCacheFlushDone, memfilename);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // track the current function or global label
 | 
					  // 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),
 | 
					    FunctionName #(P) FunctionName(.reset(reset_ext | TestBenchReset),
 | 
				
			||||||
			      .clk(clk), .ProgramAddrMapFile(ProgramAddrMapFile), .ProgramLabelMapFile(ProgramLabelMapFile));
 | 
								      .clk(clk), .ProgramAddrMapFile(ProgramAddrMapFile), .ProgramLabelMapFile(ProgramLabelMapFile));
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user