build/efinix: Improve error message when Efinity toolchain is not found.
This commit is contained in:
parent
fd354c5759
commit
f0a3fcfefa
|
@ -22,11 +22,14 @@ class EfinixPlatform(GenericPlatform):
|
||||||
self.pll_available = ['PLL_TL0', 'PLL_TR0', 'PLL_TR1', 'PLL_TR2', 'PLL_TR3', 'PLL_BR0', 'PLL_BR1', 'PLL_BR2', 'PLL_BL0']
|
self.pll_available = ['PLL_TL0', 'PLL_TR0', 'PLL_TR1', 'PLL_TR2', 'PLL_TR3', 'PLL_BR0', 'PLL_BR1', 'PLL_BR2', 'PLL_BL0']
|
||||||
self.pll_used = []
|
self.pll_used = []
|
||||||
|
|
||||||
if 'LITEX_ENV_EFINITY' in os.environ:
|
if os.getenv("LITEX_ENV_EFINITY", False) == False:
|
||||||
self.efinity_path = os.environ['LITEX_ENV_EFINITY'].rstrip('/')
|
msg = "Unable to find or source Efinity toolchain, please either:\n"
|
||||||
os.environ['EFINITY_HOME'] = self.efinity_path
|
msg += "- Set LITEX_ENV_EFINITY environment variant to Efinity path.\n"
|
||||||
else:
|
msg += "- Or add Efinity toolchain to your $PATH."
|
||||||
raise OSError('Unable to find Efinity toolchain, please set LITEX_ENV_EFINITY to ${install_dir}')
|
raise OSError(msg)
|
||||||
|
|
||||||
|
self.efinity_path = os.environ["LITEX_ENV_EFINITY"].rstrip('/')
|
||||||
|
os.environ["EFINITY_HOME"] = self.efinity_path
|
||||||
|
|
||||||
if toolchain == "efinity":
|
if toolchain == "efinity":
|
||||||
self.toolchain = efinity.EfinityToolchain(self.efinity_path)
|
self.toolchain = efinity.EfinityToolchain(self.efinity_path)
|
||||||
|
|
|
@ -16,11 +16,14 @@ class EfinixProgrammer(GenericProgrammer):
|
||||||
|
|
||||||
def __init__(self, cable_name=""):
|
def __init__(self, cable_name=""):
|
||||||
self.cable_name = cable_name
|
self.cable_name = cable_name
|
||||||
if 'LITEX_ENV_EFINITY' in os.environ:
|
if os.getenv("LITEX_ENV_EFINITY", False) == False:
|
||||||
self.efinity_path = os.environ['LITEX_ENV_EFINITY'].rstrip('/')
|
msg = "Unable to find or source Efinity toolchain, please either:\n"
|
||||||
os.environ['EFINITY_HOME'] = self.efinity_path
|
msg += "- Set LITEX_ENV_EFINITY environment variant to Efinity path.\n"
|
||||||
else:
|
msg += "- Or add Efinity toolchain to your $PATH."
|
||||||
raise OSError('Unable to find Efinity toolchain, please set LITEX_ENV_EFINITY to ${install_dir}')
|
raise OSError(msg)
|
||||||
|
|
||||||
|
self.efinity_path = os.environ["LITEX_ENV_EFINITY"].rstrip('/')
|
||||||
|
os.environ["EFINITY_HOME"] = self.efinity_path
|
||||||
|
|
||||||
def load_bitstream(self, bitstream_file, cable_suffix=""):
|
def load_bitstream(self, bitstream_file, cable_suffix=""):
|
||||||
os.environ['EFXPGM_HOME'] = self.efinity_path + '/pgm'
|
os.environ['EFXPGM_HOME'] = self.efinity_path + '/pgm'
|
||||||
|
|
Loading…
Reference in New Issue