cvw/wally-pipelined/regression/regression-wally.py
Noah Boorstin d2064987e9 Add busybear testbench to nightly regression checking
If you don't like how I did this please feel free to undo it
2021-02-02 22:05:35 +00:00

59 lines
1.7 KiB
Python
Executable File

#!/usr/bin/python3
##################################
#
# regression-wally.py
# David_Harris@Hmc.edu 25 January 2021
#
# Run a regression with multiple configurations and report any errors.
#
##################################
# edit this line to add more configurations
confignames = ["rv32ic", "rv64ic", "busybear"]
import multiprocessing, os
fail = 0
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"
if config == "busybear":
cmd = "echo 'quit' | vsim -do wally-busybear.do -c >" + logname
os.system(cmd)
# check for success. grep returns 0 if found, 1 if not found
cmd = "grep -e 'no more .* to read' " + logname + "> /dev/null"
grepval = os.system(cmd)
if (grepval):
if print_res:print(logname+": failures detected")
return 1
else:
if print_res:print(logname+": Success")
return 0
else:
cmd = "vsim -c >" + logname +" <<!\ndo wally-pipelined-batch-parallel.do ../config/" + config + " " + config + "\n!\n"
os.system(cmd)
# check for success. grep returns 0 if found, 1 if not found
cmd = "grep 'All tests ran without failures' " + logname + "> /dev/null"
grepval = os.system(cmd)
if (grepval):
if print_res:print(logname+": failures detected")
return 1
else:
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)