forked from Open-CMSIS-Pack/devtools
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathProjMgrRunDebug.h
More file actions
280 lines (253 loc) · 6.56 KB
/
Copy pathProjMgrRunDebug.h
File metadata and controls
280 lines (253 loc) · 6.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
/*
* Copyright (c) 2024-2026 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef PROJMGRRUNDEBUG_H
#define PROJMGRRUNDEBUG_H
#include "ProjMgrWorker.h"
/**
* @brief ram type
*/
struct RamType {
unsigned long long start = 0;
unsigned long long size = 0;
std::string pname;
};
/**
* @brief programming algorithm types
*/
struct AlgorithmType {
std::string algorithm;
unsigned long long start = 0;
unsigned long long size = 0;
RamType ram;
};
/**
* @brief memory type
*/
struct MemoryType {
std::string name;
std::string access;
std::string alias;
std::string fromPack;
unsigned long long start = 0;
unsigned long long size = 0;
std::string pname;
};
/**
* @brief flash info block
*/
struct FlashInfoBlockType {
unsigned long long count = 0;
unsigned long long size = 0;
std::optional<unsigned long long> arg;
};
/**
* @brief flash info
*/
struct FlashInfoType {
std::string name;
unsigned long long start = 0;
unsigned long long pageSize = 0;
std::vector<FlashInfoBlockType> blocks;
std::optional<unsigned long long> blankVal;
std::optional<unsigned long long> fillVal;
std::optional<unsigned int> ptime;
std::optional<unsigned int> etime;
std::string pname;
};
/**
* @brief processor capabilities
*/
struct ProcessorCapabilitiesType {
std::string core;
std::string revision;
std::string pname;
std::string endian;
std::string fpu;
std::string mpu;
std::string dsp;
std::string trustzone;
std::string mve;
std::string pacbti;
unsigned int maxClock = 0;
std::optional<unsigned int> punits;
std::optional<unsigned int> cdecp;
};
/**
* @brief system resources type
*/
struct SystemResourcesType {
std::vector<MemoryType> memories;
std::vector<ProcessorCapabilitiesType> processors;
};
/**
* @brief files type
*/
struct FilesType {
std::string file;
std::string info;
std::string type;
std::string load;
std::string offset;
std::string pname;
};
/**
* @brief debug sequences block type
*/
struct DebugSequencesBlockType {
std::string info;
std::string execute;
std::string control_if;
std::string control_while;
std::optional<unsigned int>timeout;
bool bAtomic = false;
std::vector<DebugSequencesBlockType> blocks;
};
/**
* @brief debug sequences type
*/
struct DebugSequencesType {
std::string name;
std::string info;
std::vector<DebugSequencesBlockType> blocks;
std::string pname;
};
/**
* @brief debug vars type
*/
struct DebugVarsType {
std::string vars;
};
/**
* @brief punit type
*/
struct PunitType {
std::optional<unsigned int> punit;
std::optional<unsigned long long> address;
};
/**
* @brief processor type
*/
struct ProcessorType {
std::string pname;
std::vector<PunitType> punits;
std::optional<unsigned int> apid;
std::string resetSequence;
};
/**
* @brief datapatch type
*/
struct DatapatchType {
unsigned int apid;
unsigned long long address;
unsigned long long value;
std::optional<unsigned long long> mask;
std::string type;
std::string info;
};
/**
* @brief access port type
*/
struct AccessPortType {
unsigned int apid;
std::optional<unsigned int> index;
std::optional<unsigned long long> address;
std::optional<unsigned int> hprot;
std::optional<unsigned int> sprot;
std::vector<DatapatchType> datapatch;
std::vector<AccessPortType> accessPorts;
};
/**
* @brief debug port type
*/
struct DebugPortType {
unsigned int dpid;
std::optional<unsigned int> jtagTapIndex;
std::optional<unsigned int> swdTargetSel;
std::vector<AccessPortType> accessPorts;
};
/**
* @brief debug topology type
*/
struct DebugTopologyType {
std::vector<DebugPortType> debugPorts;
std::vector<ProcessorType> processors;
std::optional<bool> swj;
std::optional<bool> dormant;
std::string sdf;
};
/**
* @brief debug run manager types
*/
struct RunDebugType {
std::string solution;
std::string solutionName;
std::string targetType;
std::string targetSet;
std::string cbuildRun;
std::string compiler;
std::string board;
std::string boardPack;
std::string device;
std::string devicePack;
std::vector<AlgorithmType> algorithms;
std::vector<FlashInfoType> flashInfo;
std::vector<FilesType> outputs;
std::vector<FilesType> systemDescriptions;
SystemResourcesType systemResources;
DebuggerType debugger;
DebugVarsType debugVars;
std::vector<DebugSequencesType> debugSequences;
DebugTopologyType debugTopology;
};
/**
* @brief projmgr run debug management class
*/
class ProjMgrRunDebug {
public:
/**
* @brief class constructor
*/
ProjMgrRunDebug(void);
/**
* @brief class destructor
*/
~ProjMgrRunDebug(void);
/**
* @brief get run debug info
* @return reference to m_runDebug
*/
RunDebugType& Get() { return m_runDebug; };
/**
* @brief collect run/debug info for selected contexts
* @param vector of selected contexts
* @return true if executed successfully
*/
bool CollectSettings(const std::vector<ContextItem*>& contexts, const DebugAdaptersItem& adapters);
void Clear() {
m_runDebug = {};
}
protected:
RunDebugType m_runDebug;
void GetDebugSequenceBlock(const RteItem* item, DebugSequencesBlockType& block);
void PushBackUniquely(std::vector<std::pair<const RteItem*, std::vector<std::string>>>& vec,
const RteItem* item, const std::string pname);
void AddGeneratedImage(const ContextItem* context, const std::string& filename, const std::string& type, const std::string& load);
void AddGeneratedImages(const ContextItem* context);
void SetAccessPorts(std::vector<AccessPortType>& parent, const std::map<unsigned int,
std::vector<AccessPortType>>& childrenMap);
void SetProtNodes(const RteDeviceProperty* item, AccessPortType& ap);
bool GetDebugAdapter(const std::string& name, const DebugAdaptersItem& adapters, DebugAdapterItem& match);
void CollectDebuggerSettings(const ContextItem& context, const DebugAdaptersItem& adapters,
const std::map<std::string, RteDeviceProperty*>& pnames);
void CollectDebugTopology(const ContextItem& context, std::vector<std::pair<const RteItem*, std::vector<std::string>>> debugs,
const std::map<std::string, RteDeviceProperty*>& pnames);
void CollectTelnetOptions(const ContextItem& context, DebugAdapterItem& adapter,
const std::map<std::string, RteDeviceProperty*>& pnames);
void SetTelnetPort(TelnetOptionsItem& item, unsigned long long& port, std::set<unsigned long long>& usedPorts);
CustomItem& CustomMapFind(std::vector<std::pair<std::string, CustomItem>>& customMap, const std::string& key);
void MergeCustomItems(const CustomItem& src, CustomItem& dst);
};
#endif // PROJMGRRUNDEBUG_H