build: pass build_name to get_verilog (same name for top module and top level file)
This commit is contained in:
parent
b7a1888a36
commit
e8262ed447
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue