Skip to content

Commit ad087f9

Browse files
committed
#537: add a new risc-v template
1 parent cb22566 commit ad087f9

File tree

4 files changed

+1636
-0
lines changed

4 files changed

+1636
-0
lines changed

plugins/org.eclipse.embedcdt.templates.xpack.ui/plugin.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,19 @@
2828
</toolChain>
2929
</template>
3030
</extension>
31+
32+
<extension point="org.eclipse.cdt.core.templates">
33+
<template
34+
filterPattern=".*g[c\+][c\+]"
35+
id="org.eclipse.embedcdt.templates.xpack.ui.hello.world.riscv.qemu.project"
36+
location="$nl$/templates/hello-world-riscv-qemu-xpack-project/template.xml"
37+
projectType="org.eclipse.cdt.build.core.buildArtefactType.exe">
38+
</template>
39+
</extension>
40+
<extension point="org.eclipse.cdt.core.templateAssociations">
41+
<template id="org.eclipse.embedcdt.templates.xpack.ui.hello.world.riscv.qemu.project">
42+
<toolChain id="ilg.gnumcueclipse.managedbuild.cross.riscv.toolchain.base">
43+
</toolChain>
44+
</template>
45+
</extension>
3146
</plugin>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
{% if HWcoreRiscv == 'riscv-rv32imac' %}
3+
<launchConfiguration type="ilg.gnumcueclipse.debug.gdbjtag.qemu.riscv32.launchConfigurationType">
4+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.architecture" value="riscv32"/>
5+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.gdbServerExecutable" value="${qemu_riscv32_path}/${qemu_riscv32_executable}"/>
6+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.gdbServerQemuCpuName" value=""/>
7+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.gdbServerQemuMachineName" value="virt"/>
8+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.semihosting.cmdline" value="{{ projectName }} RV32"/>
9+
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.doDebugInRam" value="true"/>
10+
{% elsif HWcoreRiscv == 'riscv-rv64imafdc' %}
11+
<launchConfiguration type="ilg.gnumcueclipse.debug.gdbjtag.qemu.riscv64.launchConfigurationType">
12+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.architecture" value="riscv64"/>
13+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.gdbServerExecutable" value="${qemu_riscv64_path}/${qemu_riscv64_executable}"/>
14+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.gdbServerQemuCpuName" value=""/>
15+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.gdbServerQemuMachineName" value="virt"/>
16+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.semihosting.cmdline" value="{{ projectName }} RV64"/>
17+
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.doDebugInRam" value="true"/>
18+
{% endif %}
19+
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/{{ projectName }}.elf"/>
20+
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="{{ projectName }}"/>
21+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
22+
<listEntry value="/{{ projectName }}"/>
23+
</listAttribute>
24+
25+
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.disableGraphics" value="true"/>
26+
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.doContinue" value="true"/>
27+
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.doFirstReset" value="true"/>
28+
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.doGdbServerAllocateConsole" value="true"/>
29+
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.doGdbServerPreferXpacksBin" value="true"/>
30+
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.doSecondReset" value="true"/>
31+
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.doStartGdbServer" value="true"/>
32+
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.enableSemihosting" value="true"/>
33+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.gdbClientOtherCommands" value="set mem inaccessible-by-default off"/>
34+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.gdbClientOtherOptions" value=""/>
35+
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.gdbServerDelaySeconds" value="0"/>
36+
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.gdbServerGdbPortNumber" value="1234"/>
37+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.gdbServerOther" value="-d unimp,guest_errors"/>
38+
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.isGdbServerVerbose" value="false"/>
39+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.otherInitCommands" value=""/>
40+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.qemu.otherRunCommands" value=""/>
41+
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.svdPath" value=""/>
42+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
43+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
44+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
45+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU MCU QEMU"/>
46+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
47+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
48+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
49+
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="1234"/>
50+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
51+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
52+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
53+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
54+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
55+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
56+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
57+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
58+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
59+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
60+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
61+
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${cross_prefix}gdb${cross_suffix}"/>
62+
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
63+
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
64+
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
65+
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
66+
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
67+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
68+
<listEntry value="4"/>
69+
</listAttribute>
70+
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;/&gt;&#10;"/>
71+
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
72+
</launchConfiguration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
###############################################################################
2+
# Copyright (c) 2014 Liviu Ionescu.
3+
#
4+
# This program and the accompanying materials
5+
# are made available under the terms of the Eclipse Public License 2.0
6+
# which accompanies this distribution, and is available at
7+
# https://www.eclipse.org/legal/epl-2.0/
8+
#
9+
# SPDX-License-Identifier: EPL-2.0
10+
#
11+
# Contributors:
12+
# Liviu Ionescu - Arm version
13+
###############################################################################
14+
15+
#Template Default Values
16+
HW.template.riscv.label=Hello World RISC-V QEMU xPack C/C++ Project
17+
HW.template.riscv.description=A managed C/C++ project running \
18+
on QEMU emulated RISC-V processors.
19+
20+
# Used to configure the target wizard
21+
HW.group.target.riscv.label=Project settings
22+
HW.group.target.riscv.description=Select the CPU and define project options.
23+
24+
HWcore.riscv.label=MCU:
25+
HWcore.riscv.description=The MCU, like RV32/RV64
26+
27+
# Common definitions
28+
29+
someWarnings.riscv.label=Check some warnings
30+
someWarnings.riscv.description=Enable -Wall and -Wextra.
31+
32+
mostWarnings.riscv.label=Check most warnings
33+
mostWarnings.riscv.description=Enable as many warnings as possible.
34+
35+
useWerror.riscv.label=Enable -Werror
36+
useWerror.riscv.description=Instruct the compiler to stop on warnings.
37+
38+
doNotUseExceptions.riscv.label=Do not use exceptions
39+
doNotUseExceptions.riscv.descriptions=Do not use exceptions and RTTI
40+
41+
useOg.riscv.label=Use -Og on debug
42+
useOg.riscv.description=Use the new optimization flag for the debug configurations.
43+
44+
useNano.riscv.label=Use newlib nano
45+
useNano.riscv.description=Use the size optimised version of newlib.
46+

0 commit comments

Comments
 (0)