Parallelize regression-wally.p

This commit is contained in:
Jarred Allen 2021-02-01 15:40:27 -05:00
parent 1b9ec8b339
commit 5cf3d188c6

View File

@ -11,11 +11,12 @@
# edit this line to add more configurations
confignames = ["rv32ic", "rv64ic"]
import os
import multiprocessing, os
fail = 0
for config in confignames:
def test_config(config, print_res=True):
"""Run the given config, and return 0 if it suceeds and 1 if it fails"""
logname = "wally_"+config+".log"
cmd = "vsim -c >" + logname +" <<!\ndo wally-pipelined-batch.do ../config/" + config + "\n!\n"
os.system(cmd)
@ -24,12 +25,18 @@ for config in confignames:
cmd = "grep 'All tests ran without failures' " + logname + "> /dev/null"
grepval = os.system(cmd)
if (grepval):
fail = fail + 1
print(logname+": failures detected")
if print_res:print(logname+": failures detected")
return 1
else:
print(logname+": Success")
if print_res:print(logname+": Success")
return 0
pool = multiprocessing.Pool(min(len(confignames), 12))
fail = sum(pool.map(test_config, confignames))
if (fail):
print ("Regression failed with " +str(fail)+ " failed configurations")
exit(1)
else:
print ("SUCCESS! All tests ran without failures")
exit(0)