Skip to content

Commit 6849fd9

Browse files
authored
Merge pull request #3413 from theotherjimmy/iar-def-typo
Deduplicate IAR exporter templates and enable a few more targets
2 parents 4524c5f + e29135e commit 6849fd9

File tree

5 files changed

+177
-3033
lines changed

5 files changed

+177
-3033
lines changed

tools/export/iar/__init__.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ class IAR(Exporter):
3131
if hasattr(obj, 'device_name') and
3232
obj.device_name in IAR_DEFS.keys() and "IAR" in obj.supported_toolchains]
3333

34-
SPECIAL_TEMPLATES = {
35-
'rz_a1h' : 'iar/iar_rz_a1h.ewp.tmpl',
36-
'nucleo_f746zg' : 'iar/iar_nucleo_f746zg.ewp.tmpl'
37-
}
38-
3934
def iar_groups(self, grouped_src):
4035
"""Return a namedtuple of group info
4136
Positional Arguments:
@@ -68,7 +63,9 @@ def iar_device(self):
6863
"CoreVariant": '',
6964
"GFPUCoreSlave": '',
7065
"GFPUCoreSlave2": 40,
71-
"GBECoreSlave": 35
66+
"GBECoreSlave": 35,
67+
"FPU2": 0,
68+
"NrRegs": 0,
7269
}
7370

7471
iar_defaults.update(device_info)
@@ -86,9 +83,6 @@ def format_src(self, srcs):
8683
grouped[group] = [self.format_file(src) for src in files]
8784
return grouped
8885

89-
def get_ewp_template(self):
90-
return self.SPECIAL_TEMPLATES.get(self.target.lower(), 'iar/ewp.tmpl')
91-
9286
def generate(self):
9387
"""Generate the .eww, .ewd, and .ewp files"""
9488
srcs = self.resources.headers + self.resources.s_sources + \
@@ -122,9 +116,9 @@ def generate(self):
122116
}
123117
ctx.update(flags)
124118

125-
self.gen_file('iar/eww.tmpl', ctx, self.project_name+".eww")
119+
self.gen_file('iar/eww.tmpl', ctx, self.project_name + ".eww")
126120
self.gen_file('iar/ewd.tmpl', ctx, self.project_name + ".ewd")
127-
self.gen_file(self.get_ewp_template(), ctx, self.project_name + ".ewp")
121+
self.gen_file('iar/ewp.tmpl', ctx, self.project_name + ".ewp")
128122

129123
@staticmethod
130124
def build(project_name, log_name="build_log.txt", cleanup=True):

tools/export/iar/ewp.tmpl

Lines changed: 160 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -10,153 +10,166 @@
1010
<settings>
1111
<name>General</name>
1212
<archiveVersion>3</archiveVersion>
13-
<data>
14-
<version>22</version>
15-
<wantNonLocal>1</wantNonLocal>
16-
<debug>1</debug>
17-
<option>
18-
<name>GRuntimeLibThreads</name>
19-
<state>0</state>
20-
</option>
21-
<option>
22-
<name>ExePath</name>
23-
<state>$PROJ_DIR$\BUILD\Exe</state>
24-
</option>
25-
<option>
26-
<name>ObjPath</name>
27-
<state>$PROJ_DIR$\BUILD\Obj</state>
28-
</option>
29-
<option>
30-
<name>ListPath</name>
31-
<state>$PROJ_DIR$\BUILD\List</state>
32-
</option>
33-
<option>
34-
<name>Variant</name>
35-
<version>20</version>
36-
<state>{{device.CoreVariant}}</state>
37-
</option>
38-
<option>
39-
<name>GEndianMode</name>
40-
<state>0</state>
41-
</option>
42-
<option>
43-
<name>Input variant</name>
44-
<version>3</version>
45-
<state>1</state>
46-
</option>
47-
<option>
48-
<name>Input description</name>
49-
<state>Full formatting.</state>
50-
</option>
51-
<option>
52-
<name>Output variant</name>
53-
<version>2</version>
54-
<state>3</state>
55-
</option>
56-
<option>
57-
<name>Output description</name>
58-
<state>No specifier a, A.</state>
59-
</option>
60-
<option>
61-
<name>GOutputBinary</name>
62-
<state>0</state>
63-
</option>
64-
<option>
65-
<name>FPU</name>
66-
<version>2</version>
67-
<state>5</state>
68-
</option>
69-
<option>
70-
<name>OGCoreOrChip</name>
71-
<state>1</state>
72-
</option>
73-
<option>
74-
<name>GRuntimeLibSelect</name>
75-
<version>0</version>
76-
<state>2</state>
77-
</option>
78-
<option>
79-
<name>GRuntimeLibSelectSlave</name>
80-
<version>0</version>
81-
<state>2</state>
82-
</option>
83-
<option>
84-
<name>RTDescription</name>
85-
<state>Use the full configuration of the C/C++ runtime library. Full locale interface, C locale, file descriptor support, multibytes in printf and scanf, and hex floats in strtod.</state>
86-
</option>
87-
<option>
88-
<name>OGProductVersion</name>
89-
<state>5.10.0.159</state>
90-
</option>
91-
<option>
92-
<name>OGLastSavedByProductVersion</name>
93-
<state>7.10.3.6927</state>
94-
</option>
95-
<option>
96-
<name>GeneralEnableMisra</name>
97-
<state>0</state>
98-
</option>
99-
<option>
100-
<name>GeneralMisraVerbose</name>
101-
<state>0</state>
102-
</option>
103-
<option>
104-
<name>OGChipSelectEditMenu</name>
105-
<state>{{device.OGChipSelectEditMenu}}</state>
106-
</option>
107-
<option>
108-
<name>GenLowLevelInterface</name>
109-
<state>0</state>
110-
</option>
111-
<option>
112-
<name>GEndianModeBE</name>
113-
<state>1</state>
114-
</option>
115-
<option>
116-
<name>OGBufferedTerminalOutput</name>
117-
<state>0</state>
118-
</option>
119-
<option>
120-
<name>GenStdoutInterface</name>
121-
<state>0</state>
122-
</option>
123-
<option>
124-
<name>GeneralMisraRules98</name>
125-
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
126-
<version>0</version>
127-
</option>
128-
<option>
129-
<name>GeneralMisraVer</name>
130-
<state>0</state>
131-
</option>
132-
<option>
133-
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
134-
<version>0</version>
135-
<name>GeneralMisraRules04</name>
136-
</option>
137-
<option>
138-
<name>RTConfigPath2</name>
139-
<state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
140-
</option>
141-
<option>
142-
<name>GFPUCoreSlave</name>
143-
<version>20</version>
144-
<state>{{device.GFPUCoreSlave}}</state>
145-
</option>
146-
<option>
147-
<name>GBECoreSlave</name>
148-
<version>20</version>
149-
<state>{{device.GBECoreSlave}}</state>
150-
</option>
151-
<option>
152-
<name>OGUseCmsis</name>
153-
<state>0</state>
154-
</option>
155-
<option>
156-
<name>OGUseCmsisDspLib</name>
157-
<state>0</state>
158-
</option>
159-
</data>
13+
<data>
14+
<version>24</version>
15+
<wantNonLocal>1</wantNonLocal>
16+
<debug>1</debug>
17+
<option>
18+
<name>GRuntimeLibThreads</name>
19+
<state>0</state>
20+
</option>
21+
<option>
22+
<name>ExePath</name>
23+
<state>$PROJ_DIR$\BUILD\Exe</state>
24+
</option>
25+
<option>
26+
<name>ObjPath</name>
27+
<state>$PROJ_DIR$\BUILD\Obj</state>
28+
</option>
29+
<option>
30+
<name>ListPath</name>
31+
<state>$PROJ_DIR$\BUILD\List</state>
32+
</option>
33+
<option>
34+
<name>GEndianMode</name>
35+
<state>0</state>
36+
</option>
37+
<option>
38+
<name>Input variant</name>
39+
<version>3</version>
40+
<state>1</state>
41+
</option>
42+
<option>
43+
<name>Input description</name>
44+
<state>Full formatting.</state>
45+
</option>
46+
<option>
47+
<name>Output variant</name>
48+
<version>2</version>
49+
<state>3</state>
50+
</option>
51+
<option>
52+
<name>Output description</name>
53+
<state>No specifier a, A.</state>
54+
</option>
55+
<option>
56+
<name>GOutputBinary</name>
57+
<state>0</state>
58+
</option>
59+
<option>
60+
<name>OGCoreOrChip</name>
61+
<state>1</state>
62+
</option>
63+
<option>
64+
<name>GRuntimeLibSelect</name>
65+
<version>0</version>
66+
<state>2</state>
67+
</option>
68+
<option>
69+
<name>GRuntimeLibSelectSlave</name>
70+
<version>0</version>
71+
<state>2</state>
72+
</option>
73+
<option>
74+
<name>RTDescription</name>
75+
<state>Use the full configuration of the C/C++ runtime library. Full locale interface, C locale, file descriptor support, multibytes in printf and scanf, and hex floats in strtod.</state>
76+
</option>
77+
<option>
78+
<name>OGProductVersion</name>
79+
<state>5.10.0.159</state>
80+
</option>
81+
<option>
82+
<name>OGLastSavedByProductVersion</name>
83+
<state>7.80.2.11970</state>
84+
</option>
85+
<option>
86+
<name>GeneralEnableMisra</name>
87+
<state>0</state>
88+
</option>
89+
<option>
90+
<name>GeneralMisraVerbose</name>
91+
<state>0</state>
92+
</option>
93+
<option>
94+
<name>OGChipSelectEditMenu</name>
95+
<state>{{device.OGChipSelectEditMenu}}</state>
96+
</option>
97+
<option>
98+
<name>GenLowLevelInterface</name>
99+
<state>0</state>
100+
</option>
101+
<option>
102+
<name>GEndianModeBE</name>
103+
<state>1</state>
104+
</option>
105+
<option>
106+
<name>OGBufferedTerminalOutput</name>
107+
<state>0</state>
108+
</option>
109+
<option>
110+
<name>GenStdoutInterface</name>
111+
<state>0</state>
112+
</option>
113+
<option>
114+
<name>GeneralMisraRules98</name>
115+
<version>0</version>
116+
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
117+
</option>
118+
<option>
119+
<name>GeneralMisraVer</name>
120+
<state>0</state>
121+
</option>
122+
<option>
123+
<name>GeneralMisraRules04</name>
124+
<version>0</version>
125+
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
126+
</option>
127+
<option>
128+
<name>RTConfigPath2</name>
129+
<state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
130+
</option>
131+
<option>
132+
<name>GBECoreSlave</name>
133+
<version>24</version>
134+
<state>{{GBECoreSlave}}</state>
135+
</option>
136+
<option>
137+
<name>OGUseCmsis</name>
138+
<state>0</state>
139+
</option>
140+
<option>
141+
<name>OGUseCmsisDspLib</name>
142+
<state>0</state>
143+
</option>
144+
<option>
145+
<name>CoreVariant</name>
146+
<version>24</version>
147+
<state>{{device.CoreVariant}}</state>
148+
</option>
149+
<option>
150+
<name>GFPUDeviceSlave</name>
151+
<state></state>
152+
</option>
153+
<option>
154+
<name>FPU2</name>
155+
<version>0</version>
156+
<state>{{device.FPU2}}</state>
157+
</option>
158+
<option>
159+
<name>NrRegs</name>
160+
<version>0</version>
161+
<state>{{device.NrRegs}}</state>
162+
</option>
163+
<option>
164+
<name>NEON</name>
165+
<state>{{device.NEON}}</state>
166+
</option>
167+
<option>
168+
<name>GFPUCoreSlave2</name>
169+
<version>24</version>
170+
<state>{{device.GFPUCoreSlave2}}</state>
171+
</option>
172+
</data>
160173
</settings>
161174
<settings>
162175
<name>ICCARM</name>

0 commit comments

Comments
 (0)