Skip to content

Commit

Permalink
gdb: add or1k and or1knd target support
Browse files Browse the repository at this point in the history
  • Loading branch information
fjullien authored and wallento committed Mar 13, 2016
1 parent ac6c80b commit b853c77
Show file tree
Hide file tree
Showing 8 changed files with 3,843 additions and 20 deletions.
7 changes: 0 additions & 7 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3728,10 +3728,6 @@ case "${target}" in
;;
*-*-rtems*)
noconfigdirs="$noconfigdirs target-libgloss"
# this is not caught below because this stanza matches earlier
case $target in
or1k*-*-*) noconfigdirs="$noconfigdirs gdb" ;;
esac
;;
# The tpf target doesn't support gdb yet.
*-*-tpf*)
Expand Down Expand Up @@ -3942,9 +3938,6 @@ case "${target}" in
nvptx*-*-*)
noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
;;
or1k*-*-*)
noconfigdirs="$noconfigdirs gdb"
;;
sh-*-* | sh64-*-*)
case "${target}" in
sh*-*-elf)
Expand Down
7 changes: 0 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1065,10 +1065,6 @@ case "${target}" in
;;
*-*-rtems*)
noconfigdirs="$noconfigdirs target-libgloss"
# this is not caught below because this stanza matches earlier
case $target in
or1k*-*-*) noconfigdirs="$noconfigdirs gdb" ;;
esac
;;
# The tpf target doesn't support gdb yet.
*-*-tpf*)
Expand Down Expand Up @@ -1279,9 +1275,6 @@ case "${target}" in
nvptx*-*-*)
noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
;;
or1k*-*-*)
noconfigdirs="$noconfigdirs gdb"
;;
sh-*-* | sh64-*-*)
case "${target}" in
sh*-*-elf)
Expand Down
26 changes: 26 additions & 0 deletions gdb/configure.tgt
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,32 @@ nios2*-*-*)
gdb_target_obs="nios2-tdep.o"
;;

or1k-*-linux*)
# Target: OpenCores OpenRISC 1000 32-bit implementation for Linux
gdb_target_obs="or1k-tdep.o corelow.o"
gdb_sim=../sim/or1k/libsim.a
build_gdbserver=yes
;;

or1k-*-*)
# Target: OpenCores OpenRISC 1000 32-bit implementation bare metal
gdb_target_obs="or1k-tdep.o"
gdb_sim=../sim/or1k/libsim.a
;;

or1knd-*-linux*)
# Target: OpenCores OpenRISC 1000 32-bit implementation for Linux, without delay slot
gdb_target_obs="or1k-tdep.o corelow.o"
gdb_sim=../sim/or1k/libsim.a
build_gdbserver=yes
;;

or1knd-*-*)
# Target: OpenCores OpenRISC 1000 32-bit implementation bare metal, without delay slot
gdb_target_obs="or1k-tdep.o"
gdb_sim=../sim/or1k/libsim.a
;;

powerpc*-*-freebsd*)
# Target: FreeBSD/powerpc
gdb_target_obs="rs6000-tdep.o ppc-sysv-tdep.o ppc64-tdep.o \
Expand Down
103 changes: 103 additions & 0 deletions gdb/doc/gdb.texinfo
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,10 @@ Steve Tjiang, John Newlin, and Scott Foehner.
Michael Eager and staff of Xilinx, Inc., contributed support for the
Xilinx MicroBlaze architecture.

The original port to the OpenRISC 1000 is believed to be due to
Alessandro Forin and Per Bothner. More recent ports have been the work
of Jeremy Bennett.

@node Sample Session
@chapter A Sample @value{GDBN} Session

Expand Down Expand Up @@ -21731,6 +21735,7 @@ acceptable commands.
* M68K:: Motorola M68K
* MicroBlaze:: Xilinx MicroBlaze
* MIPS Embedded:: MIPS Embedded
* OpenRISC 1000:: OpenRISC 1000 (or1k)
* PowerPC Embedded:: PowerPC Embedded
* AVR:: Atmel AVR
* CRIS:: CRIS
Expand Down Expand Up @@ -22073,6 +22078,104 @@ This command allows sending an arbitrary @var{command} string to the
monitor. The monitor must be in debug mode for this to work.
@end table

@node OpenRISC 1000
@subsection OpenRISC 1000
@cindex OpenRISC 1000

Previous versions of @value{GDBN} supported remote connection via a
proprietary JTAG protocol using the @samp{target jtag} command. Support
for this has now been dropped.


@table @code

@kindex target remote
@item target remote

This is now the only way to connect to a remote OpenRISC 1000
target. This is supported by @dfn{Or1ksim}, the OpenRISC 1000
architectural simulator, Verilator and Icarus Verilog
simulations. @dfn{Remote serial protocol} servers are also available to
drive various hardware implementations via JTAG.
Connects to remote JTAG server.

Example: @code{target remote :51000}

@kindex target sim
@item target sim

@dfn{Or1ksim}, the OpenRISC 1000 architectural simulator is now
incorporated within @value{GDBN} as a simulator target. It is started
in quiet mode with 8M of memory starting at address 0. It is possible
to pass arguments to extend this configuration using the @samp{-f}
option to @samp{target sim}. However for more complex use, the user is
advised to run @dfn{Or1ksim} separately, with its own configuration
file, and connect using @samp{target remote}

Example: @code{target sim}

@kindex info spr
@item info or1k spr
Displays groups.

@item info spr @var{group}
@itemx info spr @var{groupno}
Displays register names in selected group.

@item info spr @var{group} @var{register}
@itemx info spr @var{register}
@itemx info spr @var{groupno} @var{registerno}
@itemx info spr @var{registerno}
Shows information about specified spr register.

Example: @code{info spr DRR}

@code{DEBUG.DRR = SPR6_21 = 0 (0x0)}

@kindex spr
@item spr @var{group} @var{register} @var{value}
@itemx spr @var{register @var{value}}
@itemx spr @var{groupno} @var{registerno @var{value}}
@itemx spr @var{registerno @var{value}}
Writes @var{value} to specified spr register.

Example: spr PICMR 0x24
@end table

The use of @samp{info} and @samp{spr} commands is anachronistic. At
some time in the future they will be replaced by @samp{info register @var{spr | group name}}
and @samp{set $spr=@var{value}}.

There are some known problems with the current implementation
@cindex OpenRISC 1000 known problems

@enumerate

@item
@cindex OpenRISC 1000 known problems, hardware breakpoints and watchpoints
Some OpenRISC 1000 targets support hardware breakpoints and watchpoints.
Consult the target documentation for details. @value{GDBN} is not
perfect in handling of watchpoints. It is possible to allocate hardware
watchpoints and not discover until running that sufficient watchpoints
are not available. It is also possible that GDB will report watchpoints
being hit spuriously. This can be down to the assembly code having
additional memory accesses that are not obviously reflected in the
source code.

@item
@cindex OpenRISC 1000 known problems, architectural compatability
The OpenRISC 1000 architecture has evolved since the first port of @value{GDBN}. In particular the structure of the Unit Present register has
changed and the CPU Configuration register has been added. The port of
@value{GDBN} version @value{GDBVN} uses the @emph{current}
specification of the OpenRISC 1000.

@end enumerate

@cindex Bugs, reporting
@cindex Reporting bugs
Reports of bugs are much welcomed. Please report problems through the
OpenRISC tracker at @uref{http://opencores.org/openrisc,downloads}.

@node PowerPC Embedded
@subsection PowerPC Embedded

Expand Down
Loading

0 comments on commit b853c77

Please sign in to comment.