From d17b33131c14864bd1eae275f49a3f148e21cf29 Mon Sep 17 00:00:00 2001 From: Leo Chan Date: Thu, 22 Oct 2020 01:53:21 -0400 Subject: Squashed commit of the sb-vbs branch. Includes the SD-VBS benchmarks modified to: - Use libextra to loop as realtime jobs - Preallocate memory before starting their main computation - Accept input via stdin instead of via argc Does not include the SD-VBS matlab code. Fixes libextra execution in LITMUS^RT. --- SD-VBS/common/support/buildTable.py | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 SD-VBS/common/support/buildTable.py (limited to 'SD-VBS/common/support/buildTable.py') diff --git a/SD-VBS/common/support/buildTable.py b/SD-VBS/common/support/buildTable.py new file mode 100644 index 0000000..1a1a6aa --- /dev/null +++ b/SD-VBS/common/support/buildTable.py @@ -0,0 +1,54 @@ +import re +import sys +import os + +def getExprName(fileName): + exprFileName = os.path.basename(fileName) + exprName = re.sub("\.txt", "", exprFileName) + exprName = re.sub("_","\t", exprName, 1) + exprName = re.sub("_", "", exprName) + return(exprName) + +def getBmrkName(fileName): + benchmarkDir = os.path.dirname(fileName) + benchmarkName = os.path.basename(benchmarkDir) + return(benchmarkName) + +def getCycleCountTup(fileName): + try: + inp = open(fileName, 'r') + except IOError, err: + print "ERROR: Could not open the inputFile:"+fileName + sys.exit(1) + globalTup = None + for currline in inp: + currline = currline.strip() + currline = currline.lower() + if(re.match("cycles elapsed", currline)): + valTup = re.findall("(\d+)", currline) + return(valTup) + + if(globalTup != None): + return(globalTup) + else: + print "ERROR: INVALID INPUT FILE:"+fileName + sys.exit(2) + +def main(): + if(len(sys.argv)<2): + print "USAGE: "+sys.argv[0]+" " + sys.exit(1) + + fileName = sys.argv[1] + exprName = getExprName(fileName) + benchmarkName = getBmrkName(fileName) + cycleCountTup = getCycleCountTup(fileName) + + print "%-20s %-20s %10s\n" % (benchmarkName,exprName,cycleCountTup[0]) + + + + + +if __name__=="__main__": + main() -- cgit v1.2.2