Fix some issues with quartus and improve Riviera interface

parent 62ee5281
...@@ -141,7 +141,7 @@ class File(object): ...@@ -141,7 +141,7 @@ class File(object):
class DepFile(File): class DepFile(File):
def __init__(self, file_path, module): def __init__(self, file_path, module):
from .module import Module from hdlmake.module import Module
assert isinstance(file_path, basestring) assert isinstance(file_path, basestring)
assert isinstance(module, Module) assert isinstance(module, Module)
......
...@@ -29,6 +29,7 @@ import logging ...@@ -29,6 +29,7 @@ import logging
from hdlmake import fetch from hdlmake import fetch
from hdlmake.action import ActionMakefile from hdlmake.action import ActionMakefile
from hdlmake.util import path as path_mod
QUARTUS_STANDARD_LIBS = ['altera', 'altera_mf', 'lpm', 'ieee', 'std'] QUARTUS_STANDARD_LIBS = ['altera', 'altera_mf', 'lpm', 'ieee', 'std']
...@@ -37,6 +38,9 @@ QUARTUS_STANDARD_LIBS = ['altera', 'altera_mf', 'lpm', 'ieee', 'std'] ...@@ -37,6 +38,9 @@ QUARTUS_STANDARD_LIBS = ['altera', 'altera_mf', 'lpm', 'ieee', 'std']
class ToolQuartus(ActionMakefile): class ToolQuartus(ActionMakefile):
def __init__(self): def __init__(self):
self._preflow = None
self._postmodule = None
self._postflow = None
super(ToolQuartus, self).__init__() super(ToolQuartus, self).__init__()
def detect_version(self, path): def detect_version(self, path):
...@@ -129,7 +133,6 @@ mrproper: ...@@ -129,7 +133,6 @@ mrproper:
"""Method that checks if the TCL files declared by the module """Method that checks if the TCL files declared by the module
manifest dictionary exists and if so create them and manifest dictionary exists and if so create them and
initialize the appropriated variables in the Module instance""" initialize the appropriated variables in the Module instance"""
from hdlmake.srcfile import TCLFile
if mod.manifest_dict["quartus_preflow"] is not None: if mod.manifest_dict["quartus_preflow"] is not None:
path = path_mod.compose( path = path_mod.compose(
mod.manifest_dict["quartus_preflow"], mod.path) mod.manifest_dict["quartus_preflow"], mod.path)
...@@ -137,7 +140,7 @@ mrproper: ...@@ -137,7 +140,7 @@ mrproper:
logging.error("quartus_preflow file listed in " + mod.path + logging.error("quartus_preflow file listed in " + mod.path +
" doesn't exist: " + path + ".\nExiting.") " doesn't exist: " + path + ".\nExiting.")
quit() quit()
self.preflow = TCLFile(path) self._preflow = path
if mod.manifest_dict["quartus_postmodule"] is not None: if mod.manifest_dict["quartus_postmodule"] is not None:
path = path_mod.compose( path = path_mod.compose(
...@@ -146,7 +149,7 @@ mrproper: ...@@ -146,7 +149,7 @@ mrproper:
logging.error("quartus_postmodule file listed in " + mod.path + logging.error("quartus_postmodule file listed in " + mod.path +
" doesn't exist: " + path + ".\nExiting.") " doesn't exist: " + path + ".\nExiting.")
quit() quit()
self.postmodule = TCLFile(path) self._postmodule = path
if mod.manifest_dict["quartus_postflow"] is not None: if mod.manifest_dict["quartus_postflow"] is not None:
path = path_mod.compose( path = path_mod.compose(
...@@ -155,7 +158,7 @@ mrproper: ...@@ -155,7 +158,7 @@ mrproper:
logging.error("quartus_postflow file listed in " + mod.path + logging.error("quartus_postflow file listed in " + mod.path +
" doesn't exist: " + path + ".\nExiting.") " doesn't exist: " + path + ".\nExiting.")
quit() quit()
self.postflow = TCLFile(path) self._postflow = path
def generate_synthesis_project( def generate_synthesis_project(
self, update=False, tool_version='', top_mod=None, fileset=None): self, update=False, tool_version='', top_mod=None, fileset=None):
...@@ -163,8 +166,6 @@ mrproper: ...@@ -163,8 +166,6 @@ mrproper:
self.files = [] self.files = []
self.filename = top_mod.manifest_dict["syn_project"] self.filename = top_mod.manifest_dict["syn_project"]
self._set_tcl_files(top_mod) self._set_tcl_files(top_mod)
self.postmodule = top_mod.quartus_postmodule
self.postflow = top_mod.quartus_postflow
if update is True: if update is True:
self.read() self.read()
...@@ -191,16 +192,18 @@ mrproper: ...@@ -191,16 +192,18 @@ mrproper:
def __emit_scripts(self): def __emit_scripts(self):
tmp = 'set_global_assignment -name {0} "quartus_sh:{1}"' tmp = 'set_global_assignment -name {0} "quartus_sh:{1}"'
pre = mod = post = "" pre = mod = post = ""
if self.preflow: if self._preflow:
pre = tmp.format("PRE_FLOW_SCRIPT_FILE", self.preflow.rel_path()) pre = tmp.format(
if self.postmodule: "PRE_FLOW_SCRIPT_FILE",
self._preflow)
if self._postmodule:
mod = tmp.format( mod = tmp.format(
"POST_MODULE_SCRIPT_FILE", "POST_MODULE_SCRIPT_FILE",
self.postmodule.rel_path()) self._postmodule)
if self.postflow: if self._postflow:
post = tmp.format( post = tmp.format(
"POST_FLOW_SCRIPT_FILE", "POST_FLOW_SCRIPT_FILE",
self.postflow.rel_path()) self._postflow)
return pre + '\n' + mod + '\n' + post + '\n' return pre + '\n' + mod + '\n' + post + '\n'
def __emit_files(self): def __emit_files(self):
......
...@@ -82,6 +82,13 @@ class ToolRiviera(VsimMakefileWriter): ...@@ -82,6 +82,13 @@ class ToolRiviera(VsimMakefileWriter):
def get_standard_libraries(self): def get_standard_libraries(self):
return RIVIERA_STANDARD_LIBS return RIVIERA_STANDARD_LIBS
def generate_simulation_makefile(self, fileset, top_module):
super(
ToolRiviera,
self).generate_simulation_makefile(
fileset,
top_module)
def supported_files(self, fileset): def supported_files(self, fileset):
from hdlmake.srcfile import SourceFileSet from hdlmake.srcfile import SourceFileSet
sup_files = SourceFileSet() sup_files = SourceFileSet()
......
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