mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Remove extra spaces and use lists for assembling args and params
This commit is contained in:
parent
95a5070a72
commit
25cdf83aae
32
bin/wsim
32
bin/wsim
@ -75,28 +75,34 @@ def elfFileCheck(args):
|
||||
return ElfFile
|
||||
|
||||
def prepSim(args, ElfFile):
|
||||
flags = ""
|
||||
prefix = ""
|
||||
params = []
|
||||
args = []
|
||||
flags = []
|
||||
if args.vcd:
|
||||
args.params += " MAKE_VCD=1 "
|
||||
params.append("MAKE_VCD=1")
|
||||
if args.rvvi:
|
||||
args.params += " RVVI_SYNTH_SUPPORTED=1 "
|
||||
params.append("RVVI_SYNTH_SUPPORTED=1")
|
||||
if args.tb == "testbench_fp":
|
||||
args.params += f' TEST="{args.testsuite}" '
|
||||
if ElfFile != "":
|
||||
args.args += f" {ElfFile}"
|
||||
params.append(f'TEST="{args.testsuite}"')
|
||||
if ElfFile:
|
||||
args.append += f"{ElfFile}"
|
||||
if args.gui and args.tb == "testbench":
|
||||
args.params += " DEBUG=1 "
|
||||
params.append("DEBUG=1")
|
||||
if args.ccov:
|
||||
flags += " --ccov"
|
||||
flags.append("--ccov")
|
||||
if args.fcov:
|
||||
flags += " --fcov"
|
||||
flags.append("--fcov")
|
||||
if args.gui:
|
||||
flags += " --gui"
|
||||
flags.append("--gui")
|
||||
if args.lockstep or args.lockstepverbose:
|
||||
flags += " --lockstep"
|
||||
flags.append("--lockstep")
|
||||
if args.lockstep or args.lockstepverbose or args.fcov:
|
||||
prefix = lockstepSetup(args)
|
||||
# Combine into a single string
|
||||
args.args += " ".join(args)
|
||||
args.params += " ".join(params)
|
||||
flags = " ".join(flags)
|
||||
return flags, prefix
|
||||
|
||||
def lockstepSetup(args):
|
||||
@ -126,9 +132,9 @@ def runQuesta(args, flags, prefix):
|
||||
# Force Questa to use 64-bit mode, sometimes it defaults to 32-bit even on 64-bit machines
|
||||
prefix = "MTI_VCO_MODE=64 " + prefix
|
||||
if (args.args != ""):
|
||||
args.args = f' --args \\"{args.args}\\"'
|
||||
args.args = fr'--args \"{args.args}\"'
|
||||
if (args.params != ""):
|
||||
args.params = f' --params \\"{args.params}\\"'
|
||||
args.params = fr'--params \"{args.params}\"'
|
||||
# Questa cannot accept more than 9 arguments. fcov implies lockstep
|
||||
cmd = f"do wally.do {args.config} {args.testsuite} {args.tb} {args.args} {args.params} {flags}"
|
||||
cmd = f'cd $WALLY/sim/questa; {prefix} vsim {"-c" if not args.gui else ""} -do "{cmd}"'
|
||||
|
Loading…
Reference in New Issue
Block a user