From 92ef330c1234b5eafeaa46c8271f60f01807fdbb Mon Sep 17 00:00:00 2001
From: Dolu1990 <charles.papon.90@gmail.com>
Date: Mon, 16 Jan 2023 18:02:32 +0100
Subject: [PATCH] cpu/Vexriscv-smp fix silent generation failure

---
 litex/soc/cores/cpu/vexriscv_smp/core.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/litex/soc/cores/cpu/vexriscv_smp/core.py b/litex/soc/cores/cpu/vexriscv_smp/core.py
index e6061c254..58fd05d66 100755
--- a/litex/soc/cores/cpu/vexriscv_smp/core.py
+++ b/litex/soc/cores/cpu/vexriscv_smp/core.py
@@ -7,6 +7,7 @@
 
 import os
 from os import path
+import subprocess
 
 from migen import *
 
@@ -270,8 +271,8 @@ class VexRiscvSMP(CPU):
         gen_args.append(f"--itlb-size={VexRiscvSMP.itlb_size}")
 
         cmd = 'cd {path} && sbt "runMain vexriscv.demo.smp.VexRiscvLitexSmpClusterCmdGen {args}"'.format(path=os.path.join(vdir, "ext", "VexRiscv"), args=" ".join(gen_args))
-        if os.system(cmd) != 0:
-            raise OSError('Failed to run sbt')
+        subprocess.check_call(cmd, shell=True)
+
 
     def __init__(self, platform, variant):
         self.platform         = platform