build: fix merge

This commit is contained in:
Florent Kermarrec 2018-02-28 23:10:24 +01:00
parent 64e4e1ce84
commit 2ff50a8882
2 changed files with 5 additions and 3 deletions

View File

@ -97,7 +97,7 @@ def _run_ise(build_name, ise_path, source, mode, ngdbuild_opt,
build_script_contents = "# Autogenerated by LiteX\nset -e\n" build_script_contents = "# Autogenerated by LiteX\nset -e\n"
fail_stmt = "" fail_stmt = ""
if source: if source:
settings = common.settings(ise_path, "ISE_DS", ver, first="version") settings = common.settings(ise_path, ver, "ISE_DS")
build_script_contents += source_cmd + settings + "\n" build_script_contents += source_cmd + settings + "\n"
ext = "ngc" ext = "ngc"

View File

@ -63,7 +63,7 @@ def _run_vivado(build_name, vivado_path, source, ver=None):
command = build_script_file command = build_script_file
else: else:
build_script_contents = "# Autogenerated by LiteX\nset -e\n" build_script_contents = "# Autogenerated by LiteX\nset -e\n"
settings = common.settings(vivado_path, "Vivado", ver, first="name") settings = common.settings(vivado_path, ver)
build_script_contents += "source " + settings + "\n" build_script_contents += "source " + settings + "\n"
build_script_contents += "vivado -mode batch -source " + build_name + ".tcl\n" build_script_contents += "vivado -mode batch -source " + build_name + ".tcl\n"
build_script_file = "build_" + build_name + ".sh" build_script_file = "build_" + build_name + ".sh"
@ -179,7 +179,7 @@ class XilinxVivadoToolchain:
) )
def build(self, platform, fragment, build_dir="build", build_name="top", def build(self, platform, fragment, build_dir="build", build_name="top",
toolchain_path="/opt/Xilinx/Vivado", source=True, run=True, **kwargs): toolchain_path=None, source=True, run=True, **kwargs):
os.makedirs(build_dir, exist_ok=True) os.makedirs(build_dir, exist_ok=True)
cwd = os.getcwd() cwd = os.getcwd()
os.chdir(build_dir) os.chdir(build_dir)
@ -198,6 +198,8 @@ class XilinxVivadoToolchain:
self._build_batch(platform, sources, edifs, build_name) self._build_batch(platform, sources, edifs, build_name)
tools.write_to_file(build_name + ".xdc", _build_xdc(named_sc, named_pc)) tools.write_to_file(build_name + ".xdc", _build_xdc(named_sc, named_pc))
if run: if run:
if toolchain_path is None:
toolchain_path = "/opt/Xilinx/Vivado"
_run_vivado(build_name, toolchain_path, source) _run_vivado(build_name, toolchain_path, source)
os.chdir(cwd) os.chdir(cwd)