From c1c4910d67e4c807f18685b2027c63e1619a3553 Mon Sep 17 00:00:00 2001 From: Christian Klarhorst Date: Fri, 11 Nov 2022 14:14:47 +0100 Subject: [PATCH] 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. --- litex/soc/cores/cpu/naxriscv/core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/litex/soc/cores/cpu/naxriscv/core.py b/litex/soc/cores/cpu/naxriscv/core.py index e6b1a2549..3f40fd66f 100755 --- a/litex/soc/cores/cpu/naxriscv/core.py +++ b/litex/soc/cores/cpu/naxriscv/core.py @@ -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):