diff --git a/wally-pipelined/regression/regression-wally.py b/wally-pipelined/regression/regression-wally.py index dc23232dc..d8f2489e6 100755 --- a/wally-pipelined/regression/regression-wally.py +++ b/wally-pipelined/regression/regression-wally.py @@ -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)