build/xilinx/vivado: revert toolchain_path

This commit is contained in:
Florent Kermarrec 2018-02-28 23:45:26 +01:00
parent 2ff50a8882
commit 0332f73a7b
1 changed files with 7 additions and 2 deletions

View File

@ -180,6 +180,13 @@ class XilinxVivadoToolchain:
def build(self, platform, fragment, build_dir="build", build_name="top", def build(self, platform, fragment, build_dir="build", build_name="top",
toolchain_path=None, source=True, run=True, **kwargs): toolchain_path=None, source=True, run=True, **kwargs):
if toolchain_path is None:
if sys.platform == "win32":
toolchain_path = "C:\\Xilinx"
elif sys.platform == "cygwin":
toolchain_path = "/cygdrive/c/Xilinx"
else:
toolchain_path = "/opt/Xilinx/Vivado"
os.makedirs(build_dir, exist_ok=True) os.makedirs(build_dir, exist_ok=True)
cwd = os.getcwd() cwd = os.getcwd()
os.chdir(build_dir) os.chdir(build_dir)
@ -198,8 +205,6 @@ class XilinxVivadoToolchain:
self._build_batch(platform, sources, edifs, build_name) self._build_batch(platform, sources, edifs, build_name)
tools.write_to_file(build_name + ".xdc", _build_xdc(named_sc, named_pc)) tools.write_to_file(build_name + ".xdc", _build_xdc(named_sc, named_pc))
if run: if run:
if toolchain_path is None:
toolchain_path = "/opt/Xilinx/Vivado"
_run_vivado(build_name, toolchain_path, source) _run_vivado(build_name, toolchain_path, source)
os.chdir(cwd) os.chdir(cwd)