From 4a1756208d42d37629546966169d42ec990da08b Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 20 May 2020 10:00:39 +0200 Subject: [PATCH] build/xilinx: simplify LITEX_ENV_ISE/VIVADO handling. --- litex/build/xilinx/ise.py | 5 ++--- litex/build/xilinx/vivado.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/litex/build/xilinx/ise.py b/litex/build/xilinx/ise.py index 4e904599..34b82ae3 100644 --- a/litex/build/xilinx/ise.py +++ b/litex/build/xilinx/ise.py @@ -115,9 +115,8 @@ def _run_ise(build_name, mode, ngdbuild_opt, toolchain, platform): script_ext = ".sh" shell = ["bash"] build_script_contents = "# Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\nset -e\n" - litex_env_ise = os.getenv("LITEX_ENV_ISE", None) - if litex_env_ise is not None: - build_script_contents += "source " + os.path.join(litex_env_ise, "settings64.sh\n") + if os.getenv("LITEX_ENV_ISE", False): + build_script_contents += "source " + os.path.join(os.getenv("LITEX_ENV_ISE"), "settings64.sh\n") fail_stmt = "" if mode == "edif": ext = "ngo" diff --git a/litex/build/xilinx/vivado.py b/litex/build/xilinx/vivado.py index 2f707e2d..d81c682d 100644 --- a/litex/build/xilinx/vivado.py +++ b/litex/build/xilinx/vivado.py @@ -73,9 +73,8 @@ def _build_script(build_name): tools.write_to_file(script_file, script_contents) else: script_contents = "# Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\nset -e\n" - litex_env_vivado = os.getenv("LITEX_ENV_VIVADO", None) - if litex_env_vivado is not None: - script_contents += "source " + os.path.join(litex_env_vivado, "settings64.sh\n") + if os.getenv("LITEX_ENV_VIVADO", False): + script_contents += "source " + os.path.join(os.getenv("LITEX_ENV_VIVADO"), "settings64.sh\n") script_contents += "vivado -mode batch -source " + build_name + ".tcl\n" script_file = "build_" + build_name + ".sh" tools.write_to_file(script_file, script_contents) -- 2.30.2