Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate IAR exporter templates and enable a few more targets #3413

Merged
merged 4 commits into from
Dec 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions tools/export/iar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ class IAR(Exporter):
obj.device_name in IAR_DEFS.keys() and "IAR" in obj.supported_toolchains
and DeviceCMSIS.check_supported(target)]

SPECIAL_TEMPLATES = {
'rz_a1h' : 'iar/iar_rz_a1h.ewp.tmpl',
'nucleo_f746zg' : 'iar/iar_nucleo_f746zg.ewp.tmpl'
}

def iar_groups(self, grouped_src):
"""Return a namedtuple of group info
Positional Arguments:
Expand Down Expand Up @@ -69,7 +64,9 @@ def iar_device(self):
"CoreVariant": '',
"GFPUCoreSlave": '',
"GFPUCoreSlave2": 40,
"GBECoreSlave": 35
"GBECoreSlave": 35,
"FPU2": 0,
"NrRegs": 0,
}

iar_defaults.update(device_info)
Expand All @@ -87,9 +84,6 @@ def format_src(self, srcs):
grouped[group] = [self.format_file(src) for src in files]
return grouped

def get_ewp_template(self):
return self.SPECIAL_TEMPLATES.get(self.target.lower(), 'iar/ewp.tmpl')

def generate(self):
"""Generate the .eww, .ewd, and .ewp files"""
srcs = self.resources.headers + self.resources.s_sources + \
Expand Down Expand Up @@ -117,9 +111,9 @@ def generate(self):
}
ctx.update(flags)

self.gen_file('iar/eww.tmpl', ctx, self.project_name+".eww")
self.gen_file('iar/eww.tmpl', ctx, self.project_name + ".eww")
self.gen_file('iar/ewd.tmpl', ctx, self.project_name + ".ewd")
self.gen_file(self.get_ewp_template(), ctx, self.project_name + ".ewp")
self.gen_file('iar/ewp.tmpl', ctx, self.project_name + ".ewp")

@staticmethod
def build(project_name, log_name="build_log.txt", cleanup=True):
Expand Down
307 changes: 160 additions & 147 deletions tools/export/iar/ewp.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,153 +10,166 @@
<settings>
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>22</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>GRuntimeLibThreads</name>
<state>0</state>
</option>
<option>
<name>ExePath</name>
<state>$PROJ_DIR$\BUILD\Exe</state>
</option>
<option>
<name>ObjPath</name>
<state>$PROJ_DIR$\BUILD\Obj</state>
</option>
<option>
<name>ListPath</name>
<state>$PROJ_DIR$\BUILD\List</state>
</option>
<option>
<name>Variant</name>
<version>20</version>
<state>{{device.CoreVariant}}</state>
</option>
<option>
<name>GEndianMode</name>
<state>0</state>
</option>
<option>
<name>Input variant</name>
<version>3</version>
<state>1</state>
</option>
<option>
<name>Input description</name>
<state>Full formatting.</state>
</option>
<option>
<name>Output variant</name>
<version>2</version>
<state>3</state>
</option>
<option>
<name>Output description</name>
<state>No specifier a, A.</state>
</option>
<option>
<name>GOutputBinary</name>
<state>0</state>
</option>
<option>
<name>FPU</name>
<version>2</version>
<state>5</state>
</option>
<option>
<name>OGCoreOrChip</name>
<state>1</state>
</option>
<option>
<name>GRuntimeLibSelect</name>
<version>0</version>
<state>2</state>
</option>
<option>
<name>GRuntimeLibSelectSlave</name>
<version>0</version>
<state>2</state>
</option>
<option>
<name>RTDescription</name>
<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>
</option>
<option>
<name>OGProductVersion</name>
<state>5.10.0.159</state>
</option>
<option>
<name>OGLastSavedByProductVersion</name>
<state>7.10.3.6927</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>{{device.OGChipSelectEditMenu}}</state>
</option>
<option>
<name>GenLowLevelInterface</name>
<state>0</state>
</option>
<option>
<name>GEndianModeBE</name>
<state>1</state>
</option>
<option>
<name>OGBufferedTerminalOutput</name>
<state>0</state>
</option>
<option>
<name>GenStdoutInterface</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
<version>0</version>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
<version>0</version>
<name>GeneralMisraRules04</name>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
</option>
<option>
<name>GFPUCoreSlave</name>
<version>20</version>
<state>{{device.GFPUCoreSlave}}</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>20</version>
<state>{{device.GBECoreSlave}}</state>
</option>
<option>
<name>OGUseCmsis</name>
<state>0</state>
</option>
<option>
<name>OGUseCmsisDspLib</name>
<state>0</state>
</option>
</data>
<data>
<version>24</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>GRuntimeLibThreads</name>
<state>0</state>
</option>
<option>
<name>ExePath</name>
<state>$PROJ_DIR$\BUILD\Exe</state>
</option>
<option>
<name>ObjPath</name>
<state>$PROJ_DIR$\BUILD\Obj</state>
</option>
<option>
<name>ListPath</name>
<state>$PROJ_DIR$\BUILD\List</state>
</option>
<option>
<name>GEndianMode</name>
<state>0</state>
</option>
<option>
<name>Input variant</name>
<version>3</version>
<state>1</state>
</option>
<option>
<name>Input description</name>
<state>Full formatting.</state>
</option>
<option>
<name>Output variant</name>
<version>2</version>
<state>3</state>
</option>
<option>
<name>Output description</name>
<state>No specifier a, A.</state>
</option>
<option>
<name>GOutputBinary</name>
<state>0</state>
</option>
<option>
<name>OGCoreOrChip</name>
<state>1</state>
</option>
<option>
<name>GRuntimeLibSelect</name>
<version>0</version>
<state>2</state>
</option>
<option>
<name>GRuntimeLibSelectSlave</name>
<version>0</version>
<state>2</state>
</option>
<option>
<name>RTDescription</name>
<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>
</option>
<option>
<name>OGProductVersion</name>
<state>5.10.0.159</state>
</option>
<option>
<name>OGLastSavedByProductVersion</name>
<state>7.80.2.11970</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>{{device.OGChipSelectEditMenu}}</state>
</option>
<option>
<name>GenLowLevelInterface</name>
<state>0</state>
</option>
<option>
<name>GEndianModeBE</name>
<state>1</state>
</option>
<option>
<name>OGBufferedTerminalOutput</name>
<state>0</state>
</option>
<option>
<name>GenStdoutInterface</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>24</version>
<state>{{GBECoreSlave}}</state>
</option>
<option>
<name>OGUseCmsis</name>
<state>0</state>
</option>
<option>
<name>OGUseCmsisDspLib</name>
<state>0</state>
</option>
<option>
<name>CoreVariant</name>
<version>24</version>
<state>{{device.CoreVariant}}</state>
</option>
<option>
<name>GFPUDeviceSlave</name>
<state></state>
</option>
<option>
<name>FPU2</name>
<version>0</version>
<state>{{device.FPU2}}</state>
</option>
<option>
<name>NrRegs</name>
<version>0</version>
<state>{{device.NrRegs}}</state>
</option>
<option>
<name>NEON</name>
<state>{{device.NEON}}</state>
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>24</version>
<state>{{device.GFPUCoreSlave2}}</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
Expand Down
Loading