Specify top-level module in Lattice Diemond build script.
authorSergiusz Bazanski <q3k@q3k.org>
Tue, 23 Jan 2018 01:17:04 +0000 (01:17 +0000)
committerSergiusz Bazanski <q3k@q3k.org>
Tue, 23 Jan 2018 01:17:04 +0000 (01:17 +0000)
When building multi-source files the toolchain gets confused as to which
module is top-level. This ensures that the build_name of the design is
selected.

litex/build/lattice/diamond.py

index c3065fe20cecbf8fa91b5c521bef791d9f94cd28..bfc72fbbe123859bf3b10e9a8079e0dbce57905e 100644 (file)
@@ -52,6 +52,7 @@ def _build_files(device, sources, vincpaths, build_name):
         tcl.append("prj_impl option {include path} {\"" + path + "\"}")
     for filename, language, library in sources:
         tcl.append("prj_src add \"" + filename + "\" -work " + library)
+    tcl.append("prj_impl option top \"{}\"".format(build_name))
     tcl.append("prj_run Synthesis -impl implementation -forceOne")
     tcl.append("prj_run Translate -impl implementation")
     tcl.append("prj_run Map -impl implementation")