Skip to content

Commit a9fb6c9

Browse files
authored
Add default attribute to memory in cbuild-run.yml
1 parent 579301e commit a9fb6c9

11 files changed

Lines changed: 33 additions & 5 deletions

tools/projmgr/include/ProjMgrRunDebug.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ struct MemoryType {
3636
std::string access;
3737
std::string alias;
3838
std::string fromPack;
39+
std::optional<bool> bDefault;
3940
unsigned long long start = 0;
4041
unsigned long long size = 0;
4142
std::string pname;

tools/projmgr/schemas/common.schema.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,12 +2247,13 @@
22472247
"SystemMemoryType": {
22482248
"type": "object",
22492249
"properties": {
2250-
"name": { "type": "string", "description": "Name of the memory region." },
2250+
"name": { "type": "string", "description": "Name of the memory region." },
22512251
"access": { "$ref": "#/definitions/MemoryAccessType" },
2252-
"start": { "type": "number", "description": "Base address of the memory." },
2253-
"size": { "type": "number", "description": "Size of the memory." },
2254-
"pname": { "type": "string", "description": "Only accessible by the specified processor." },
2255-
"alias": { "type": "string", "description": "Name of identical memory exposed at different address." },
2252+
"start": { "type": "number", "description": "Base address of the memory." },
2253+
"size": { "type": "number", "description": "Size of the memory." },
2254+
"pname": { "type": "string", "description": "Only accessible by the specified processor." },
2255+
"alias": { "type": "string", "description": "Name of identical memory exposed at different address." },
2256+
"default": { "type": "boolean", "description": "Marks a general-purpose default memory region." },
22562257
"from-pack": { "$ref": "#/definitions/PackID" }
22572258
},
22582259
"additionalProperties": false,

tools/projmgr/src/ProjMgrCbuildRun.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ void ProjMgrCbuildRun::SetResourcesNode(YAML::Node node, const SystemResourcesTy
131131
SetNodeValue(memoryNode[YAML_SIZE], ProjMgrUtils::ULLToHex(item.size));
132132
SetNodeValue(memoryNode[YAML_PNAME], item.pname);
133133
SetNodeValue(memoryNode[YAML_ALIAS], item.alias);
134+
if (item.bDefault.has_value()) {
135+
memoryNode[YAML_DEFAULT] = item.bDefault.value();
136+
}
134137
SetNodeValue(memoryNode[YAML_FROM_PACK], item.fromPack);
135138
node[YAML_MEMORY].push_back(memoryNode);
136139
}

tools/projmgr/src/ProjMgrRunDebug.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ bool ProjMgrRunDebug::CollectSettings(const vector<ContextItem*>& contexts, cons
212212
item.size = memory->GetAttributeAsULL("size");
213213
item.fromPack = memory->GetPackageID(true);
214214
item.pname = memory->GetProcessorName();
215+
if (memory->HasAttribute("default")) {
216+
item.bDefault = memory->IsDefault();
217+
}
215218
m_runDebug.systemResources.memories.push_back(item);
216219
}
217220

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ cbuild-run:
2121
access: rx
2222
start: 0x00000000
2323
size: 0x00040000
24+
default: true
2425
from-pack: ARM::RteTest_DFP@0.2.0
2526
- name: IRAM1
2627
access: rwx
2728
start: 0x20000000
2829
size: 0x00020000
30+
default: true
2931
from-pack: ARM::RteTest_DFP@0.2.0
3032
processors:
3133
- core: Cortex-M0

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,26 @@ cbuild-run:
2121
start: 0x00000000
2222
size: 0x00080000
2323
pname: cm0_core0
24+
default: true
2425
from-pack: ARM::RteTest_DFP@0.2.0
2526
- name: SRAM_DUAL
2627
access: rwx
2728
start: 0x80000000
2829
size: 0x00020000
2930
pname: cm0_core1
31+
default: true
3032
from-pack: ARM::RteTest_DFP@0.2.0
3133
- name: IROM1
3234
access: rx
3335
start: 0x00000000
3436
size: 0x00040000
37+
default: true
3538
from-pack: ARM::RteTest_DFP@0.2.0
3639
- name: IRAM1
3740
access: rwx
3841
start: 0x20000000
3942
size: 0x00020000
43+
default: true
4044
from-pack: ARM::RteTest_DFP@0.2.0
4145
processors:
4246
- core: Cortex-M0

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ cbuild-run:
1717
access: rx
1818
start: 0x00000000
1919
size: 0x00040000
20+
default: true
2021
from-pack: ARM::RteTest_DFP@0.2.0
2122
- name: SRAM
2223
access: rwx
2324
start: 0x20000000
2425
size: 0x00020000
26+
default: true
2527
from-pack: ARM::RteTest_DFP@0.2.0
2628
processors:
2729
- core: Cortex-M4

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
@@ -33,11 +33,13 @@ cbuild-run:
3333
access: rx
3434
start: 0x00000000
3535
size: 0x00040000
36+
default: true
3637
from-pack: ARM::RteTest_DFP@0.2.0
3738
- name: SRAM
3839
access: rwx
3940
start: 0x20000000
4041
size: 0x00020000
42+
default: true
4143
from-pack: ARM::RteTest_DFP@0.2.0
4244
- name: CustomMemory
4345
access: rwx

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
@@ -30,11 +30,13 @@ cbuild-run:
3030
access: rx
3131
start: 0x00000000
3232
size: 0x00040000
33+
default: true
3334
from-pack: ARM::RteTest_DFP@0.2.0
3435
- name: IRAM1
3536
access: rwx
3637
start: 0x20000000
3738
size: 0x00020000
39+
default: true
3840
from-pack: ARM::RteTest_DFP@0.2.0
3941
- name: RAM-External
4042
access: rwx

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,26 @@ cbuild-run:
3434
start: 0x00000000
3535
size: 0x00080000
3636
pname: cm0_core0
37+
default: true
3738
from-pack: ARM::RteTest_DFP@0.2.0
3839
- name: SRAM_DUAL
3940
access: rwx
4041
start: 0x80000000
4142
size: 0x00020000
4243
pname: cm0_core1
44+
default: true
4345
from-pack: ARM::RteTest_DFP@0.2.0
4446
- name: IROM1
4547
access: rx
4648
start: 0x00000000
4749
size: 0x00040000
50+
default: true
4851
from-pack: ARM::RteTest_DFP@0.2.0
4952
- name: IRAM1
5053
access: rwx
5154
start: 0x20000000
5255
size: 0x00020000
56+
default: true
5357
from-pack: ARM::RteTest_DFP@0.2.0
5458
processors:
5559
- core: Cortex-M0

0 commit comments

Comments
 (0)