more cleanup

This commit is contained in:
Jordan Carlin 2024-12-08 14:20:55 -08:00
parent 922bdb5cca
commit b58ab831e7
No known key found for this signature in database

View File

@ -55,7 +55,7 @@ def elfFileCheck(args):
ElfFile = ""
if os.path.isfile(args.elf):
ElfFile = f"+ElfFile={os.path.abspath(args.elf)}"
elif args.elf != "":
elif args.elf:
print(f"ELF file not found: {args.elf}")
sys.exit(1)
elif args.testsuite.endswith('.elf'): # No --elf argument; check if testsuite has a .elf extension and use that instead
@ -138,11 +138,11 @@ def runSim(args, flags, prefix):
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 != "":
if args.args:
args.args = fr'--args \"{args.args}\"'
if args.params != "":
if args.params:
args.params = fr'--params \"{args.params}\"'
if args.define != "":
if args.define:
args.define = fr'--define \"{args.define}\"'
# 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} {args.define} {flags}"
@ -156,11 +156,11 @@ def runVerilator(args):
def runVCS(args, flags, prefix):
print(f"Running VCS on {args.config} {args.testsuite}")
if args.args != "":
if args.args:
args.args = f'--args "{args.args}"'
if args.params != "":
if args.params:
args.params = f'--params "{args.params}"'
if args.define != "":
if args.define:
args.define = f'--define "{args.define}"'
cmd = f"cd $WALLY/sim/vcs; {prefix} ./run_vcs {args.config} {args.testsuite} --tb {args.tb} {args.args} {args.params} {args.define} {flags}"
print(cmd)