Skip to content

Commit 651eae3

Browse files
Update Opella instructions for XML tdesc
Adding new custom Ashling reg files, which have required location for PC, STATUS32, LP_START and LP_END registers. Also updating README with relevant instructions. Signed-off-by: Anton Kolesov <[email protected]>
1 parent 6bcbb29 commit 651eae3

File tree

4 files changed

+710
-27
lines changed

4 files changed

+710
-27
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -319,39 +319,40 @@ chain. Command to start it:
319319

320320
Where <core.xml> is a path to XML file describing AUX registers of target core.
321321
The Ashling drivers distribution contain files for ARC 600 (arc600-core.xml)
322-
and ARC 700 (arc700-core.xml). File for ARC EM is not part of Opella-XD
323-
drivers distribution, but is part of this `toolchain` repository and can be
324-
found in `extras/opella-xd` directory.
322+
and ARC 700 (arc700-core.xml). However due to recent changes in GDB with
323+
regards of support of XML target descriptions those files will not work out of
324+
the box, as order of some registers changed. To use Ashling GDB server with GDB
325+
starting from 2015.06 release it is required to use modified files that can be
326+
found in this `toolchain` repository in `extras/opella-xd` directory.
325327

326328
The Ashling gdbserver might emit error messages like "Error: Core is running".
327329
Those messages are harmless and do not affect the debugging experience.
328330

329-
*Before* connecting GDB to an Opella-XD gdbserver it is essential to
330-
specify the architecture of the target. For EM, type in GDB:
331+
*Before* connecting GDB to an Opella-XD gdbserver it is essential to specify
332+
path to XML target description file that is aligned to `<core.xml>` file passed
333+
to GDB server. All registers described in `<core.xml>` also must be described
334+
in XML target description file in the same order. Otherwise GDB will not
335+
function properly.
331336

332-
(gdb) set arc opella-target arcem
337+
(gdb) set tdesc filename <path/to/opella-CPU-tdesc.xml>
333338

334-
(other possible values are `arc600` and `arc700`).
339+
XML target description files are provided in the same `extras/opella-xd`
340+
directory as Ashling GDB server core files.
335341

336342
Then connect to the target as with the OpenOCD/Linux gdbserver. For example a
337343
full session with an Opella-XD controlling an ARC EM target could start as
338344
follows:
339345

340346
$ arc-elf32-gcc -mEM -g simple.c
341347
$ arc-elf32-gdb --quiet a.out
342-
(gdb) set arc opella-target arcem
348+
(gdb) set tdesc filename toolchain/extras/opella-xd/opella-arcem-tdesc.xml
343349
(gdb) set target remote :2331
344350
(gdb) load
345351
(gdb) break main
346352
(gdb) continue
347353
(gdb) break exit
348354
(gdb) continue
349355

350-
Available Opella targets are: *arc600*, *arc700* and *arcem*. The same target
351-
is used for both EM4 and EM6, so registers that are not present en EM4 template
352-
(for example IC_CTRL) still will be printed by the GDB. Their values will be
353-
shown as zeros and setting them will not affect core, nor will cause any error.
354-
355356

356357
### Debugging applications on Linux for ARC
357358

extras/opella-xd/arc-opella-em.xml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
2828
<register name="" number="0x" mask="0xFFFFFFFF" access="RW"
2929
description="" />
3030
-->
31-
32-
<!-- Baseline regs, always present -->
33-
<!-- baseline:curr state -->
34-
<register name="IDENTITY" description="Identity" number="0x4" mask ="0xFFFFFFFF" access="RO">
35-
<field name="CHIPID" description="unique chip identifier" size="16" offset="16" access="RO" />
36-
<field name="ARCNUM" description="additional identity number" size= "8" offset= "8" access="RO" />
37-
<field name="ARCVER" description="basecase version number" size= "8" offset= "0" access="RO" />
38-
</register>
31+
<!-- registers from aux-minimal feature -->
3932
<register name="PC" description="program counter" number="0x6" mask ="0xFFFFFFFE" access="RW"/>
33+
<register name="LP_START" description="Loop Start" number="0x2" mask ="0xFFFFFFFE" access="RW" >
34+
<field name="reserved" onwrite="0" size="1" offset="0" access="RW" />
35+
</register>
36+
<register name="LP_END" description="Loop End" number="0x3" mask ="0xFFFFFFFE" access="RW" >
37+
<field name="reserved" onwrite="0" size="1" offset="0" access="RW" />
38+
</register>
4039
<register name="STATUS32" number="0xA" mask ="0x700FFFFF" access="RW"
4140
description="status flags">
4241
<field name="H" description="halt bit" size="1" offset= "0" access="RO">
@@ -58,6 +57,14 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
5857
<field name="AD" size="1" offset="19" access="RW" description="Disable alignment checking"/>
5958
<field name="IE" size="1" offset="31" access="RW" description="Interrupt enable"/>
6059
</register>
60+
61+
<!-- Baseline regs, always present -->
62+
<!-- baseline:curr state -->
63+
<register name="IDENTITY" description="Identity" number="0x4" mask ="0xFFFFFFFF" access="RO">
64+
<field name="CHIPID" description="unique chip identifier" size="16" offset="16" access="RO" />
65+
<field name="ARCNUM" description="additional identity number" size= "8" offset= "8" access="RO" />
66+
<field name="ARCVER" description="basecase version number" size= "8" offset= "0" access="RO" />
67+
</register>
6168
<register name="BTA" number="0x412" mask="0xFFFFFFFE" access="RW"
6269
description="branch target address" />
6370
<register name="ECR" description="exception cause register" number="0x403" mask="0xC0FFFFFF" access="RW">
@@ -97,12 +104,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
97104
-->
98105

99106
<!-- if lp_size>0 -->
100-
<register name="LP_START" description="Loop Start" number="0x2" mask ="0xFFFFFFFE" access="RW" >
101-
<field name="reserved" onwrite="0" size="1" offset="0" access="RW" />
102-
</register>
103-
<register name="LP_END" description="Loop End" number="0x3" mask ="0xFFFFFFFE" access="RW" >
104-
<field name="reserved" onwrite="0" size="1" offset="0" access="RW" />
105-
</register>
106107

107108
<!-- code density -->
108109
<register name="JLI_BASE" number="0x290" mask="0xFFFFFFFC" access="RW"

0 commit comments

Comments
 (0)