From 106b1f29a723b0c6372ee83315b9a65a5dfa379f Mon Sep 17 00:00:00 2001 From: Franck Jullien Date: Mon, 20 Sep 2021 08:42:27 +0200 Subject: [PATCH] efinix: fix programmer load_bitstream --- litex/build/efinix/programmer.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/litex/build/efinix/programmer.py b/litex/build/efinix/programmer.py index 1981b5fa3..10a3eaff4 100644 --- a/litex/build/efinix/programmer.py +++ b/litex/build/efinix/programmer.py @@ -6,6 +6,7 @@ import os import sys +import subprocess from litex.build.generic_programmer import GenericProgrammer @@ -21,7 +22,11 @@ class EfinixProgrammer(GenericProgrammer): def load_bitstream(self, bitstream_file, cable_suffix=""): os.environ['EFXPGM_HOME'] = self.efinity_path + '/pgm' - self.call([self.efinity_path + '/bin/python3', self.efinity_path + - 'pgm/bin/efx_pgm/ftdi_program.py', bitstream_file, - "-m", "jtag" - ]) + if (subprocess.call([self.efinity_path + '/bin/python3', self.efinity_path + + '/pgm/bin/efx_pgm/ftdi_program.py', bitstream_file, + "-m", "jtag"], env=os.environ.copy()) != 0): + msg = f"Error occured during {self.__class__.__name__}'s call, please check:\n" + msg += f"- {self.__class__.__name__} installation.\n" + msg += f"- access permissions.\n" + msg += f"- hardware and cable." + raise OSError(msg)