+import os
+
from litex.build.generic_platform import GenericPlatform
from litex.build.xilinx import common, vivado, ise
def __init__(self, *args, toolchain="ise", **kwargs):
GenericPlatform.__init__(self, *args, **kwargs)
+ self.edifs = set()
if toolchain == "ise":
self.toolchain = ise.XilinxISEToolchain()
elif toolchain == "vivado":
else:
raise ValueError("Unknown toolchain")
+ def add_edif(self, filename):
+ self.edifs.add((os.path.abspath(filename)))
+
def get_verilog(self, *args, special_overrides=dict(), **kwargs):
so = dict(common.xilinx_special_overrides)
if self.device[:3] == "xc7":
self.clocks = dict()
self.false_paths = set()
- def _build_batch(self, platform, sources, build_name):
+ def _build_batch(self, platform, sources, edifs, build_name):
tcl = []
tcl.append("create_property ars_ff cell")
tcl.append("create_property ars_false_path net")
tcl.append("add_files " + filename_tcl)
tcl.append("set_property library {} [get_files {}]"
.format(library, filename_tcl))
-
+ for filename in edifs:
+ filename_tcl = "{" + filename + "}"
+ tcl.append("read_edif " + filename_tcl)
tcl.append("read_xdc {}.xdc".format(build_name))
tcl.extend(c.format(build_name=build_name) for c in self.pre_synthesis_commands)
# "-include_dirs {}" crashes Vivado 2016.4
v_file = build_name + ".v"
v_output.write(v_file)
sources = platform.sources | {(v_file, "verilog", "work")}
- self._build_batch(platform, sources, build_name)
+ edifs = platform.edifs
+ self._build_batch(platform, sources, edifs, build_name)
tools.write_to_file(build_name + ".xdc", _build_xdc(named_sc, named_pc))
if run:
_run_vivado(build_name, toolchain_path, source)