Skip to content

Commit

Permalink
Merge branch 'enjoy-digital:master' into bios_bootp
Browse files Browse the repository at this point in the history
  • Loading branch information
m-byte authored Nov 27, 2024
2 parents cba27bf + 76829aa commit f5484f8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions litex/build/altera/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class AlteraPlatform(GenericPlatform):
"flash" : ".rbf"
}
create_rbf = True
create_svf = True

_supported_toolchains = ["quartus"]

Expand Down
17 changes: 17 additions & 0 deletions litex/build/altera/quartus.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ def build_script(self):
quartus_fit --read_settings_files=off --write_settings_files=off {build_name} -c {build_name}
quartus_asm --read_settings_files=off --write_settings_files=off {build_name} -c {build_name}
quartus_sta {build_name} -c {build_name}"""

# Create .rbf.
if self.platform.create_rbf:
if sys.platform in ["win32", "cygwin"]:
script_contents += """
Expand All @@ -205,6 +207,21 @@ def build_script(self):
then
quartus_cpf -c {build_name}.sof {build_name}.rbf
fi
"""
# Create .svf.
if self.platform.create_svf:
if sys.platform in ["win32", "cygwin"]:
script_contents += """
if exist "{build_name}.sof" (
quartus_cpf -c -q \"12.0MHz\" -g 3.3 -n p {build_name}.sof {build_name}.svf
)
"""
else:
script_contents += """
if [ -f "{build_name}.sof" ]
then
quartus_cpf -c -q \"12.0MHz\" -g 3.3 -n p {build_name}.sof {build_name}.svf
fi
"""
script_contents = script_contents.format(build_name=build_name, synth_tool=self._synth_tool)
tools.write_to_file(script_file, script_contents, force_unix=True)
Expand Down
6 changes: 4 additions & 2 deletions litex/build/efinix/efinity.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@ def run_script(self, script):
if r != 0:
raise OSError("Error occurred during efx_map execution.")


vdbfile = f"work_syn/{self._build_name}.vdb"
if not os.path.exists(vdbfile):
vdbfile = f"outflow/{self._build_name}.vdb"

r = tools.subprocess_call_filtered([self.efinity_path + "/bin/efx_pnr",
"--circuit", f"{self._build_name}",
Expand All @@ -401,7 +403,7 @@ def run_script(self, script):
"--pack",
"--place",
"--route",
"--vdb_file", f"work_syn/{self._build_name}.vdb",
"--vdb_file", vdbfile,
"--use_vdb_file", "on",
"--place_file", f"outflow/{self._build_name}.place",
"--route_file", f"outflow/{self._build_name}.route",
Expand Down

0 comments on commit f5484f8

Please sign in to comment.