build: pass build_name to get_verilog (same name for top module and top level file)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 2 Dec 2015 13:18:09 +0000 (14:18 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 2 Dec 2015 13:18:09 +0000 (14:18 +0100)
litex/build/altera/quartus.py
litex/build/lattice/diamond.py
litex/build/xilinx/ise.py
litex/build/xilinx/vivado.py

index cdab36be32d7670740252501e91475ed0877fe22..e7a27622d913b32ae17fab23e5e5f7c55a0493f9 100644 (file)
@@ -113,7 +113,7 @@ quartus_sta {build_name} -c {build_name}
 
 class AlteraQuartusToolchain:
     def build(self, platform, fragment, build_dir="build", build_name="top",
-              toolchain_path="/opt/Altera", run=True):
+              toolchain_path="/opt/Altera", run=True, **kwargs):
         cwd = os.getcwd()
         tools.mkdir_noerror(build_dir)
         os.chdir(build_dir)
@@ -122,7 +122,7 @@ class AlteraQuartusToolchain:
             fragment = fragment.get_fragment()
         platform.finalize(fragment)
 
-        v_output = platform.get_verilog(fragment)
+        v_output = platform.get_verilog(fragment, name=build_name, **kwargs)
         named_sc, named_pc = platform.resolve_signals(v_output.ns)
         v_file = build_name + ".v"
         v_output.write(v_file)
index 857fef02175b0a537fa8fcb263d92ddb58bae317..68d1db449158eb5827a80bc274a4abeccbf22232 100644 (file)
@@ -76,7 +76,7 @@ def _run_diamond(build_name, source, ver=None):
 
 class LatticeDiamondToolchain:
     def build(self, platform, fragment, build_dir="build", build_name="top",
-              toolchain_path="/opt/Diamond", run=True):
+              toolchain_path="/opt/Diamond", run=True, **kwargs):
         tools.mkdir_noerror(build_dir)
         cwd = os.getcwd()
         os.chdir(build_dir)
@@ -85,7 +85,7 @@ class LatticeDiamondToolchain:
             fragment = fragment.get_fragment()
         platform.finalize(fragment)
 
-        v_output = platform.get_verilog(fragment)
+        v_output = platform.get_verilog(fragment, name=build_name, **kwargs)
         named_sc, named_pc = platform.resolve_signals(v_output.ns)
         v_file = build_name + ".v"
         v_output.write(v_file)
index e2d29ac39d1bd24e1cc7e81ed0a6cd0911f1159c..374bffc08197958b993ce0c79c498b72bf5e365c 100644 (file)
@@ -133,7 +133,7 @@ class XilinxISEToolchain:
         self.ise_commands = ""
 
     def build(self, platform, fragment, build_dir="build", build_name="top",
-            toolchain_path=None, source=None, run=True, mode="xst"):
+            toolchain_path=None, source=None, run=True, mode="xst", **kwargs):
         if not isinstance(fragment, _Fragment):
             fragment = fragment.get_fragment()
         if toolchain_path is None:
@@ -155,7 +155,7 @@ class XilinxISEToolchain:
         os.chdir(build_dir)
         try:
             if mode == "xst" or mode == "yosys":
-                v_output = platform.get_verilog(fragment)
+                v_output = platform.get_verilog(fragment, name=build_name, **kwargs)
                 vns = v_output.ns
                 named_sc, named_pc = platform.resolve_signals(vns)
                 v_file = build_name + ".v"
index 557016e72da73d833bdaddd6db841e9d930fb59c..032b78bbec673e77cab835fcb3267cc9bc66d83a 100644 (file)
@@ -112,7 +112,7 @@ class XilinxVivadoToolchain:
         tools.write_to_file(build_name + ".tcl", "\n".join(tcl))
 
     def build(self, platform, fragment, build_dir="build", build_name="top",
-            toolchain_path="/opt/Xilinx/Vivado", source=True, run=True):
+            toolchain_path="/opt/Xilinx/Vivado", source=True, run=True, **kwargs):
         tools.mkdir_noerror(build_dir)
         cwd = os.getcwd()
         os.chdir(build_dir)
@@ -120,7 +120,7 @@ class XilinxVivadoToolchain:
         if not isinstance(fragment, _Fragment):
             fragment = fragment.get_fragment()
         platform.finalize(fragment)
-        v_output = platform.get_verilog(fragment)
+        v_output = platform.get_verilog(fragment, name=build_name, **kwargs)
         named_sc, named_pc = platform.resolve_signals(v_output.ns)
         v_file = build_name + ".v"
         v_output.write(v_file)