From 29eaf068f384d08b128bed213483318ce1691246 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 16 Apr 2013 22:55:24 +0200 Subject: [PATCH] xilinx_ise: do not attempt to source settings file on Windows --- mibuild/xilinx_ise.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/mibuild/xilinx_ise.py b/mibuild/xilinx_ise.py index 0d7a663b..fa1eb1b3 100644 --- a/mibuild/xilinx_ise.py +++ b/mibuild/xilinx_ise.py @@ -1,4 +1,4 @@ -import os, struct, subprocess +import os, struct, subprocess, sys from decimal import Decimal from migen.fhdl.structure import * @@ -85,16 +85,19 @@ def _build_files(device, sources, named_sc, named_pc, build_name): -p %s""" % (build_name, build_name, device) tools.write_to_file(build_name + ".xst", xst_contents) +def _is_valid_version(path, v): + try: + Decimal(v) + return os.path.isdir(os.path.join(path, v)) + except: + return False + def _run_ise(build_name, ise_path, source): - def is_valid_version(v): - try: - Decimal(v) - return os.path.isdir(os.path.join(ise_path, v)) - except: - return False + if sys.platform == "win32" or sys.platform == "cygwin": + source = False build_script_contents = "# Autogenerated by mibuild\nset -e\n" if source: - vers = [ver for ver in os.listdir(ise_path) if is_valid_version(ver)] + vers = [ver for ver in os.listdir(ise_path) if _is_valid_version(ise_path, ver)] tools_version = max(vers) bits = struct.calcsize("P")*8 xilinx_settings_file = '%s/%s/ISE_DS/settings%d.sh' % (ise_path, tools_version, bits) -- 2.30.2