Skip to content

Commit

Permalink
[projmgr] Add component's external generator info into cbuild.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
grasci-arm authored Jan 19, 2024
1 parent 27678e9 commit 76d2052
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tools/projmgr/schemas/common.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,12 @@
"description": "Component specific generator info. Any field in this object overrides the corresponding value from the general GeneratorType",
"type": "object",
"properties": {
"id": { "type": "string" },
"id": { "type": "string", "description": "Generator identifier" },
"path": { "type": "string", "description": "Path name for storing the files generated" },
"from-pack": { "$ref": "#/definitions/PackID"},
"files": { "$ref": "#/definitions/FilesType" }
},
"required": [ "id", "from-pack" ]
"required": [ "id" ]
},
"ComponentID": {
"type": "string",
Expand Down
3 changes: 2 additions & 1 deletion tools/projmgr/src/ProjMgrWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ bool ProjMgrWorker::ProcessComponents(ContextItem& context) {

// Get generator
RteGenerator* generator = matchedComponent->GetGenerator();
const string generatorId = generator ? generator->GetID() : "";
string generatorId = generator ? generator->GetID() : "";
if (generator) {
context.generators.insert({ generatorId, generator });
string genDir;
Expand All @@ -1647,6 +1647,7 @@ bool ProjMgrWorker::ProcessComponents(ContextItem& context) {
// keep track of used generators
m_extGenerator->AddUsedGenerator(extGenId, genDir, context.name);
context.extGenDir[extGenId] = genDir;
generatorId = extGenId;
}
}

Expand Down
5 changes: 5 additions & 0 deletions tools/projmgr/src/ProjMgrYamlEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ void ProjMgrYamlCbuild::SetComponentsNode(YAML::Node node, const ContextItem* co
SetNodeValue(componentNode[YAML_GENERATOR][YAML_ID], component.generator);
SetNodeValue(componentNode[YAML_GENERATOR][YAML_FROM_PACK], RtePackage::GetPackageIDfromAttributes(*rteGenerator->GetPackage()));
SetGeneratorFiles(componentNode[YAML_GENERATOR], context, componentId);
} else if (context->extGenDir.find(component.generator) != context->extGenDir.end()) {
SetNodeValue(componentNode[YAML_GENERATOR][YAML_ID], component.generator);
SetNodeValue(componentNode[YAML_GENERATOR][YAML_PATH],
FormatPath(fs::path(context->extGenDir.at(component.generator)).append(context->cproject->name + ".cgen.yml").generic_string(),
context->directories.cbuild));
} else {
ProjMgrLogger::Warn(string("Component ") + componentId + " uses unknown generator " + component.generator);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ build-gen:
- component: ARM::RteTestGenerator:Check Global [email protected]
from-pack: ARM::[email protected]
selected-by: RteTestGenerator:Check Global Generator
generator:
id: RteTestExternalGenerator
path: ${DEVTOOLS(data)}/ExternalGenerator/generated/MultiCore/core0.cgen.yml
linker:
script: ${DEVTOOLS(data)}/ExternalGenerator/multi_0/RTE/Device/RteTest_ARMCM0_Dual_cm0_core0/ac6_linker_script.sct.src
regions: ${DEVTOOLS(data)}/ExternalGenerator/multi_0/RTE/Device/RteTest_ARMCM0_Dual_cm0_core0/regions_RteTest_ARMCM0_Dual_cm0_core0.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ build-gen:
- component: ARM::RteTestGenerator:Check Global [email protected]
from-pack: ARM::[email protected]
selected-by: RteTestGenerator:Check Global Generator
generator:
id: RteTestExternalGenerator
path: ${DEVTOOLS(data)}/ExternalGenerator/generated/MultiCore/core1.cgen.yml
linker:
script: ${DEVTOOLS(data)}/ExternalGenerator/multi_1/RTE/Device/RteTest_ARMCM0_Dual_cm0_core1/ac6_linker_script.sct.src
regions: ${DEVTOOLS(data)}/ExternalGenerator/multi_1/RTE/Device/RteTest_ARMCM0_Dual_cm0_core1/regions_RteTest_ARMCM0_Dual_cm0_core1.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ build-gen:
- component: ARM::RteTestGenerator:Check Global [email protected]
from-pack: ARM::[email protected]
selected-by: RteTestGenerator:Check Global Generator
generator:
id: RteTestExternalGenerator
path: ${DEVTOOLS(data)}/ExternalGenerator/single/generated/single-core.cgen.yml
linker:
script: ${DEVTOOLS(data)}/ExternalGenerator/single/RTE/Device/RteTestGen_ARMCM0/ac6_linker_script.sct.src
regions: ${DEVTOOLS(data)}/ExternalGenerator/single/RTE/Device/RteTestGen_ARMCM0/regions_RteTestGen_ARMCM0.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ build:
- component: ARM::RteTestGenerator:Check Global [email protected]
from-pack: ARM::[email protected]
selected-by: RteTestGenerator:Check Global Generator
generator:
id: RteTestExternalGenerator
path: generated/single-core.cgen.yml
linker:
script: RTE/Device/RteTestGen_ARMCM0/ac6_linker_script.sct.src
regions: RTE/Device/RteTestGen_ARMCM0/regions_RteTestGen_ARMCM0.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ build-gen:
- component: ARM::RteTestGenerator:Check Global [email protected]
from-pack: ARM::[email protected]
selected-by: RteTestGenerator:Check Global Generator
generator:
id: RteTestExternalGenerator
path: ${DEVTOOLS(data)}/ExternalGenerator/generated/CM0/ns.cgen.yml
linker:
script: ${DEVTOOLS(data)}/ExternalGenerator/tz_ns/RTE/Device/RteTestGen_ARMCM0/ac6_linker_script.sct.src
regions: ${DEVTOOLS(data)}/ExternalGenerator/tz_ns/RTE/Device/RteTestGen_ARMCM0/regions_RteTestGen_ARMCM0.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ build-gen:
- component: ARM::RteTestGenerator:Check Global [email protected]
from-pack: ARM::[email protected]
selected-by: RteTestGenerator:Check Global Generator
generator:
id: RteTestExternalGenerator
path: ${DEVTOOLS(data)}/ExternalGenerator/generated/CM0/s.cgen.yml
linker:
script: ${DEVTOOLS(data)}/ExternalGenerator/tz_s/RTE/Device/RteTestGen_ARMCM0/ac6_linker_script.sct.src
regions: ${DEVTOOLS(data)}/ExternalGenerator/tz_s/RTE/Device/RteTestGen_ARMCM0/regions_RteTestGen_ARMCM0.h
Expand Down

0 comments on commit 76d2052

Please sign in to comment.