build/xilinx/vivado: revert toolchain_path
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 28 Feb 2018 22:45:26 +0000 (23:45 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 28 Feb 2018 22:45:26 +0000 (23:45 +0100)
litex/build/xilinx/vivado.py

index b8220e57cb52163110f3938454e0a2a93cb55d52..034dcc70142887cd2b1aaad3c17414ad2994f4b2 100644 (file)
@@ -180,6 +180,13 @@ class XilinxVivadoToolchain:
 
     def build(self, platform, fragment, build_dir="build", build_name="top",
             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)
         cwd = os.getcwd()
         os.chdir(build_dir)
@@ -198,8 +205,6 @@ class XilinxVivadoToolchain:
         self._build_batch(platform, sources, edifs, build_name)
         tools.write_to_file(build_name + ".xdc", _build_xdc(named_sc, named_pc))
         if run:
-            if toolchain_path is None:
-                toolchain_path = "/opt/Xilinx/Vivado"
             _run_vivado(build_name, toolchain_path, source)
 
         os.chdir(cwd)