core/naxriscv: Don't use os.system to execute sbt

The use of os.system together with cd is a problem because it changes the
CWD for the whole python process. This breaks for example --csr-csv.
This commit is contained in:
Christian Klarhorst 2022-11-11 14:14:47 +01:00
parent c1885b333f
commit c1c4910d67
1 changed files with 1 additions and 2 deletions

View File

@ -260,8 +260,7 @@ class NaxRiscv(CPU):
cmd = f"""cd {ndir} && sbt "runMain naxriscv.platform.LitexGen {" ".join(gen_args)}\""""
print("NaxRiscv generation command :")
print(cmd)
if os.system(cmd) != 0:
raise OSError('Failed to run sbt')
subprocess.check_call(cmd, shell=True)
def add_sources(self, platform):