xilinx_ise: do not attempt to source settings file on Windows
This commit is contained in:
parent
31b1960188
commit
29eaf068f3
|
@ -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 _run_ise(build_name, ise_path, source):
|
||||
def is_valid_version(v):
|
||||
def _is_valid_version(path, v):
|
||||
try:
|
||||
Decimal(v)
|
||||
return os.path.isdir(os.path.join(ise_path, v))
|
||||
return os.path.isdir(os.path.join(path, v))
|
||||
except:
|
||||
return False
|
||||
|
||||
def _run_ise(build_name, ise_path, source):
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue