Skip to content

Commit c2e5f7d

Browse files
authored
Add the board-pack-path: and device-pack-path: in cbuild-run.yml
1 parent f74c516 commit c2e5f7d

12 files changed

Lines changed: 27 additions & 1 deletion

tools/projmgr/include/ProjMgrRunDebug.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,10 @@ struct RunDebugType {
211211
std::string compiler;
212212
std::string board;
213213
std::string boardPack;
214+
std::string boardPackPath;
214215
std::string device;
215216
std::string devicePack;
217+
std::string devicePackPath;
216218
std::vector<AlgorithmType> algorithms;
217219
std::vector<FlashInfoType> flashInfo;
218220
std::vector<FilesType> outputs;

tools/projmgr/include/ProjMgrYamlParser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ static constexpr const char* YAML_BLOCKS = "blocks";
4141
static constexpr const char* YAML_BOARD = "board";
4242
static constexpr const char* YAML_BOARD_BOOKS = "board-books";
4343
static constexpr const char* YAML_BOARD_PACK = "board-pack";
44+
static constexpr const char* YAML_BOARD_PACK_PATH = "board-pack-path";
4445
static constexpr const char* YAML_BRANCH_PROTECTION = "branch-protection";
4546
static constexpr const char* YAML_BUILD = "build";
4647
static constexpr const char* YAML_BUILD_GEN = "build-gen";
@@ -103,6 +104,7 @@ static constexpr const char* YAML_DESCRIPTION = "description";
103104
static constexpr const char* YAML_DEVICE = "device";
104105
static constexpr const char* YAML_DEVICE_BOOKS = "device-books";
105106
static constexpr const char* YAML_DEVICE_PACK = "device-pack";
107+
static constexpr const char* YAML_DEVICE_PACK_PATH = "device-pack-path";
106108
static constexpr const char* YAML_DORMANT = "dormant";
107109
static constexpr const char* YAML_DOWNLOAD_URL = "download-url";
108110
static constexpr const char* YAML_DPID = "dpid";

tools/projmgr/schemas/common.schema.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2433,8 +2433,10 @@
24332433
"compiler": { "type": "string", "description": "Compiler toolchain used for code generation." },
24342434
"board": { "$ref": "#/definitions/BoardType" },
24352435
"board-pack": { "$ref": "#/definitions/PackID" },
2436+
"board-pack-path": { "type": "string", "description": "Local path to the board pack." },
24362437
"device": { "$ref": "#/definitions/DeviceType" },
24372438
"device-pack": { "$ref": "#/definitions/PackID" },
2439+
"device-pack-path": { "type": "string", "description": "Local path to the device pack." },
24382440
"output": { "$ref": "#/definitions/RunOutputFilesType" },
24392441
"system-resources": { "$ref": "#/definitions/SystemResourcesType" },
24402442
"system-descriptions": { "$ref": "#/definitions/RunSystemFilesType" },

tools/projmgr/src/ProjMgrCbuildRun.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,14 @@ ProjMgrCbuildRun::ProjMgrCbuildRun(YAML::Node node,
4747
SetNodeValue(node[YAML_COMPILER], debugRun.compiler);
4848
SetNodeValue(node[YAML_BOARD], debugRun.board);
4949
SetNodeValue(node[YAML_BOARD_PACK], debugRun.boardPack);
50+
if (!debugRun.boardPackPath.empty()) {
51+
SetNodeValue(node[YAML_BOARD_PACK_PATH], FormatPath(debugRun.boardPackPath, m_directory));
52+
}
5053
SetNodeValue(node[YAML_DEVICE], debugRun.device);
5154
SetNodeValue(node[YAML_DEVICE_PACK], debugRun.devicePack);
55+
if (!debugRun.devicePackPath.empty()) {
56+
SetNodeValue(node[YAML_DEVICE_PACK_PATH], FormatPath(debugRun.devicePackPath, m_directory));
57+
}
5258
SetFilesNode(node[YAML_OUTPUT], debugRun.outputs);
5359
SetResourcesNode(node[YAML_SYSTEM_RESOURCES], debugRun.systemResources);
5460
SetFilesNode(node[YAML_SYSTEM_DESCRIPTIONS], debugRun.systemDescriptions);

tools/projmgr/src/ProjMgrRunDebug.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ bool ProjMgrRunDebug::CollectSettings(const vector<ContextItem*>& contexts, cons
7070
// device collections
7171
for (const auto& [pname, processor] : pnames) {
7272
if (context0->devicePack) {
73-
m_runDebug.devicePack = context0->devicePack->GetPackageID(true);
7473
const auto& deviceAlgorithms = context0->rteDevice->GetEffectiveProperties("algorithm", pname);
7574
for (const auto& deviceAlgorithm : deviceAlgorithms) {
7675
PushBackUniquely(algorithms, deviceAlgorithm, pname);
@@ -126,6 +125,10 @@ bool ProjMgrRunDebug::CollectSettings(const vector<ContextItem*>& contexts, cons
126125
}
127126
m_runDebug.systemResources.processors.push_back(item);
128127
}
128+
if (context0->devicePack) {
129+
m_runDebug.devicePack = context0->devicePack->GetPackageID(true);
130+
m_runDebug.devicePackPath = context0->devicePack->GetAbsolutePackagePath();
131+
}
129132

130133
// default ramstart/size: use the first memory with default=1 and rwx attribute
131134
// if not found, use ramstart/size from other algorithm in DFP
@@ -156,6 +159,7 @@ bool ProjMgrRunDebug::CollectSettings(const vector<ContextItem*>& contexts, cons
156159
// board collections
157160
if (context0->boardPack) {
158161
m_runDebug.boardPack = context0->boardPack->GetPackageID(true);
162+
m_runDebug.boardPackPath = context0->boardPack->GetAbsolutePackagePath();
159163
Collection<RteItem*> boardAlgorithms;
160164
context0->rteBoard->GetChildrenByTag("algorithm", boardAlgorithms);
161165
for (const auto& boardAlgorithm : boardAlgorithms) {

tools/projmgr/test/data/ImageOnly/ref/image-only+CM0.cbuild-run.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ cbuild-run:
55
target-set: <default>
66
device: ARM::RteTest_ARMCM0
77
device-pack: ARM::RteTest_DFP@0.2.0
8+
device-pack-path: ${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0
89
output:
910
- file: ../images/image1.elf
1011
type: elf

tools/projmgr/test/data/ImageOnly/ref/image-only-multicore+CM0.cbuild-run.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ cbuild-run:
55
target-set: <default>
66
device: ARM::RteTest_ARMCM0_Dual
77
device-pack: ARM::RteTest_DFP@0.2.0
8+
device-pack-path: ${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0
89
output:
910
- file: ../images/image1.elf
1011
type: elf

tools/projmgr/test/data/TestRunDebug/ref/custom+TestHW.cbuild-run.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ cbuild-run:
66
compiler: AC6
77
device: ARM::RteTest_ARMCM4_NOFP
88
device-pack: ARM::RteTest_DFP@0.2.0
9+
device-pack-path: ${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0
910
output:
1011
- file: custom/TestHW/custom.axf
1112
info: generate by custom+TestHW

tools/projmgr/test/data/TestRunDebug/ref/run-debug+TestHW.cbuild-run.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ cbuild-run:
66
compiler: AC6
77
board: Keil::RteTest Test device variant:1.1.1
88
board-pack: ARM::RteTest_DFP@0.2.0
9+
board-pack-path: ${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0
910
device: ARM::RteTest_ARMCM4_NOFP
1011
device-pack: ARM::RteTest_DFP@0.2.0
12+
device-pack-path: ${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0
1113
output:
1214
- file: run-debug/TestHW/run-debug.axf
1315
info: generate by run-debug+TestHW

tools/projmgr/test/data/TestRunDebug/ref/run-debug+TestHW2.cbuild-run.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ cbuild-run:
66
compiler: AC6
77
board: Keil::RteTest-Test-board With.Memory:1.1.1
88
board-pack: ARM::RteTest_DFP@0.2.0
9+
board-pack-path: ${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0
910
device: ARM::RteTest_ARMCM3
1011
device-pack: ARM::RteTest_DFP@0.2.0
12+
device-pack-path: ${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0
1113
output:
1214
- file: run-debug/TestHW2/run-debug.axf
1315
info: generate by run-debug+TestHW2

0 commit comments

Comments
 (0)