Support Elffiles on all simulators

This commit is contained in:
Jordan Carlin 2024-11-30 23:04:13 -08:00
parent 9b24938590
commit 9ee4a2b408
No known key found for this signature in database
2 changed files with 6 additions and 10 deletions

View File

@ -64,6 +64,9 @@ if(args.testsuite.endswith('.elf') and args.elf == ""): # No --elf argument; che
print("ELF file not found: " + args.testsuite)
exit(1)
if (ElfFile != ""):
args.args += " " + ElfFile
if(args.lockstep and not args.testsuite.endswith('.elf') and not args.testsuite == "buildroot"):
print(f"Invalid Options. Cannot run a testsuite, {args.testsuite} with lockstep. Must run a single elf.")
exit(1)
@ -143,8 +146,6 @@ if (args.tb == "testbench_fp" and args.sim != "questa"):
if (args.sim == "questa"):
if (args.gui) and (args.tb == "testbench"):
args.params += "DEBUG=1"
if (ElfFile != ""):
args.args += " " + ElfFile
if (args.args != ""):
args.args = " --args \\\"" + args.args + "\\\""
if (args.params != ""):
@ -162,7 +163,6 @@ elif (args.sim == "verilator"):
print(f"Running Verilator on {args.config} {args.testsuite}")
os.system(f"/usr/bin/make -C {regressionDir}/verilator WALLYCONF={args.config} TEST={args.testsuite} TESTBENCH={args.tb} PLUS_ARGS=\"{args.args}\" PARAM_ARGS=\"{args.params}\"")
elif (args.sim == "vcs"):
print("wsim params: " + args.params)
print(f"Running VCS on " + args.config + " " + args.testsuite)
# if (args.gui):
# flags += " --gui"
@ -174,9 +174,6 @@ elif (args.sim == "vcs"):
vcsparams = ""
else:
vcsparams = " --params \"" + args.params + "\" "
print("VCS params: " + vcsparams)
if (ElfFile != ""):
ElfFile = " --elffile " + ElfFile
cmd = cd + "; " + prefix + " ./run_vcs " + args.config + " " + args.testsuite + " " + " --tb " + args.tb + " " + vcsargs + vcsparams + ElfFile + " " + flags
cmd = cd + "; " + prefix + " ./run_vcs " + args.config + " " + args.testsuite + " " + " --tb " + args.tb + " " + vcsargs + vcsparams + " " + flags
print(cmd)
os.system(cmd)

View File

@ -24,7 +24,6 @@ parser = argparse.ArgumentParser()
parser.add_argument("config", help="Configuration file")
parser.add_argument("testsuite", help="Test suite (or none, when running a single ELF file) ")
parser.add_argument("--tb", "-t", help="Testbench", choices=["testbench", "testbench_fp"], default="testbench")
parser.add_argument("--elffile", "-e", help="ELF file name", default="")
parser.add_argument("--coverage", "-c", help="Code & Functional Coverage", action="store_true")
parser.add_argument("--fcov", "-f", help="Code & Functional Coverage", action="store_true")
parser.add_argument("--args", "-a", help="Optional arguments passed to simulator via $value$plusargs", default="")
@ -33,7 +32,7 @@ parser.add_argument("--lockstep", "-l", help="Run ImperasDV lock, step, and comp
# GUI not yet implemented
#parser.add_argument("--gui", "-g", help="Simulate with GUI", action="store_true")
args = parser.parse_args()
print("run_vcs Config=" + args.config + " tests=" + args.testsuite + " elffile=" + args.elffile + " lockstep=" + str(args.lockstep) + " args='" + args.args + "'")
print("run_vcs Config=" + args.config + " tests=" + args.testsuite + " lockstep=" + str(args.lockstep) + " args='" + args.args + "' params='" + args.params + "'")
cfgdir = "$WALLY/config"
srcdir = "$WALLY/src"
@ -88,7 +87,7 @@ PARAM_OVERRIDES=" -parameters " + wkdir + "/param_overrides.txt "
OUTPUT="sim_out"
VCS_CMD="vcs +lint=all,noGCWM,noUI,noSVA-UA,noIDTS,noNS,noULCO,noCAWM-L,noWMIA-L,noSV-PIU,noSTASKW_CO,noSTASKW_CO1,noSTASKW_RMCOF -suppress +warn -sverilog +vc -Mupdate -line -full64 -lca -ntb_opts sensitive_dyn " + "-top " + args.tb + PARAM_OVERRIDES + INCLUDE_PATH # Disabled Debug flags; add them back for a GUI mode -debug_access+all+reverse -kdb +vcs+vcdpluson
VCS = VCS_CMD + " -Mdir=" + wkdir + " " + srcdir + "/cvw.sv " + LOCKSTEP_OPTIONS + " " + COV_OPTIONS + " " + RTL_FILES + " -o " + wkdir + "/" + OUTPUT + " -work " + wkdir + " -Mlib=" + wkdir + " -l " + logdir + "/" + args.config + "_" + args.testsuite + ".log"
SIMV_CMD= wkdir + "/" + OUTPUT + " +TEST=" + args.testsuite + " " + args.elffile + " " + args.args + " -no_save " + LOCKSTEP_SIMV
SIMV_CMD= wkdir + "/" + OUTPUT + " +TEST=" + args.testsuite + " " + args.args + " -no_save " + LOCKSTEP_SIMV
# Run simulation
print("Executing: " + str(VCS) )