build/nextpnr_wrapper,yosys_nextpnr_toolchain,yosys_wrapper: fix LF for windows (#1536)

This commit is contained in:
Gwenhael Goavec-Merou 2022-12-14 21:46:08 +01:00
parent cb85a8caf1
commit d17041e076
5 changed files with 8 additions and 7 deletions

View File

@ -203,7 +203,7 @@ class LatticeRadiantToolchain(GenericToolchain):
fail_stmt = ""
if self._synth_mode == "yosys":
script_contents += self._yosys.get_yosys_call(target="script")
script_contents += self._yosys.get_yosys_call(target="script") + "\n"
script_contents += "{tool} {tcl_script}{fail_stmt}\n".format(
tool = tool,

View File

@ -85,7 +85,7 @@ class NextPNRWrapper():
"""
cmd = "{pnr_name} --{in_fmt} {build_name}.{in_fmt} --{constr_fmt}" + \
" {build_name}.{constr_fmt}" + \
" --{out_fmt} {build_name}.{out_ext} {pnr_opts}\n"
" --{out_fmt} {build_name}.{out_ext} {pnr_opts}"
base_cmd = cmd.format(
pnr_name = self.name,
build_name = self._build_name,
@ -96,7 +96,7 @@ class NextPNRWrapper():
pnr_opts = self._pnr_opts
)
if target == "makefile":
return f"{self._build_name}.{self._out_format}:\n\t" + base_cmd
return f"{self._build_name}.{self._out_format}:\n\t" + base_cmd + "\n"
elif target == "script":
return base_cmd
else:

View File

@ -452,4 +452,4 @@ def _build_yosys_project(platform, synth_opts="", build_name=""):
synth_format = "edif"
)
yosys.build_script()
return yosys.get_yosys_call("script")
return yosys.get_yosys_call("script") + "\n"

View File

@ -194,6 +194,7 @@ class YosysNextPNRToolchain(GenericToolchain):
script_ext = ".sh"
script_contents = "# Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\nset -e\n"
fail_stmt = ""
fail_stmt += "\n"
# yosys call
script_contents += self._yosys.get_yosys_call("script") + fail_stmt
@ -201,7 +202,7 @@ class YosysNextPNRToolchain(GenericToolchain):
script_contents += self._nextpnr.get_call("script") + fail_stmt
# pre packer (command to use after PNR step and before packer step)
for pre_packer in self._pre_packer_cmd:
script_contents += f"{pre_packer} {self._pre_packer_opts[pre_packer]} {fail_stmt}\n"
script_contents += f"{pre_packer} {self._pre_packer_opts[pre_packer]} {fail_stmt}"
# packer call
script_contents += f"{self.packer_cmd} {self._packer_opts} {fail_stmt}"

View File

@ -130,9 +130,9 @@ class YosysWrapper():
=======
str containing instruction and/or rule
"""
base_cmd = f"yosys -l {self._build_name}.rpt {self._build_name}.ys\n"
base_cmd = f"yosys -l {self._build_name}.rpt {self._build_name}.ys"
if target == "makefile":
return f"{self._build_name}.{self._synth_format}:\n\t" + base_cmd
return f"{self._build_name}.{self._synth_format}:\n\t" + base_cmd + "\n"
elif target == "script":
return base_cmd
else: