mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Refactor Elf eile handling for better Breker compatibility
This commit is contained in:
parent
53b5c9557a
commit
2818bdbaa8
12
bin/wsim
12
bin/wsim
@ -57,13 +57,13 @@ def validateArgs(args):
|
||||
def elfFileCheck(args):
|
||||
ElfFile = ""
|
||||
if os.path.isfile(args.elf):
|
||||
ElfFile = f"+ElfFile={os.path.abspath(args.elf)}"
|
||||
ElfFile = os.path.abspath(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
|
||||
if os.path.isfile(args.testsuite):
|
||||
ElfFile = f"+ElfFile={os.path.abspath(args.testsuite)}"
|
||||
ElfFile = os.path.abspath(args.testsuite)
|
||||
# extract the elf name from the path to be the test suite
|
||||
fields = args.testsuite.rsplit('/', 3)
|
||||
# if the name is just ref.elf in a deep path (riscv-arch-test/wally-riscv-arch-test), then use the directory name as the test suite to make it unique; otherwise work directory will have duplicates.
|
||||
@ -94,7 +94,7 @@ def prepSim(args, ElfFile):
|
||||
if args.tb == "testbench_fp":
|
||||
paramsList.append(f'TEST="{args.testsuite}"')
|
||||
if ElfFile:
|
||||
argsList.append(f"{ElfFile}")
|
||||
argsList.append(f"+ElfFile={ElfFile}")
|
||||
if args.gui and args.tb == "testbench":
|
||||
paramsList.append("DEBUG=1")
|
||||
if args.ccov:
|
||||
@ -110,11 +110,11 @@ def prepSim(args, ElfFile):
|
||||
if args.lockstep or args.lockstepverbose or args.fcov:
|
||||
prefix = lockstepSetup(args)
|
||||
defineList.append("+define+USE_IMPERAS_DV")
|
||||
if "breker" in ElfFile:
|
||||
ElfFileNoExtension = os.path.splitext(args.testsuite)[0]
|
||||
if args.config == "breker":
|
||||
ElfFileNoExtension = os.path.splitext(ElfFile)[0]
|
||||
flagsList.append("--breker")
|
||||
defineList.append("+define+USE_TREK_DV")
|
||||
argsList.append(f"+TREK_TBX_FILE={WALLY}/tests/breker/work/{ElfFileNoExtension}/{ElfFileNoExtension}.tbx")
|
||||
argsList.append(f"+TREK_TBX_FILE={ElfFileNoExtension}.tbx")
|
||||
# Combine into a single string
|
||||
args.args += " ".join(argsList)
|
||||
args.params += " ".join(paramsList)
|
||||
|
Loading…
Reference in New Issue
Block a user