From a043b2536d1bac20f06f92fcd6ea5cafce2b9835 Mon Sep 17 00:00:00 2001 From: Andrew Dennison Date: Tue, 19 Oct 2021 10:38:54 +1100 Subject: [PATCH] efinix: abort if scripts fail * get obscure downstream errors when the scripts blindly continue --- litex/build/efinix/efinity.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/litex/build/efinix/efinity.py b/litex/build/efinix/efinity.py index f517a9c0e..f099877f8 100644 --- a/litex/build/efinix/efinity.py +++ b/litex/build/efinix/efinity.py @@ -156,7 +156,9 @@ def _build_peri(efinity_path, build_name, partnumber, named_sc, named_pc, fragme tools.write_to_file("iface.py", header + gen + gpio + add + footer) - subprocess.call([efinity_path + '/bin/python3', 'iface.py']) + if subprocess.call([efinity_path + '/bin/python3', 'iface.py']) != 0: + raise OSError("Error occurred during Efinity peri script execution.") + # Project configuration ------------------------------------------------------------------------ @@ -316,7 +318,8 @@ class EfinityToolchain(): # Run if run: - subprocess.call([self.efinity_path + '/scripts/efx_run.py', build_name + '.xml', '-f', 'compile']) + if subprocess.call([self.efinity_path + '/scripts/efx_run.py', build_name + '.xml', '-f', 'compile']) != 0: + raise OSError("Error occurred during efx_run script execution.") os.chdir(cwd)