From: Florent Kermarrec Date: Tue, 19 May 2020 14:21:52 +0000 (+0200) Subject: build/xilinx: source settings64.sh automatically just before build if LITEX_ENV_ISE... X-Git-Tag: 24jan2021_ls180~323 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b4267a79011fa7dd7cb84961196875d3be81f077;p=litex.git build/xilinx: source settings64.sh automatically just before build if LITEX_ENV_ISE/LITEX_ENV_VIVADO environment variables are set. --- diff --git a/litex/build/xilinx/ise.py b/litex/build/xilinx/ise.py index 57864174..4e904599 100644 --- a/litex/build/xilinx/ise.py +++ b/litex/build/xilinx/ise.py @@ -115,6 +115,9 @@ 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") fail_stmt = "" if mode == "edif": ext = "ngo" diff --git a/litex/build/xilinx/vivado.py b/litex/build/xilinx/vivado.py index 8652d786..2f707e2d 100644 --- a/litex/build/xilinx/vivado.py +++ b/litex/build/xilinx/vivado.py @@ -73,6 +73,9 @@ 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") script_contents += "vivado -mode batch -source " + build_name + ".tcl\n" script_file = "build_" + build_name + ".sh" tools.write_to_file(script_file, script_contents)