mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-03 02:05:21 +00:00
Parallelize regression-wally.p
This commit is contained in:
parent
1b9ec8b339
commit
5cf3d188c6
@ -11,11 +11,12 @@
|
|||||||
# edit this line to add more configurations
|
# edit this line to add more configurations
|
||||||
confignames = ["rv32ic", "rv64ic"]
|
confignames = ["rv32ic", "rv64ic"]
|
||||||
|
|
||||||
import os
|
import multiprocessing, os
|
||||||
|
|
||||||
fail = 0
|
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"
|
logname = "wally_"+config+".log"
|
||||||
cmd = "vsim -c >" + logname +" <<!\ndo wally-pipelined-batch.do ../config/" + config + "\n!\n"
|
cmd = "vsim -c >" + logname +" <<!\ndo wally-pipelined-batch.do ../config/" + config + "\n!\n"
|
||||||
os.system(cmd)
|
os.system(cmd)
|
||||||
@ -24,12 +25,18 @@ for config in confignames:
|
|||||||
cmd = "grep 'All tests ran without failures' " + logname + "> /dev/null"
|
cmd = "grep 'All tests ran without failures' " + logname + "> /dev/null"
|
||||||
grepval = os.system(cmd)
|
grepval = os.system(cmd)
|
||||||
if (grepval):
|
if (grepval):
|
||||||
fail = fail + 1
|
if print_res:print(logname+": failures detected")
|
||||||
print(logname+": failures detected")
|
return 1
|
||||||
else:
|
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):
|
if (fail):
|
||||||
print ("Regression failed with " +str(fail)+ " failed configurations")
|
print ("Regression failed with " +str(fail)+ " failed configurations")
|
||||||
|
exit(1)
|
||||||
else:
|
else:
|
||||||
print ("SUCCESS! All tests ran without failures")
|
print ("SUCCESS! All tests ran without failures")
|
||||||
|
exit(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user