build.plat: bypass tool detection if NMIGEN_*_env is set.

It's not practical to detect tools within the toolchain environment
for various reasons, so just assume the tools are there if the user
says they are.

Before this commit, the tools would be searched outside the toolchain
environment, which of course would always fail for Vivado, ISE, etc.
This commit is contained in:
whitequark 2019-09-12 21:56:48 +00:00
parent c8f8c09f29
commit 9ea3ff7ae2
3 changed files with 15 additions and 8 deletions

View file

@ -163,9 +163,9 @@ class LatticeECP5Platform(TemplatedPlatform):
# {{autogenerated}}
set -e{{verbose("x")}}
if [ -z "$BASH" ] ; then exec /bin/bash "$0" "$@"; fi
if [ -n "$NMIGEN_{{platform.toolchain}}_env" ]; then
bindir=$(dirname "$NMIGEN_{{platform.toolchain}}_env")
. "$NMIGEN_{{platform.toolchain}}_env"
if [ -n "${{platform._toolchain_env_var}}" ]; then
bindir=$(dirname "${{platform._toolchain_env_var}}")
. "${{platform._toolchain_env_var}}"
fi
{{emit_commands("sh")}}
""",

View file

@ -88,7 +88,7 @@ class XilinxSpartan3Or6Platform(TemplatedPlatform):
# {{autogenerated}}
set -e{{verbose("x")}}
if [ -z "$BASH" ] ; then exec /bin/bash "$0" "$@"; fi
[ -n "$NMIGEN_{{platform.toolchain}}_env" ] && . "$NMIGEN_{{platform.toolchain}}_env"
[ -n "${{platform._toolchain_env_var}}" ] && . "${{platform._toolchain_env_var}}"
{{emit_commands("sh")}}
""",
"{{name}}.v": r"""