Open dbalthazor opened 2 years ago
@dbalthazor Adding an environment variable is a good idea but I think we should keep the current behavior to search the user's path if no environment variable is given. That will maintain backward compatibility. In order of priority:
vivado_path
VUNIT_VIVADO_PATH
vivado
or
vivado = str(Path(vivado_path).resolve() / "bin" / "vivado") if vivado_path is not None else environ["VUNIT_VIVADO_PATH"] if "VUNIT_VIVADO_PATH" in environ else "vivado"
The vivado.py python script pulls the path to the vivado binary from either the user's path or from method argument, rather than from a env variable like the simulator paths. Modifying the
run_vivado
method under vivado.py to pull from an env variable would make it much easier to work with multiple local vivado installs on a machine, and unify this code with how VUnit specifies other binaries.The
run_vivado
method might look something like this