OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [gdb/] [doc/] [or32.texinfo] - Diff between revs 227 and 232

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 227 Rev 232
Line 2... Line 2...
@c Copyright (C) 2008 Embecosm Limited
@c Copyright (C) 2008 Embecosm Limited
@c
@c
@c %**start of header
@c %**start of header
@c makeinfo ignores cmds prev to setfilename, so its arg cannot make use
@c makeinfo ignores cmds prev to setfilename, so its arg cannot make use
@c of @set vars.  However, you can override filename with makeinfo -o.
@c of @set vars.  However, you can override filename with makeinfo -o.
@setfilename or1k.info
@setfilename or32.info
@c
@c
@include gdb-cfg.texi
@include gdb-cfg.texi
@c
@c
@settitle Debugging the OpenRISC 1000 with @value{GDBN}
@settitle Debugging the OpenRISC 1000 with @value{GDBN}
@setchapternewpage odd
@setchapternewpage odd
Line 35... Line 35...
 
 
@c This is a dir.info fragment to support semi-automated addition of
@c This is a dir.info fragment to support semi-automated addition of
@c manuals to an info tree.
@c manuals to an info tree.
@dircategory Software development
@dircategory Software development
@direntry
@direntry
* Gdb for OpenRISC 1000: (gdb for Or1K).   The GNU debugger for OpenRISC 1000.
* Gdb for OpenRISC 1000: (gdb for Or32).   The GNU debugger for OpenRISC 1000.
@end direntry
@end direntry
 
 
@ifinfo
@ifinfo
This file documents the @sc{gnu} debugger @value{GDBN} when used with
This file documents the @sc{gnu} debugger @value{GDBN} when used with
OpenRISC 1000 processors.
OpenRISC 1000 processors.
Line 65... Line 65...
@subtitle @value{EDITION} Edition, for @value{GDBN} version @value{GDBVN}
@subtitle @value{EDITION} Edition, for @value{GDBN} version @value{GDBVN}
@author Jeremy Bennett, Embecosm Limited
@author Jeremy Bennett, Embecosm Limited
@page
@page
@tex
@tex
{\parskip=0pt
{\parskip=0pt
\hfill Please report bugs using the OpenCores tracker:\par
\hfill Please report bugs using the OpenRISC bug tracker:\par
\hfill @uref{www.opencores.org/ptracker.cgi/list/or1k}.\par
\hfill @uref{http://opencores.org/openrisc,bugtracker}.\par
\hfill {\it Debugging the OpenRISC 1000 with @value{GDBN}}\par
\hfill {\it Debugging the OpenRISC 1000 with @value{GDBN}}\par
\hfill \TeX{}info \texinfoversion\par
\hfill \TeX{}info \texinfoversion\par
}
}
@end tex
@end tex
 
 
@vskip 0pt plus 1filll
@vskip 0pt plus 1filll
Copyright @copyright{} 2008
Copyright @copyright{} 2008
Embecosm Limited.
Embecosm Limited.
@sp 2
@sp 2
Published by Embecosm Limited@*
Published by Embecosm Limited@*
68 Hambledon Road
Palamos House #104
Bournemouth BH7 6PJ, UK@*
Lymington SO41 9AL, UK@*
 
 
Permission is granted to copy, distribute and/or modify this document
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 3 or
under the terms of the GNU Free Documentation License, Version 3 or
any later version published by the Free Software Foundation; with the
any later version published by the Free Software Foundation; with the
Front-Cover Texts being ``Debugging the OpenRISC 1000 with GDB by
Front-Cover Texts being ``Debugging the OpenRISC 1000 with GDB by
Line 120... Line 120...
@end ifnottex
@end ifnottex
 
 
@contents
@contents
 
 
@node Summary
@node Summary
@unnumbered Summary of @value{GDBN} with OpenRISC 1000
@unnumbered Summary of @value{GDBN} for the OpenRISC 1000
@cindex Overview
@cindex Overview
@cindex Summary
@cindex Summary
 
 
@value{GDBN} is described well in its user manual, ``Debugging with GDB: The
@value{GDBN} is described well in its user manual, ``Debugging with GDB: The
GNU Source-Level Debugger''.
GNU Source-Level Debugger''.
Line 138... Line 138...
@value{GDBN} @dfn{Remote Serial Protocol} (@acronym{RSP}).
@value{GDBN} @dfn{Remote Serial Protocol} (@acronym{RSP}).
 
 
@cindex JTAG
@cindex JTAG
@cindex jtag, target
@cindex jtag, target
@cindex target jtag
@cindex target jtag
For backwards compatibility, @value{GDBN} for OpenRISC also supports the
Past releases of @value{GDBN} for OpenRISC supported a custom remote
legacy custom remote protocol, which drives the JTAG interface on the OpenRISC
protocol, which drives the JTAG interface on the OpenRISC 1000. This is
1000.  This is provided by adding a special target, ``jtag'' to @value{GDBN},
now obsolete, since all targets support the @dfn{Remote Serial
allowing the debugger to connect via the JTAG interface. @xref{Connecting to
Protocol}, with adapters available to drive JTAG. Support has been
the Target,,Connecting to the Target}.
dropped from @value{GDBN} release 7.1.
 
 
 
@cindex simulator,
 
@cindex simlator, target
 
@cindex target simulator
 
This release implements a simulator, based on Or1ksim, the OpenRISC
 
architectural simulator. @command{target sim} will connect to a vanilla
 
Or1ksim model with 8MB of RAM starting at address zero.
 
 
@cindex SPR
@cindex SPR
@cindex Special Purpose Registers
@cindex Special Purpose Registers
@cindex @command{spr} command
@cindex @command{spr} command
@cindex commands, @command{spr}
@cindex commands, @command{spr}
Line 175... Line 182...
@cindex graphical debugging, @command{gdbtui}
@cindex graphical debugging, @command{gdbtui}
@cindex graphical debugging, @command{ddd}
@cindex graphical debugging, @command{ddd}
@cindex @command{gdbtui}
@cindex @command{gdbtui}
@cindex @command{ddd}
@cindex @command{ddd}
For those who like their debugging graphical, the @command{gdbtui} command is
For those who like their debugging graphical, the @command{gdbtui} command is
available (typically as @command{or32-uclinux-gdbtui}). @value{GDBN} for
available (typically as @command{or32-elf-gdbtui}). @value{GDBN} for
OpenRISC 1000 can also be run under @command{ddd} as follows:
OpenRISC 1000 can also be run under @command{ddd} as follows:
 
 
@example
@example
@command{ddd --debugger=or32-uclinux-gdb --gdb}
@command{ddd --debugger=or32-elf-gdb --gdb}
@end example
@end example
 
 
@menu
@menu
* Contributors::                Contributors to GDB for the OpenRISC 1000
* Contributors::                Contributors to GDB for the OpenRISC 1000
@end menu
@end menu
Line 194... Line 201...
The pantheon of contributors to GDB over the years is recorded in the main
The pantheon of contributors to GDB over the years is recorded in the main
user manual, `Debugging with GDB: The GNU Source-Level Debugger''.
user manual, `Debugging with GDB: The GNU Source-Level Debugger''.
 
 
@cindex contributors, OpenRISC 1000
@cindex contributors, OpenRISC 1000
There is no official history of contributors to the OpenRISC 1000
There is no official history of contributors to the OpenRISC 1000
version. However the current author believes the original GDB 5.0 and 5.3
version. However the current author believes the original @value{GDBN}
ports were the work of:
5.0 and 5.3 ports were the work of:
 
 
@itemize @bullet
@itemize @bullet
@item
@item
@cindex Ivan Guzvinex
@cindex Ivan Guzvinex
@cindex Guzvinex, Ivan
@cindex Guzvinex, Ivan
Line 225... Line 232...
@cindex Chris Ziomkowski
@cindex Chris Ziomkowski
@cindex Ziomkowski, Chris
@cindex Ziomkowski, Chris
@cindex OpenRISC 1000 JTAG interface
@cindex OpenRISC 1000 JTAG interface
@cindex JTAG, OpenRISC 1000 interface
@cindex JTAG, OpenRISC 1000 interface
Mark Mlinar at Cygnus Support and Chris Ziomkowski at ASICS.ws,who wrote the
Mark Mlinar at Cygnus Support and Chris Ziomkowski at ASICS.ws,who wrote the
OpenRISC JTAG interface.
OpenRISC JTAG interface (now obsolete).
@end itemize
@end itemize
 
 
@cindex Jeremy Bennett
@cindex Jeremy Bennett
@cindex Bennett, Jeremy
@cindex Bennett, Jeremy
@cindex Embecosm
@cindex Embecosm
Line 250... Line 257...
@cindex connecting, OpenRISC 1000 target
@cindex connecting, OpenRISC 1000 target
There are two ways to connect to an OpenRISC 1000 target with GDB.
There are two ways to connect to an OpenRISC 1000 target with GDB.
 
 
@enumerate
@enumerate
@item
@item
@cindex @command{target jtag} command
 
@cindex commands, @command{target jtag}
 
@cindex OpenRISC 1000 target, local connecting
 
@cindex target, local, OpenRISC 1000, connecting
 
@cindex connecting, OpenRISC 1000 target, local
 
@cindex local OpenRISC 1000 target, connecting
 
@cindex OpenRISC 1000 target, direct connecting
 
@cindex target, direct, OpenRISC 1000, connecting
 
@cindex connecting, OpenRISC 1000 target, direct
 
@cindex direct OpenRISC 1000 target, connecting
 
To hardware directly connected via a JP1 header linked to the parallel
 
port. This uses the @value{GDBN} command @command{target jtag}.
 
 
 
@item
 
@cindex @command{target remote} command
@cindex @command{target remote} command
@cindex commands, @command{target remote}
@cindex commands, @command{target remote}
@cindex @command{target extended-remote} command
@cindex @command{target extended-remote} command
@cindex commands, @command{target extended-remote}
@cindex commands, @command{target extended-remote}
@cindex OpenRISC 1000 target, remote connecting via RSP
@cindex OpenRISC 1000 target, remote connecting via RSP
Line 278... Line 271...
is running the architectural simulator using the standard @value{GDBN}
is running the architectural simulator using the standard @value{GDBN}
@dfn{Remote Serial Protocol}. This uses the @value{GDBN} commands
@dfn{Remote Serial Protocol}. This uses the @value{GDBN} commands
@command{target remote} or @command{target extended-remote}.
@command{target remote} or @command{target extended-remote}.
 
 
@item
@item
@cindex @command{target jtag} command
@cindex @command{target sim} command
@cindex commands, @command{target jtag}
@cindex commands, @command{target sim}
@cindex OpenRISC 1000 target, remote connecting via JTAG
@cindex OpenRISC 1000 target, simulator
 
@cindex sim, target
 
@cindex target sim
@cindex target, remote, OpenRISC 1000, connecting via JTAG
@cindex target, remote, OpenRISC 1000, connecting via JTAG
@cindex connecting, OpenRISC 1000 target, remote via JTAG
@cindex connecting, OpenRISC 1000 target, remote via JTAG
@cindex remote OpenRISC 1000 target, connecting via JTAG
@cindex remote OpenRISC 1000 target, connecting via JTAG
Via a TCP/IP socket to a machine which has the hardware connected, or
To the OpenRISC architectural simulator, Or1ksim, integrated as a GDB
is running the architectural simulator using the custom OpenRISC 1000 Remote
simulator.  This uses the @value{GDBN} command @command{target sim}.
JTAG protocol. This uses the @value{GDBN} command @command{target jtag}.
 
 
@end enumerate
 
 
@quotation Note
@quotation Note
This connection mechanism is deprecated. It remains for backward compatibility
Connection via the obsolete proprietary OpenRISC JTAG protocol is no
only.
longer supported.
@end quotation
@end quotation
 
 
@end enumerate
 
 
 
@cindex OpenRISC 1000 Architectural Simulator
@cindex OpenRISC 1000 Architectural Simulator
@cindex OpenRISC 1000 Architectural Simulator, patch
 
@cindex patch, OpenRISC 1000 Architectural Simulator
 
@cindex Or1ksim
@cindex Or1ksim
@cindex Or1ksim, patch
 
@cindex patch, Or1ksim
 
@quotation Caution
@quotation Caution
If used with version 0.2.0 of the architectural simulator, Or1ksim,
This release of GDB requires the latest experimental version of Or1ksim,
@value{GDBN} version @value{GDBVN} requires a patch to be applied to the
built from SVN revision 229 or later.
architectural simulator. This should be available on the OpenCores website, or
 
contact the author directly. Only the legacy OpenRISC 1000 Remote JTAG
 
Protocol interface is available for this version of the architectural
 
simualtor.
 
 
 
The user is strongly recommended to use Or1ksim 0.3.0 or later, since this
 
interfaces directly to @value{GDBN} using the @dfn{Remote Serial Protocol}.
 
@end quotation
@end quotation
 
 
@menu
@menu
* Direct JTAG Connection::            Direct connection via a JTAG JP1
 
                                      interface
 
* Remote Serial Protocol Connection:: Connection via the @value{GDBN} Remote
* Remote Serial Protocol Connection:: Connection via the @value{GDBN} Remote
                                      Serial Protocol Interface
                                      Serial Protocol Interface
* Remote JTAG Connection::            Connection via the OpenRISC 1000 Remote
* Simulator Connection::              Connection to the built in simulator
                                      JTAG Interface
 
@end menu
@end menu
 
 
@node Direct JTAG Connection
 
@section Direct connection via a JTAG JP1 Interface
 
@cindex OpenRISC 1000 target, local connecting
 
@cindex target, local, OpenRISC 1000, connecting
 
@cindex connecting, OpenRISC 1000 target, local
 
@cindex local OpenRISC 1000 target, connecting
 
@cindex OpenRISC 1000 target, direct connecting
 
@cindex target, direct, OpenRISC 1000, connecting
 
@cindex connecting, OpenRISC 1000 target, direct
 
@cindex direct OpenRISC 1000 target, connecting
 
 
 
In this case the the device to which the JP1 header is connected must be
 
specifed to the @command{target jtag} command. Typically that will be the
 
parallel printer port, so the command would be:
 
 
 
@cindex local @command{target jtag} command
 
@cindex direct @command{target jtag} command
 
@cindex @command{target jtag} command, local
 
@cindex @command{target jtag} command, direct
 
@cindex commands, @command{target jtag}, local
 
@cindex commands, @command{target jtag}, direct
 
@cindex local target specification
 
@cindex direct target specification
 
@cindex target specification, local
 
@cindex target specification, direct
 
@example
 
@command{target jtag /dev/lp}
 
@end example
 
 
 
@cindex @command{target jtag} command, local, testing
 
@cindex @command{target jtag} command, direct, testing
 
@cindex commands, @command{target jtag}, local, testing
 
@cindex commands, @command{target jtag}, direct, testing
 
@quotation Caution
 
The current author is not aware of anyone using the JP1
 
interface. As a result this code has not been tested in the port to
 
@value{GDBN} version @value{GDBVN}. Modern hardware connections are usually via
 
interfaces such as USB, for which the OpenRISC Remote Interface can be used
 
(@pxref{Remote JTAG Connection,,Remote JTAG Connection}).
 
@end quotation
 
 
 
@node Remote Serial Protocol Connection
@node Remote Serial Protocol Connection
@section Connection via the @value{GDBN} Remote Serial Protocol
@section Connection via the @value{GDBN} Remote Serial Protocol
@cindex OpenRISC 1000 target, remote connecting via RSP
@cindex OpenRISC 1000 target, remote connecting via RSP
@cindex target, remote, OpenRISC 1000, connecting via RSP
@cindex target, remote, OpenRISC 1000, connecting via RSP
@cindex connecting, OpenRISC 1000 target, remote via RSP
@cindex connecting, OpenRISC 1000 target, remote via RSP
Line 403... Line 342...
@cindex target specification for RSP, same machine
@cindex target specification for RSP, same machine
@example
@example
@command{target remote :51000}
@command{target remote :51000}
@end example
@end example
 
 
@node Remote JTAG Connection
@node Simulator Connection
@section Connection via the OpenRISC 1000 Remote JTAG Interface
@section Connection to the Built in Simulator
@cindex OpenRISC 1000 target, remote connecting
@cindex OpenRISC 1000 target, simulator
@cindex target, remote, OpenRISC 1000, connecting
@cindex target, simulator, OpenRISC 1000, connecting
@cindex connecting, OpenRISC 1000 target, remote
@cindex connecting, OpenRISC 1000 target, simulator
@cindex remote OpenRISC 1000 target, connecting
@cindex simulator OpenRISC 1000 target, connecting
 
 
Historically, @value{GDBN} communicated with remote OpenRISC 1000 targets
 
using a customer protocol, the @dfn{OpenRISC 1000 Remote JTAG
 
Interface}.
 
 
 
This protocol is maintained for backwards compatibility, but is now
 
deprecated. It communicates to the target through a TCP/IP socket. The target
 
must then implement the client side of the interface to drive either physical
 
hardware (for example through a USB/JTAG connector) or a simulation of the
 
hardware (such as the OpenRISC Architectural Simulator).
 
 
 
Although referred to as the @emph{remote} interface, the target may actually
The simplest way to run programs under @value{GDBN} is to connect to the
be on the same machine, just running in a separate process, with its own
built in simulator. This is the OpenRISC architectural simulator,
terminal window.
Or1ksim, which has been integrated into GDB as a standard simulator.
 
 
For example, to connect to the OpenRISC 1000 Architectural simulator, which is
 
running on machine ``thomas'' and has been configured to talk to @value{GDBN}
 
on port 50000, I could use the command:
 
 
 
@cindex remote @command{target jtag} command
@cindex @command{target sim} command
@cindex @command{target jtag} command, remote
@cindex commands, @command{target sim}
@cindex commands, @command{target jtag}, remote
 
@cindex remote target specification
 
@cindex target specification, remote
 
@example
@example
@command{target jtag jtag://thomas:50000}
@command{target sim}
@end example
@end example
 
 
The target machine is specified after the @b{jtag://} and separated from the
By default, the simulator is configured with 8MB of RAM running from
target port by a colon. If the architectural simulator was running on the same
address 0x0, and the simulator runs with the Or1ksim @command{--quiet}
machine, just @b{locahost} would suffice as the machine name, thus:
option, to mimize extraneous output.
 
 
@cindex remote target specification, same machine
@cindex @command{target sim}, additional options
@cindex target specification, same machine
Additional options may be specified to the underlying Or1ksim engine,
@example
exactly as when using Or1ksim standalone, with the entire argument
@command{target jtag jtag://localhost:50000}
string prefixed by @command{-f}.  For example.
@end example
 
 
 
@cindex Igor Mohor
 
@cindex Mohor, Igor
 
@cindex Debug interface types
 
Unfortunately there are now two different flavours of the JTAG
 
interface used with OpenRISC 1000. The original version was created
 
for use with the OpenRISC 1000 System-on-Chip, @b{ORPSoC}. A new
 
(smaller and simpler) JTAG interface was developed by Igor Mohor in
 
2004, which is used on some designs.
 
 
 
The default behavior of @value{GDBN} is to use the original ORPSoC
 
version of the interface for backwards compatibility. @value{GDBN} can
 
use the Igor Mohor version by specifying for example:
 
 
 
@example
 
@command{target jtag jtag_mohor://localhost:50000}
 
@end example
 
 
 
This interface is only available with remote connections using the legacy
 
OpenRISC 1000 Remote JTAG Protocol (deprecated). The direct JP1 interface can
 
support only the ORPSoC version of JTAG.
 
 
 
The recommended approach is to use the @value{GDBN} @dfn{Remote Serial
 
Protocol} which interfaces directly to the simulator, and is independent of
 
the JTAG implementation used.
 
 
 
For completeness
 
 
 
@example
 
@command{target jtag jtag_orpsoc://localhost:50000}
 
@end example
 
 
 
is provided as a synonym for:
 
 
 
@example
@example
@command{target jtag jtag://localhost:50000}
@command{target sim "-f --report-memory-errors -f mysim.cfg"}
@end example
@end example
 
 
@cindex reset
@quotation Note
@cindex resetting the target
It is possible to use @command{target sim} many times. However any arguments
@cindex target reset
are only applied the first time. Or1ksim can only be instantiated
By default, establishing a connection @emph{does not} reset the target. This
once. On the completion of a run it is not actually cosed, merely
allows debugging to resume a partially complete program on connection. If a
stalled.
reset is required, the keyworkd @command{RESET} (case insensitive) may be
@end quotation
added at the end of the @command{target} command. For example:
 
 
 
@example
 
@command{target jtag jtag://localhost:50000 reset}
 
@end example
 
 
 
@cindex robustness, OpenRISC remote JTAG interface
@quotation Caution
@cindex JTAG, robustness or remote interface
Any additional configuration must take account of the existing
@cindex Remote Serial Protocol
8MB memory block. At present there is no way to remove that memory
@cindex RSP
block.
@quotation Warning
 
The OpenRISC remote JTAG interface is not particularly robust. In particular
 
dropping and reconnecting sessions does not seem to work well. This was a key
 
factor in its replacement by the generic @value{GDBN} Remote Serial Interface.
 
@end quotation
@end quotation
 
 
@node OpenRISC 1000 Specific Commands
@node OpenRISC 1000 Specific Commands
@chapter Commands just for the OpenRISC 1000
@chapter Commands just for the OpenRISC 1000
@cindex @command{info spr} command
@cindex @command{info spr} command
Line 700... Line 579...
location 0x0. The debugging interface is enabled by using a debug section.
location 0x0. The debugging interface is enabled by using a debug section.
 
 
@example
@example
section debug
section debug
  enabled         =          1
  enabled         =          1
  gdb_enabled     =          1
  rsp_enabled     =          1
  server_port     =      50000
  server_port     =      50000
end
end
@end example
@end example
 
 
The architectural simulator is started in its own terminal window. If the
The architectural simulator is started in its own terminal window. If the
configuration is in @code{rsp.cfg}, then the command might be:
configuration is in @code{rsp.cfg}, then the command might be:
 
 
@example
@example
@command{or32-uclinux-sim -f rsp.cfg}
@command{or32-elf-sim -f rsp.cfg}
Reading script file from 'rsp.cfg'...
Reading script file from 'rsp.cfg'...
Building automata... done, num uncovered: 0/213.
Building automata... done, num uncovered: 0/213.
Parsing operands data... done.
Parsing operands data... done.
Resetting memory controller.
Resetting memory controller.
Resetting PIC.
Resetting PIC.
Line 722... Line 601...
Note that no program is specified - that will be loaded from @value{GDBN}.
Note that no program is specified - that will be loaded from @value{GDBN}.
 
 
In a separate window start up @value{GDBN}.
In a separate window start up @value{GDBN}.
 
 
@example
@example
@command{or32-uclinux-gdb}
@command{or32-elf-gdb}
@end example
@end example
 
 
A local copy of the symbol table is needed, specified with the @command{file}
A local copy of the symbol table is needed, specified with the @command{file}
command.
command.
 
 
Line 740... Line 619...
Copyright (C) 2008 Free Software Foundation, Inc.
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=or32-uclinux".
This GDB was configured as "--host=i686-pc-linux-gnu --target=or32-elf".
(gdb) @command{file hello}
(gdb) @command{file hello}
Reading symbols from /home/jeremy/svntrunk/GNU/gdb-6.8/progs_or32/hello...done.
Reading symbols from /home/jeremy/svntrunk/GNU/gdb-6.8/progs_or32/hello...done.
(gdb)
(gdb)
@end example
@end example
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.