forked from Open-CMSIS-Pack/devtools
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathRteConstants.h
More file actions
212 lines (179 loc) · 8.37 KB
/
Copy pathRteConstants.h
File metadata and controls
212 lines (179 loc) · 8.37 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
#ifndef RteConstants_H
#define RteConstants_H
/******************************************************************************/
/* RTE - CMSIS Run-Time Environment */
/******************************************************************************/
/** @file RteConstants.h
* @brief CMSIS RTE Data Model
*/
/******************************************************************************/
/*
* Copyright (c) 2020-2023 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
/******************************************************************************/
#include <string>
#include <list>
#include <vector>
#include <set>
#include "CollectionUtils.h"
class RteConstants
{
private:
RteConstants() {}; // private constructor to forbid instantiation of a utility class
public:
// common constants
static constexpr const char* CR = "\r";
static constexpr const char* LF = "\n";
static constexpr const char* CRLF = "\r\n";
/**
* @brief component and pack delimiters
*/
static constexpr const char* AND_STR = "&";
static constexpr const char AND_CHAR = '&';
static constexpr const char* AT_STR = "@";
static constexpr const char AT_CHAR = '@';
static constexpr const char* COLON_STR = ":";
static constexpr const char COLON_CHAR = ':';
static constexpr const char* SEMI_COLON_STR = ";";
static constexpr const char SEM_COLON_CHAR = ';';
static constexpr const char* COMMA_STR = ",";
static constexpr const char COMMA_CHAR = ',';
static constexpr const char* DOT_STR = ".";
static constexpr const char DOT_CHAR = '.';
static constexpr const char* OBRACE_STR = "(";
static constexpr const char OBRACE_CHAR= '(';
static constexpr const char* CBRACE_STR = ")";
static constexpr const char CBRACE_CHAR = ')';
static constexpr const char* OSQBRACE_STR = "[";
static constexpr const char OSQBRACE_CHAR = '[';
static constexpr const char* CSQBRACE_STR = "]";
static constexpr const char CSQBRACE_CHAR = ']';
static constexpr const char* SPACE_STR = " ";
static constexpr const char SPACE_CHAR = ' ';
static constexpr const char* COMPONENT_DELIMITERS = ":&@";
static constexpr const char* SUFFIX_CVENDOR = "::";
static constexpr const char* PREFIX_CBUNDLE = "&";
static constexpr const char PREFIX_CBUNDLE_CHAR = *PREFIX_CBUNDLE;
static constexpr const char* PREFIX_CGROUP = ":";
static constexpr const char* PREFIX_CSUB = ":";
static constexpr const char* PREFIX_CVARIANT = "&";
static constexpr const char PREFIX_CVARIANT_CHAR = *PREFIX_CVARIANT;
static constexpr const char* PREFIX_CVERSION = "@";
static constexpr const char PREFIX_CVERSION_CHAR = *PREFIX_CVERSION;
static constexpr const char* SUFFIX_PACK_VENDOR = "::";
static constexpr const char* PREFIX_PACK_VERSION = "@";
static constexpr const char PREFIX_PACK_VERSION_CHAR = '@';
static constexpr const char* NULL_VERSION = "0.0.0";
/**
* @brief output types
*/
static constexpr const char* OUTPUT_TYPE_BIN = "bin";
static constexpr const char* OUTPUT_TYPE_ELF = "elf";
static constexpr const char* OUTPUT_TYPE_HEX = "hex";
static constexpr const char* OUTPUT_TYPE_LIB = "lib";
static constexpr const char* OUTPUT_TYPE_CMSE = "cmse-lib";
static constexpr const char* OUTPUT_TYPE_MAP = "map";
/**
* @brief access sequences
*/
static constexpr const char* AS_SOLUTION = "Solution";
static constexpr const char* AS_PROJECT = "Project";
static constexpr const char* AS_COMPILER = "Compiler";
static constexpr const char* AS_BUILD_TYPE = "BuildType";
static constexpr const char* AS_TARGET_TYPE = "TargetType";
static constexpr const char* AS_DNAME = "Dname";
static constexpr const char* AS_PNAME = "Pname";
static constexpr const char* AS_BNAME = "Bname";
static constexpr const char* AS_DPACK = "Dpack";
static constexpr const char* AS_BPACK = "Bpack";
static constexpr const char* AS_SOLUTION_DIR = "SolutionDir";
static constexpr const char* AS_PROJECT_DIR = "ProjectDir";
static constexpr const char* AS_SOLUTION_DIR_BR = "SolutionDir()";
static constexpr const char* AS_PROJECT_DIR_BR = "ProjectDir()";
static constexpr const char* AS_OUT_DIR = "OutDir";
static constexpr const char* AS_PACK_DIR = "Pack";
static constexpr const char* AS_BIN = OUTPUT_TYPE_BIN;
static constexpr const char* AS_ELF = OUTPUT_TYPE_ELF;
static constexpr const char* AS_HEX = OUTPUT_TYPE_HEX;
static constexpr const char* AS_LIB = OUTPUT_TYPE_LIB;
static constexpr const char* AS_CMSE = OUTPUT_TYPE_CMSE;
static constexpr const char* AS_MAP = OUTPUT_TYPE_MAP;
/**
* @brief default and toolchain specific output affixes
*/
static constexpr const char* DEFAULT_ELF_SUFFIX = ".elf";
static constexpr const char* DEFAULT_LIB_PREFIX = "";
static constexpr const char* DEFAULT_LIB_SUFFIX = ".a";
static constexpr const char* AC6_ELF_SUFFIX = ".axf";
static constexpr const char* GCC_ELF_SUFFIX = ".elf";
static constexpr const char* IAR_ELF_SUFFIX = ".out";
static constexpr const char* AC6_LIB_PREFIX = "";
static constexpr const char* GCC_LIB_PREFIX = "lib";
static constexpr const char* IAR_LIB_PREFIX = "";
static constexpr const char* AC6_LIB_SUFFIX = ".lib";
static constexpr const char* GCC_LIB_SUFFIX = ".a";
static constexpr const char* IAR_LIB_SUFFIX = ".a";
/**
* @brief device attributes maps
*/
static constexpr const char* YAML_FPU = "fpu";
static constexpr const char* YAML_DSP = "dsp";
static constexpr const char* YAML_MVE = "mve";
static constexpr const char* YAML_ENDIAN = "endian";
static constexpr const char* YAML_TRUSTZONE = "trustzone";
static constexpr const char* YAML_BRANCH_PROTECTION = "branch-protection";
static constexpr const char* YAML_ON = "on";
static constexpr const char* YAML_OFF = "off";
static constexpr const char* YAML_FPU_DP = "dp";
static constexpr const char* YAML_FPU_SP = "sp";
static constexpr const char* YAML_MVE_FP = "fp";
static constexpr const char* YAML_MVE_INT = "int";
static constexpr const char* YAML_ENDIAN_BIG = "big";
static constexpr const char* YAML_ENDIAN_LITTLE = "little";
static constexpr const char* YAML_BP_BTI = "bti";
static constexpr const char* YAML_BP_BTI_SIGNRET = "bti-signret";
static constexpr const char* YAML_TZ_SECURE = "secure";
static constexpr const char* YAML_TZ_SECURE_ONLY = "secure-only";
static constexpr const char* YAML_TZ_NON_SECURE = "non-secure";
static constexpr const char* RTE_DFPU = "Dfpu";
static constexpr const char* RTE_DDSP = "Ddsp";
static constexpr const char* RTE_DMVE = "Dmve";
static constexpr const char* RTE_DENDIAN = "Dendian";
static constexpr const char* RTE_DSECURE = "Dsecure";
static constexpr const char* RTE_DTZ = "Dtz";
static constexpr const char* RTE_DBRANCHPROT = "DbranchProt";
static constexpr const char* RTE_DPACBTI = "Dpacbti";
static constexpr const char* RTE_DP_FPU = "DP_FPU";
static constexpr const char* RTE_SP_FPU = "SP_FPU";
static constexpr const char* RTE_NO_FPU = "NO_FPU";
static constexpr const char* RTE_DSP = "DSP";
static constexpr const char* RTE_NO_DSP = "NO_DSP";
static constexpr const char* RTE_MVE = "MVE";
static constexpr const char* RTE_FP_MVE = "FP_MVE";
static constexpr const char* RTE_NO_MVE = "NO_MVE";
static constexpr const char* RTE_ENDIAN_BIG = "Big-endian";
static constexpr const char* RTE_ENDIAN_LITTLE = "Little-endian";
static constexpr const char* RTE_ENDIAN_CONFIGURABLE = "Configurable";
static constexpr const char* RTE_SECURE = "Secure";
static constexpr const char* RTE_SECURE_ONLY = "Secure-only";
static constexpr const char* RTE_NON_SECURE = "Non-secure";
static constexpr const char* RTE_TZ_DISABLED = "TZ-disabled";
static constexpr const char* RTE_TZ = "TZ";
static constexpr const char* RTE_NO_TZ = "NO_TZ";
static constexpr const char* RTE_BTI = "BTI";
static constexpr const char* RTE_BTI_SIGNRET = "BTI_SIGNRET";
static constexpr const char* RTE_NO_BRANCHPROT = "NO_BRANCHPROT";
static constexpr const char* RTE_NO_PACBTI = "NO_PACBTI";
static const StrMap DeviceAttributesKeys;
static const StrPairVecMap DeviceAttributesValues;
/**
* @brief get equivalent device attribute
* @param key device attribute rte key
* @param value device attribute value (rte or yaml)
* @return rte or yaml equivalent device value
*/
static const std::string& GetDeviceAttribute(const std::string& key, const std::string& value);
};
#endif // RteConstants_H