Skip to content

Commit 708d541

Browse files
authored
[projmgr] Fix pname for SCVD entries in cbuild-run
1 parent e6c34fe commit 708d541

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

test/packs/ARM/RteTest_DFP/0.2.0/ARM.RteTest_DFP.pdsc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@
474474
</files>
475475
</component>
476476

477-
<component Cclass="RteTest" Cgroup="scvd" Cversion="1.1.1" condition="ARMCM3 RteTest">
477+
<component Cclass="RteTest" Cgroup="scvd" Cversion="1.1.1" condition="DeviceDependent">
478478
<description>scvd test</description>
479479
<files>
480480
<file category="other" name="Components/RteTest.scvd"/>

tools/projmgr/src/ProjMgrRunDebug.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024-2025 Arm Limited. All rights reserved.
2+
* Copyright (c) 2024-2026 Arm Limited. All rights reserved.
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -211,17 +211,26 @@ bool ProjMgrRunDebug::CollectSettings(const vector<ContextItem*>& contexts, cons
211211
m_runDebug.systemDescriptions.push_back(item);
212212
}
213213
}
214-
StrVec scvdFiles;
214+
// scvd
215+
StrVecMap scvdFiles;
215216
for (const auto& context : contexts) {
216217
for (const auto& [scvdFile, _] : context->rteActiveTarget->GetScvdFiles()) {
217-
CollectionUtils::PushBackUniquely(scvdFiles, scvdFile);
218+
CollectionUtils::PushBackUniquely(scvdFiles[scvdFile], context->deviceItem.pname);
218219
}
219220
}
220-
for (const auto& scvdFile : scvdFiles) {
221-
FilesType item;
222-
item.file = scvdFile;
223-
item.type = "scvd";
224-
m_runDebug.systemDescriptions.push_back(item);
221+
for (const auto& [scvdFile, pnameVec] : scvdFiles) {
222+
const bool allPnames = pnameVec.size() == pnames.size();
223+
// when one file is valid for multiple cores, but not for all cores -> multiple entries with a different pname each
224+
for (const auto& pname : pnameVec) {
225+
FilesType item;
226+
item.file = scvdFile;
227+
item.type = "scvd";
228+
item.pname = allPnames ? "" : pname;
229+
m_runDebug.systemDescriptions.push_back(item);
230+
if (allPnames) {
231+
break;
232+
}
233+
}
225234
}
226235

227236
// outputs

tools/projmgr/test/data/TestRunDebug/core0.cproject.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
project:
44

55
device: :cm0_core0
6+
7+
components:
8+
- component: RteTest:scvd

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ build:
7676
category: doc
7777
version: 0.1.1
7878
- component: ARM::RteTest:scvd@1.1.1
79-
condition: ARMCM3 RteTest
79+
condition: DeviceDependent
8080
from-pack: ARM::RteTest_DFP@0.2.0
8181
selected-by: RteTest:scvd
8282
files:

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ cbuild-run:
5454
system-descriptions:
5555
- file: ${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0/Device/ARM/SVD/ARMCM0.svd
5656
type: svd
57+
- file: ${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0/Components/RteTest.scvd
58+
type: scvd
59+
pname: cm0_core0
5760
debugger:
5861
name: CMSIS-DAP@pyOCD
5962
protocol: swd

0 commit comments

Comments
 (0)