Skip to content

Commit bc155a1

Browse files
authored
[cbuild-run] Add implicit access attributes for memory with legacy id (#1185)
1 parent b888284 commit bc155a1

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

tools/projmgr/include/ProjMgrRunDebug.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class ProjMgrRunDebug {
153153
void PushBackUniquely(std::vector<std::pair<const RteItem*, std::vector<std::string>>>& vec,
154154
const RteItem* item, const std::string pname);
155155
FilesType SetLoadFromOutput(const ContextItem* context, OutputType output, const std::string type);
156+
std::string GetAccessAttributes(const RteItem* mem);
156157
};
157158

158159
#endif // PROJMGRRUNDEBUG_H

tools/projmgr/src/ProjMgrRunDebug.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ bool ProjMgrRunDebug::CollectSettings(const vector<ContextItem*>& contexts) {
127127
for (const auto& [memory, pname] : memories) {
128128
MemoryType item;
129129
item.name = memory->GetName();
130-
item.access = memory->GetAccess();
130+
item.access = GetAccessAttributes(memory);
131131
item.alias = memory->GetAlias();
132132
item.start = memory->GetAttributeAsULL("start");
133133
item.size = memory->GetAttributeAsULL("size");
@@ -315,3 +315,13 @@ void ProjMgrRunDebug::PushBackUniquely(vector<pair<const RteItem*, vector<string
315315
}
316316
vec.push_back({ item, { pname } });
317317
}
318+
319+
string ProjMgrRunDebug::GetAccessAttributes(const RteItem* mem)
320+
{
321+
string access = mem->GetAccess();
322+
if (access.empty()) {
323+
RteItem m = *mem;
324+
access = string(m.IsReadAccess() ? "r" : "") + (m.IsWriteAccess() ? "w" : "") + (m.IsExecuteAccess() ? "x" : "");
325+
}
326+
return access;
327+
}

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
@@ -29,12 +29,14 @@ cbuild-run:
2929
system-resources:
3030
memory:
3131
- name: IROM1
32+
access: rx
3233
start: 0x00000000
3334
size: 0x00040000
3435
default: true
3536
startup: true
3637
from-pack: ARM::[email protected]
3738
- name: IRAM1
39+
access: rw
3840
start: 0x20000000
3941
size: 0x00020000
4042
default: true

0 commit comments

Comments
 (0)