-import os, struct, subprocess
+import os, struct, subprocess, sys
from decimal import Decimal
from migen.fhdl.structure import *
-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)