Ejemplo n.º 1
0
def settings(path, ver=None, sub=None):
    if ver is None:
        vers = list(tools.versions(path))
        if not vers:
            raise OSError("no version directory for Xilinx tools found in "
                          + path)
        ver = max(vers)

    full = os.path.join(path, str(ver))
    if sub:
        full = os.path.join(full, sub)

    search = [64, 32]
    if tools.arch_bits() == 32:
        search.reverse()

    if sys.platform == "win32" or sys.platform == "cygwin":
        script_ext = "bat"
    else:
        script_ext = "sh"

    for b in search:
        settings = os.path.join(full, "settings{0}.{1}".format(b, script_ext))
        if os.path.exists(settings):
            return settings

    raise OSError("no Xilinx tools settings file found")
Ejemplo n.º 2
0
def settings(path, ver=None, sub=None):
    if ver is None:
        vers = list(tools.versions(path))
        if not vers:
            raise OSError("no version directory for Xilinx tools found in " +
                          path)
        ver = max(vers)

    full = os.path.join(path, str(ver))
    if sub:
        full = os.path.join(full, sub)

    search = [64, 32]
    if tools.arch_bits() == 32:
        search.reverse()

    if sys.platform == "win32" or sys.platform == "cygwin":
        script_ext = "bat"
    else:
        script_ext = "sh"

    for b in search:
        settings = os.path.join(full, "settings{0}.{1}".format(b, script_ext))
        if os.path.exists(settings):
            return settings

    raise OSError("no Xilinx tools settings file found")
Ejemplo n.º 3
0
def _get_bindir(path, ver=None):
    if ver is None:
        # _x64 suffix means StrictVersion will fail.
        vers = list(tools.versions(path, strict=False))
        if not vers:
            raise OSError("no version directory for Diamond tools found in "
                          + path)
        ver = max(vers)

    # Lattice does not provide 32-bit binaries anymore.
    if sys.platform in ("win32", "cygwin"):
        bin_suffix = "nt64"
    else:
        bin_suffix = "lin64"

    return os.path.join(path, str(ver), "bin", bin_suffix)