From e3bc36fa1d73456485d59c50fdf07c7ea58f2155 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Mon, 30 May 2022 23:37:40 +0200 Subject: [PATCH] f4pga/wrappers/sh: raise exception if F4PGA_INSTALL_DIR is undefined Signed-off-by: Unai Martinez-Corral --- f4pga/wrappers/sh/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/f4pga/wrappers/sh/__init__.py b/f4pga/wrappers/sh/__init__.py index ab8a99a..3d96618 100644 --- a/f4pga/wrappers/sh/__init__.py +++ b/f4pga/wrappers/sh/__init__.py @@ -31,9 +31,13 @@ F4PGA_FAM = f4pga_environ.get('F4PGA_FAM', 'xc7') isQuickLogic = F4PGA_FAM == 'eos-s3' SH_SUBDIR = 'quicklogic' if isQuickLogic else F4PGA_FAM -F4PGA_INSTALL_DIR = Path(f4pga_environ.get('F4PGA_INSTALL_DIR')) -f4pga_environ['F4PGA_ENV_BIN'] = f4pga_environ.get('F4PGA_ENV_BIN', str(F4PGA_INSTALL_DIR / F4PGA_FAM / 'conda/bin')) -f4pga_environ['F4PGA_ENV_SHARE'] = f4pga_environ.get('F4PGA_ENV_SHARE', str(F4PGA_INSTALL_DIR / F4PGA_FAM / ( +F4PGA_INSTALL_DIR = f4pga_environ.get('F4PGA_INSTALL_DIR') +if F4PGA_INSTALL_DIR is None: + raise(Exception("Required environment variable F4PGA_INSTALL_DIR is undefined!")) +F4PGA_INSTALL_DIR_PATH = Path(F4PGA_INSTALL_DIR) + +f4pga_environ['F4PGA_ENV_BIN'] = f4pga_environ.get('F4PGA_ENV_BIN', str(F4PGA_INSTALL_DIR_PATH / F4PGA_FAM / 'conda/bin')) +f4pga_environ['F4PGA_ENV_SHARE'] = f4pga_environ.get('F4PGA_ENV_SHARE', str(F4PGA_INSTALL_DIR_PATH / F4PGA_FAM / ( 'share' if isQuickLogic else 'install/share/symbiflow' )))