mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Change addLockstepTestsByDir to addTestsByDir
This commit is contained in:
parent
568e6803ee
commit
b27447f552
@ -291,18 +291,35 @@ def addTests(tests, sim):
|
|||||||
configs.append(tc)
|
configs.append(tc)
|
||||||
|
|
||||||
|
|
||||||
def addLockstepTestsByDir(dir, config, sim, fcovMode):
|
def addTestsByDir(dir, config, sim, lockstepMode=0):
|
||||||
sim_logdir = WALLY+ "/sim/" + sim + "/logs/"
|
if os.path.isdir(dir):
|
||||||
if (coverStr != ""): # use --fcov in place of --lockstep
|
sim_logdir = WALLY+ "/sim/" + sim + "/logs/"
|
||||||
cmdPrefix="wsim --sim " + sim + " " + coverStr + " " + config
|
if coverStr == "--fcov": # use --fcov in place of --lockstep
|
||||||
else:
|
cmdPrefix="wsim --sim " + sim + " " + coverStr + " " + config
|
||||||
cmdPrefix="wsim --lockstep --sim " + sim + " " + config
|
gs="Mismatches : 0"
|
||||||
if (os.path.isdir(dir)):
|
if ("cvw-arch-verif/tests" in dir and not "priv" in dir):
|
||||||
|
fileEnd = "ALL.elf"
|
||||||
|
else:
|
||||||
|
fileEnd = ".elf"
|
||||||
|
elif coverStr == "--ccov":
|
||||||
|
cmdPrefix="wsim --sim " + sim + " " + coverStr + " " + config
|
||||||
|
gs="Single Elf file tests are not signatured verified."
|
||||||
|
if ("cvw-arch-verif/tests" in dir and not "priv" in dir):
|
||||||
|
fileEnd = "ALL.elf"
|
||||||
|
else:
|
||||||
|
fileEnd = ".elf"
|
||||||
|
elif lockstepMode:
|
||||||
|
cmdPrefix="wsim --lockstep --sim " + sim + " " + config
|
||||||
|
gs="Mismatches : 0"
|
||||||
|
fileEnd = ".elf"
|
||||||
|
else:
|
||||||
|
cmdPrefix="wsim --sim " + sim + " " + config
|
||||||
|
gs="Single Elf file tests are not signatured verified."
|
||||||
|
fileEnd = ".elf"
|
||||||
for dirpath, dirnames, filenames in os.walk(os.path.abspath(dir)):
|
for dirpath, dirnames, filenames in os.walk(os.path.abspath(dir)):
|
||||||
for file in filenames:
|
for file in filenames:
|
||||||
# fcov lockstep only runs on WALLY-COV-ALL.elf files; other lockstep runs on all files
|
# fcov lockstep only runs on WALLY-COV-ALL.elf files; other lockstep runs on all files
|
||||||
if ((file.endswith(".elf") and (fcovMode == 0 or "tests/priv" in dir)) or
|
if file.endswith(fileEnd):
|
||||||
(file.endswith("ALL.elf") and fcovMode == 1)):
|
|
||||||
fullfile = os.path.join(dirpath, file)
|
fullfile = os.path.join(dirpath, file)
|
||||||
fields = fullfile.rsplit('/', 3)
|
fields = fullfile.rsplit('/', 3)
|
||||||
if (fields[2] == "ref"):
|
if (fields[2] == "ref"):
|
||||||
@ -318,7 +335,7 @@ def addLockstepTestsByDir(dir, config, sim, fcovMode):
|
|||||||
name=file,
|
name=file,
|
||||||
variant=config,
|
variant=config,
|
||||||
cmd=cmdPrefix + " " + fullfile + " > " + sim_log,
|
cmd=cmdPrefix + " " + fullfile + " > " + sim_log,
|
||||||
grepstr="Mismatches : 0",
|
grepstr=gs,
|
||||||
grepfile = sim_log)
|
grepfile = sim_log)
|
||||||
configs.append(tc)
|
configs.append(tc)
|
||||||
else:
|
else:
|
||||||
@ -421,11 +438,10 @@ if (args.ccov): # only run RV64GC tests on Questa in code coverage mode
|
|||||||
if (args.fp):
|
if (args.fp):
|
||||||
addTests(tests64gc_fp, coveragesim)
|
addTests(tests64gc_fp, coveragesim)
|
||||||
elif (args.fcov): # run tests in lockstep in functional coverage mode
|
elif (args.fcov): # run tests in lockstep in functional coverage mode
|
||||||
addLockstepTestsByDir(WALLY+"/addins/cvw-arch-verif/tests/rv32/", "rv32gc", coveragesim, 1)
|
addTestsByDir(WALLY+"/addins/cvw-arch-verif/tests/rv32/", "rv32gc", coveragesim)
|
||||||
addLockstepTestsByDir(WALLY+"/addins/cvw-arch-verif/tests/rv64/", "rv64gc", coveragesim, 1)
|
addTestsByDir(WALLY+"/addins/cvw-arch-verif/tests/rv64/", "rv64gc", coveragesim)
|
||||||
addLockstepTestsByDir(WALLY+"/addins/cvw-arch-verif/tests/priv/rv32/", "rv32gc", coveragesim, 1)
|
addTestsByDir(WALLY+"/addins/cvw-arch-verif/tests/priv/rv32/", "rv32gc", coveragesim)
|
||||||
addLockstepTestsByDir(WALLY+"/addins/cvw-arch-verif/tests/priv/rv64/", "rv64gc", coveragesim, 1)
|
addTestsByDir(WALLY+"/addins/cvw-arch-verif/tests/priv/rv64/", "rv64gc", coveragesim)
|
||||||
#addLockstepTestsByDir(WALLY+"/tests/riscof/work/wally-riscv-arch-test/rv64i_m/privilege/src/", "rv64gc", coveragesim, 0)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
for sim in sims:
|
for sim in sims:
|
||||||
@ -437,9 +453,9 @@ else:
|
|||||||
|
|
||||||
# run derivative configurations and lockstep tests in nightly regression
|
# run derivative configurations and lockstep tests in nightly regression
|
||||||
if (args.nightly):
|
if (args.nightly):
|
||||||
addLockstepTestsByDir(WALLY+"/tests/coverage", "rv64gc", lockstepsim, 0)
|
addTestsByDir(WALLY+"/tests/coverage", "rv64gc", lockstepsim, 1)
|
||||||
addLockstepTestsByDir(WALLY+"/tests/riscof/work/wally-riscv-arch-test/rv64i_m", "rv64gc", lockstepsim, 0)
|
addTestsByDir(WALLY+"/tests/riscof/work/wally-riscv-arch-test/rv64i_m", "rv64gc", lockstepsim, 1)
|
||||||
addLockstepTestsByDir(WALLY+"/tests/riscof/work/wally-riscv-arch-test/rv32i_m", "rv32gc", lockstepsim, 0)
|
addTestsByDir(WALLY+"/tests/riscof/work/wally-riscv-arch-test/rv32i_m", "rv32gc", lockstepsim, 1)
|
||||||
addTests(derivconfigtests, defaultsim)
|
addTests(derivconfigtests, defaultsim)
|
||||||
# addTests(bpredtests, defaultsim) # This is currently broken in regression due to something related to the new wsim script.
|
# addTests(bpredtests, defaultsim) # This is currently broken in regression due to something related to the new wsim script.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user