Skip to content

Commit 65510f2

Browse files
authored
[cbuild-run] Implement extensions (system-resources, debug-vars, debuggers)
1 parent 98f8b4e commit 65510f2

File tree

14 files changed

+529
-37
lines changed

14 files changed

+529
-37
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
<description>
167167
RteTest ARM Cortex M4 is a clone description from ARM.CMSIS pack.
168168
</description>
169+
<debugconfig default="jtag" clock="40000000"/>
169170
<debugvars configfile="Device/ARM/Debug/ARMCM4.dbgconf" version="0.2.1" >
170171
__var DbgMCU_CR = 0x00000007; // DBGMCU_CR: DBG_SLEEP, DBG_STOP, DBG_STANDBY
171172
__var TraceClk_Pin = 0x00040003; // PE2
@@ -458,6 +459,7 @@
458459
<compatibleDevice deviceIndex="0" Dvendor="ARM:82" Dname="RteTest_ARMCM3"/>
459460
<memory name="RAM-External" access="rwx" start="0x90000000" size="0x00800000"/>
460461
<memory name="Flash-External" access="rx" start="0x70000000" size="0x04000000"/>
462+
<debugProbe debugClock="30000000" debugLink="swd" name="CMSIS-DAP"/>
461463
</board>
462464
<board name="RteTest Test board no mounted device" vendor="Keil" revision="2.2.2">
463465
<description>uVision Simulator</description>

tools/projmgr/include/ProjMgrParser.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-2021 Arm Limited. All rights reserved.
2+
* Copyright (c) 2020-2025 Arm Limited. All rights reserved.
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -420,6 +420,24 @@ struct CdefaultItem {
420420
std::vector<MiscItem> misc;
421421
};
422422

423+
/**
424+
* @brief debugger item containing
425+
* name of debug configuration
426+
* brief description
427+
* debug port (jtag or swd)
428+
* debug clock speed
429+
* debug configuration file
430+
* type filter
431+
*/
432+
struct DebuggerItem {
433+
std::string name;
434+
std::string info;
435+
std::string port;
436+
std::string clock;
437+
std::string dbgconf;
438+
TypeFilter type;
439+
};
440+
423441
typedef std::vector<std::pair<std::string, BuildType>> BuildTypes;
424442
typedef std::vector<std::pair<std::string, TargetType>> TargetTypes;
425443
/**
@@ -439,7 +457,8 @@ typedef std::vector<std::pair<std::string, TargetType>> TargetTypes;
439457
* list of packs,
440458
* cdefault enable switch,
441459
* generator options,
442-
* list of executes
460+
* list of executes,
461+
* list of debuggers
443462
*/
444463
struct CsolutionItem {
445464
std::string name;
@@ -459,6 +478,7 @@ struct CsolutionItem {
459478
GeneratorsItem generators;
460479
CbuildPackItem cbuildPack;
461480
std::vector<ExecutesItem> executes;
481+
std::vector<DebuggerItem> debuggers;
462482
std::vector<std::string> ymlOrderedBuildTypes;
463483
std::vector<std::string> ymlOrderedTargetTypes;
464484
};

tools/projmgr/include/ProjMgrRunDebug.h

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024 Arm Limited. All rights reserved.
2+
* Copyright (c) 2024-2025 Arm Limited. All rights reserved.
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -9,7 +9,7 @@
99

1010
#include "ProjMgrWorker.h"
1111

12-
/**
12+
/**
1313
* @brief programming algorithm types
1414
*/
1515
struct AlgorithmType {
@@ -22,6 +22,29 @@ struct AlgorithmType {
2222
std::string pname;
2323
};
2424

25+
/**
26+
* @brief memory type
27+
*/
28+
struct MemoryType {
29+
std::string name;
30+
std::string access;
31+
std::string alias;
32+
std::string fromPack;
33+
unsigned long long start = 0;
34+
unsigned long long size = 0;
35+
bool bDefault = false;
36+
bool bStartup = false;
37+
bool bUninit = false;
38+
std::string pname;
39+
};
40+
41+
/**
42+
* @brief system resources type
43+
*/
44+
struct SystemResourcesType {
45+
std::vector<MemoryType> memories;
46+
};
47+
2548
/**
2649
* @brief files type
2750
*/
@@ -40,7 +63,7 @@ struct DebugSequencesBlockType {
4063
std::string control_if;
4164
std::string control_while;
4265
std::string timeout;
43-
bool atomic = false;
66+
bool bAtomic = false;
4467
std::vector<DebugSequencesBlockType> blocks;
4568
};
4669

@@ -54,6 +77,24 @@ struct DebugSequencesType {
5477
std::string pname;
5578
};
5679

80+
/**
81+
* @brief debug vars type
82+
*/
83+
struct DebugVarsType {
84+
std::string vars;
85+
};
86+
87+
/**
88+
* @brief debugger type
89+
*/
90+
struct DebuggerType {
91+
std::string name;
92+
std::string info;
93+
std::string port;
94+
unsigned long long clock = 0;
95+
std::string dbgconf;
96+
};
97+
5798
/**
5899
* @brief debug run manager types
59100
*/
@@ -69,6 +110,9 @@ struct RunDebugType {
69110
std::vector<AlgorithmType> algorithms;
70111
std::vector<FilesType> outputs;
71112
std::vector<FilesType> systemDescriptions;
113+
SystemResourcesType systemResources;
114+
std::vector<DebuggerType> debuggers;
115+
DebugVarsType debugVars;
72116
std::vector<DebugSequencesType> debugSequences;
73117
};
74118

tools/projmgr/include/ProjMgrWorker.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ struct ContextTypesItem {
297297
* vector of device books
298298
* vector of board books
299299
* additional memory
300+
* debuggers
300301
*/
301302
struct ContextItem {
302303
CdefaultItem* cdefault = nullptr;
@@ -359,6 +360,7 @@ struct ContextItem {
359360
std::vector<BookItem> deviceBooks;
360361
std::vector<BookItem> boardBooks;
361362
std::vector<MemoryItem> memory;
363+
std::vector<DebuggerItem> debuggers;
362364
};
363365

364366
/**
@@ -851,6 +853,7 @@ class ProjMgrWorker {
851853
bool ProcessGpdsc(ContextItem& context);
852854
bool ProcessConfigFiles(ContextItem& context);
853855
bool ProcessComponentFiles(ContextItem& context);
856+
void ProcessDebuggers(ContextItem& context);
854857
bool ProcessExecutes(ContextItem& context, bool solutionLevel = false);
855858
bool ProcessGroups(ContextItem& context);
856859
bool ProcessSequencesRelatives(ContextItem& context, bool rerun);

tools/projmgr/include/ProjMgrYamlParser.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-2023 Arm Limited. All rights reserved.
2+
* Copyright (c) 2020-2025 Arm Limited. All rights reserved.
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -15,6 +15,7 @@
1515
*/
1616
static constexpr const char* YAML_ACCESS = "access";
1717
static constexpr const char* YAML_ALGORITHM = "algorithm";
18+
static constexpr const char* YAML_ALIAS = "alias";
1819
static constexpr const char* YAML_APIS = "apis";
1920
static constexpr const char* YAML_API = "api";
2021
static constexpr const char* YAML_ADDPATH = "add-path";
@@ -49,6 +50,7 @@ static constexpr const char* YAML_CBUILD_SET = "cbuild-set";
4950
static constexpr const char* YAML_CDEFAULT = "cdefault";
5051
static constexpr const char* YAML_CLAYERS = "clayers";
5152
static constexpr const char* YAML_CLAYER = "clayer";
53+
static constexpr const char* YAML_CLOCK = "clock";
5254
static constexpr const char* YAML_CPROJECTS = "cprojects";
5355
static constexpr const char* YAML_CPROJECT = "cproject";
5456
static constexpr const char* YAML_CSOLUTION = "csolution";
@@ -71,6 +73,10 @@ static constexpr const char* YAML_COPY_TO = "copy-to";
7173
static constexpr const char* YAML_CREATED_BY = "created-by";
7274
static constexpr const char* YAML_CREATED_FOR = "created-for";
7375
static constexpr const char* YAML_DEBUG = "debug";
76+
static constexpr const char* YAML_DEBUG_SEQUENCES = "debug-sequences";
77+
static constexpr const char* YAML_DEBUG_VARS = "debug-vars";
78+
static constexpr const char* YAML_DEBUGGER = "debugger";
79+
static constexpr const char* YAML_DBGCONF = "dbgconf";
7480
static constexpr const char* YAML_DEFAULT = "default";
7581
static constexpr const char* YAML_DEFINE = "define";
7682
static constexpr const char* YAML_DEFINE_ASM = "define-asm";
@@ -152,6 +158,7 @@ static constexpr const char* YAML_PACKS_MISSING = "packs-missing";
152158
static constexpr const char* YAML_PACKS_UNUSED = "packs-unused";
153159
static constexpr const char* YAML_PATH = "path";
154160
static constexpr const char* YAML_PNAME = "pname";
161+
static constexpr const char* YAML_PORT = "port";
155162
static constexpr const char* YAML_PROCESSOR = "processor";
156163
static constexpr const char* YAML_PROGRAMMING = "programming";
157164
static constexpr const char* YAML_PROJECT = "project";
@@ -172,17 +179,18 @@ static constexpr const char* YAML_SOLUTION = "solution";
172179
static constexpr const char* YAML_SELECT = "select";
173180
static constexpr const char* YAML_SELECTED_BY = "selected-by";
174181
static constexpr const char* YAML_SELECTED_BY_PACK = "selected-by-pack";
175-
static constexpr const char* YAML_SEQUENCES = "sequences";
176182
static constexpr const char* YAML_SETUPS = "setups";
177183
static constexpr const char* YAML_SETUP = "setup";
178184
static constexpr const char* YAML_SET = "set";
179185
static constexpr const char* YAML_SETTINGS = "settings";
180186
static constexpr const char* YAML_SELECT_COMPILER = "select-compiler";
181187
static constexpr const char* YAML_SIZE = "size";
182188
static constexpr const char* YAML_START = "start";
189+
static constexpr const char* YAML_STARTUP = "startup";
183190
static constexpr const char* YAML_STATUS = "status";
184191
static constexpr const char* YAML_SWITCH = "switch";
185192
static constexpr const char* YAML_SYSTEM_DESCRIPTIONS = "system-descriptions";
193+
static constexpr const char* YAML_SYSTEM_RESOURCES = "system-resources";
186194
static constexpr const char* YAML_TARGET_CONFIGURATIONS = "target-configurations";
187195
static constexpr const char* YAML_TARGETTYPE = "target-type";
188196
static constexpr const char* YAML_TARGETTYPES = "target-types";
@@ -192,8 +200,10 @@ static constexpr const char* YAML_CORE = "core";
192200
static constexpr const char* YAML_TITLE = "title";
193201
static constexpr const char* YAML_TYPE = "type";
194202
static constexpr const char* YAML_UNDEFINE = "undefine";
203+
static constexpr const char* YAML_UNINIT = "uninit";
195204
static constexpr const char* YAML_UPDATE = "update";
196205
static constexpr const char* YAML_VARIABLES = "variables";
206+
static constexpr const char* YAML_VARS = "vars";
197207
static constexpr const char* YAML_VERSION = "version";
198208
static constexpr const char* YAML_WARNINGS = "warnings";
199209
static constexpr const char* YAML_WHILE = "while";
@@ -280,6 +290,7 @@ class ProjMgrYamlParser {
280290
void ParseOutputDirs(const YAML::Node& parent, const std::string& file, struct DirectoriesItem& directories);
281291
void ParseGenerators(const YAML::Node& parent, const std::string& file, GeneratorsItem& generators);
282292
void ParseExecutes(const YAML::Node& parent, const std::string& file, std::vector<ExecutesItem>& executes);
293+
bool ParseDebugger(const YAML::Node& parent, const std::string& file, std::vector<DebuggerItem>& debbugers);
283294
void ParseConnections(const YAML::Node& parent, std::vector<ConnectItem>& connects);
284295
bool ParseTargetType(const YAML::Node& parent, const std::string& file, TargetType& targetType);
285296
bool ParseBuildTypes(const YAML::Node& parent, const std::string& file, BuildTypes& buildTypes);

tools/projmgr/schemas/common.schema.json

Lines changed: 82 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,7 @@
10481048
"description": "The tool required to build this csolution project."
10491049
},
10501050
"debug": { "$ref": "#/definitions/DebugType" },
1051+
"debugger": { "$ref": "#/definitions/DebuggersType" },
10511052
"define": { "$ref": "#/definitions/DefinesType" },
10521053
"define-asm": { "$ref": "#/definitions/DefinesAsmType" },
10531054
"del-path": { "$ref": "#/definitions/DelpathsType" },
@@ -1922,6 +1923,11 @@
19221923
},
19231924
"additionalProperties": false
19241925
},
1926+
"MemoryAccessType": {
1927+
"description": "Memory access permission.",
1928+
"pattern": "^[rwxpsnc]+$",
1929+
"type": "string"
1930+
},
19251931
"MemoryType": {
19261932
"title": "memory:",
19271933
"description": "Additional memory available",
@@ -1933,7 +1939,7 @@
19331939
"type": "object",
19341940
"properties": {
19351941
"name": { "title": "name:", "type": "string", "description": "Memory identifier." },
1936-
"access": { "title": "access:", "type": "string", "description": "Memory access permission." },
1942+
"access": { "title": "access:", "$ref": "#/definitions/MemoryAccessType" },
19371943
"algorithm":{ "title": "algorithm:", "type": "string", "description": "Programming algorithm." },
19381944
"start": { "title": "start:", "type": "number", "description": "Memory start address." },
19391945
"size": { "title": "size:", "type": "number", "description": "Memory size." }
@@ -1974,6 +1980,7 @@
19741980
"additionalProperties": false
19751981
},
19761982
"DebugSequencesType": {
1983+
"description": "Debug sequences for the target.",
19771984
"type": "array",
19781985
"uniqueItems": true,
19791986
"items": { "$ref": "#/definitions/DebugSequenceType" }
@@ -2009,22 +2016,84 @@
20092016
},
20102017
"additionalProperties": false
20112018
},
2019+
"SystemResourcesType": {
2020+
"description": "Resources of a target system.",
2021+
"type": "object",
2022+
"properties": {
2023+
"memory": { "$ref": "#/definitions/SystemMemoriesType" }
2024+
},
2025+
"additionalProperties": false
2026+
},
2027+
"SystemMemoriesType": {
2028+
"type": "array",
2029+
"uniqueItems": true,
2030+
"items": { "$ref": "#/definitions/SystemMemoryType" }
2031+
},
2032+
"SystemMemoryType": {
2033+
"type": "object",
2034+
"properties": {
2035+
"name": { "type": "string", "description": "Name of the memory region." },
2036+
"access": { "$ref": "#/definitions/MemoryAccessType" },
2037+
"start": { "type": "number", "description": "Base address of the memory." },
2038+
"size": { "type": "number", "description": "Size of the memory." },
2039+
"default": { "type": "boolean", "description": "Memory is always accessible (used for algorithm when no ram-start is specified)." },
2040+
"startup": { "type": "boolean", "description": "Default startup code location (vector table)." },
2041+
"pname": { "type": "string", "description": "Only accessible by a specific processor." },
2042+
"uninit": { "type": "boolean", "description": "Memory content must not be altered." },
2043+
"alias": { "type": "string", "description": "Name of identical memory exposed at different address." },
2044+
"from-pack": { "$ref": "#/definitions/PackID" }
2045+
},
2046+
"additionalProperties": false,
2047+
"required": ["name"]
2048+
},
2049+
"DebuggersType": {
2050+
"description": "Connection information to debuggers.",
2051+
"type": "array",
2052+
"uniqueItems": true,
2053+
"items": { "$ref": "#/definitions/DebuggerType" }
2054+
},
2055+
"DebuggerType": {
2056+
"type": "object",
2057+
"properties": {
2058+
"name": { "type": "string", "description": "Identifies the debug configuration." },
2059+
"info": { "type": "string", "description": "Brief description of the connection." },
2060+
"port": { "enum": [ "jtag", "swd" ], "description": "Selected debug port (jtag or swd)." },
2061+
"clock": { "type": "number", "description": "Selected debug clock speed." },
2062+
"dbgconf": { "type": "string", "description": "Debugger configuration file (pinout, trace)." },
2063+
"for-context": { "$ref": "#/definitions/ForContext" },
2064+
"not-for-context": { "$ref": "#/definitions/NotForContext" }
2065+
},
2066+
"additionalProperties": false,
2067+
"required": ["name"]
2068+
},
2069+
"DebugVarsType": {
2070+
"description": "Debug variables for debug sequences.",
2071+
"type": "object",
2072+
"properties": {
2073+
"vars": { "type": "string", "description": "Initial values for debug variables used in debug sequences." }
2074+
},
2075+
"additionalProperties": false,
2076+
"required": ["vars"]
2077+
},
20122078
"RunDebugDescType": {
20132079
"description": "This section describes generated contents",
20142080
"type": "object",
20152081
"properties": {
2016-
"generated-by": { "type": "string", "description": "Tool name along with version information used to generate this file." },
2017-
"solution": { "type": "string", "description": "Solution path." },
2018-
"target-type": { "type": "string", "description": "Target type." },
2019-
"compiler": { "type": "string", "description": "Selection of compiler used." },
2020-
"board": { "$ref": "#/definitions/BoardType" },
2021-
"device": { "$ref": "#/definitions/DeviceType" },
2022-
"board-pack": { "$ref": "#/definitions/PackID" },
2023-
"device-pack": { "$ref": "#/definitions/PackID" },
2024-
"programming": { "$ref": "#/definitions/ProgrammingType" },
2025-
"system-descriptions": { "$ref": "#/definitions/RunFilesType", "description": "System description files." },
2026-
"output": { "$ref": "#/definitions/RunFilesType", "description": "Application image files." },
2027-
"sequences": { "$ref": "#/definitions/DebugSequencesType", "description": "Debug sequences for the target." }
2082+
"generated-by": { "type": "string", "description": "Tool name along with version information used to generate this file." },
2083+
"solution": { "type": "string", "description": "Solution path." },
2084+
"target-type": { "type": "string", "description": "Target type." },
2085+
"compiler": { "type": "string", "description": "Selection of compiler used." },
2086+
"board": { "$ref": "#/definitions/BoardType" },
2087+
"device": { "$ref": "#/definitions/DeviceType" },
2088+
"board-pack": { "$ref": "#/definitions/PackID" },
2089+
"device-pack": { "$ref": "#/definitions/PackID" },
2090+
"programming": { "$ref": "#/definitions/ProgrammingType" },
2091+
"system-descriptions": { "$ref": "#/definitions/RunFilesType", "description": "System description files." },
2092+
"output": { "$ref": "#/definitions/RunFilesType", "description": "Application image files." },
2093+
"system-resources": { "$ref": "#/definitions/SystemResourcesType" },
2094+
"debugger": { "$ref": "#/definitions/DebuggersType" },
2095+
"debug-vars": { "$ref": "#/definitions/DebugVarsType" },
2096+
"debug-sequences": { "$ref": "#/definitions/DebugSequencesType" }
20282097
},
20292098
"additionalProperties": false
20302099
}

0 commit comments

Comments
 (0)