[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1. Connecting to an OpenRISC 1000 Target

There are two ways to connect to an OpenRISC 1000 target with GDB.

  1. To hardware directly connected via a JP1 header linked to the parallel port. This uses the GDB command target jtag.
  2. Via a TCP/IP socket to a machine which has the hardware connected, or is running the architectural simulator using the standard GDB Remote Serial Protocol. This uses the GDB commands target remote or target extended-remote.
  3. Via a TCP/IP socket to a machine which has the hardware connected, or is running the architectural simulator using the custom OpenRISC 1000 Remote JTAG protocol. This uses the GDB command target jtag.

    Note: This connection mechanism is deprecated. It remains for backward compatibility only.

Caution: If used with version 0.2.0 of the architectural simulator, Or1ksim, GDB version 6.8 requires a patch to be applied to the 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 GDB using the Remote Serial Protocol.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1 Direct connection via a JTAG JP1 Interface

In this case the the device to which the JP1 header is connected must be specifed to the target jtag command. Typically that will be the parallel printer port, so the command would be:

 
target jtag /dev/lp

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 GDB version 6.8. Modern hardware connections are usually via interfaces such as USB, for which the OpenRISC Remote Interface can be used (see section Remote JTAG Connection).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2 Connection via the GDB Remote Serial Protocol

The usual mode of operation is through the GDB Remote Serial Protocol (RSP). This communicates to the target through a TCP/IP socket. The target must then implement the server 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 a remote interface, the target may actually be on the same machine, just running in a separate process, with its own terminal window.

For example, to connect to the OpenRISC 1000 Architectural simulator, which is running on machine “thomas” and has been configured to talk to GDB on port 51000, the following command would be used:

 
target remote thomas:51000

The target machine is specified as the machine name and port number. If the architectural simulator was running on the same machine, its name may be omitted, thus:

 
target remote :51000

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.3 Connection via the OpenRISC 1000 Remote JTAG Interface

Historically, GDB communicated with remote OpenRISC 1000 targets using a customer protocol, the 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 remote interface, the target may actually be on the same machine, just running in a separate process, with its own terminal window.

For example, to connect to the OpenRISC 1000 Architectural simulator, which is running on machine “thomas” and has been configured to talk to GDB on port 50000, I could use the command:

 
target jtag jtag://thomas:50000

The target machine is specified after the jtag:// and separated from the target port by a colon. If the architectural simulator was running on the same machine, just locahost would suffice as the machine name, thus:

 
target jtag jtag://localhost:50000

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, 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 GDB is to use the original ORPSoC version of the interface for backwards compatibility. GDB can use the Igor Mohor version by specifying for example:

 
target jtag jtag_mohor://localhost:50000

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 GDB Remote Serial Protocol which interfaces directly to the simulator, and is independent of the JTAG implementation used.

For completeness

 
target jtag jtag_orpsoc://localhost:50000

is provided as a synonym for:

 
target jtag jtag://localhost:50000

By default, establishing a connection does not reset the target. This allows debugging to resume a partially complete program on connection. If a reset is required, the keyworkd RESET (case insensitive) may be added at the end of the target command. For example:

 
target jtag jtag://localhost:50000 reset

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 GDB Remote Serial Interface.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Jeremy Bennett on November, 12 2008 using texi2html 1.78.