Choose PCSRC or CSRC compilation for harvard cpus
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 20 Mar 2009 17:01:52 +0000 (17:01 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 20 Mar 2009 17:01:52 +0000 (17:01 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2400 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos_utils.py
wizard/const.py

index e522bdf9cbe49e26e6f5be95e7d6656177e33139..b872cf1501986baacbdd101199241a1b712d2cfc 100644 (file)
@@ -108,9 +108,9 @@ def makefileGenerator(projectInfo, makefile):
 def csrcGenerator(projectInfo):
     modules = projectInfo.info("MODULES")
     if "harvard" in projectInfo.info("CPU_INFOS")["CPU_TAGS"]:
-        pcsrc_need = projectInfo.info("CPU_INFOS")["PC_SRC"]
+        harvard = True
     else:
-        pcsrc_need = []
+        harvard = False
     csrc = []
     pcsrc = []
     constants = {}
@@ -120,19 +120,22 @@ def csrcGenerator(projectInfo):
                 constants.update(information["constants"])
             for filename, path in findDefinitions(module + ".c", projectInfo):
                 path = path.replace(projectInfo.info("SOURCES_PATH"), projectInfo.info("PROJECT_PATH"))
-                csrc.append(path + "/" + filename)
-                if module in pcsrc_need:
+                if not harvard or "harvard" not in information or information["harvard"] == "both":
+                    csrc.append(path + "/" + filename)
+                if harvard and "harvard" in information:
                     pcsrc.append(path + "/" + filename)
             for filename, path in findDefinitions(module + "_" + projectInfo.info("CPU_INFOS")["TOOLCHAIN"] + ".c", projectInfo):
                 path = path.replace(projectInfo.info("SOURCES_PATH"), projectInfo.info("PROJECT_PATH"))
-                csrc.append(path + "/" + filename)
-                if module in pcsrc_need:
+                if not harvard or "harvard" not in information or information["harvard"] == "both":
+                    csrc.append(path + "/" + filename)
+                if harvard and "harvard" in information:
                     pcsrc.append(path + "/" + filename)
             for tag in projectInfo.info("CPU_INFOS")["CPU_TAGS"]:
                 for filename, path in findDefinitions(module + "_" + tag + ".c", projectInfo):
                     path = path.replace(projectInfo.info("SOURCES_PATH"), projectInfo.info("PROJECT_PATH"))
-                    csrc.append(path + "/" + filename)
-                    if module in pcsrc_need:
+                    if not harvard or "harvard" not in information or information["harvard"] == "both":
+                        csrc.append(path + "/" + filename)
+                    if harvard and "harvard" in information:
                         pcsrc.append(path + "/" + filename)
     csrc = " \\\n\t".join(csrc) + " \\"
     pcsrc = " \\\n\t".join(pcsrc) + " \\"
@@ -266,6 +269,11 @@ def loadModuleDefinition(first_comment):
         if "module_description" in moduleDefinition.keys():
             moduleDict[moduleName]["description"] = moduleDefinition["module_description"]
             del moduleDefinition["module_description"]
+        if const.MODULE_DEFINITION["module_harvard"] in moduleDefinition.keys():
+            harvard = moduleDefinition[const.MODULE_DEFINITION["module_harvard"]]
+            if harvard == "both" or harvard == "pgm_memory":
+                moduleDict[moduleName]["harvard"] = harvard
+            del moduleDefinition[const.MODULE_DEFINITION["module_harvard"]]
         moduleDict[moduleName]["constants"] = moduleDefinition
         moduleDict[moduleName]["enabled"] = False
     return toBeParsed, moduleDict
index 2b89412634570d8156f9761ddc64637b95d5779c..454a76e44d3eb36362b3ca005d95ce00d435fde9 100644 (file)
@@ -53,4 +53,5 @@ MODULE_DEFINITION = {
     "module_name": "module_name",
     "module_configuration": "module_configuration",
     "module_depends": "module_depends",
+    "module_harvard": "module_harvard",
 }
\ No newline at end of file