self.setProjectInfo("CPU_INFOS", infos)
self.setProjectInfo("CPU_NAME", unicode(self.pageContent.cpuList.currentItem().text()))
self.setProjectInfo("SELECTED_FREQ", unicode(long(self.pageContent.frequencySpinBox.value())))
+ tag_dict = self.projectInfo("ALL_CPU_TAGS")
+ for tag in tag_dict:
+ if tag in infos["CPU_TAGS"] + [infos["CPU_NAME"], infos["CORE_CPU"]]:
+ tag_dict[tag] = "True"
+ else:
+ tag_dict[tag] = "False"
+ self.setProjectInfo("ALL_CPU_TAGS", tag_dict)
return True
else:
return False
self.pageContent.cpuList.clear()
self.pageContent.cpuList.setCurrentItem(None)
infos = bertos_utils.loadCpuInfos(self.project())
+ tag_list = bertos_utils.getTagSet(infos)
+ # Create, fill and store the dict with the tags
+ tag_dict = {}
+ for element in tag_list:
+ tag_dict[element] = "False"
+ self.setProjectInfo("ALL_CPU_TAGS", tag_dict)
for cpu in infos:
item = QListWidgetItem(cpu["CPU_NAME"])
item.setData(Qt.UserRole, qvariant_converter.convertDict(cpu))
cpuInfos.append(getInfos(definition))
return cpuInfos
+def getTagSet(cpu_info):
+ tag_set = set([])
+ for cpu in cpu_info:
+ tag_set |= set([cpu["CPU_NAME"]])
+ tag_set |= set(cpu["CPU_TAGS"])
+ tag_set |= set([cpu["CORE_CPU"]])
+ return tag_set
+
+
def getInfos(definition):
D = {}
D.update(const.CPU_DEF)
del module_definition[const.MODULE_DEFINITION["module_name"]]
module_dict[module_name] = {}
if const.MODULE_DEFINITION["module_depends"] in module_definition.keys():
- if type(module_definition[const.MODULE_DEFINITION["module_depends"]]) == str:
- module_definition[const.MODULE_DEFINITION["module_depends"]] = (module_definition[const.MODULE_DEFINITION["module_depends"]],)
- module_dict[module_name]["depends"] = module_definition[const.MODULE_DEFINITION["module_depends"]]
+ depends = module_definition[const.MODULE_DEFINITION["module_depends"]]
del module_definition[const.MODULE_DEFINITION["module_depends"]]
+ if type(depends) == str:
+ depends = (depends,)
+ module_dict[module_name]["depends"] = depends
else:
module_dict[module_name]["depends"] = ()
if const.MODULE_DEFINITION["module_configuration"] in module_definition.keys():
module_dict[module_name]["hw"] = hw
else:
module_dict[module_name]["hw"] = ()
+ if const.MODULE_DEFINITION["module_supports"] in module_definition.keys():
+ supports = module_definition[const.MODULE_DEFINITION["module_supports"]]
+ del module_definition[const.MODULE_DEFINITION["module_supports"]]
+ module_dict[module_name]["supports"] = supports
module_dict[module_name]["constants"] = module_definition
module_dict[module_name]["enabled"] = False
return to_be_parsed, module_dict
"module_depends": "module_depends",
"module_harvard": "module_harvard",
"module_hw": "module_hw",
+ "module_supports": "module_supports",
}
\ No newline at end of file