mirror of https://github.com/efabless/caravel.git
Update script to return fatal error when hex generation fails
This commit is contained in:
parent
f2ca45358b
commit
407b0be306
|
@ -116,13 +116,15 @@ class RunTest:
|
||||||
f"--strip-debug -ffreestanding -nostdlib -o {elf_out} {SOURCE_FILES} {c_file}")
|
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} "
|
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}"
|
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(elf_command)+"\n"+"\n")
|
||||||
self.full_terminal.write(os.path.expandvars(hex_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.full_terminal.write(os.path.expandvars(sed_command)+"\n"+"\n")
|
||||||
self.cd_cocotb()
|
self.cd_cocotb()
|
||||||
self.full_terminal.close()
|
self.full_terminal.close()
|
||||||
|
if hex_gen_state != 0 :
|
||||||
|
print(f"fatal: Error when generating hex")
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
def cd_make(self):
|
def cd_make(self):
|
||||||
os.chdir(f"{os.getenv('VERILOG_PATH')}/dv/make")
|
os.chdir(f"{os.getenv('VERILOG_PATH')}/dv/make")
|
||||||
|
|
Loading…
Reference in New Issue