Merge pull request #1197 from jordancarlin/wally-do

Update wally.do to handle more arguments
This commit is contained in:
David Harris 2024-12-18 12:01:38 -08:00 committed by GitHub
commit 413288dd62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,7 +8,7 @@
# #
# Takes 1:10 to run RV64IC tests using gui # Takes 1:10 to run RV64IC tests using gui
# Usage: do wally.do <config> <testcases> <testbench> [--ccov] [--fcov] [--gui] [--args "any number of +value"] [--params "any number of VAR=VAL parameter overrides"] # Usage: do wally.do <config> <testcases> <testbench> [--ccov] [--fcov] [--gui] [--args "any number of +value"] [--params "any number of VAR=VAL parameter overrides"] [--define "any number of +define+VAR=VAL"]
# Example: do wally.do rv64gc arch64i testbench # Example: do wally.do rv64gc arch64i testbench
# Use this wally.do file to run this example. # Use this wally.do file to run this example.
@ -72,20 +72,23 @@ set accFlag ""
# Need to be able to pass arguments to vopt. Unforunately argv does not work because # Need to be able to pass arguments to vopt. Unforunately argv does not work because
# it takes on different values if vsim and the do file are called from the command line or # it takes on different values if vsim and the do file are called from the command line or
# if the do file is called from questa sim directly. This chunk of code uses the $4 through $n # if the do file is called from questa sim directly. This chunk of code uses the $n variables
# variables and compacts into a single list for passing to vopt. # and compacts them into a single list for passing to vopt. Shift is used to move the arguments
set from 4 # through the list.
set step 1
set lst {} set lst {}
echo "number of args = $argc"
for {set i 0} true {incr i} { # Shift off the first three arguments (config, testcases, testbench)
set x [expr {$i*$step + $from}] shift
if {$x > $argc} break shift
set arg [expr "$$x"] shift
lappend lst $arg
# Copy the remaining arguments into a list
while {$argc > 0} {
lappend lst [expr "\$1"]
shift
} }
echo "number of args = $argc"
echo "lst = $lst" echo "lst = $lst"
# if +acc found set flag and remove from list # if +acc found set flag and remove from list