Passing arguments to buildroot, not yet checking result correctly

This commit is contained in:
David Harris 2024-04-06 11:42:41 -07:00
parent b3f007ec7f
commit 3c855e3e90
4 changed files with 28 additions and 18 deletions

View File

@ -219,10 +219,18 @@ def addTests(tests, sim):
for test in tests: for test in tests:
config = test[0]; config = test[0];
suites = test[1]; suites = test[1];
if(len(test) >= 4 and test[2] == "configOptions"): if (len(test) > 2):
configOptions = test[3] args = " ".join(test[2::])
cmdPrefix = "vsim > {} -c <<!\ndo wally-batch.do "+config #args = str(test[2])
print("args = ", args)
args = " --args " + args
#cmdPrefix = "wsim -s " + sim + " " + config + " --args " + args
#if(len(test) >= 4 and test[2] == "configOptions"):
# configOptions = test[3]
# cmdPrefix = "vsim > {} -c <<!\ndo wally-batch.do "+config
else: else:
args = ""
configOptions = "" configOptions = ""
#cmdPrefix = "vsim > {} -c <<!\ndo wally-batch.do "+config #cmdPrefix = "vsim > {} -c <<!\ndo wally-batch.do "+config
cmdPrefix="wsim -s " + sim + " " + config cmdPrefix="wsim -s " + sim + " " + config
@ -231,7 +239,7 @@ def addTests(tests, sim):
name=t, name=t,
variant=config, variant=config,
#cmd=cmdPrefix+" "+t+" configOptions "+configOptions+"\n!", #cmd=cmdPrefix+" "+t+" configOptions "+configOptions+"\n!",
cmd=cmdPrefix + " " + t, cmd=cmdPrefix + " " + t + args,
grepstr="All tests ran without failures") grepstr="All tests ran without failures")
configs.append(tc) configs.append(tc)

View File

@ -22,9 +22,9 @@ parser.add_argument("--sim", "-s", help="Simulator", choices=["questa", "verilat
parser.add_argument("--tb", "-t", help="Testbench", choices=["testbench", "testbench_fp"], default="testbench") parser.add_argument("--tb", "-t", help="Testbench", choices=["testbench", "testbench_fp"], default="testbench")
parser.add_argument("--gui", "-g", help="Simulate with GUI", action="store_true") parser.add_argument("--gui", "-g", help="Simulate with GUI", action="store_true")
parser.add_argument("--coverage", "-c", help="Code & Functional Coverage", action="store_true") parser.add_argument("--coverage", "-c", help="Code & Functional Coverage", action="store_true")
parser.add_argument("--arg", "-a", help="Optional arguments passed to simulator via $value$plusargs", default="") parser.add_argument("--args", "-a", help="Optional arguments passed to simulator via $value$plusargs", default="")
args = parser.parse_args() args = parser.parse_args()
print("Config=" + args.config + " tests=" + args.testsuite + " sim=" + args.sim + " gui=" + str(args.gui) + " arg='" + args.arg + "'") print("Config=" + args.config + " tests=" + args.testsuite + " sim=" + args.sim + " gui=" + str(args.gui) + " args='" + args.args + "'")
# Validate arguments # Validate arguments
if (args.gui): if (args.gui):
@ -40,7 +40,7 @@ if (args.coverage):
# Launch selected simulator # Launch selected simulator
cd = "cd $WALLY/sim/" +args.sim cd = "cd $WALLY/sim/" +args.sim
if (args.sim == "questa"): if (args.sim == "questa"):
cmd = "do wally.do " + args.config + " " + args.testsuite + " " + args.tb + " " + args.arg cmd = "do wally.do " + args.config + " " + args.testsuite + " " + args.tb + " " + args.args
if (args.coverage): if (args.coverage):
cmd += " -coverage" cmd += " -coverage"
if (args.gui): # launch Questa with GUI; add +acc to keep variables accessible if (args.gui): # launch Questa with GUI; add +acc to keep variables accessible

View File

@ -57,14 +57,16 @@ for {set i 0} true {incr i} {
} }
if {$argc >= 3} { if {$argc >= 3} {
if {$3 eq "-coverage" || ($argc >= 7 && $7 eq "-coverage")} {
set coverage 1
set CoverageVoptArg "+cover=sbecf"
set CoverageVsimArg "-coverage"
} elseif {$3 eq "configOptions"} {
set configOptions $lst set configOptions $lst
puts $configOptions puts $configOptions
} #if {$3 eq "-coverage" || ($argc >= 7 && $7 eq "-coverage")} {
# set coverage 1
# set CoverageVoptArg "+cover=sbecf"
# set CoverageVsimArg "-coverage"
#} elseif {$3 eq "configOptions"} {
# set configOptions $lst
# puts $configOptions
#}
} }
# compile source files # compile source files
@ -78,7 +80,7 @@ vlog -lint -work ${WKDIR} +incdir+${CONFIG}/$1 +incdir+${CONFIG}/deriv/$1 +incdi
# remove +acc flag for faster sim during regressions if there is no need to access internal signals # remove +acc flag for faster sim during regressions if there is no need to access internal signals
#vopt wkdir/${CFG}_${TESTSUITE}.${TESTBENCH} -work ${WKDIR} -G TEST=$2 ${configOptions} -o testbenchopt ${CoverageVoptArg} #vopt wkdir/${CFG}_${TESTSUITE}.${TESTBENCH} -work ${WKDIR} -G TEST=$2 ${configOptions} -o testbenchopt ${CoverageVoptArg}
vopt wkdir/${CFG}_${TESTSUITE}.${TESTBENCH} -work ${WKDIR} ${configOptions} -o testbenchopt ${CoverageVoptArg} vopt wkdir/${CFG}_${TESTSUITE}.${TESTBENCH} -work ${WKDIR} ${configOptions} -o testbenchopt ${CoverageVoptArg}
vsim -lib ${WKDIR} testbenchopt +TEST=${TESTSUITE} -fatal 7 -suppress 3829 ${CoverageVsimArg} vsim -lib ${WKDIR} testbenchopt +TEST=${TESTSUITE} ${configOptions} -fatal 7 -suppress 3829 ${CoverageVsimArg}
# vsim -lib wkdir/work_${1}_${2} testbenchopt -fatal 7 -suppress 3829 # vsim -lib wkdir/work_${1}_${2} testbenchopt -fatal 7 -suppress 3829
# power add generates the logging necessary for said generation. # power add generates the logging necessary for said generation.

View File

@ -44,7 +44,6 @@ module testbench;
parameter I_CACHE_ADDR_LOGGER=0; parameter I_CACHE_ADDR_LOGGER=0;
parameter D_CACHE_ADDR_LOGGER=0; parameter D_CACHE_ADDR_LOGGER=0;
parameter RISCV_DIR = "/opt/riscv"; parameter RISCV_DIR = "/opt/riscv";
// parameter INSTR_LIMIT = 0;
`ifdef USE_IMPERAS_DV `ifdef USE_IMPERAS_DV
import idvPkg::*; import idvPkg::*;
@ -108,6 +107,7 @@ module testbench;
TEST = "none"; TEST = "none";
if (!$value$plusargs("INSTR_LIMIT=%d", INSTR_LIMIT)) if (!$value$plusargs("INSTR_LIMIT=%d", INSTR_LIMIT))
INSTR_LIMIT = 0; INSTR_LIMIT = 0;
$display("INSTR_LIMIT = ", INSTR_LIMIT);
// pick tests based on modes supported // pick tests based on modes supported