Provide the Quartus properties as a dictionary

parent 63139ec6
...@@ -155,11 +155,11 @@ class ToolQuartus(ToolSyn): ...@@ -155,11 +155,11 @@ class ToolQuartus(ToolSyn):
property_dict = { property_dict = {
'what': None, 'what': None,
'name': None, 'name': None,
'name_type': None, 'type': None,
'from_': None, 'from': None,
'to_': None, 'to': None,
'section_id': None, 'section_id': None,
'tag_': None} 'tag': None}
property_dict.update(new_property) property_dict.update(new_property)
words = [] words = []
words.append(dict([(b, a) for a, b in words.append(dict([(b, a) for a, b in
...@@ -168,17 +168,17 @@ class ToolQuartus(ToolSyn): ...@@ -168,17 +168,17 @@ class ToolQuartus(ToolSyn):
words.append(property_dict['what']) words.append(property_dict['what'])
if property_dict['name'] is not None: if property_dict['name'] is not None:
words.append("-name") words.append("-name")
words.append(property_dict['name_type'])
words.append(property_dict['name']) words.append(property_dict['name'])
if property_dict['from_'] is not None: words.append('\\"%s\\"' % property_dict['value'])
if property_dict['from'] is not None:
words.append("-from") words.append("-from")
words.append(property_dict['from_']) words.append(property_dict['from'])
if property_dict['tag_'] is not None: if property_dict['tag'] is not None:
words.append("-tag") words.append("-tag")
words.append(property_dict['to_']) words.append(property_dict['tag'])
if property_dict['to_'] is not None: if property_dict['to'] is not None:
words.append("-to") words.append("-to")
words.append(property_dict['to_']) words.append(property_dict['to'])
if property_dict['section_id'] is not None: if property_dict['section_id'] is not None:
words.append("-section_id") words.append("-section_id")
words.append(property_dict['section_id']) words.append(property_dict['section_id'])
...@@ -190,24 +190,27 @@ class ToolQuartus(ToolSyn): ...@@ -190,24 +190,27 @@ class ToolQuartus(ToolSyn):
command_list.append(self._tcl_controls["project"]) command_list.append(self._tcl_controls["project"])
command_list.append(self._emit_property( command_list.append(self._emit_property(
self.SET_GLOBAL_ASSIGNMENT, self.SET_GLOBAL_ASSIGNMENT,
{'name_type': 'FAMILY', {'name': 'FAMILY',
'name': '\\"$(SYN_FAMILY)\\"'})) 'value': '$(SYN_FAMILY)'}))
command_list.append(self._emit_property( command_list.append(self._emit_property(
self.SET_GLOBAL_ASSIGNMENT, self.SET_GLOBAL_ASSIGNMENT,
{'name_type': 'DEVICE', {'name': 'DEVICE',
'name':'\\"$(SYN_DEVICE)\\"'})) 'value':'$(SYN_DEVICE)'}))
command_list.append(self._emit_property( command_list.append(self._emit_property(
self.SET_GLOBAL_ASSIGNMENT, self.SET_GLOBAL_ASSIGNMENT,
{'name_type': 'TOP_LEVEL_ENTITY', {'name': 'TOP_LEVEL_ENTITY',
'name': '\\"$(TOP_MODULE)\\"'})) 'value': '$(TOP_MODULE)'}))
for user_property in self.manifest_dict.get("syn_properties", []): for user_property in self.manifest_dict.get("syn_properties", []):
if not isinstance(user_property, dict):
logging.error("Quartus property should be defined as dict: "
+ str(user_property))
quit(1)
command_list.append(self._emit_property(self.SET_GLOBAL_ASSIGNMENT, command_list.append(self._emit_property(self.SET_GLOBAL_ASSIGNMENT,
{'name_type': user_property[0], user_property))
'name': '\\"%s\\"' % user_property[1]}))
for inc in self.manifest_dict.get("include_dirs", []): for inc in self.manifest_dict.get("include_dirs", []):
command_list.append(self._emit_property(self.SET_GLOBAL_ASSIGNMENT, command_list.append(self._emit_property(self.SET_GLOBAL_ASSIGNMENT,
{'name_type': 'SEARCH_PATH', {'name': 'SEARCH_PATH',
'name': '\\"%s\\"' % inc})) 'value': inc}))
self._tcl_controls["project"] = '\n'.join(command_list) self._tcl_controls["project"] = '\n'.join(command_list)
super(ToolQuartus, self)._makefile_syn_tcl() super(ToolQuartus, self)._makefile_syn_tcl()
...@@ -224,8 +227,8 @@ class ToolQuartus(ToolSyn): ...@@ -224,8 +227,8 @@ class ToolQuartus(ToolSyn):
quit(1) quit(1)
preflow = '"' + 'quartus_sh:' + path + '"' preflow = '"' + 'quartus_sh:' + path + '"'
command_list.append(self._emit_property(self.SET_GLOBAL_ASSIGNMENT, command_list.append(self._emit_property(self.SET_GLOBAL_ASSIGNMENT,
{'name_type': 'PRE_FLOW_SCRIPT_FILE', {'name': 'PRE_FLOW_SCRIPT_FILE',
'name': preflow})) 'value': preflow}))
if "quartus_postmodule" in self.manifest_dict: if "quartus_postmodule" in self.manifest_dict:
path = shell.tclpath(path_mod.compose( path = shell.tclpath(path_mod.compose(
self.manifest_dict["quartus_postmodule"], self.manifest_dict["quartus_postmodule"],
...@@ -237,8 +240,8 @@ class ToolQuartus(ToolSyn): ...@@ -237,8 +240,8 @@ class ToolQuartus(ToolSyn):
quit(1) quit(1)
postmodule = '"' + 'quartus_sh:' + path + '"' postmodule = '"' + 'quartus_sh:' + path + '"'
command_list.append(self._emit_property(self.SET_GLOBAL_ASSIGNMENT, command_list.append(self._emit_property(self.SET_GLOBAL_ASSIGNMENT,
{'name_type': 'POST_MODULE_SCRIPT_FILE', {'name': 'POST_MODULE_SCRIPT_FILE',
'name': postmodule})) 'value': postmodule}))
if "quartus_postflow" in self.manifest_dict: if "quartus_postflow" in self.manifest_dict:
path = shell.tclpath(path_mod.compose( path = shell.tclpath(path_mod.compose(
self.manifest_dict["quartus_postflow"], os.getcwd())) self.manifest_dict["quartus_postflow"], os.getcwd()))
...@@ -249,7 +252,7 @@ class ToolQuartus(ToolSyn): ...@@ -249,7 +252,7 @@ class ToolQuartus(ToolSyn):
quit(1) quit(1)
postflow = '"' + 'quartus_sh:' + path + '"' postflow = '"' + 'quartus_sh:' + path + '"'
command_list.append(self._emit_property(self.SET_GLOBAL_ASSIGNMENT, command_list.append(self._emit_property(self.SET_GLOBAL_ASSIGNMENT,
{'name_type': 'POST_FLOW_SCRIPT_FILE', {'name': 'POST_FLOW_SCRIPT_FILE',
'name': postflow})) 'value': postflow}))
self._tcl_controls["files"] = '\n'.join(command_list) self._tcl_controls["files"] = '\n'.join(command_list)
super(ToolQuartus, self)._makefile_syn_files() super(ToolQuartus, self)._makefile_syn_files()
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