Update script to return fatal error when hex generation fails

This commit is contained in:
M0stafaRady 2022-10-01 01:48:55 -07:00
parent f2ca45358b
commit 407b0be306
1 changed files with 4 additions and 2 deletions

View File

@ -116,13 +116,15 @@ class RunTest:
f"--strip-debug -ffreestanding -nostdlib -o {elf_out} {SOURCE_FILES} {c_file}")
hex_command = f"{GCC_PATH}/{GCC_PREFIX}-objcopy -O verilog {elf_out} {hex_file} "
sed_command = f"sed -ie 's/@10/@00/g' {hex_file}"
os.system(f"docker run -it -v /home:/home efabless/dv:latest sh -c 'cd {test_dir} && {elf_command} && {hex_command} && {sed_command} '")
hex_gen_state = os.system(f"docker run -it -v /home:/home efabless/dv:latest sh -c 'cd {test_dir} && {elf_command} && {hex_command} && {sed_command} '")
self.full_terminal.write(os.path.expandvars(elf_command)+"\n"+"\n")
self.full_terminal.write(os.path.expandvars(hex_command)+"\n"+"\n")
self.full_terminal.write(os.path.expandvars(sed_command)+"\n"+"\n")
self.cd_cocotb()
self.full_terminal.close()
if hex_gen_state != 0 :
print(f"fatal: Error when generating hex")
sys.exit()
def cd_make(self):
os.chdir(f"{os.getenv('VERILOG_PATH')}/dv/make")