URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk
- from Rev 518 to Rev 522
- ↔ Reverse comparison
Rev 518 → Rev 522
/gnu-src/gcc-4.5.1/gcc/config/or32/or32.md
365,9 → 365,9
"l.movhi \t%0,hi(%1)\;l.ori \t%0,%0,lo(%1)" |
;; the switch of or32 bfd to Rela allows us to schedule insns separately. |
"(GET_CODE (operands[1]) != CONST_INT |
|| ! (CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[1]),'I', \"I\") |
|| CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[1]),'K', \"K\") |
|| CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[1]), 'M', \"M\"))) |
|| ! (CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[1]), 'I', \"I\") |
|| CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[1]), 'K', \"K\") |
|| CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[1]), 'M', \"M\"))) |
&& reload_completed |
&& GET_CODE (operands[1]) != HIGH && GET_CODE (operands[1]) != LO_SUM" |
[(pc)] |
713,13 → 713,13
;; |
(define_insn_and_split "movdi" |
[(set (match_operand:DI 0 "nonimmediate_operand" "=r, r, m, r") |
(match_operand:DI 1 "general_operand" " r, m, r, n"))] |
(match_operand:DI 1 "general_operand" " r, m, r, n"))] |
"" |
"* |
return or32_output_move_double (operands); |
" |
"&& reload_completed && CONSTANT_P (operands[1])" |
[(set (match_dup 2) (match_dup 3)) (set (match_dup 4) (match_dup 5))] |
[(set (match_dup 2) (match_dup 3)) (set (match_dup 4) (match_dup 5))] |
"operands[2] = operand_subword (operands[0], 0, 0, DImode); |
operands[3] = operand_subword (operands[1], 0, 0, DImode); |
operands[4] = operand_subword (operands[0], 1, 0, DImode); |
/gnu-src/gcc-4.5.1/gcc/config/or32/or32.h
48,16 → 48,14
|
#undef CPP_SPEC |
#define CPP_SPEC \ |
"%{!mnewlib*:%{pthread:-D_XOPEN_SOURCE=700}}" \ |
"%{mnewlib*:-idirafter %(target_prefix)/newlib-include}" |
"%{!mnewlib:%{pthread:-D_XOPEN_SOURCE=700}}" |
|
/* Make sure we pick up the crti.o, crtbegin.o, crtend.o and crtn.o files. */ |
#undef STARTFILE_SPEC |
#define STARTFILE_SPEC \ |
"%{!shared:"\ |
"%{mnewlib*:%(target_prefix)/lib/crt0.o} "\ |
"%{mnewlib-*:%(target_prefix)/lib/crtparam-%*.o} "\ |
"%{!mnewlib*:crt0.o%s} crti.o%s crtbegin.o%s}" |
"%{mnewlib:%(target_prefix)/lib/crt0.o} "\ |
"%{!mnewlib:crt0.o%s} crti.o%s crtbegin.o%s}" |
|
#undef ENDFILE_SPEC |
#define ENDFILE_SPEC "crtend.o%s crtn.o%s" |
789,7 → 787,6
#define RETURN_ADDR_RTX(COUNT, FP) \ |
((COUNT) ? NULL_RTX : get_hard_reg_initial_val (Pmode, LINK_REGNUM)) |
|
|
/* Addressing modes, and classification of registers for them. */ |
|
/* #define HAVE_POST_INCREMENT */ |
1005,12 → 1002,8
#undef DWARF2_FRAME_INFO |
#define DWARF2_FRAME_INFO 1 |
|
/* Macro to idenfity where the incoming return address is on a function call |
before the start of the prologue (i.e. the link register). Used to produce |
DWARF2 frame debug info when DWARF2_UNWIND_INFO is non-zero. Override any |
default value. */ |
#undef INCOMING_RETURN_ADDR_RTX |
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, LINK_REGNUM) |
/* Macro specifying which register holds the return address */ |
#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (LINK_REGNUM) |
|
/* Where is the start of our stack frame in relation to the end of the |
previous stack frame at the start of a function, before the prologue */ |
/gnu-src/gdb-7.2/gdb/or32-tdep.c
24,20 → 24,42
|
/*----------------------------------------------------------------------------- |
This version for the OpenRISC 1000 architecture is a rewrite by Jeremy |
Bennett of the old GDB 5.3 interface to make use of gdbarch for GDB 6.8. |
Bennett of the old GDB 5.3 interface to make use of gdbarch for GDB 6.8. It |
has since been updated for GDB 7.2. |
|
The code tries to follow the GDB coding style. |
|
Commenting is Doxygen compatible. |
|
Notes on the GDB 7.2 version |
============================ |
|
The primary change is to support the new GCC 4.5.1 compiler, which no |
longer adds preceding underscores to global values and uses DWARF2 as its |
default debug format. |
|
This version now supports Or1ksim integrated as a simulator library, so |
"target sim" will work. It does require Or1ksim to be available as a |
library at configuration time, with the Or1ksim installation directory |
specified by the argument --with-or1ksim. |
|
The ad-hoc prologue analysis, which was always a weak point has been |
stripped out and replaced with code based on the generic approach in |
prologue-value.c and prologue-value.h. |
|
The objective with this version is to get reasonable results on regression |
testing. Something the older versions never achieved. |
|
Notes on the GDB 6.8 version |
============================ |
|
Much has been stripped out in the interests of getting a basic working |
system. This is described as the OpenRISC 1000 target architecture, so |
should work with 16, 32 and 64 bit versions of that architecture and should |
work whether or not they have floating point and/or vector registers. |
should work with 32 and 64 bit versions of that architecture and should |
work whether or not they have floating point and/or vector registers, |
although to date it has only been tested with the 32-bit integer |
archtiecture. |
|
There was never a capability to run simulator commands (no remote target |
implemented the required function), so that has been removed. |
|
The info trace command has been removed. The meaning of this is not clear - |
it relies on a value in register 255 of the debug group, which is |
undocumented. |
47,7 → 69,7
this functionality. |
|
Support for multiple contexts (which was rudimentary, and not working) has |
been removed. */ |
been removed. */ |
/*---------------------------------------------------------------------------*/ |
|
#include "demangle.h" |
578,13 → 600,13
static char *or32_gdb_reg_names[OR32_TOTAL_NUM_REGS] = |
{ |
/* general purpose registers */ |
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", |
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", |
"r0", "sp", "fp", "r3", "r4", "r5", "r6", "r7", |
"r8", "lr", "r10", "r11", "r12", "r13", "r14", "r15", |
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", |
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", |
|
/* previous program counter, next program counter and status register */ |
"ppc", "npc", "sr" |
"ppc", "pc", "sr" |
|
/* Floating point and vector registers may appear as pseudo registers in |
the future. */ |
951,6 → 973,13
{ |
CORE_ADDR pc = frame_unwind_register_unsigned (next_frame, OR32_NPC_REGNUM); |
|
if (frame_debug) |
{ |
fprintf_unfiltered (gdb_stdlog, |
"or32_unwind_pc, next_frame = 0x%p, pc = 0x%p\n", |
next_frame, (void *) pc); |
} |
|
return pc; |
|
} /* or32_unwind_pc() */ |
973,6 → 1002,13
{ |
CORE_ADDR sp = frame_unwind_register_unsigned (next_frame, OR32_SP_REGNUM); |
|
if (frame_debug) |
{ |
fprintf_unfiltered (gdb_stdlog, |
"or32_unwind_sp, next_frame = 0x%p, sp = 0x%p\n", |
next_frame, (void *) sp); |
} |
|
return sp; |
|
} /* or32_unwind_sp() */ |
1293,6 → 1329,13
CORE_ADDR start_addr; |
CORE_ADDR end_addr; |
|
if (frame_debug) |
{ |
fprintf_unfiltered (gdb_stdlog, |
"or32_frame_cache, prologue_cache = 0x%p\n", |
*prologue_cache); |
} |
|
/* Nothing to do if we already have this info */ |
if (NULL != *prologue_cache) |
{ |
1311,6 → 1354,11
/* Return early if GDB couldn't find the function. */ |
if (start_addr == 0) |
{ |
if (frame_debug) |
{ |
fprintf_unfiltered (gdb_stdlog, " couldn't find function\n"); |
} |
|
return info; |
} |
|
1473,6 → 1521,14
/* Build the frame ID */ |
trad_frame_set_id (info, frame_id_build (this_sp_for_id, start_addr)); |
|
if (frame_debug) |
{ |
fprintf_unfiltered (gdb_stdlog, " this_sp_for_id = 0x%p\n", |
(void *) this_sp_for_id); |
fprintf_unfiltered (gdb_stdlog, " start_addr = 0x%p\n", |
(void *) start_addr); |
} |
|
return info; |
|
} /* or32_frame_cache() */ |
1560,6 → 1616,7
}; |
|
|
#if 0 |
/*----------------------------------------------------------------------------*/ |
/*!Return the base address of the frame |
|
1608,6 → 1665,7
return &or32_frame_base; |
|
} /* or32_frame_base_sniffer () */ |
#endif |
|
|
/* -------------------------------------------------------------------------- */ |
1716,10 → 1774,12
set_gdbarch_push_dummy_call (gdbarch, or32_push_dummy_call); |
set_gdbarch_dummy_id (gdbarch, or32_dummy_id); |
|
#if 0 |
/* Set up sniffers for the frame base. Use DWARF debug info if available, |
otherwise use our own sniffer. */ |
frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer); |
frame_base_append_sniffer (gdbarch, or32_frame_base_sniffer); |
#endif |
|
/* Frame unwinders. Use DWARF debug info if available, otherwise use our |
own unwinder. */ |
/gnu-src/gdb-7.2/gdb/or32-tdep.h
442,8 → 442,10
int bytes_per_address; |
}; |
|
/* Global variable controlling frame debug messages */ |
extern int frame_debug; |
|
/* Global disassembly instructions */ |
|
extern int print_insn_big_or32 (bfd_vma memaddr, |
struct disassemble_info *info); |
extern int print_insn_little_or32 (bfd_vma memaddr, |
/gnu-src/gdb-7.2/gdb/regformats/reg-or32.dat
1,5 → 1,5
name:or32 |
expedite:sp,lr,npc |
expedite:sp,lr,pc |
32:r0 |
32:sp |
32:fp |
33,5 → 33,5
32:r30 |
32:r31 |
32:ppc |
32:npc |
32:pc |
32:sr |
/gnu-src/gdb-7.2/gdb/ChangeLog.or32
1,3 → 1,9
2011-04-09 Jeremy Bennett <jeremy.bennett@embecosm.com> |
|
* or32-tdep.c (or32_register_name): Use the sp, fp, lr and pc as |
register names in lieu of r1, r2, r9 and npc. |
* regformats/reg-or32.dat: use pc in lieu of npc. |
|
2011-03-27 Jeremy Bennett <jeremy.bennett@embecosm.com> |
|
* NEWS.or32, version.in: Updated for release 7.2-or32-1.0rc3. |
/gnu-src/boards/or32-linux-sim.exp
49,8 → 49,9
|
# We seem to only pass in the first of the arguments supplied to the command. |
|
# We seem to set the timeout to 30, no matter what. Not sure that is right |
# here. |
# The timeout is a mess. It seems to always be 10, not the timeout needed to |
# execute a regression test (typicall 300 seconds). Fixed by using our onw |
# timeout data. |
|
# @param[in] hostname The board we are telnetting to |
# @param[in] cmd The command to run |
60,9 → 61,12
# ----------------------------------------------------------------------------- |
proc telnet_exec {hostname cmd args} { |
global timeout |
global verbose |
global verbos |
set output "(no output)" |
|
# Save the old timeout, since its global, and we'll want to restore it. |
set old_timeout $timeout |
|
verbose "Executing $hostname $cmd $args" |
|
# Get the first argument, if any. |
91,10 → 95,9
} |
} |
|
# Make the telnet session the current process. |
# Make the telnet session the current process. Short timeout for this. |
set spawn_id [board_info $hostname fileid] |
set old_timeout $timeout |
set timeout 30 |
set timeout 10 |
|
#Hit enter to make sure you get a shell prompt |
send -- "\r" |
126,9 → 129,17
} |
} |
|
# Restore timeout for commands. Not sure why we only use the first of the |
# arguments. |
set timeout $old_timeout |
# JPB to set custom timeout. Old timeout saved, so we can restore it, |
# since it's global. Not sure why we only use the first of the arguments. |
if [board_info $hostname exists telnet_exec_timeout] { |
set timeout [board_info $hostname telnet_exec_timeout] |
verbose "Telnet exec timeout set to $timeout" |
} else { |
# Appropriate default |
set timeout 300 |
verbose "Telnet exec timeout set to default value $timeout" |
} |
|
send "$cmd $pargs\r" |
|
expect { |
138,6 → 149,7
if [info exists expect_out(buffer)] { |
set execute_output_string $expect_out(buffer) |
} |
set timeout $old_timeout |
telnet_close $hostname |
return [list -1 "telnet to $hostname for $cmd $pargs failed (timeout)"] |
} |
183,8 → 195,72
# features. |
|
# ----------------------------------------------------------------------------- |
# Upload REMOTEFILE from HOST as LOCALFILE by FTP |
|
# This version swaps the argument order, which is what the regression test |
# seems to expect. |
|
# Also allows a custom timeout to be set. |
|
# @param[in] host The host we are connected to. |
# @param[in] localfile The local file to send |
# @param[in] remotefile Name of file at remote end. |
# ----------------------------------------------------------------------------- |
proc ftp_upload {host localfile remotefile} { |
set prompt "ftp>" |
|
verbose "ftping $remotefile from $host to $localfile" |
|
# JPB to set custom timeout (not marked global, so we don't need to save |
# and restore) |
if [board_info $host exists ftp_upload_timeout] { |
set timeout [board_info $host ftp_upload_timeout] |
verbose "FTP upload timeout set to $timeout" |
} else { |
# Appropriate default |
set timeout 15 |
verbose "FTP upload timeout set to default value $timeout" |
} |
|
set spawn_id [ftp_open $host] |
if {$spawn_id < 0} { |
return "" |
} |
set loop 1 |
|
while {$loop} { |
send -i $spawn_id "get $remotefile $localfile\n" |
expect { |
-i $spawn_id -re ".*Too many open files.*$prompt" { |
ftp_close $host |
} |
-i $spawn_id -re ".*No such file or directory.*$prompt" { |
set loop 0 |
set remotefile "" |
} |
-i $spawn_id -re "(^|\[\r\n\])226.*$prompt" {set loop 0} |
-i $spawn_id -re "(^|\[\r\n\])\[0-9\]\[0-9\]\[0-9\].*$prompt" { |
set loop 0 |
set remotefile "" |
} |
-i $spawn_id default { |
ftp_close $host |
} |
} |
if {$loop} { |
set spawn_id [ftp_open $host] |
if {$spawn_id < 0} { |
return "" |
} |
} |
} |
return $localfile |
} |
|
|
# ----------------------------------------------------------------------------- |
# Download LOCALFILE to HOST as REMOTEFILE by FTP |
# |
|
# This version takes a user specified timeout, which we need for our slow |
# simulated connection. |
|
214,6 → 290,10
if [board_info $host exists ftp_download_timeout] { |
set timeout [board_info $host ftp_download_timeout] |
verbose "FTP download timeout set to $timeout" |
} else { |
# Appropriate default |
set timeout 15 |
verbose "FTP download timeout set to default value $timeout" |
} |
|
while {$loop} { |
267,9 → 347,9
|
# Set up remote target info. We select the IP address using an external |
# program which knows about all available Linuxes. |
set linux_hostname [exec [file dirname $env(DEJAGNU)]/get-ip.sh] |
set linux_hostname [exec [file dirname $env(DEJAGNU)]/get-ip.sh --rotate] |
set_board_info hostname $linux_hostname |
send_user "OR32 target hostname is $linux_hostname" |
send_user "OR32 target hostname is $linux_hostname\n" |
|
set_board_info username root |
|
285,14 → 365,16
set target_alias "or32-linux" |
|
set_board_info connect telnet |
set_board_info shell_prompt "# " |
set_board_info telnet_username "root" |
set_board_info telnet_password "" |
set_board_info shell_prompt "# " |
set_board_info telnet_username "root" |
set_board_info telnet_password "" |
set_board_info telnet_exec_timeout 300 |
|
set_board_info file_transfer ftp |
set_board_info ftp_username root |
set_board_info ftp_password "" |
set_board_info ftp_download_timeout 120 |
set_board_info ftp_upload_timeout 120 |
|
# Options for the simulator |
# set cfg_file [lookfor_file ${srcdir} libgloss/or32/sim.cfg] |
302,9 → 384,11
# have been specified before we get here. |
#set_board_info compiler "[find_gcc]" |
|
# We need to define the right flags if pthreads is to work. |
# set_board_info cflags "-D_XOPEN_SOURCE=600" |
# set_board_info cxxflags "-D_XOPEN_SOURCE=600" |
# We need to define this flag to generate default .gcda files if we are using |
# a stock compiler, without the profopt.exp changes. No problem with doubling |
# up the argument in normal circumstances. |
set_board_info cflags "-fprofile-dir=." |
set_board_info cxxflags "-fprofile-dir=." |
|
# No linker script needed. |
set_board_info ldscript "" |
/gnu-src/boards/or32-elf-sim.exp
48,9 → 48,8
# doesn't work with the standard expect commands, and will end up generating a |
# blank -isystem option, which confuses things severely. |
|
# It's sufficient just to specify -mnewlib. Bit of a shame to |
# specify it both in cflags, which are also used when linking, so we'll get |
# the libraries OK as well. |
# It's sufficient just to specify -mnewlib, but we explicitly specify |
# -mboard=or1ksim, althoug at present that is the default anyway. |
set_board_info compiler "[find_gcc]" |
set_board_info cflags "-mnewlib -mboard=or1ksim" |
|