Commit 2dedd6fe authored by Tristan Gingold's avatar Tristan Gingold

Quartus: handle both .qsf/.qpf extension for project file.

parent 85f8c39c
......@@ -90,19 +90,27 @@ SYN_GRADE := {syn_grade}
tool_path=self.manifest_dict["syn_path"],
top_module=self.manifest_dict["syn_top"]))
def _makefile_syn_tcl(self):
"""Create the Makefile TCL dictionary for the selected tool"""
command_list = ["create", "open", "save", "close"]
for command in command_list:
def _makefile_syn_prj_tcl_cmd(self):
"""Create the Makefile variables for the TCL project commands."""
for command in ["create", "open", "save", "close"]:
if command in self._tcl_controls:
self.writeln('TCL_{} := {}'.format(
command.upper(), self._tcl_controls[command]))
def _makefile_syn_override_prj_tcl_create(self):
"""Override the TCL create project command by the open one if
the project already exists"""
self.writeln("""\
ifneq ($(wildcard $(PROJECT_FILE)),)
TCL_CREATE := $(TCL_OPEN)
endif""")
self.writeln()
def _makefile_syn_tcl(self):
"""Create the Makefile TCL dictionary for the selected tool"""
self._makefile_syn_prj_tcl_cmd()
self._makefile_syn_override_prj_tcl_create()
def _makefile_syn_files(self):
"""Write the files TCL section of the Makefile"""
fileset_dict = {}
......
......@@ -204,6 +204,16 @@ class ToolQuartus(MakefileSyn):
self._tcl_controls["project"] = '\n'.join(command_list)
super(ToolQuartus, self)._makefile_syn_tcl()
def _makefile_syn_override_prj_tcl_create(self):
"""Override the TCL create project command by the open one if
the project already exists. For Quartus, a project may have
different extensions."""
self.writeln("""\
ifneq ($(wildcard $(PROJECT).qpf $(PROJECT).qsf)),)
TCL_CREATE := $(TCL_OPEN)
endif""")
self.writeln()
def _makefile_syn_files(self):
# Insert the Quartus standard control TCL files
command_list = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment