OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 92 to Rev 93
    Reverse comparison

Rev 92 → Rev 93

/openrisc/trunk/or1ksim/sim-config.h
53,13 → 53,17
{
struct
{ /* External linkage for SystemC */
void *class_ptr;
unsigned long int (*read_up) (void *class_ptr,
unsigned long int addr,
unsigned long int mask);
void (*write_up) (void *class_ptr,
unsigned long int addr,
unsigned long int mask, unsigned long int wdata);
void *class_ptr;
int (*read_up) (void *class_ptr,
unsigned long int addr,
unsigned char mask[],
unsigned char rdata[],
int data_len);
int (*write_up) (void *class_ptr,
unsigned long int addr,
unsigned char mask[],
unsigned char wdata[],
int data_len);
} ext;
 
struct
/openrisc/trunk/or1ksim/ltmain.sh
1,6 → 1,6
# Generated from ltmain.m4sh.
 
# ltmain.sh (GNU libtool) 2.2.6b
# ltmain.sh (GNU libtool) 2.2.6
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
65,7 → 65,7
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
# $progname: (GNU libtool) 2.2.6b
# $progname: (GNU libtool) 2.2.6 Debian-2.2.6a-4
# automake: $automake_version
# autoconf: $autoconf_version
#
73,9 → 73,9
 
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=2.2.6b
VERSION="2.2.6 Debian-2.2.6a-4"
TIMESTAMP=""
package_revision=1.3017
package_revision=1.3012
 
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
5033,7 → 5033,10
case $pass in
dlopen) libs="$dlfiles" ;;
dlpreopen) libs="$dlprefiles" ;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
link)
libs="$deplibs %DEPLIBS%"
test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
;;
esac
fi
if test "$linkmode,$pass" = "lib,dlpreopen"; then
5344,19 → 5347,19
# It is a libtool convenience library, so add in its objects.
convenience="$convenience $ladir/$objdir/$old_library"
old_convenience="$old_convenience $ladir/$objdir/$old_library"
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
if $opt_duplicate_deps ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
elif test "$linkmode" != prog && test "$linkmode" != lib; then
func_fatal_error "\`$lib' is not a convenience library"
fi
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
if $opt_duplicate_deps ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
continue
fi # $pass = conv
 
5893,6 → 5896,7
if test "$link_all_deplibs" != no; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
path=
case $deplib in
-L*) path="$deplib" ;;
*.la)
6206,6 → 6210,9
revision="$number_minor"
lt_irix_increment=no
;;
*)
func_fatal_configuration "$modename: unknown library version type \`$version_type'"
;;
esac
;;
no)
/openrisc/trunk/or1ksim/configure.ac
28,7 → 28,7
 
# Use a full version number (x.y.z, possibly with "rcn" as a suffix) when
# preparing a release, otherwise use a the date version (yyyy-mm-dd).
AC_INIT([or1ksim], [2010-04-21], [openrisc@opencores.org])
AC_INIT([or1ksim], [2010-04-28], [openrisc@opencores.org])
AC_CONFIG_MACRO_DIR([m4])
 
# Generically use extensions such as _GNU_SOURCE if available.
352,31 → 352,33
-I\${top_srcdir}/cuc -I\${top_srcdir}/port -I\${top_srcdir}/argtable2"
AC_SUBST(INCLUDES)
 
AC_CONFIG_FILES([Makefile \
argtable2/Makefile \
bpb/Makefile \
cache/Makefile \
cpu/Makefile \
cpu/common/Makefile \
cpu/or1k/Makefile \
cuc/Makefile \
debug/Makefile \
doc/Makefile \
mmu/Makefile \
peripheral/Makefile \
peripheral/channels/Makefile \
pm/Makefile \
pic/Makefile \
port/Makefile \
support/Makefile \
testsuite/Makefile \
testsuite/config/Makefile \
testsuite/lib/Makefile \
testsuite/libsim.tests/Makefile \
testsuite/or1ksim.tests/Makefile \
testsuite/test-code/Makefile \
testsuite/test-code/lib-iftest/Makefile \
tick/Makefile \
AC_CONFIG_FILES([Makefile \
argtable2/Makefile \
bpb/Makefile \
cache/Makefile \
cpu/Makefile \
cpu/common/Makefile \
cpu/or1k/Makefile \
cuc/Makefile \
debug/Makefile \
doc/Makefile \
mmu/Makefile \
peripheral/Makefile \
peripheral/channels/Makefile \
pm/Makefile \
pic/Makefile \
port/Makefile \
support/Makefile \
testsuite/Makefile \
testsuite/config/Makefile \
testsuite/lib/Makefile \
testsuite/libsim.tests/Makefile \
testsuite/or1ksim.tests/Makefile \
testsuite/test-code/Makefile \
testsuite/test-code/lib-iftest/Makefile \
testsuite/test-code/lib-inttest/Makefile \
testsuite/test-code/lib-upcalls/Makefile \
tick/Makefile \
vapi/Makefile])
 
# yuck. I don't know why I cannot just substitute $CPU_ARCH in the above
/openrisc/trunk/or1ksim/doc/or1ksim.info
64,7 → 64,7
Unpack the software and create a _separate_ directory in which to build
it:
 
tar jxf or1ksim-2010-04-21.tar.bz2
tar jxf or1ksim-2010-04-28.tar.bz2
mkdir builddir_or1ksim
cd builddir_or1ksim
 
81,7 → 81,7
OpenRISC 1000 32-bit architecture. If this argument is omitted, it will
default to OpenRISC 1000 32-bit with a warning
 
../or1ksim-2010-04-21/configure --target=or32-uclinux ...
../or1ksim-2010-04-28/configure --target=or32-uclinux ...
 
There are several other options available, many of which are standard
to GNU `configure' scripts. Use `configure --help' to see all the
243,7 → 243,7
=============================
 
The following problems and issues are known about with Or1ksim
2010-04-21. The OpenRISC tracker may be used to see the current state
2010-04-28. The OpenRISC tracker may be used to see the current state
of these issues and to raise new problems and feature requests. It may
be found at `http://www.opencores.org/ptracker.cgi/view/or1k/398'.
 
487,11 → 487,13
The header file `or1ksim.h' contains appropriate declarations of the
functions exported by the Or1ksim library. These are:
 
-- `or1ksim.h': int or1ksim_init (const char *CONFIG_FILE, const char
*IMAGE_FILE, void *CLASS_PTR, unsigned long int (*UPR)(void
*CLASS_PTR, unsigned long int ADDR, unsigned long int MASK),
void (*UPW)(void *CLASS_PTR, unsigned long int ADDR, unsigned
long int MASK, unsigned long int WDATA))
-- `or1ksim.h': int or1ksim_init (const char
*CONFIG_FILE, const char *IMAGE_FILE, void *CLASS_PTR, int
(*UPR)(void *CLASS_PTR, unsigned long int ADDR, unsigned char
MASK[], unsigned char RDATA[], int DATA_LEN), int (*UPW)(void
*CLASS_PTR, unsigned long int ADDR, unsigned char MASK[], unsigned
char WDATA[], int DATA_LEN))
 
The initialization function is supplied with the name of a
configuration file, CONFIG_FILE, an executable image, IMAGE_FILE,
a pointer to the calling class, CLASS_PTR (since the library may
506,17 → 508,28
UPR is called for any reads to an external address. The CLASS_PTR
is passed back with these upcalls, allowing the function to
associate the call with the class which originally initialized the
library.
library. Both UPW and UPR should return zero on success and
non-zero otherwise. At the present time the meaning of non-zero
values is not defined but this may change in the future.
 
MASK indicates which bytes in the word are to be written or read.
MASK indicates which bytes in the data are to be written or read.
Bytes to be read/written should have 0xff set in MASK. Otherwise
the byte should be zero.
the byte should be zero. The adddress, ADDR, is the _full_
address, since the upcall function must handle all generic
devices, using the full address for decoding.
 
ADDR, MASK, WDATA and the result from UPR all use host-endianess,
_not_ model-endianess. The internal Or1ksim routines manage all
the conversion.
Endianness is not completely transparent, since Or1ksim is
transferring byte vectors, not multi-byte values.
 
Caution: This is a change from version 0.3.0. It simplifies
the interface, and makes Or1ksim more consistent with payload
representation in SystemC TLM 2.0.
 
Note: The current implementation of Or1ksim always transfers
single words (4 bytes), using masks if smaller values are
required. In this it mimcs the behavior of the WishBone bus.
 
 
-- `or1ksim.h': int or1ksim_run (double DURATION)
Run the simulator for the simulated duration specified (in
seconds).
3667,7 → 3680,7
(line 122)
* log_enabled (verification API configuration): Verification API Configuration.
(line 28)
* long: Simulator Library. (line 74)
* long: Simulator Library. (line 87)
* mc (memory configuration): Memory Configuration.
(line 100)
* memory configuration: Memory Configuration.
3724,15 → 3737,15
* nways (cache configuration): Cache Configuration. (line 22)
* nways (MMU configuration): Memory Management Configuration.
(line 22)
* or1ksim_get_time_period: Simulator Library. (line 64)
* or1ksim_init: Simulator Library. (line 18)
* or1ksim_interrupt: Simulator Library. (line 79)
* or1ksim_interrupt_clear: Simulator Library. (line 97)
* or1ksim_interrupt_set: Simulator Library. (line 88)
* or1ksim_is_le: Simulator Library. (line 69)
* or1ksim_reset_duration: Simulator Library. (line 49)
* or1ksim_run: Simulator Library. (line 44)
* or1ksim_set_time_point: Simulator Library. (line 60)
* or1ksim_get_time_period: Simulator Library. (line 77)
* or1ksim_init: Simulator Library. (line 14)
* or1ksim_interrupt: Simulator Library. (line 92)
* or1ksim_interrupt_clear: Simulator Library. (line 110)
* or1ksim_interrupt_set: Simulator Library. (line 101)
* or1ksim_is_le: Simulator Library. (line 82)
* or1ksim_reset_duration: Simulator Library. (line 62)
* or1ksim_run: Simulator Library. (line 57)
* or1ksim_set_time_point: Simulator Library. (line 73)
* output rediretion: Concepts. (line 7)
* overflow flag setting by instructions: Configuring the Build.
(line 70)
4071,43 → 4084,43
Node: Profiling Utility13349
Node: Memory Profiling Utility14259
Node: Simulator Library15624
Node: Configuration21109
Node: Configuration File Format21718
Node: Configuration File Preprocessing22010
Node: Configuration File Syntax22381
Node: Simulator Configuration25166
Node: Simulator Behavior25457
Node: Verification API Configuration29501
Node: CUC Configuration31441
Node: Core OpenRISC Configuration33358
Node: CPU Configuration33860
Node: Memory Configuration37665
Node: Memory Management Configuration42978
Node: Cache Configuration45355
Node: Interrupt Configuration47741
Node: Power Management Configuration48477
Node: Branch Prediction Configuration49754
Node: Debug Interface Configuration51114
Node: Peripheral Configuration55334
Node: Memory Controller Configuration55960
Node: UART Configuration58565
Node: DMA Configuration62084
Node: Ethernet Configuration63951
Node: GPIO Configuration67929
Node: Display Interface Configuration69562
Node: Frame Buffer Configuration71871
Node: Keyboard Configuration73735
Node: Disc Interface Configuration75973
Node: Generic Peripheral Configuration80916
Node: Interactive Command Line83211
Node: Verification API90185
Node: Code Internals94615
Node: Coding Conventions95175
Node: Global Data Structures99602
Node: Concepts102259
Ref: Output Redirection102404
Node: Internal Debugging102943
Node: GNU Free Documentation License103440
Node: Index125847
Node: Configuration21816
Node: Configuration File Format22425
Node: Configuration File Preprocessing22717
Node: Configuration File Syntax23088
Node: Simulator Configuration25873
Node: Simulator Behavior26164
Node: Verification API Configuration30208
Node: CUC Configuration32148
Node: Core OpenRISC Configuration34065
Node: CPU Configuration34567
Node: Memory Configuration38372
Node: Memory Management Configuration43685
Node: Cache Configuration46062
Node: Interrupt Configuration48448
Node: Power Management Configuration49184
Node: Branch Prediction Configuration50461
Node: Debug Interface Configuration51821
Node: Peripheral Configuration56041
Node: Memory Controller Configuration56667
Node: UART Configuration59272
Node: DMA Configuration62791
Node: Ethernet Configuration64658
Node: GPIO Configuration68636
Node: Display Interface Configuration70269
Node: Frame Buffer Configuration72578
Node: Keyboard Configuration74442
Node: Disc Interface Configuration76680
Node: Generic Peripheral Configuration81623
Node: Interactive Command Line83918
Node: Verification API90892
Node: Code Internals95322
Node: Coding Conventions95882
Node: Global Data Structures100309
Node: Concepts102966
Ref: Output Redirection103111
Node: Internal Debugging103650
Node: GNU Free Documentation License104147
Node: Index126554

End Tag Table
/openrisc/trunk/or1ksim/doc/or1ksim.texi
599,7 → 599,13
The header file @file{or1ksim.h} contains appropriate declarations of
the functions exported by the @value{OR1KSIM} library. These are:
 
@deftypefn {@file{or1ksim.h}} int or1ksim_init (const char *@var{config_file}, const char *@var{image_file}, void *@var{class_ptr}, unsigned long int (*@var{upr})(void *@var{class_ptr}, unsigned long int @var{addr}, unsigned long int @var{mask}), void (*@var{upw})(void *@var{class_ptr}, unsigned long int @var{addr}, unsigned long int @var{mask}, unsigned long int @var{wdata}))
@deftypefn {@file{or1ksim.h}} int or1ksim_init (const char
*@var{config_file}, const char *@var{image_file}, void *@var{class_ptr},
int (*@var{upr})(void *@var{class_ptr}, unsigned long int @var{addr},
unsigned char @var{mask}[], unsigned char @var{rdata}[], int
@var{data_len}), int (*@var{upw})(void *@var{class_ptr}, unsigned long
int @var{addr}, unsigned char @var{mask}[], unsigned char @var{wdata}[],
int @var{data_len}))
 
The initialization function is supplied with the name of a
configuration file, @var{config_file}, an executable image, @var{image_file}, a pointer to the calling
615,16 → 621,31
file). @var{upr} is called for any reads to an external address. The
@var{class_ptr} is passed back with these upcalls, allowing the
function to associate the call with the class which originally
initialized the library.
initialized the library. Both @var{upw} and @var{upr} should return
zero on success and non-zero otherwise. At the present time the meaning
of non-zero values is not defined but this may change in the future.
 
@var{mask} indicates which bytes in the word are to be written or
@var{mask} indicates which bytes in the data are to be written or
read. Bytes to be read/written should have 0xff set in
@var{mask}. Otherwise the byte should be zero.
@var{mask}. Otherwise the byte should be zero. The adddress,
@var{addr}, is the @emph{full} address, since the upcall function must
handle all generic devices, using the full address for decoding.
 
@var{addr}, @var{mask}, @var{wdata} and the result from @var{upr} all
use host-endianess, @emph{not} model-endianess. The internal
@value{OR1KSIM} routines manage all the conversion.
Endianness is not completely transparent, since @value{OR1KSIM} is
transferring byte vectors, not multi-byte values.
 
@quotation Caution
This is a change from version 0.3.0. It simplifies the interface, and
makes @value{OR1KSIM} more consistent with payload representation in
SystemC TLM 2.0.
@end quotation
 
@quotation Note
The current implementation of Or1ksim always transfers single words (4
bytes), using masks if smaller values are required. In this it mimcs the
behavior of the WishBone bus.
@end quotation
 
@end deftypefn
 
@deftypefn {@file{or1ksim.h}} int or1ksim_run (double @var{duration})
/openrisc/trunk/or1ksim/doc/version.texi
1,4 → 1,4
@set UPDATED 20 April 2010
@set UPDATED 28 April 2010
@set UPDATED-MONTH April 2010
@set EDITION 2010-04-21
@set VERSION 2010-04-21
@set EDITION 2010-04-28
@set VERSION 2010-04-28
/openrisc/trunk/or1ksim/or1ksim.h
46,16 → 46,19
extern "C" {
#endif
 
int or1ksim_init (const char *config_file,
const char *image_file,
void *class_ptr,
unsigned long int (*upr) (void *class_ptr,
unsigned long int addr,
unsigned long int mask),
void (*upw) (void *class_ptr,
unsigned long int addr,
unsigned long int mask,
unsigned long int wdata));
int or1ksim_init (const char *config_file,
const char *image_file,
void *class_ptr,
int (*upr) (void *class_ptr,
unsigned long int addr,
unsigned char mask[],
unsigned char rdata[],
int data_len),
int (*upw) (void *class_ptr,
unsigned long int addr,
unsigned char mask[],
unsigned char wdata[],
int data_len));
 
int or1ksim_run (double duration);
 
/openrisc/trunk/or1ksim/ChangeLog
1,3 → 1,22
2010-04-28 Jeremy Bennett <jeremy.bennett@embecosm.com>
* or1ksim.h <or1ksim_init>: Upcall arguments redefined.
* libtoplevel.c (or1ksim_init): Upcall arguments redefined.
* sim-config.h <struct config.ext>: definition of read_up and
write_up changed.
* generic.c (ext_read_word, ext_write_word): Deleted.
(mtohl, htoml, mtohs, htoms): Deleted.
(generic_read_byte, generic_write_byte, generic_read_hw)
(generic_write_hw, generic_read_word, generic_write_word): Changed
to use new upcall interface.
 
2010-04-22 Jeremy Bennett <jeremy.bennett@embecosm.com>
* sim-config.c (read_script_file): Check cur_section is defined
before dereferencing to identify parameter.
* peripheral/generic.c (generic_read_byte, generic_write_byte)
(generic_read_half_word, generic_write_half_word)
(generic_read_word, generic_write_word): Use upcall availability
as test for upcall.
 
2010-04-21 Jeremy Bennett <jeremy.bennett@embecosm.com>
* NEWS: updated
* mprofile.c (main_mprofiler): Bug 1710 fixed.
19,7 → 38,7
* README: Updated.
* configure.ac: Check for rl_event_hook declaration.
* sim-cmd.c (initialize_readline): Only use rl_event_hook if it's
available.
available.
* peripheral/atadevice.c: Added conditional includes for Apple MAC.
* port/strndup.c: Include stddef.h to define size_t.
 
29,7 → 48,7
* support/dbchs.h: simprintf channel removed.
* support/Makefile.am: References to simprintf.* removed.
* cpu/or32/generate.c (generate_body): Generate exception for
illegal instructions.
illegal instructions.
* cpu/or32/insnset.c: NOP_PRINTF and stackaddr removed.
* cpu/or32/execute.c (evalsim_reg): Remove simprintf reference.
* peripheral/channels/xterm.c (xterm_open): write result used.
/openrisc/trunk/or1ksim/testsuite/libsim.tests/upcalls.cfg
0,0 → 1,155
/* upcall-basic.cfg -- Or1ksim configuration script file for basic upcalls
 
Copyright (C) 2001, Marko Mlinar <markom@opencores.org>
Copyright (C) 2010 Embecosm Limited
 
Contributor Marko Mlinar <markom@opencores.org>
Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
This file is part of OpenRISC 1000 Architectural Simulator.
 
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.
 
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
 
You should have received a copy of the GNU General Public License along
with this program. If not, see <http: www.gnu.org/licenses/>. */
 
section memory
/*random_seed = 12345
type = random*/
pattern = 0x00
type = unknown /* Fastest */
name = "FLASH"
ce = 0
mc = 0
baseaddr = 0xf0000000
size = 0x00200000
delayr = 10
delayw = -1
end
 
section memory
/*random_seed = 12345
type = random*/
pattern = 0x00
type = unknown /* Fastest */
name = "RAM"
ce = 1
mc = 0
baseaddr = 0x00000000
size = 0x00200000
delayr = 2
delayw = 4
end
 
section immu
enabled = 1
nsets = 64
nways = 1
ustates = 2
pagesize = 8192
end
 
section dmmu
enabled = 1
nsets = 64
nways = 1
ustates = 2
pagesize = 8192
end
 
section ic
enabled = 1
nsets = 256
nways = 1
ustates = 2
blocksize = 16
end
 
section dc
enabled = 1
nsets = 256
nways = 1
ustates = 2
blocksize = 16
end
 
section cpu
ver = 0x12
rev = 0x0001
/* upr = */
superscalar = 0
hazards = 0
dependstats = 0
end
 
section bpb
enabled = 0
btic = 0
end
 
section debug
/* enabled = 1
rsp_enabled = 1
rsp_port = 51000*/
end
 
section sim
debug = 0
profile = 0
prof_fn = "sim.profile"
exe_log = 0
exe_log_type = software
exe_log_fn = "executed.log"
end
 
section mc
enabled = 1
baseaddr = 0x93000000
POC = 0x00000008 /* Power on configuration register */
index = 0
end
 
section dma
baseaddr = 0xB8000000
irq = 4
end
 
section ethernet
enabled = 0
baseaddr = 0x92000000
irq = 4
rtx_type = 0
end
 
section VAPI
enabled = 0
server_port = 9998
end
 
section fb
enabled = 1
baseaddr = 0x97000000
refresh_rate = 10000
filename = "primary"
end
 
section kbd
enabled = 0
end
 
section generic
enabled = 1
baseaddr = 0x98000000
size = 32
end
/openrisc/trunk/or1ksim/testsuite/libsim.tests/Makefile.in
210,8 → 210,13
top_srcdir = @top_srcdir@
 
# Just distribute this stuff
EXTRA_DIST = default.cfg \
lib-iftest.exp
EXTRA_DIST = default.cfg \
int-edge.cfg \
int-edge.exp \
int-level.cfg \
int-level.exp \
lib-iftest.exp \
upcalls.cfg
 
all: all-am
 
/openrisc/trunk/or1ksim/testsuite/libsim.tests/int-edge.exp
0,0 → 1,130
# int-edge.exp. Test of the library edge triggered interrupt functions
 
# Copyright (C) 2010 Embecosm Limited
 
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
# This file is part of OpenRISC 1000 Architectural Simulator.
 
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
 
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
 
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http:#www.gnu.org/licenses/>. */
 
# -----------------------------------------------------------------------------
# This code is commented throughout for use with Doxygen.
# -----------------------------------------------------------------------------
 
 
# Run the library edge triggered interrupts in a number of ways.
 
# Sequence of independent interrupts
run_libsim "int-edge simple 1" \
[list "Initalization succeeded." \
"Starting interrupt handler" \
"Enabling interrupts." \
"Triggering interrupt 2" \
"PICSR 0x00000004 -> 0x00000000" \
"Triggering interrupt 3" \
"PICSR 0x00000008 -> 0x00000000" \
"Test completed successfully."] \
"lib-inttest/lib-inttest-edge" "int-edge.cfg" \
"int-logger/int-logger-edge" "1" "2" "3"
 
run_libsim "int-edge simple 2" \
[list "Initalization succeeded." \
"Starting interrupt handler" \
"Enabling interrupts." \
"Triggering interrupt 7" \
"PICSR 0x00000080 -> 0x00000000" \
"Triggering interrupt 17" \
"PICSR 0x00020000 -> 0x00000000" \
"Triggering interrupt 31" \
"PICSR 0x80000000 -> 0x00000000" \
"Test completed successfully."] \
"lib-inttest/lib-inttest-edge" "int-edge.cfg" \
"int-logger/int-logger-edge" "1" "7" "17" "31"
 
# Duplicated interrupts
run_libsim "int-edge duplicated 1" \
[list "Initalization succeeded." \
"Starting interrupt handler" \
"Enabling interrupts." \
"Triggering interrupt 2" \
"PICSR 0x00000004 -> 0x00000000" \
"Triggering interrupt 4" \
"PICSR 0x00000010 -> 0x00000000" \
"Triggering interrupt 2" \
"PICSR 0x00000004 -> 0x00000000" \
"Test completed successfully."] \
"lib-inttest/lib-inttest-edge" "int-edge.cfg" \
"int-logger/int-logger-edge" "1" "2" "4" "2"
 
run_libsim "int-edge duplicated 2" \
[list "Initalization succeeded." \
"Starting interrupt handler" \
"Enabling interrupts." \
"Triggering interrupt 2" \
"PICSR 0x00000004 -> 0x00000000" \
"Triggering interrupt 2" \
"PICSR 0x00000004 -> 0x00000000" \
"Triggering interrupt 2" \
"PICSR 0x00000004 -> 0x00000000" \
"Triggering interrupt 2" \
"PICSR 0x00000004 -> 0x00000000" \
"Triggering interrupt 2" \
"PICSR 0x00000004 -> 0x00000000" \
"Triggering interrupt 2" \
"PICSR 0x00000004 -> 0x00000000" \
"Triggering interrupt 2" \
"PICSR 0x00000004 -> 0x00000000" \
"Triggering interrupt 2" \
"PICSR 0x00000004 -> 0x00000000" \
"Test completed successfully."] \
"lib-inttest/lib-inttest-edge" "int-edge.cfg" \
"int-logger/int-logger-edge" "1" "2" "2" "2" "2" "2" "2" "2" "2"
 
# All from upcalls
run_libsim "int-edge all upcall" \
[list "Initalization succeeded." \
"Starting interrupt handler" \
"Enabling interrupts." \
"Triggering interrupt 7" \
"PICSR 0x00000080 -> 0x00000000" \
"Triggering interrupt 17" \
"PICSR 0x00020000 -> 0x00000000" \
"Triggering interrupt 31" \
"PICSR 0x80000000 -> 0x00000000" \
"Test completed successfully."] \
"lib-inttest/lib-inttest-edge" "int-edge.cfg" \
"int-logger/int-logger-edge" "20" "7" "17" "31"
 
# Check the boundaries of acceptable interrupt numbers
run_libsim "int-edge check boundaries" \
[list "Initalization succeeded." \
"Starting interrupt handler" \
"Enabling interrupts." \
"Triggering interrupt 0" \
"PICSR 0x00000001 -> 0x00000000" \
"Triggering interrupt 1" \
"PICSR 0x00000002 -> 0x00000000" \
"Triggering interrupt 31" \
"PICSR 0x80000000 -> 0x00000000" \
"Warning: Invalid interrupt # 32 - ignored" \
"Triggering interrupt 31" \
"PICSR 0x80000000 -> 0x00000000" \
"Triggering interrupt 1" \
"PICSR 0x00000002 -> 0x00000000" \
"Triggering interrupt 0" \
"PICSR 0x00000001 -> 0x00000000" \
"Test completed successfully."] \
"lib-inttest/lib-inttest-edge" "int-edge.cfg" \
"int-logger/int-logger-edge" "10" "0" "1" "31" "32" "31" "1" "0"
/openrisc/trunk/or1ksim/testsuite/libsim.tests/Makefile.am
28,5 → 28,10
 
 
# Just distribute this stuff
EXTRA_DIST = default.cfg \
lib-iftest.exp
EXTRA_DIST = default.cfg \
int-edge.cfg \
int-edge.exp \
int-level.cfg \
int-level.exp \
lib-iftest.exp \
upcalls.cfg
/openrisc/trunk/or1ksim/testsuite/libsim.tests/int-level.exp
0,0 → 1,113
# int-level.exp. Test of the library level triggered interrupt functions
 
# Copyright (C) 2010 Embecosm Limited
 
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
# This file is part of OpenRISC 1000 Architectural Simulator.
 
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
 
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
 
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http:#www.gnu.org/licenses/>. */
 
# -----------------------------------------------------------------------------
# This code is commented throughout for use with Doxygen.
# -----------------------------------------------------------------------------
 
 
# Run the library level triggered interrupts in a number of ways.
 
# Sequence of independent interrupts
run_libsim "int-level simple 1" \
[list "Initalization succeeded." \
"Starting interrupt handler" \
"Enabling interrupts." \
"Raising interrupt 1" \
"PICSR = 0x00000002" \
"Clearing interrupt 1" \
"Test completed successfully."] \
"lib-inttest/lib-inttest-level" "int-level.cfg" \
"int-logger/int-logger-level" "+1" "-1"
 
run_libsim "int-level simple 2" \
[list "Initalization succeeded." \
"Starting interrupt handler" \
"Enabling interrupts." \
"Raising interrupt 7" \
"PICSR = 0x00000080" \
"Clearing interrupt 7" \
"Raising interrupt 17" \
"PICSR = 0x00020000" \
"Clearing interrupt 17" \
"Raising interrupt 31" \
"PICSR = 0x80000000" \
"Clearing interrupt 31" \
"Test completed successfully."] \
"lib-inttest/lib-inttest-level" "int-level.cfg" \
"int-logger/int-logger-level" "+7" "-7" "+17" "-17" "+31" "-31"
 
# Uncleared interrupt (this only matches the first two reports or PICSR, there
# are many)
run_libsim "int-level uncleared interrupt" \
[list "Initalization succeeded." \
"Starting interrupt handler" \
"Enabling interrupts." \
"Raising interrupt 1" \
"PICSR = 0x00000002" \
"PICSR = 0x00000002" \
"Test completed successfully."] \
"lib-inttest/lib-inttest-level" "int-level.cfg" \
"int-logger/int-logger-level" "+1"
 
# Clearing the wrong interrupt
run_libsim "int-level wrong clear" \
[list "Initalization succeeded." \
"Starting interrupt handler" \
"Enabling interrupts." \
"Raising interrupt 31" \
"PICSR = 0x80000000" \
"Clearing interrupt 1" \
"PICSR = 0x80000000" \
"Clearing interrupt 31" \
"Test completed successfully."] \
"lib-inttest/lib-inttest-level" "int-level.cfg" \
"int-logger/int-logger-level" "+31" "-1" "-31"
 
# Check the boundaries of acceptable interrupt numbers
run_libsim "int-level check boundaries" \
[list "Warning: Invalid interrupt # 32 to raise." \
"Warning: Invalid interrupt # 32 to clear." \
"Initalization succeeded." \
"Starting interrupt handler" \
"Enabling interrupts." \
"Raising interrupt 0" \
"PICSR = 0x00000001" \
"Clearing interrupt 0" \
"Raising interrupt 1" \
"PICSR = 0x00000002" \
"Clearing interrupt 1" \
"Raising interrupt 31" \
"PICSR = 0x80000000" \
"Clearing interrupt 31" \
"Raising interrupt 31" \
"PICSR = 0x80000000" \
"Clearing interrupt 31" \
"Raising interrupt 1" \
"PICSR = 0x00000002" \
"Clearing interrupt 1" \
"Raising interrupt 0" \
"PICSR = 0x00000001" \
"Clearing interrupt 0" \
"Test completed successfully."] \
"lib-inttest/lib-inttest-level" "int-level.cfg" \
"int-logger/int-logger-level" "+0" "-0" "+1" "-1" "+31" "-31" "+32" "-32" \
"+31" "-31" "+1" "-1" "+0" "-0"
/openrisc/trunk/or1ksim/testsuite/libsim.tests/int-edge.cfg
0,0 → 1,160
/* int-edge.cfg -- Or1ksim configuration script file for edge triggered PIC
 
Copyright (C) 2001, Marko Mlinar <markom@opencores.org>
Copyright (C) 2010 Embecosm Limited
 
Contributor Marko Mlinar <markom@opencores.org>
Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
This file is part of OpenRISC 1000 Architectural Simulator.
 
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.
 
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
 
You should have received a copy of the GNU General Public License along
with this program. If not, see <http: www.gnu.org/licenses/>. */
 
section memory
/*random_seed = 12345
type = random*/
pattern = 0x00
type = unknown /* Fastest */
name = "FLASH"
ce = 0
mc = 0
baseaddr = 0xf0000000
size = 0x00200000
delayr = 10
delayw = -1
end
 
section memory
/*random_seed = 12345
type = random*/
pattern = 0x00
type = unknown /* Fastest */
name = "RAM"
ce = 1
mc = 0
baseaddr = 0x00000000
size = 0x00200000
delayr = 2
delayw = 4
end
 
section immu
enabled = 1
nsets = 64
nways = 1
ustates = 2
pagesize = 8192
end
 
section dmmu
enabled = 1
nsets = 64
nways = 1
ustates = 2
pagesize = 8192
end
 
section ic
enabled = 1
nsets = 256
nways = 1
ustates = 2
blocksize = 16
end
 
section dc
enabled = 1
nsets = 256
nways = 1
ustates = 2
blocksize = 16
end
 
section cpu
ver = 0x12
rev = 0x0001
/* upr = */
superscalar = 0
hazards = 0
dependstats = 0
end
 
section bpb
enabled = 0
btic = 0
end
 
section debug
/* enabled = 1
rsp_enabled = 1
rsp_port = 51000*/
end
 
section sim
debug = 0
profile = 0
prof_fn = "sim.profile"
exe_log = 0
exe_log_type = software
exe_log_fn = "executed.log"
end
 
section mc
enabled = 1
baseaddr = 0x93000000
POC = 0x00000008 /* Power on configuration register */
index = 0
end
 
section dma
baseaddr = 0xB8000000
irq = 4
end
 
section ethernet
enabled = 0
baseaddr = 0x92000000
irq = 4
rtx_type = 0
end
 
section VAPI
enabled = 0
server_port = 9998
end
 
section fb
enabled = 1
baseaddr = 0x97000000
refresh_rate = 10000
filename = "primary"
end
 
section kbd
enabled = 0
end
 
section pic
enabled = 1
edge_trigger = 1
end
 
section generic
enabled = 1
baseaddr = 0x98000000
size = 8
end
/openrisc/trunk/or1ksim/testsuite/libsim.tests/int-level.cfg
0,0 → 1,160
/* int-level.cfg -- Or1ksim configuration script file for level triggered PIC
 
Copyright (C) 2001, Marko Mlinar <markom@opencores.org>
Copyright (C) 2010 Embecosm Limited
 
Contributor Marko Mlinar <markom@opencores.org>
Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
This file is part of OpenRISC 1000 Architectural Simulator.
 
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.
 
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
 
You should have received a copy of the GNU General Public License along
with this program. If not, see <http: www.gnu.org/licenses/>. */
 
section memory
/*random_seed = 12345
type = random*/
pattern = 0x00
type = unknown /* Fastest */
name = "FLASH"
ce = 0
mc = 0
baseaddr = 0xf0000000
size = 0x00200000
delayr = 10
delayw = -1
end
 
section memory
/*random_seed = 12345
type = random*/
pattern = 0x00
type = unknown /* Fastest */
name = "RAM"
ce = 1
mc = 0
baseaddr = 0x00000000
size = 0x00200000
delayr = 2
delayw = 4
end
 
section immu
enabled = 1
nsets = 64
nways = 1
ustates = 2
pagesize = 8192
end
 
section dmmu
enabled = 1
nsets = 64
nways = 1
ustates = 2
pagesize = 8192
end
 
section ic
enabled = 1
nsets = 256
nways = 1
ustates = 2
blocksize = 16
end
 
section dc
enabled = 1
nsets = 256
nways = 1
ustates = 2
blocksize = 16
end
 
section cpu
ver = 0x12
rev = 0x0001
/* upr = */
superscalar = 0
hazards = 0
dependstats = 0
end
 
section bpb
enabled = 0
btic = 0
end
 
section debug
/* enabled = 1
rsp_enabled = 1
rsp_port = 51000*/
end
 
section sim
debug = 0
profile = 0
prof_fn = "sim.profile"
exe_log = 0
exe_log_type = software
exe_log_fn = "executed.log"
end
 
section mc
enabled = 1
baseaddr = 0x93000000
POC = 0x00000008 /* Power on configuration register */
index = 0
end
 
section dma
baseaddr = 0xB8000000
irq = 4
end
 
section ethernet
enabled = 0
baseaddr = 0x92000000
irq = 4
rtx_type = 0
end
 
section VAPI
enabled = 0
server_port = 9998
end
 
section fb
enabled = 1
baseaddr = 0x97000000
refresh_rate = 10000
filename = "primary"
end
 
section kbd
enabled = 0
end
 
section pic
enabled = 1
edge_trigger = 0 /* Level triggered */
end
 
section generic
enabled = 1
baseaddr = 0x98000000
size = 8
end
/openrisc/trunk/or1ksim/testsuite/libsim.tests/upcalls.exp
0,0 → 1,78
# upcalls.exp. Test of the library upcall functions
 
# Copyright (C) 2010 Embecosm Limited
 
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
# This file is part of OpenRISC 1000 Architectural Simulator.
 
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
 
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
 
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http:#www.gnu.org/licenses/>. */
 
# -----------------------------------------------------------------------------
# This code is commented throughout for use with Doxygen.
# -----------------------------------------------------------------------------
 
 
# Run the basic upcall test
run_libsim "upcalls - basic" \
[list "Initalization succeeded." \
"Setting alignment exception handler." \
"Writing registers." \
"Wrote byte at 0x98000000 = 0xde." \
"Wrote byte at 0x98000001 = 0xad." \
"Wrote byte at 0x98000002 = 0xbe." \
"Wrote byte at 0x98000003 = 0xef." \
"Wrote half word at 0x98000004 = 0xbaad." \
"Wrote half word at 0x98000006 = 0xf00d." \
"Wrote full word at 0x98000008 = 0xcafebabe." \
"Reading registers." \
"Read full word at 0x98000000 = 0xdeadbeef." \
"Read byte at 0x98000004 = 0xba." \
"Read byte at 0x98000005 = 0xad." \
"Read byte at 0x98000006 = 0xf0." \
"Read byte at 0x98000007 = 0x0d." \
"Read half word at 0x98000008 = 0xcafe." \
"Read half word at 0x9800000a = 0xbabe." \
"All done." \
"report(0xdeaddead);" \
"exit(0)"] \
"lib-upcalls/lib-upcalls" "upcalls.cfg" "upcalls/upcall-basic" \
"14" "32"
 
# Run the misalignment upcall test
run_libsim "upcalls - misaligned" \
[list "Initalization succeeded." \
"Setting alignment exception handler." \
"Writing registers." \
"Wrote byte at 0x98000000 = 0xde." \
"Wrote half word at 0x98000002 = 0xdead." \
"Writing half word at 0x98000005: misalignment exception." \
"Wrote full word at 0x98000008 = 0xdeadbeef." \
"Writing full word at 0x9800000d: misalignment exception." \
"Writing full word at 0x98000012: misalignment exception." \
"Writing full word at 0x98000017: misalignment exception." \
"Wrote full word at 0x9800001c = 0xbaadbabe." \
"Reading registers." \
"Read byte at 0x98000000 = 0xde." \
"Read half word at 0x98000002 = 0xdead." \
"Reading half word at 0x98000005: misalignment exception." \
"Read full word at 0x98000008 = 0xdeadbeef." \
"Reading full word at 0x9800000d: misalignment exception." \
"Reading full word at 0x98000012: misalignment exception." \
"Reading full word at 0x98000017: misalignment exception." \
"Read full word at 0x9800001c = 0xbaadbabe." \
"report(0xdeaddead);" \
"exit(0)"] \
"lib-upcalls/lib-upcalls" "upcalls.cfg" "upcalls/upcall-misaligned" \
"8" "32"
/openrisc/trunk/or1ksim/testsuite/test-code-or1k/m4/libtool.m4
2470,13 → 2470,10
# before this can be enabled.
hardcode_into_libs=yes
 
# Add ABI-specific directories to the system library path.
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
 
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
 
# We used to test for /lib/ld.so.1 and disable shared libraries on
2488,6 → 2485,18
dynamic_linker='GNU/Linux ld.so'
;;
 
netbsdelf*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='NetBSD ld.elf_so'
;;
 
netbsd*)
version_type=sunos
need_lib_prefix=no
3079,7 → 3088,7
lt_cv_deplibs_check_method=pass_all
;;
 
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
3760,7 → 3769,7
;;
esac
;;
netbsd*)
netbsd* | netbsdelf*-gnu)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
4185,6 → 4194,9
cygwin* | mingw* | cegcc*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
4249,6 → 4261,9
openbsd*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
esac
 
_LT_TAGVAR(ld_shlibs, $1)=yes
4431,7 → 4446,7
fi
;;
 
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
4606,6 → 4621,7
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
_LT_TAGVAR(link_all_deplibs, $1)=no
else
# not using gcc
if test "$host_cpu" = ia64; then
4844,7 → 4860,7
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
 
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
/openrisc/trunk/or1ksim/testsuite/test-code-or1k/m4/ltversion.m4
9,15 → 9,15
 
# Generated from ltversion.in.
 
# serial 3017 ltversion.m4
# serial 3012 ltversion.m4
# This file is part of GNU Libtool
 
m4_define([LT_PACKAGE_VERSION], [2.2.6b])
m4_define([LT_PACKAGE_REVISION], [1.3017])
m4_define([LT_PACKAGE_VERSION], [2.2.6])
m4_define([LT_PACKAGE_REVISION], [1.3012])
 
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.2.6b'
macro_revision='1.3017'
[macro_version='2.2.6'
macro_revision='1.3012'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
/openrisc/trunk/or1ksim/testsuite/test-code-or1k/configure
2045,8 → 2045,8
 
 
 
macro_version='2.2.6b'
macro_revision='1.3017'
macro_version='2.2.6'
macro_revision='1.3012'
 
 
 
4179,7 → 4179,7
lt_cv_deplibs_check_method=pass_all
;;
 
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
else
7390,6 → 7390,9
openbsd*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu)
link_all_deplibs=no
;;
esac
 
ld_shlibs=yes
7572,7 → 7575,7
fi
;;
 
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
7747,6 → 7750,7
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
link_all_deplibs=no
else
# not using gcc
if test "$host_cpu" = ia64; then
8161,7 → 8165,7
link_all_deplibs=yes
;;
 
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
9123,13 → 9127,10
# before this can be enabled.
hardcode_into_libs=yes
 
# Add ABI-specific directories to the system library path.
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
 
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
 
# We used to test for /lib/ld.so.1 and disable shared libraries on
9141,6 → 9142,18
dynamic_linker='GNU/Linux ld.so'
;;
 
netbsdelf*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='NetBSD ld.elf_so'
;;
 
netbsd*)
version_type=sunos
need_lib_prefix=no
10074,7 → 10087,7
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10077 "configure"
#line 10090 "configure"
#include "confdefs.h"
 
#if HAVE_DLFCN_H
10170,7 → 10183,7
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10173 "configure"
#line 10186 "configure"
#include "confdefs.h"
 
#if HAVE_DLFCN_H
12671,7 → 12684,7
_ACEOF
 
 
ac_config_files="$ac_config_files Makefile acv-gpio/Makefile acv-uart/Makefile basic/Makefile cache/Makefile cbasic/Makefile cfg/Makefile dhry/Makefile dmatest/Makefile eth/Makefile except/Makefile except-test/Makefile exit/Makefile ext/Makefile fbtest/Makefile functest/Makefile flag/Makefile int-test/Makefile inst-set-test/Makefile kbdtest/Makefile local-global/Makefile loop/Makefile mc-async/Makefile mc-dram/Makefile mc-ssram/Makefile mc-sync/Makefile mc-common/Makefile mem-test/Makefile mmu/Makefile mul/Makefile mycompress/Makefile support/Makefile tick/Makefile uos/Makefile"
ac_config_files="$ac_config_files Makefile acv-gpio/Makefile acv-uart/Makefile basic/Makefile cache/Makefile cbasic/Makefile cfg/Makefile dhry/Makefile dmatest/Makefile eth/Makefile except/Makefile except-test/Makefile exit/Makefile ext/Makefile fbtest/Makefile functest/Makefile flag/Makefile int-test/Makefile int-logger/Makefile inst-set-test/Makefile kbdtest/Makefile local-global/Makefile loop/Makefile mc-async/Makefile mc-dram/Makefile mc-ssram/Makefile mc-sync/Makefile mc-common/Makefile mem-test/Makefile mmu/Makefile mul/Makefile mycompress/Makefile support/Makefile tick/Makefile uos/Makefile upcalls/Makefile"
 
 
cat >confcache <<\_ACEOF
13591,6 → 13604,7
"functest/Makefile") CONFIG_FILES="$CONFIG_FILES functest/Makefile" ;;
"flag/Makefile") CONFIG_FILES="$CONFIG_FILES flag/Makefile" ;;
"int-test/Makefile") CONFIG_FILES="$CONFIG_FILES int-test/Makefile" ;;
"int-logger/Makefile") CONFIG_FILES="$CONFIG_FILES int-logger/Makefile" ;;
"inst-set-test/Makefile") CONFIG_FILES="$CONFIG_FILES inst-set-test/Makefile" ;;
"kbdtest/Makefile") CONFIG_FILES="$CONFIG_FILES kbdtest/Makefile" ;;
"local-global/Makefile") CONFIG_FILES="$CONFIG_FILES local-global/Makefile" ;;
13607,6 → 13621,7
"support/Makefile") CONFIG_FILES="$CONFIG_FILES support/Makefile" ;;
"tick/Makefile") CONFIG_FILES="$CONFIG_FILES tick/Makefile" ;;
"uos/Makefile") CONFIG_FILES="$CONFIG_FILES uos/Makefile" ;;
"upcalls/Makefile") CONFIG_FILES="$CONFIG_FILES upcalls/Makefile" ;;
 
*) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
/openrisc/trunk/or1ksim/testsuite/test-code-or1k/Makefile.in
278,6 → 278,7
functest \
flag \
inst-set-test \
int-logger \
int-test \
kbdtest \
local-global \
291,7 → 292,8
mul \
mycompress \
tick \
uos
uos \
upcalls
 
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
/openrisc/trunk/or1ksim/testsuite/test-code-or1k/kbdtest/kbdtest.c
69,6 → 69,44
 
 
/* --------------------------------------------------------------------------*/
/*!Print an escaped character
Non-printable characters use their name:
'\n' - ENTER
' ' - SPACE
'\t' - TAB
 
Any char > 127 (0x7f) is an error.
 
Any other char less than 0x20 appears as ^<char>. */
/* --------------------------------------------------------------------------*/
static void
print_escaped_char (unsigned char c)
{
switch (c)
{
case '\n': printf ("Received: ENTER.\n"); return;
case ' ': printf ("Received: SPACE.\n"); return;
case '\t': printf ("Received: TAB.\n"); return;
 
default:
if (c > 0x7f)
{
printf ("\nWarning: received erroneous character 0x%02x.\n",
(unsigned int) c);
}
else if (c < 0x20)
{
printf ("Received '^%c'.\n", '@' + c);
}
else
{
printf ("Received '%c'.\n", c);
}
}
} /* print_escaped_char () */
 
 
/* --------------------------------------------------------------------------*/
/*!Utility to read a 32 bit memory mapped register
 
@param[in] addr The address to read from
205,7 → 243,7
}
else
{
printf ("%c", c);
print_escaped_char (c);
char_scan_made = x;
}
}
225,7 → 263,7
}
else
{
printf ("%c", c);
print_escaped_char (c);
char_scan_made = x;
}
 
307,7 → 345,7
mtspr (SPR_SR, mfspr(SPR_SR) | SPR_SR_IEE);
mtspr (SPR_PICMR, mfspr(SPR_PICMR) | (0x00000001L << KBD_IRQ));
 
/* Wait until the interrupt handler is finished */
/* Wait until the interrupt handler is finished. */
while (num_chars_done < MAX_CHARS_TO_READ)
{
}
/openrisc/trunk/or1ksim/testsuite/test-code-or1k/upcalls/upcall-basic.c
0,0 → 1,199
/* upcall-basic.c. Test of Or1ksim basic handling of upcalls
 
Copyright (C) 2010 Embecosm Limited
 
Contributors various OpenCores participants
Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
This file is part of OpenRISC 1000 Architectural Simulator.
 
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.
 
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
 
You should have received a copy of the GNU General Public License along
with this program. If not, see <http: www.gnu.org/licenses/>. */
 
/* ----------------------------------------------------------------------------
This code is commented throughout for use with Doxygen.
--------------------------------------------------------------------------*/
 
#include "support.h"
#include "spr-defs.h"
#include "board.h"
 
 
/*!Alignment exception handler defined here. */
unsigned long excpt_align;
 
 
/* --------------------------------------------------------------------------*/
/*!Write a memory mapped byte register
 
@param[in] addr Memory mapped address
@param[in] value Value to set */
/* --------------------------------------------------------------------------*/
static void
setreg8 (unsigned long int addr,
unsigned char value)
{
*((volatile unsigned char *) addr) = value;
printf ("Wrote byte at 0x%08lx = 0x%02x.\n", addr, value);
 
} /* setreg8 () */
 
 
/* --------------------------------------------------------------------------*/
/*!Write a memory mapped half word register
 
@param[in] addr Memory mapped address
@param[in] value Value to set */
/* --------------------------------------------------------------------------*/
static void
setreg16 (unsigned long int addr,
unsigned short int value)
{
*((volatile unsigned short int *) addr) = value;
printf ("Wrote half word at 0x%08lx = 0x%04x.\n", addr, value);
 
} /* setreg16 () */
 
 
/* --------------------------------------------------------------------------*/
/*!Write a memory mapped full word register
 
@param[in] addr Memory mapped address
@param[in] value Value to set */
/* --------------------------------------------------------------------------*/
static void
setreg32 (unsigned long int addr,
unsigned long int value)
{
*((volatile unsigned long int *) addr) = value;
printf ("Wrote full word at 0x%08lx = 0x%08lx.\n", addr, value);
 
} /* setreg32 () */
 
 
/* --------------------------------------------------------------------------*/
/*!Read a memory mapped byte register
 
@param[in] addr Memory mapped address
 
@return Value read */
/* --------------------------------------------------------------------------*/
unsigned char
getreg8 (unsigned long int addr)
{
unsigned char res = *((volatile unsigned char *) addr);
printf ("Read byte at 0x%08lx = 0x%02x.\n", addr, res);
return res;
 
} /* getreg8 () */
 
 
/* --------------------------------------------------------------------------*/
/*!Read a memory mapped half word register
 
@param[in] addr Memory mapped address
 
@return Value read */
/* --------------------------------------------------------------------------*/
unsigned short int
getreg16 (unsigned long int addr)
{
unsigned short int res = *((volatile unsigned short int *) addr);
printf ("Read half word at 0x%08lx = 0x%04x.\n", addr, res);
return res;
 
} /* getreg16 () */
 
 
/* --------------------------------------------------------------------------*/
/*!Read a memory mapped full word register
 
@param[in] addr Memory mapped address
 
@return Value read */
/* --------------------------------------------------------------------------*/
unsigned long int
getreg32 (unsigned long int addr)
{
unsigned long int res = *((volatile unsigned long int *) addr);
printf ("Read full word at 0x%08lx = 0x%08lx.\n", addr, res);
return res;
 
} /* getreg32 () */
 
 
/* --------------------------------------------------------------------------*/
/*! Exception handler for misalignment.
 
Notes what has happened. */
/* --------------------------------------------------------------------------*/
void align_handler (void)
{
printf ("Misaligned access.\n");
 
} /* align_handler () */
 
 
/* --------------------------------------------------------------------------*/
/*!Main program to read and write memory mapped registers
 
All these calls should be correctly aligned, but we set an handler, just in
case.
 
@return The return code from the program (always zero). */
/* --------------------------------------------------------------------------*/
int
main ()
{
/* Set the exception handler */
printf ("Setting alignment exception handler.\n");
excpt_align = (unsigned long)align_handler;
 
/* Write some registers */
printf ("Writing registers.\n");
 
/* Byte aligned */
setreg8 (GENERIC_BASE, 0xde);
setreg8 (GENERIC_BASE + 1, 0xad);
setreg8 (GENERIC_BASE + 2, 0xbe);
setreg8 (GENERIC_BASE + 3, 0xef);
 
/* Half word aligned */
setreg16 (GENERIC_BASE + 4, 0xbaad);
setreg16 (GENERIC_BASE + 6, 0xf00d);
 
/* Full word aligned */
setreg32 (GENERIC_BASE + 8, 0xcafebabe);
 
/* Read some registers, but mix up which size from where. */
printf ("Reading registers.\n");
 
/* Full word aligned */
(void)getreg32 (GENERIC_BASE + 0);
 
/* Byte aligned */
(void)getreg8 (GENERIC_BASE + 4);
(void)getreg8 (GENERIC_BASE + 5);
(void)getreg8 (GENERIC_BASE + 6);
(void)getreg8 (GENERIC_BASE + 7);
 
/* Half word aligned */
(void)getreg16 (GENERIC_BASE + 8);
(void)getreg16 (GENERIC_BASE + 10);
 
/* All done */
printf ("All done.\n");
report (0xdeaddead);
return 0;
 
} /* main () */
openrisc/trunk/or1ksim/testsuite/test-code-or1k/upcalls/upcall-basic.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: openrisc/trunk/or1ksim/testsuite/test-code-or1k/upcalls/Makefile.in =================================================================== --- openrisc/trunk/or1ksim/testsuite/test-code-or1k/upcalls/Makefile.in (nonexistent) +++ openrisc/trunk/or1ksim/testsuite/test-code-or1k/upcalls/Makefile.in (revision 93) @@ -0,0 +1,523 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile.am for or1ksim OR1K test program: upcalls + +# Copyright (C) Embecosm Limited, 2010 + +# Contributor Jeremy Bennett + +# This file is part of OpenRISC 1000 Architectural Simulator. + +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 3 of the License, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. + +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . */ + +# ----------------------------------------------------------------------------- +# This code is commented throughout for use with Doxygen. +# ----------------------------------------------------------------------------- +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +check_PROGRAMS = upcall-basic$(EXEEXT) upcall-misaligned$(EXEEXT) +subdir = upcalls +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am_upcall_basic_OBJECTS = upcall-basic.$(OBJEXT) +upcall_basic_OBJECTS = $(am_upcall_basic_OBJECTS) +upcall_basic_DEPENDENCIES = ../except/except.lo \ + ../support/libsupport.la +upcall_basic_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(upcall_basic_LDFLAGS) $(LDFLAGS) -o $@ +am_upcall_misaligned_OBJECTS = upcall-misaligned.$(OBJEXT) +upcall_misaligned_OBJECTS = $(am_upcall_misaligned_OBJECTS) +upcall_misaligned_DEPENDENCIES = ../except/except.lo \ + ../support/libsupport.la +upcall_misaligned_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(upcall_misaligned_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/../../depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(upcall_basic_SOURCES) $(upcall_misaligned_SOURCES) +DIST_SOURCES = $(upcall_basic_SOURCES) $(upcall_misaligned_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIM = @SIM@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# Basic test +upcall_basic_SOURCES = upcall-basic.c +upcall_basic_LDFLAGS = -T$(srcdir)/../default.ld +upcall_basic_LDADD = ../except/except.lo \ + ../support/libsupport.la + + +# Test for misaligned calls +upcall_misaligned_SOURCES = upcall-misaligned.c +upcall_misaligned_LDFLAGS = -T$(srcdir)/../default.ld +upcall_misaligned_LDADD = ../except/except.lo \ + ../support/libsupport.la + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu upcalls/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu upcalls/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +upcall-basic$(EXEEXT): $(upcall_basic_OBJECTS) $(upcall_basic_DEPENDENCIES) + @rm -f upcall-basic$(EXEEXT) + $(upcall_basic_LINK) $(upcall_basic_OBJECTS) $(upcall_basic_LDADD) $(LIBS) +upcall-misaligned$(EXEEXT): $(upcall_misaligned_OBJECTS) $(upcall_misaligned_DEPENDENCIES) + @rm -f upcall-misaligned$(EXEEXT) + $(upcall_misaligned_LINK) $(upcall_misaligned_OBJECTS) $(upcall_misaligned_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upcall-basic.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upcall-misaligned.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: openrisc/trunk/or1ksim/testsuite/test-code-or1k/upcalls/Makefile.am =================================================================== --- openrisc/trunk/or1ksim/testsuite/test-code-or1k/upcalls/Makefile.am (nonexistent) +++ openrisc/trunk/or1ksim/testsuite/test-code-or1k/upcalls/Makefile.am (revision 93) @@ -0,0 +1,45 @@ +# Makefile.am for or1ksim OR1K test program: upcalls + +# Copyright (C) Embecosm Limited, 2010 + +# Contributor Jeremy Bennett + +# This file is part of OpenRISC 1000 Architectural Simulator. + +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 3 of the License, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. + +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . */ + +# ----------------------------------------------------------------------------- +# This code is commented throughout for use with Doxygen. +# ----------------------------------------------------------------------------- + + +# Test programs for upcalls +check_PROGRAMS = upcall-basic \ + upcall-misaligned + +# Basic test +upcall_basic_SOURCES = upcall-basic.c + +upcall_basic_LDFLAGS = -T$(srcdir)/../default.ld + +upcall_basic_LDADD = ../except/except.lo \ + ../support/libsupport.la + +# Test for misaligned calls +upcall_misaligned_SOURCES = upcall-misaligned.c + +upcall_misaligned_LDFLAGS = -T$(srcdir)/../default.ld + +upcall_misaligned_LDADD = ../except/except.lo \ + ../support/libsupport.la
openrisc/trunk/or1ksim/testsuite/test-code-or1k/upcalls/Makefile.am Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: openrisc/trunk/or1ksim/testsuite/test-code-or1k/upcalls/upcall-misaligned.c =================================================================== --- openrisc/trunk/or1ksim/testsuite/test-code-or1k/upcalls/upcall-misaligned.c (nonexistent) +++ openrisc/trunk/or1ksim/testsuite/test-code-or1k/upcalls/upcall-misaligned.c (revision 93) @@ -0,0 +1,290 @@ +/* upcall-misaligned.c. Test of Or1ksim misaligned handling of upcalls + + Copyright (C) 2010 Embecosm Limited + + Contributors various OpenCores participants + Contributor Jeremy Bennett + + This file is part of OpenRISC 1000 Architectural Simulator. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 3 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along + with this program. If not, see . */ + +/* ---------------------------------------------------------------------------- + This code is commented throughout for use with Doxygen. + --------------------------------------------------------------------------*/ + +#include "support.h" +#include "spr-defs.h" +#include "board.h" + + +/*!Alignment exception handler defined here. */ +unsigned long excpt_align; + +/*!Flag set if we get a misaligned access */ +static int misaligned_p; + +/* --------------------------------------------------------------------------*/ +/*!Write a memory mapped byte register + + Report the result, noting if we get a misalignment exception. + + @param[in] addr Memory mapped address + @param[in] value Value to set */ +/* --------------------------------------------------------------------------*/ +static void +setreg8 (unsigned long int addr, + unsigned char value) +{ + *((volatile unsigned char *) addr) = value; + + if (misaligned_p) + { + printf ("Writing byte at 0x%08lx: misalignment exception.\n", addr); + misaligned_p = 0; + } + else + { + printf ("Wrote byte at 0x%08lx = 0x%02x.\n", addr, value); + } +} /* setreg8 () */ + + +/* --------------------------------------------------------------------------*/ +/*!Write a memory mapped half word register + + Report the result, noting if we get a misalignment exception. + + @param[in] addr Memory mapped address + @param[in] value Value to set */ +/* --------------------------------------------------------------------------*/ +static void +setreg16 (unsigned long int addr, + unsigned short int value) +{ + *((volatile unsigned short int *) addr) = value; + + if (misaligned_p) + { + printf ("Writing half word at 0x%08lx: misalignment exception.\n", addr); + misaligned_p = 0; + } + else + { + printf ("Wrote half word at 0x%08lx = 0x%04x.\n", addr, value); + } +} /* setreg16 () */ + + +/* --------------------------------------------------------------------------*/ +/*!Write a memory mapped full word register + + Report the result, noting if we get a misalignment exception. + + @param[in] addr Memory mapped address + @param[in] value Value to set */ +/* --------------------------------------------------------------------------*/ +static void +setreg32 (unsigned long int addr, + unsigned long int value) +{ + *((volatile unsigned long int *) addr) = value; + + if (misaligned_p) + { + printf ("Writing full word at 0x%08lx: misalignment exception.\n", addr); + misaligned_p = 0; + } + else + { + printf ("Wrote full word at 0x%08lx = 0x%08lx.\n", addr, value); + } +} /* setreg32 () */ + + +/* --------------------------------------------------------------------------*/ +/*!Read a memory mapped byte register + + Report the result, noting if we get a misalignment exception. + + @param[in] addr Memory mapped address + + @return Value read */ +/* --------------------------------------------------------------------------*/ +unsigned char +getreg8 (unsigned long int addr) +{ + unsigned char res = *((volatile unsigned char *) addr); + + if (misaligned_p) + { + printf ("Reading byte at 0x%08lx: misalignment exception.\n", addr); + misaligned_p = 0; + } + else + { + printf ("Read byte at 0x%08lx = 0x%02x.\n", addr, res); + } + + return res; + +} /* getreg8 () */ + + +/* --------------------------------------------------------------------------*/ +/*!Read a memory mapped half word register + + Report the result, noting if we get a misalignment exception. + + @param[in] addr Memory mapped address + + @return Value read */ +/* --------------------------------------------------------------------------*/ +unsigned short int +getreg16 (unsigned long int addr) +{ + unsigned short int res = *((volatile unsigned short int *) addr); + + if (misaligned_p) + { + printf ("Reading half word at 0x%08lx: misalignment exception.\n", addr); + misaligned_p = 0; + } + else + { + printf ("Read half word at 0x%08lx = 0x%04x.\n", addr, res); + } + + return res; + +} /* getreg16 () */ + + +/* --------------------------------------------------------------------------*/ +/*!Read a memory mapped full word register + + Report the result, noting if we get a misalignment exception. + + @param[in] addr Memory mapped address + + @return Value read */ +/* --------------------------------------------------------------------------*/ +unsigned long int +getreg32 (unsigned long int addr) +{ + unsigned long int res = *((volatile unsigned long int *) addr); + + if (misaligned_p) + { + printf ("Reading full word at 0x%08lx: misalignment exception.\n", addr); + misaligned_p = 0; + } + else + { + printf ("Read full word at 0x%08lx = 0x%08lx.\n", addr, res); + } + + return res; + +} /* getreg32 () */ + + +/* --------------------------------------------------------------------------*/ +/*!Exception handler for misalignment. + + Set the flag to indicated we have hit an exception. + + We can't just return, since that will give us the instruction that caused + the problem in the first place. What we do instead is patch the EPCR SPR. + + This is fine, so long as we didn't trap in a delay slot. The crude response + to that then we just exit. */ +/* --------------------------------------------------------------------------*/ +void align_handler (void) +{ + misaligned_p = 1; + + unsigned long int iaddr = mfspr (SPR_EPCR_BASE); + unsigned long int instr = *(unsigned long int *) iaddr; + unsigned char opc = instr >> 26; + + switch (opc) + { + case 0x00: /* l.j */ + case 0x01: /* l.jal */ + case 0x03: /* l.bnf */ + case 0x04: /* l.bf */ + case 0x11: /* l.jr */ + case 0x12: /* l.jalr */ + + printf ("Misalignment exception unable to recover from delay slot.\n"); + exit (1); + break; + + default: + mtspr (SPR_EPCR_BASE, iaddr + 4); /* Step past */ + break; + } +} /* align_handler () */ + + +/* --------------------------------------------------------------------------*/ +/*!Main program to read and write memory mapped registers + + Some of these are misaligned and should cause the appropriate exception. + + @return The return code from the program (always zero). */ +/* --------------------------------------------------------------------------*/ +int +main () +{ + /* Set the exception handler, and note that no exceptions have yet + happened. */ + printf ("Setting alignment exception handler.\n"); + excpt_align = (unsigned long)align_handler; + misaligned_p = 0; + + /* Write some registers */ + printf ("Writing registers.\n"); + + setreg8 (GENERIC_BASE, 0xde); + + setreg16 (GENERIC_BASE + 2, 0xdead); /* Aligned */ + setreg16 (GENERIC_BASE + 5, 0xbeef); /* Unaligned */ + + setreg32 (GENERIC_BASE + 8, 0xdeadbeef); /* Aligned */ + setreg32 (GENERIC_BASE + 13, 0xcafebabe); /* Unaligned */ + setreg32 (GENERIC_BASE + 18, 0xbaadf00d); /* Unaligned */ + setreg32 (GENERIC_BASE + 23, 0xfee1babe); /* Unaligned */ + setreg32 (GENERIC_BASE + 28, 0xbaadbabe); /* Aligned */ + + /* Write some registers */ + printf ("Reading registers.\n"); + + (void)getreg8 (GENERIC_BASE); + + (void)getreg16 (GENERIC_BASE + 2); /* Aligned */ + (void)getreg16 (GENERIC_BASE + 5); /* Unaligned */ + + (void)getreg32 (GENERIC_BASE + 8); /* Aligned */ + (void)getreg32 (GENERIC_BASE + 13); /* Unaligned */ + (void)getreg32 (GENERIC_BASE + 18); /* Unaligned */ + (void)getreg32 (GENERIC_BASE + 23); /* Unaligned */ + (void)getreg32 (GENERIC_BASE + 28); /* Aligned */ + + /* We don't actually ever return */ + report (0xdeaddead); + return 0; + +} /* main () */
openrisc/trunk/or1ksim/testsuite/test-code-or1k/upcalls/upcall-misaligned.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: openrisc/trunk/or1ksim/testsuite/test-code-or1k/configure.ac =================================================================== --- openrisc/trunk/or1ksim/testsuite/test-code-or1k/configure.ac (revision 92) +++ openrisc/trunk/or1ksim/testsuite/test-code-or1k/configure.ac (revision 93) @@ -132,6 +132,7 @@ functest/Makefile \ flag/Makefile \ int-test/Makefile \ + int-logger/Makefile \ inst-set-test/Makefile \ kbdtest/Makefile \ local-global/Makefile \ @@ -147,6 +148,7 @@ mycompress/Makefile \ support/Makefile \ tick/Makefile \ - uos/Makefile]) + uos/Makefile \ + upcalls/Makefile]) AC_OUTPUT
/openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-logger/Makefile.in
0,0 → 1,519
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
 
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
 
@SET_MAKE@
 
# Makefile.am for or1ksim OR1K test programs: int-logger-{edge,level}
 
# Copyright (C) Embecosm Limited, 2010
 
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
# This file is part of OpenRISC 1000 Architectural Simulator.
 
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
 
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
 
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http:#www.gnu.org/licenses/>. */
 
# -----------------------------------------------------------------------------
# This code is commented throughout for use with Doxygen.
# -----------------------------------------------------------------------------
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
check_PROGRAMS = int-logger-edge$(EXEEXT) int-logger-level$(EXEEXT)
subdir = int-logger
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am_int_logger_edge_OBJECTS = int-logger-edge.$(OBJEXT)
int_logger_edge_OBJECTS = $(am_int_logger_edge_OBJECTS)
int_logger_edge_DEPENDENCIES = ../except/except.lo \
../support/libsupport.la
int_logger_edge_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(int_logger_edge_LDFLAGS) $(LDFLAGS) -o $@
am_int_logger_level_OBJECTS = int-logger-level.$(OBJEXT)
int_logger_level_OBJECTS = $(am_int_logger_level_OBJECTS)
int_logger_level_DEPENDENCIES = ../except/except.lo \
../support/libsupport.la
int_logger_level_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(int_logger_level_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/../../depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(int_logger_edge_SOURCES) $(int_logger_level_SOURCES)
DIST_SOURCES = $(int_logger_edge_SOURCES) $(int_logger_level_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SIM = @SIM@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
int_logger_edge_SOURCES = int-logger-edge.c
int_logger_edge_LDFLAGS = -T$(srcdir)/../default.ld
int_logger_edge_LDADD = ../except/except.lo \
../support/libsupport.la
 
int_logger_level_SOURCES = int-logger-level.c
int_logger_level_LDFLAGS = -T$(srcdir)/../default.ld
int_logger_level_LDADD = ../except/except.lo \
../support/libsupport.la
 
all: all-am
 
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu int-logger/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu int-logger/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
 
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
 
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
int-logger-edge$(EXEEXT): $(int_logger_edge_OBJECTS) $(int_logger_edge_DEPENDENCIES)
@rm -f int-logger-edge$(EXEEXT)
$(int_logger_edge_LINK) $(int_logger_edge_OBJECTS) $(int_logger_edge_LDADD) $(LIBS)
int-logger-level$(EXEEXT): $(int_logger_level_OBJECTS) $(int_logger_level_DEPENDENCIES)
@rm -f int-logger-level$(EXEEXT)
$(int_logger_level_LINK) $(int_logger_level_OBJECTS) $(int_logger_level_LDADD) $(LIBS)
 
mostlyclean-compile:
-rm -f *.$(OBJEXT)
 
distclean-compile:
-rm -f *.tab.c
 
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/int-logger-edge.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/int-logger-level.Po@am__quote@
 
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
 
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
 
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
 
mostlyclean-libtool:
-rm -f *.lo
 
clean-libtool:
-rm -rf .libs _libs
 
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
 
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
 
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
 
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
 
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
 
clean-generic:
 
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
 
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
mostlyclean-am
 
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
 
dvi: dvi-am
 
dvi-am:
 
html: html-am
 
html-am:
 
info: info-am
 
info-am:
 
install-data-am:
 
install-dvi: install-dvi-am
 
install-dvi-am:
 
install-exec-am:
 
install-html: install-html-am
 
install-html-am:
 
install-info: install-info-am
 
install-info-am:
 
install-man:
 
install-pdf: install-pdf-am
 
install-pdf-am:
 
install-ps: install-ps-am
 
install-ps-am:
 
installcheck-am:
 
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
 
mostlyclean: mostlyclean-am
 
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
 
pdf: pdf-am
 
pdf-am:
 
ps: ps-am
 
ps-am:
 
uninstall-am:
 
.MAKE: check-am install-am install-strip
 
.PHONY: CTAGS GTAGS all all-am check check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool ctags \
distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am
 
 
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
/openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-logger/Makefile.am
0,0 → 1,44
# Makefile.am for or1ksim OR1K test programs: int-logger-{edge,level}
 
# Copyright (C) Embecosm Limited, 2010
 
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
# This file is part of OpenRISC 1000 Architectural Simulator.
 
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
 
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
 
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http:#www.gnu.org/licenses/>. */
 
# -----------------------------------------------------------------------------
# This code is commented throughout for use with Doxygen.
# -----------------------------------------------------------------------------
 
 
# Test programs which report on interrupts received. One for edge triggered,
# one for level triggered.
check_PROGRAMS = int-logger-edge \
int-logger-level
 
int_logger_edge_SOURCES = int-logger-edge.c
 
int_logger_edge_LDFLAGS = -T$(srcdir)/../default.ld
 
int_logger_edge_LDADD = ../except/except.lo \
../support/libsupport.la
 
int_logger_level_SOURCES = int-logger-level.c
 
int_logger_level_LDFLAGS = -T$(srcdir)/../default.ld
 
int_logger_level_LDADD = ../except/except.lo \
../support/libsupport.la
openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-logger/Makefile.am Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-logger/int-logger-edge.c =================================================================== --- openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-logger/int-logger-edge.c (nonexistent) +++ openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-logger/int-logger-edge.c (revision 93) @@ -0,0 +1,132 @@ +/* int-logger-edge.c. Test of Or1ksim handling of edge triggered interrupts + + Copyright (C) 2010 Embecosm Limited + + Contributors various OpenCores participants + Contributor Jeremy Bennett + + This file is part of OpenRISC 1000 Architectural Simulator. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 3 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along + with this program. If not, see . */ + +/* ---------------------------------------------------------------------------- + This code is commented throughout for use with Doxygen. + --------------------------------------------------------------------------*/ + +#include "support.h" +#include "spr-defs.h" +#include "board.h" + + +/* --------------------------------------------------------------------------*/ +/*!Write a memory mapped register + + @param[in] addr Memory mapped address + @param[in] value Value to set */ +/* --------------------------------------------------------------------------*/ +static void +setreg (unsigned long addr, + unsigned char value) +{ + *((volatile unsigned char *) addr) = value; + +} /* setreg () */ + + +/* --------------------------------------------------------------------------*/ +/*!Read a memory mapped register + + @param[in] addr Memory mapped address + + @return Value read */ +/* --------------------------------------------------------------------------*/ +unsigned long +getreg (unsigned long addr) +{ + return *((volatile unsigned char *) addr); + +} /* getreg () */ + + +/* --------------------------------------------------------------------------*/ +/*!Generic interrupt handler + + This should receive the interrupt exception. Report the value in PICSR, + then clear the interrupt and reporting it again */ +/* --------------------------------------------------------------------------*/ +static void +interrupt_handler () +{ + unsigned long int old_picsr = mfspr (SPR_PICSR); + mtspr (SPR_PICSR, 0); + unsigned long int new_picsr = mfspr (SPR_PICSR); + + printf ("PICSR 0x%08lx -> 0x%08lx\n", old_picsr, new_picsr); + +} /* interrupt_handler () */ + + +/* --------------------------------------------------------------------------*/ +/*!Main program to set up interrupt handler + + We make a series of upcalls, after 500 us and then every 1000us, which + prompt some interrupts. By doing this, our upcalls should always be well + clear of any calling function interrupt generation, which is on millisecond + boundaries. + + @return The return code from the program (always zero). */ +/* --------------------------------------------------------------------------*/ +int +main () +{ + printf ("Starting interrupt handler\n"); + excpt_int = (unsigned long)interrupt_handler; + + /* Enable interrupts */ + printf ("Enabling interrupts.\n"); + mtspr (SPR_SR, mfspr(SPR_SR) | SPR_SR_IEE); + mtspr (SPR_PICMR, 0xffffffff); + + /* Loop forever, upcalling at the desired intervals. */ + unsigned long int start = read_timer (); + + while (1) + { + static int do_read_p = 1; + static long int end_time = 500; + + while ((read_timer () - start) < end_time) + { + } + + /* Do our memory mapped upcall, alternating reads and writes. */ + if (do_read_p) + { + (void)getreg (GENERIC_BASE); + do_read_p = 0; + } + else + { + setreg (GENERIC_BASE, 0); + do_read_p = 1; + } + + /* Wait 1000us before next upcall. */ + end_time += 1000; + } + + /* We don't actually ever return */ + return 0; + +} /* main () */
openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-logger/int-logger-edge.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-logger/int-logger-level.c =================================================================== --- openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-logger/int-logger-level.c (nonexistent) +++ openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-logger/int-logger-level.c (revision 93) @@ -0,0 +1,116 @@ +/* int-logger-level.c. Test of Or1ksim handling of level triggered interrupts + + Copyright (C) 2010 Embecosm Limited + + Contributors various OpenCores participants + Contributor Jeremy Bennett + + This file is part of OpenRISC 1000 Architectural Simulator. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 3 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along + with this program. If not, see . */ + +/* ---------------------------------------------------------------------------- + This code is commented throughout for use with Doxygen. + --------------------------------------------------------------------------*/ + +#include "support.h" +#include "spr-defs.h" +#include "board.h" + + +/* --------------------------------------------------------------------------*/ +/*!Write a memory mapped register + + @param[in] addr Memory mapped address + @param[in] value Value to set */ +/* --------------------------------------------------------------------------*/ +static void +setreg (unsigned long addr, + unsigned char value) +{ + *((volatile unsigned char *) addr) = value; + +} /* setreg () */ + + +/* --------------------------------------------------------------------------*/ +/*!Read a memory mapped register + + @param[in] addr Memory mapped address + + @return Value read */ +/* --------------------------------------------------------------------------*/ +unsigned long +getreg (unsigned long addr) +{ + return *((volatile unsigned char *) addr); + +} /* getreg () */ + + +/* --------------------------------------------------------------------------*/ +/*!Generic interrupt handler + + This should receive the interrupt exception. Report the value in + PICSR. Clearing will be done externally. */ +/* --------------------------------------------------------------------------*/ +static void +interrupt_handler () +{ + unsigned long int picsr = mfspr (SPR_PICSR); + + /* Report the interrupt */ + printf ("PICSR = 0x%08lx\n", picsr); + + /* Request the interrupt be cleared with a write upcall. */ + setreg (GENERIC_BASE, 0); + +} /* interrupt_handler () */ + + +/* --------------------------------------------------------------------------*/ +/*!Main program to set up interrupt handler + + @return The return code from the program (always zero). */ +/* --------------------------------------------------------------------------*/ +int +main () +{ + printf ("Starting interrupt handler\n"); + excpt_int = (unsigned long)interrupt_handler; + + /* Enable interrupts */ + printf ("Enabling interrupts.\n"); + mtspr (SPR_SR, mfspr(SPR_SR) | SPR_SR_IEE); + mtspr (SPR_PICMR, 0xffffffff); + + /* Loop forever, upcalling reads every 500us to generate interrupts. */ + unsigned long int start = read_timer (); + + while (1) + { + static long int end_time = 500; + + while ((read_timer () - start) < end_time) + { + } + + /* Do our memory mapped upcall read to generate an interrupt. */ + (void)getreg (GENERIC_BASE); + } + + /* We don't actually ever return */ + return 0; + +} /* main () */
openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-logger/int-logger-level.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: openrisc/trunk/or1ksim/testsuite/test-code-or1k/ChangeLog =================================================================== --- openrisc/trunk/or1ksim/testsuite/test-code-or1k/ChangeLog (revision 92) +++ openrisc/trunk/or1ksim/testsuite/test-code-or1k/ChangeLog (revision 93) @@ -1,3 +1,28 @@ +2010-04-28 Jeremy Bennett + * int-logger/int-logger-edge.c: Created. + * int-logger/Makefile.am: Added int-logger-edge. + * int-logger/Makefile.in: Regenerated. + * upcalls/upcall-basic.c: Created. + * upcalls/upcall-misaligned.c: Created. + * upcalls/Makefile.am: Created. + * upcalls/Makefile.in: Regenerated. + +2010-04-25 Jeremy Bennett + * kbdtest/kbdtest.c (print_escaped_char): Added function to print + chars more clearly. + +2010-04-23 Jeremy Bennett + * configure.ac: Added new interrupt test make files. + * configure: Regenerated. + * int-logger/int-logger-level.c: Created. + * int-logger/Makefile.am: Created. + * int-logger/Makefile.in: Regenerated. + +2010-04-22 Jeremy Bennett + * support/support.c (print_base, printf_unsigned_base): Value and + base made unsigned. + (print_decimal): cast value to unsigned for call to print_base. + 2010-04-21 Jeremy Bennett * AUTHORS: Moved from parent directory * configure: Regenerated. Index: openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-test/int-test.S =================================================================== --- openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-test/int-test.S (revision 92) +++ openrisc/trunk/or1ksim/testsuite/test-code-or1k/int-test/int-test.S (revision 93) @@ -1,4 +1,4 @@ -/* int-test.S. Test of Or1ksim interrupt controller +/* int-test.S. Test of Or1ksim interrupt handling Copyright (C) 1999-2006 OpenCores Copyright (C) 2010 Embecosm Limited @@ -25,7 +25,9 @@ This code is commented throughout for use with Doxygen. --------------------------------------------------------------------------*/ -/* Within the test we'll use following global variables: +/* NOTE. This is not a test of the Programmable Interrupt Controller. + + Within the test we'll use following global variables: r16 interrupt counter r17 current tick timer comparison counter @@ -38,10 +40,11 @@ r25-r31 used by int handler The test do the following: - We set up the tick timer to trigger once and then we trigger interrupts incrementally - on every cycle in the specified test program; on interrupt handler we check if data computed - so far exactly matches precalculated values. If interrupt has returned incorreclty, we can - detect this using assertion routine at the end. + We set up the tick timer to trigger once and then we trigger interrupts + incrementally on every cycle in the specified test program; on interrupt + handler we check if data computed so far exactly matches precalculated + values. If interrupt has returned incorreclty, we can detect this using + assertion routine at the end. */ #include "spr-defs.h"
/openrisc/trunk/or1ksim/testsuite/test-code-or1k/Makefile.am
56,6 → 56,7
functest \
flag \
inst-set-test \
int-logger \
int-test \
kbdtest \
local-global \
69,4 → 70,5
mul \
mycompress \
tick \
uos
uos \
upcalls
/openrisc/trunk/or1ksim/testsuite/test-code-or1k/support/board.h
43,6 → 43,7
#define KBD_BASE_ADD 0x94000000
#define KBD_IRQ 5
#define MC_BASE_ADDR 0x93000000
#define GENERIC_BASE 0x98000000
#define DMA_BASE 0xb8000000
 
#endif
/openrisc/trunk/or1ksim/testsuite/test-code-or1k/support/support.c
128,9 → 128,9
@return the length of the string created. */
/* --------------------------------------------------------------------------*/
static int
print_base (long int uval,
char buf[],
int base)
print_base (long unsigned int uval,
char buf[],
unsigned int base)
{
/* Initially print backwards. Always have at least a zero. */
int i = 0;
271,7 → 271,7
digits. Allow for end of string marker */
char num_array[11];
 
int num_width = print_base (val, num_array, 10);
int num_width = print_base ((unsigned long int) val, num_array, 10);
 
/* Now print out the number. */
num_width += is_signed_p ? 1 : 0;
326,10 → 326,10
@return The number of chars printed */
/* --------------------------------------------------------------------------*/
static int
printf_unsigned_base (long int val,
int width,
int leading_zeros_p,
int base)
printf_unsigned_base (unsigned long int val,
int width,
int leading_zeros_p,
unsigned int base)
{
int is_signed_p = 0;
 
/openrisc/trunk/or1ksim/testsuite/lib/or1ksim.exp
66,6 → 66,11
 
expect {
 
$matchstr {
# String to match. Silently accept. Do first, so we can match
# specific warnings or errors if desired
}
 
-re "Warning" {
fail "$testname: warning: $expect_out(buffer)";
return
76,10 → 81,6
return
}
 
$matchstr {
# String to match. Silently accept
}
 
eof {
fail "$testname: hit EOF seeking match line $match_line";
return
/openrisc/trunk/or1ksim/testsuite/lib/libsim.exp
0,0 → 1,108
# Or1ksim library expect test functions for use with DejaGNU under automake
 
# Copyright (C) 2010 Embecosm Limited
 
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
# This file is part of OpenRISC 1000 Architectural Simulator.
 
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
 
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
 
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http:#www.gnu.org/licenses/>. */
 
# -----------------------------------------------------------------------------
# This code is commented throughout for use with Doxygen.
# -----------------------------------------------------------------------------
 
 
# -----------------------------------------------------------------------------
#! Run a libor1ksim program with the supplied config_file and target program.
#
#! @param[in] testname The name of the test
#! @param[in] match_list A list of expected responses
#! @param[in] libprog The libor1ksim program
#! @param[in] config The or1ksim config file to use
#! @param[in] or1kprog The program image to use on libprog
#! @param[in] args Any other arguments
# -----------------------------------------------------------------------------
proc run_libsim { testname match_list libprog config or1kprog args } {
global error_spawn_id
global spawn_id
global verbose
global env
 
# Construct the config filename or use the default
if {0 == [string length $config]} {
set config "default.cfg";
}
 
set libprog_name "./test-code/$libprog"
set config_name "$env(srcdir)/libsim.tests/$config";
set or1kprog_name "./test-code-or1k/$or1kprog"
 
set command_line "$libprog_name $config_name $or1kprog_name $args"
 
if { $verbose > 1 } {
send_user "starting $command_line\n"
}
 
# Run the program.
eval "spawn $command_line"
 
# Try each matchstr in turn, counting the lines for error reporting
set match_line 0;
 
foreach matchstr $match_list {
 
set match_line [expr {$match_line + 1}];
 
if { $verbose > 2 } {
send_user "matching |$matchstr|\n";
}
 
expect {
 
$matchstr {
# String to match. Silently accept. Do first, so we can match
# specific warnings or errors if desired
}
 
-re "Warning" {
fail "$testname: warning: $expect_out(buffer)";
return
}
 
-re "ERROR" {
fail "$testname: error: $expect_out(buffer)";
return
}
 
eof {
fail "$testname: hit EOF seeking match line $match_line";
return
}
timeout {
perror "Timeout";
fail "$testname: timeout";
return
}
}
}
 
# If we get here we've passed
pass $testname;
 
}
 
# Timeout 3 seconds is plenty as default
set timeout 3
/openrisc/trunk/or1ksim/testsuite/or1ksim.tests/cbasic.exp
44,7 → 44,7
"report(0xffffffff);" \
"report(0x00000d7a);" \
"report(0x00000d7a);" \
"RESULT: 0x21522153" \
"RESULT: 0xdeaddead" \
"report(0xdeaddead);" \
"exit(0)"] \
"" "cbasic/cbasic"
/openrisc/trunk/or1ksim/testsuite/or1ksim.tests/mul.exp
29,7 → 29,7
[list "x00000034" \
"00000000" \
"70a2588c" \
"59ced0cd, expected 59ced0cd" \
"a6312f33, expected a6312f33" \
"0d4de375, expected 0d4de375" \
"61ab48dc, expected 61ab48dc" \
"report(0xdeaddead);" \
/openrisc/trunk/or1ksim/testsuite/or1ksim.tests/mmu.exp
70,9 → 70,9
"tlbtr = 0017b3c0 dtlb_val = 000003c0" \
"ea = 4007e000 set = 63 way = 0" \
"tlbtr = 0017e3c0 dtlb_val = 000003c0" \
"ea = 7ff84004 set = 61 way = 0" \
"ea = 8007bffc set = 61 way = 0" \
"tlbtr = 0017b3c0 dtlb_val = 000003c0" \
"ea = 7ff82000 set = 63 way = 0" \
"ea = 8007e000 set = 63 way = 0" \
"tlbtr = 0017e3c0 dtlb_val = 000003c0" \
"ea = 0027c000 set = 62 way = 0" \
"tlbtr = 0017c3c0 dtlb_val = 000003c0" \
126,9 → 126,9
"ta = 0017bff8" \
"ea = 4007e000 set = 63 way = 0" \
"ta = 0017e000" \
"ea = 7ff84008 set = 61 way = 0" \
"ea = 8007bff8 set = 61 way = 0" \
"ta = 0017bff8" \
"ea = 7ff82000 set = 63 way = 0" \
"ea = 8007e000 set = 63 way = 0" \
"ta = 0017e000" \
"ea = 0027e000 set = 63 way = 0" \
"ta = 0017e000" \
/openrisc/trunk/or1ksim/testsuite/or1ksim.tests/kbdtest.exp
26,10 → 26,34
 
# Run the keyboard test. Note the need for double quoting of "backslash"
# characters.
run_or1ksim "kbdtest" \
[list "Reading from keyboard." \
"Enabling interrupts." \
"Te3+=-</.\\\\|\\\"'`}]\\\t !%^&)*" \
"report(0xdeaddead);" \
"exit(0)"] \
run_or1ksim "kbdtest" \
[list "Reading from keyboard." \
"Enabling interrupts." \
"Received 'T'" \
"Received 'e'" \
"Received '3'" \
"Received '+'" \
"Received '='" \
"Received '-'" \
"Received '<'" \
"Received '/'" \
"Received '.'" \
"Received '\\\\'" \
"Received '|'" \
"Received '\"'" \
"Received '\\\''" \
"Received '`'" \
"Received '}'" \
"Received ']'" \
"Received: TAB" \
"Received: SPACE" \
"Received '!'" \
"Received '%'" \
"Received '^'" \
"Received '&'" \
"Received ')'" \
"Received '*'" \
"Received: ENTER" \
"report(0xdeaddead);" \
"exit(0)"] \
"kbdtest.cfg" "kbdtest/kbdtest"
/openrisc/trunk/or1ksim/testsuite/or1ksim.tests/int-test.exp
1,4 → 1,4
# int-test.exp. Interrupt controller test using DejaGNU under automake
# int-test.exp. Interrupt test using DejaGNU under automake
 
# Copyright (C) 2010 Embecosm Limited
 
24,7 → 24,8
# -----------------------------------------------------------------------------
 
 
# Run the Interrupt controller test
# Run the Interrupt test. Note this is not a test of the Programmable
# Interrupt Controller.
run_or1ksim "int-test" \
[list "report(0x00000628);" \
"report(0x00000000);" \
/openrisc/trunk/or1ksim/testsuite/ChangeLog
1,3 → 1,32
2010-04-28 Jeremy Bennett <jeremy.bennett@embecosm.com>
* libsim.tests/upcalls.exp: Created.
* libsim.tests/upcalls.cfg: Created.
* test-code/lib-upcalls/lib-upcalls.c: Changed to use new upcall
interface.
* test-code/lib-inttest/lib-inttest-edge.c: Created.
* test-code/lib-inttest/lib-inttest-level.c: Changed to use new
upcall interface.
 
2010-04-25 Jeremy Bennett <jeremy.bennett@embecosm.com>
* libsim.tests/int-level.exp: Created.
* test-code/lib-upcalls: Created.
* test-code/lib-upcalls/lib-upcalls.c: Created.
* test-code/lib-upcalls/Makefile.am: Created.
* test-code/lib-upcalls/Makefile.in: Regenerated.
function to print chars more clearly.
* or1ksim.tests/kbd.exp: Updated for new test output format.
 
2010-04-23 Jeremy Bennett <jeremy.bennett@embecosm.com>
* test-code/lib-inttest/lib-inttest-level.c: Created.
* Makefile.am: Updated for new tests
* Makefile.in: Regenerated.
* README: Updated for new library test results.
 
2010-04-22 Jeremy Bennett <jeremy.bennett@embecosm.com>
* or1ksim.tests/cbasic.exp: Errors due to buggy printf fixed.
* or1ksim.tests/mmu.exp: Errors due to buggy printf fixed.
* or1ksim.tests/mul.exp: Errors due to buggy printf fixed.
 
2010-04-21 Jeremy Bennett <jeremy.bennett@embecosm.com>
* test-code-or1k: Renamed from test-code.
* configure.ac, configure: Moved to test-code-or1k.
/openrisc/trunk/or1ksim/testsuite/test-code/Makefile.in
247,7 → 247,10
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = lib-iftest
SUBDIRS = lib-iftest \
lib-inttest \
lib-upcalls
 
all: all-recursive
 
.SUFFIXES:
/openrisc/trunk/or1ksim/testsuite/test-code/lib-upcalls/Makefile.in
0,0 → 1,515
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
 
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
 
@SET_MAKE@
 
# Makefile.am for libor1ksim test program: lib-upcalls
 
# Copyright (C) Embecosm Limited, 2010
 
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
# This file is part of OpenRISC 1000 Architectural Simulator.
 
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
 
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
 
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http:#www.gnu.org/licenses/>. */
 
# -----------------------------------------------------------------------------
# This code is commented throughout for use with Doxygen.
# -----------------------------------------------------------------------------
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
check_PROGRAMS = lib-upcalls$(EXEEXT)
subdir = testsuite/test-code/lib-upcalls
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am_lib_upcalls_OBJECTS = lib-upcalls.$(OBJEXT)
lib_upcalls_OBJECTS = $(am_lib_upcalls_OBJECTS)
lib_upcalls_DEPENDENCIES = $(top_builddir)/libsim.la
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(lib_upcalls_SOURCES)
DIST_SOURCES = $(lib_upcalls_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
ARFLAGS = @ARFLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_DIR = @BUILD_DIR@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPU_ARCH = @CPU_ARCH@
CYGPATH_W = @CYGPATH_W@
DEBUGFLAGS = @DEBUGFLAGS@
DEFS = @DEFS@
DEJAGNU = @DEJAGNU@
DEPDIR = @DEPDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INCLUDES = @INCLUDES@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LOCAL_CFLAGS = @LOCAL_CFLAGS@
LOCAL_DEFS = @LOCAL_DEFS@
LOCAL_LDFLAGS = @LOCAL_LDFLAGS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POW_LIB = @POW_LIB@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SUMVERSION = @SUMVERSION@
TERMCAP_LIB = @TERMCAP_LIB@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
subdirs = @subdirs@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
 
# Edge based interrupt
lib_upcalls_SOURCES = lib-upcalls.c
lib_upcalls_LDADD = $(top_builddir)/libsim.la
all: all-am
 
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu testsuite/test-code/lib-upcalls/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu testsuite/test-code/lib-upcalls/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
 
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
 
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
lib-upcalls$(EXEEXT): $(lib_upcalls_OBJECTS) $(lib_upcalls_DEPENDENCIES)
@rm -f lib-upcalls$(EXEEXT)
$(LINK) $(lib_upcalls_OBJECTS) $(lib_upcalls_LDADD) $(LIBS)
 
mostlyclean-compile:
-rm -f *.$(OBJEXT)
 
distclean-compile:
-rm -f *.tab.c
 
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib-upcalls.Po@am__quote@
 
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
 
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
 
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
 
mostlyclean-libtool:
-rm -f *.lo
 
clean-libtool:
-rm -rf .libs _libs
 
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
 
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
 
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
 
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
 
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
 
clean-generic:
 
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
 
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
mostlyclean-am
 
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
 
dvi: dvi-am
 
dvi-am:
 
html: html-am
 
html-am:
 
info: info-am
 
info-am:
 
install-data-am:
 
install-dvi: install-dvi-am
 
install-dvi-am:
 
install-exec-am:
 
install-html: install-html-am
 
install-html-am:
 
install-info: install-info-am
 
install-info-am:
 
install-man:
 
install-pdf: install-pdf-am
 
install-pdf-am:
 
install-ps: install-ps-am
 
install-ps-am:
 
installcheck-am:
 
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
 
mostlyclean: mostlyclean-am
 
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
 
pdf: pdf-am
 
pdf-am:
 
ps: ps-am
 
ps-am:
 
uninstall-am:
 
.MAKE: check-am install-am install-strip
 
.PHONY: CTAGS GTAGS all all-am check check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool ctags \
distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am
 
 
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
/openrisc/trunk/or1ksim/testsuite/test-code/lib-upcalls/lib-upcalls.c
0,0 → 1,376
/* lib-upcalls.c. Test of Or1ksim library upcall interface.
 
Copyright (C) 1999-2006 OpenCores
Copyright (C) 2010 Embecosm Limited
 
Contributors various OpenCores participants
Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
This file is part of OpenRISC 1000 Architectural Simulator.
 
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.
 
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
 
You should have received a copy of the GNU General Public License along
with this program. If not, see <http: www.gnu.org/licenses/>. */
 
/* ----------------------------------------------------------------------------
This code is commented throughout for use with Doxygen.
--------------------------------------------------------------------------*/
 
#include <errno.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
 
#include "or1ksim.h"
 
 
/*! Memory mapped register memory */
static unsigned char *regv;
 
/*! Number of bytes of register memory */
static int regc;
 
/*! Number of times each upcall has been called */
static int upcall_count;
 
 
/* --------------------------------------------------------------------------*/
/*!Read upcall
 
Upcall from Or1ksim to read a word from an external peripheral. Read the
specified bytes from the peripheral if available.
 
We only ever expect to get 4 byte reads here (modeling Wishbone).
 
@note We receive the full address, since there is a single upcall routine,
and this allows us to decode between potentially multiple devices.
 
@todo We assume that the register memory size is a power of 2, making
address shortening a simple modulo exercise. We should use a more
generic solution.
 
@note The mask is a byte mask. Since this is testing, we warn if any byte
is not either 0xff or 0x00.
 
@param[in] class_ptr A handle pass back from the initalization. Intended
for C++ callers, not used here.
@param[in] addr Address to read from.
@param[in] mask Byte mask for the read.
@param[out] rdata Buffer for the data read.
@param[in] data_len Number of bytes in mask and rdata.
 
@return Zero on success, non-zero on failure. */
/* --------------------------------------------------------------------------*/
static int
read_upcall (void *class_ptr,
unsigned long int addr,
unsigned char mask[],
unsigned char rdata[],
int data_len)
{
unsigned long int devaddr = addr % regc;
 
upcall_count--; /* One less upcall to do */
 
if (4 != data_len)
{
printf ("Warning: 4-byte reads only supported for this device.\n");
return -1;
}
 
if (devaddr > regc - data_len)
{
printf ("Warning: read from 0x%08lx out of range: zero result.\n",
devaddr);
return -1;
}
 
/* Read the data */
int i;
 
for (i = 0; i < 4; i++)
{
switch (mask[i])
{
case 0x00: rdata[i] = 0; break;
case 0xff: rdata[i] = regv[devaddr + i]; break;
 
default:
printf ("Warning: invalid mask byte %d for read 0x%02x: "
"treated as 0xff.\n", i, mask[i]);
rdata[i] = regv[devaddr + i];
break;
}
}
 
/* printf ("Read from 0x%08lx: vector [%02x %02x %02x %02x ], " */
/* "mask [%02x %02x %02x %02x ].\n", devaddr, rdata[0], rdata[1], */
/* rdata[2], rdata[3], mask[0], mask[1], mask[2], mask[3]); */
 
return 0; /* Success */
 
} /* read_upcall () */
 
 
/* --------------------------------------------------------------------------*/
/*!Write upcall
 
Upcall from Or1ksim to write a word to an external peripheral. Read the
specified bytes from the peripheral if available.
 
We only ever expect to get 4 byte reads here (modeling Wishbone).
 
@note We receive the full address, since there is a single upcall routine,
and this allows us to decode between potentially multiple devices.
 
@todo We assume that the register memory size is a power of 2, making
address shortening a simple modulo exercise. We should use a more
generic solution.
 
@note The mask is a byte mask. Since this is testing, we warn if any byte
is not either 0xff or 0x00.
 
@param[in] class_ptr A handle pass back from the initalization. Intended
for C++ callers, not used here.
@param[in] addr Address to write to.
@param[in] mask Byte mask for the write.
@param[in] wdata The data to write.
@param[in] data_len Number of bytes in mask and rdata.
 
@return Zero on success, non-zero on failure. */
/* --------------------------------------------------------------------------*/
static int
write_upcall (void *class_ptr,
unsigned long int addr,
unsigned char mask[],
unsigned char wdata[],
int data_len)
{
unsigned long int devaddr = addr % regc;
 
upcall_count--; /* One less upcall to do */
 
if (4 != data_len)
{
printf ("Warning: 4-byte writes only supported for this device.\n");
return -1;
}
 
if (devaddr > regc - data_len)
{
printf ("Warning: write to 0x%08lx out of range: ignored.\n",
devaddr);
return -1;
}
 
/* printf ("Write to 0x%08lx: vector [%02x %02x %02x %02x ], " */
/* "mask [%02x %02x %02x %02x ].\n", devaddr, wdata[0], wdata[1], */
/* wdata[2], wdata[3], mask[0], mask[1], mask[2], mask[3]); */
 
/* Write the data */
int i;
 
for (i = 0; i < 4; i++)
{
switch (mask[i])
{
case 0x00: break;
case 0xff: regv[devaddr + i] = wdata[i]; break;
 
default:
printf ("Warning: invalid mask byte %d for write 0x%02x: "
"treated as 0xff.\n", i, mask[i]);
regv[devaddr + i] = wdata[i];
break;
}
}
 
return 0; /* Success */
 
} /* write_upcall () */
 
 
/* --------------------------------------------------------------------------*/
/*!Main program
 
Build an or1ksim program using the library which loads a program and config
from the command line which will drive upcalls.
 
lib-upcalls <config-file> <image> <upcall_count> <reg_bytes> [<reg_file>]
 
A register memory of <reg_bytes> bytes is initalized from <reg_file> if
present, or zeroed if not. <image> is run continuously, making upcalls,
which are satisfied using the register memory. The program exits
successfully when <upcall_count> upcalls have been made.
 
@note The endianness is specified on the command line, rather than being
read from the or1ksim library, to allow tests for mismatched
assumptions when using the library.
 
@param[in] argc Number of elements in argv
@param[in] argv Vector of program name and arguments
 
@return Return code for the program. */
/* --------------------------------------------------------------------------*/
int
main (int argc,
char *argv[])
{
char *reg_file;
 
/* Parse args */
switch (argc)
{
case 5:
reg_file = NULL;
break;
 
case 6:
reg_file = argv[5];
break;
 
default:
printf ("usage: lib-upcalls <config-file> <image> "
"<upcall_count> <reg_bytes> [<reg_file>]\n");
return 1;
}
 
upcall_count = atoi (argv[3]);
 
if (upcall_count <= 0)
{
printf ("ERROR: Upcall count must be positive\n");
return 1;
}
 
regc = atoi (argv[4]);
 
if (regc < 0)
{
printf ("ERROR: Register memory size must be positive\n");
return 1;
}
 
/* Read the register file if provided. */
regv = malloc (regc * sizeof (unsigned char));
 
if (NULL == regv)
{
printf ("ERROR: Failed to allocate register memory\n");
return 1;
}
 
int next_free_byte = 0;
 
if (NULL != reg_file)
{
FILE *fd = fopen (reg_file, "r");
 
if (NULL == fd)
{
printf ("ERROR: Failed to open register file: %s\n",
strerror (errno));
free (regv);
return 1;
}
 
for (; next_free_byte < regc; next_free_byte++)
{
unsigned char byte;
 
if (1 == fscanf (fd, "%2hhx ", &byte))
{
regv[next_free_byte] = byte;
}
else
{
break;
}
}
 
/* Should have read the whole file successfully. */
if (ferror (fd))
{
printf ("ERROR: Reading register file: %s\n", strerror (errno));
free (regv);
return 1;
}
if (!feof (fd))
{
printf ("Warning: additional register file data ignored.\n");
}
 
if (0 != fclose (fd))
{
printf ("ERROR: Failed to close register file: %s\n",
strerror (errno));
free (regv);
return 1;
}
}
 
/* Fill in any remaining bytes with zero */
if (next_free_byte < regc)
{
(void)memset (&(regv[next_free_byte]), 0, regc - next_free_byte);
}
 
/* Initialize the program. Put the initialization message afterwards, or it
will get swamped by the Or1ksim header. */
if (0 == or1ksim_init (argv[1], argv[2], NULL, &read_upcall, &write_upcall))
{
printf ("Initalization succeeded.\n");
}
else
{
printf ("Initalization failed.\n");
return 1;
}
 
/* Run repeatedly for 1 millisecond until we hit a breakpoint or all upcalls
are done. */
do
{
switch (or1ksim_run (1.0e-3))
{
case OR1KSIM_RC_OK:
break;
 
case OR1KSIM_RC_BRKPT:
printf ("Test completed successfully: hit breakpoint.\n");
return 0;
 
default:
printf ("ERROR: run failed\n");
return 1;
}
}
while (upcall_count > 0);
 
/* A little longer to allow response to last upcall to be handled. */
switch (or1ksim_run (1.0e-3))
{
case OR1KSIM_RC_OK:
printf ("Test completed successfully: All upcalls processed.\n");
return 0;
 
case OR1KSIM_RC_BRKPT:
printf ("Test completed successfully: hit breakpoint.\n");
return 0;
 
default:
printf ("ERROR: run failed\n");
return 1;
}
} /* main () */
openrisc/trunk/or1ksim/testsuite/test-code/lib-upcalls/lib-upcalls.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: openrisc/trunk/or1ksim/testsuite/test-code/lib-upcalls/Makefile.am =================================================================== --- openrisc/trunk/or1ksim/testsuite/test-code/lib-upcalls/Makefile.am (nonexistent) +++ openrisc/trunk/or1ksim/testsuite/test-code/lib-upcalls/Makefile.am (revision 93) @@ -0,0 +1,33 @@ +# Makefile.am for libor1ksim test program: lib-upcalls + +# Copyright (C) Embecosm Limited, 2010 + +# Contributor Jeremy Bennett + +# This file is part of OpenRISC 1000 Architectural Simulator. + +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 3 of the License, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. + +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . */ + +# ----------------------------------------------------------------------------- +# This code is commented throughout for use with Doxygen. +# ----------------------------------------------------------------------------- + + +# A generic program to handle upcalls. +check_PROGRAMS = lib-upcalls + +# Edge based interrupt +lib_upcalls_SOURCES = lib-upcalls.c + +lib_upcalls_LDADD = $(top_builddir)/libsim.la
openrisc/trunk/or1ksim/testsuite/test-code/lib-upcalls/Makefile.am Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: openrisc/trunk/or1ksim/testsuite/test-code/Makefile.am =================================================================== --- openrisc/trunk/or1ksim/testsuite/test-code/Makefile.am (revision 92) +++ openrisc/trunk/or1ksim/testsuite/test-code/Makefile.am (revision 93) @@ -26,4 +26,6 @@ # Subdirs for each test program. -SUBDIRS = lib-iftest +SUBDIRS = lib-iftest \ + lib-inttest \ + lib-upcalls
/openrisc/trunk/or1ksim/testsuite/test-code/lib-inttest/lib-inttest-edge.c
0,0 → 1,216
/* lib-inttest-edge.c. Test of Or1ksim library edge triggered interrupt funcs.
 
Copyright (C) 1999-2006 OpenCores
Copyright (C) 2010 Embecosm Limited
 
Contributors various OpenCores participants
Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
This file is part of OpenRISC 1000 Architectural Simulator.
 
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.
 
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
 
You should have received a copy of the GNU General Public License along
with this program. If not, see <http: www.gnu.org/licenses/>. */
 
/* ----------------------------------------------------------------------------
This code is commented throughout for use with Doxygen.
--------------------------------------------------------------------------*/
 
#include <stdlib.h>
#include <stdio.h>
 
#include "or1ksim.h"
 
 
/*! Number of interrupts in PIC */
#define NUM_INTS 32
 
/*! Globally shared pointer to the interrupts */
char **intv;
 
/*! Number of interrupts to process */
int intc;
 
 
/* --------------------------------------------------------------------------*/
/*!Trigger the next interrupt
 
Generate the next edge triggered interrupt. Put out a message if doing so,
and warn if the interrupt would be invalid.
 
@return 1 (true) if an interrupt was triggered, 0 (false) otherwise. */
/* --------------------------------------------------------------------------*/
static int
do_next_int ()
{
static int next_int = 0; /* Next interrupt to process */
 
while (next_int < intc)
{
int inum = atoi (intv[next_int++]);
 
if ((0 <= inum) && (inum < NUM_INTS))
{
printf ("Triggering interrupt %d\n", inum);
or1ksim_interrupt (inum);
return 1;
}
else
{
printf ("Warning: Invalid interrupt # %d - ignored\n", inum);
}
}
 
return 0; /* No more interrupts to trigger */
 
} /* do_next_int () */
 
 
/* --------------------------------------------------------------------------*/
/*!Read upcall
 
Upcall from Or1ksim to read a word from an external peripheral. If called
this will trigger an interrupt.
 
@param[in] class_ptr A handle pass back from the initalization. Intended
for C++ callers, not used here.
@param[in] addr Address to read from. Ignored here.
@param[in] mask Byte mask for the read. Ignored here.
@param[out] rdata Buffer for the data read. Ignored here.
@param[in] data_len Number of bytes in mask and rdata.
 
@return Zero on success, non-zero on failure. Always zero here. */
/* --------------------------------------------------------------------------*/
static int
read_upcall (void *class_ptr,
unsigned long int addr,
unsigned char mask[],
unsigned char rdata[],
int data_len)
{
do_next_int ();
 
return 0; /* Success */
 
} /* read_upcall () */
 
 
/* --------------------------------------------------------------------------*/
/*!Write upcall
 
Upcall from Or1ksim to write a word to an external peripheral. If called
this will trigger an interrupt.
 
@param[in] class_ptr A handle pass back from the initalization. Intended
for C++ callers, not used here.
@param[in] addr Address to write to. Ignored here.
@param[in] mask Byte mask for the write. Ignored here.
@param[in] wdata The data to write. Ignored here.
@param[in] data_len Number of bytes in mask and rdata.
 
@return Zero on success, non-zero on failure. Always zero here. */
/* --------------------------------------------------------------------------*/
static int
write_upcall (void *class_ptr,
unsigned long int addr,
unsigned char mask[],
unsigned char wdata[],
int data_len)
{
do_next_int ();
 
return 0; /* Success */
 
} /* write_upcall () */
 
 
/* --------------------------------------------------------------------------*/
/*!Main program
 
Build an or1ksim program using the library which loads a program and config
from the command line, and then drives interrupts. Usage:
 
lib-inttest-edge <config-file> <image> <duration_ms> <int #> <int #> ...
 
<image> is run for repeated perios of <duration_ms>, during which it
will make upcalls. Between each period and during each upcall an edge based
interrupt will be triggered, until all interrupts listed have been
triggered.
 
@param[in] argc Number of elements in argv
@param[in] argv Vector of program name and arguments
 
@return Return code for the program. */
/* --------------------------------------------------------------------------*/
int
main (int argc,
char *argv[])
{
/* Parse args */
if (argc < 5)
{
fprintf (stderr,
"usage: lib-inttest-edge <config-file> <image> <duration_ms> "
"<int #> <int #> ...\n");
return 1;
}
 
int duration_ms = atoi (argv[3]);
double duration = (double) duration_ms / 1.0e3;
 
if (duration_ms <= 0)
{
fprintf (stderr, "ERROR. Duration must be positive number of ms\n");
return 1;
}
 
/* Initialize the program. Put the initialization message afterwards, or it
will get swamped by the Or1ksim header. */
if (0 == or1ksim_init (argv[1], argv[2], NULL, &read_upcall, &write_upcall))
{
printf ("Initalization succeeded.\n");
}
else
{
printf ("Initalization failed.\n");
return 1;
}
 
/* Do each interrupt in turn. Set up the shared pointer to the interrupts
and counter. */
intv = &(argv[4]);
intc = argc - 4;
 
do
{
/* Run the code */
if (OR1KSIM_RC_OK != or1ksim_run (duration))
{
printf ("ERROR: run failed\n");
return 1;
}
}
while (do_next_int ());
 
/* One more run, to allow interrupt handler enough time to finish
processing. */
if (OR1KSIM_RC_OK != or1ksim_run (duration))
{
printf ("ERROR: run failed\n");
return 1;
}
 
/* All interrupts should have been handled. */
printf ("Test completed successfully.\n");
return 0;
 
} /* main () */
openrisc/trunk/or1ksim/testsuite/test-code/lib-inttest/lib-inttest-edge.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: openrisc/trunk/or1ksim/testsuite/test-code/lib-inttest/Makefile.in =================================================================== --- openrisc/trunk/or1ksim/testsuite/test-code/lib-inttest/Makefile.in (nonexistent) +++ openrisc/trunk/or1ksim/testsuite/test-code/lib-inttest/Makefile.in (revision 93) @@ -0,0 +1,527 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile.am for libor1ksim test program: lib-inttest + +# Copyright (C) Embecosm Limited, 2010 + +# Contributor Jeremy Bennett + +# This file is part of OpenRISC 1000 Architectural Simulator. + +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 3 of the License, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. + +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . */ + +# ----------------------------------------------------------------------------- +# This code is commented throughout for use with Doxygen. +# ----------------------------------------------------------------------------- +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +check_PROGRAMS = lib-inttest-edge$(EXEEXT) lib-inttest-level$(EXEEXT) +subdir = testsuite/test-code/lib-inttest +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am_lib_inttest_edge_OBJECTS = lib-inttest-edge.$(OBJEXT) +lib_inttest_edge_OBJECTS = $(am_lib_inttest_edge_OBJECTS) +lib_inttest_edge_DEPENDENCIES = $(top_builddir)/libsim.la +am_lib_inttest_level_OBJECTS = lib-inttest-level.$(OBJEXT) +lib_inttest_level_OBJECTS = $(am_lib_inttest_level_OBJECTS) +lib_inttest_level_DEPENDENCIES = $(top_builddir)/libsim.la +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(lib_inttest_edge_SOURCES) $(lib_inttest_level_SOURCES) +DIST_SOURCES = $(lib_inttest_edge_SOURCES) \ + $(lib_inttest_level_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_DIR = @BUILD_DIR@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPU_ARCH = @CPU_ARCH@ +CYGPATH_W = @CYGPATH_W@ +DEBUGFLAGS = @DEBUGFLAGS@ +DEFS = @DEFS@ +DEJAGNU = @DEJAGNU@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INCLUDES = @INCLUDES@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCAL_CFLAGS = @LOCAL_CFLAGS@ +LOCAL_DEFS = @LOCAL_DEFS@ +LOCAL_LDFLAGS = @LOCAL_LDFLAGS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SUMVERSION = @SUMVERSION@ +TERMCAP_LIB = @TERMCAP_LIB@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# Edge based interrupt +lib_inttest_edge_SOURCES = lib-inttest-edge.c +lib_inttest_edge_LDADD = $(top_builddir)/libsim.la + +# Level based interrupt +lib_inttest_level_SOURCES = lib-inttest-level.c +lib_inttest_level_LDADD = $(top_builddir)/libsim.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu testsuite/test-code/lib-inttest/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu testsuite/test-code/lib-inttest/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +lib-inttest-edge$(EXEEXT): $(lib_inttest_edge_OBJECTS) $(lib_inttest_edge_DEPENDENCIES) + @rm -f lib-inttest-edge$(EXEEXT) + $(LINK) $(lib_inttest_edge_OBJECTS) $(lib_inttest_edge_LDADD) $(LIBS) +lib-inttest-level$(EXEEXT): $(lib_inttest_level_OBJECTS) $(lib_inttest_level_DEPENDENCIES) + @rm -f lib-inttest-level$(EXEEXT) + $(LINK) $(lib_inttest_level_OBJECTS) $(lib_inttest_level_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib-inttest-edge.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib-inttest-level.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: openrisc/trunk/or1ksim/testsuite/test-code/lib-inttest/lib-inttest-level.c =================================================================== --- openrisc/trunk/or1ksim/testsuite/test-code/lib-inttest/lib-inttest-level.c (nonexistent) +++ openrisc/trunk/or1ksim/testsuite/test-code/lib-inttest/lib-inttest-level.c (revision 93) @@ -0,0 +1,295 @@ +/* lib-inttest-level.c. Test of Or1ksim library level triggered interrupt funcs. + + Copyright (C) 1999-2006 OpenCores + Copyright (C) 2010 Embecosm Limited + + Contributors various OpenCores participants + Contributor Jeremy Bennett + + This file is part of OpenRISC 1000 Architectural Simulator. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 3 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along + with this program. If not, see . */ + +/* ---------------------------------------------------------------------------- + This code is commented throughout for use with Doxygen. + --------------------------------------------------------------------------*/ + +#include +#include +#include + +#include "or1ksim.h" + + +/*! Number of interrupts in PIC */ +#define NUM_INTS 32 + +/*! Vector of interrupts to be raised */ +static int *raisev; + +/*! Count of interrupts to be raised */ +static int raisec = 0; + +/*! Next interrupt to be raised */ +static int next_raise = 0; + +/*! Vector of interrupts to be cleared */ +static int *clearv; + +/*! Count of interrupts to be cleared */ +static int clearc = 0; + +/*! Next interrupt to be cleared */ +static int next_clear = 0; + + +/* --------------------------------------------------------------------------*/ +/*!Read upcall + + Upcall from Or1ksim to read a word from an external peripheral. If called + this will raise the next interrupt. + + @param[in] class_ptr A handle pass back from the initalization. Intended + for C++ callers, not used here. + @param[in] addr Address to read from. Ignored here. + @param[in] mask Byte mask for the read. Ignored here. + @param[out] rdata Buffer for the data read. Ignored here. + @param[in] data_len Number of bytes in mask and rdata. + + @return Zero on success, non-zero on failure. Always zero here. */ +/* --------------------------------------------------------------------------*/ +static int +read_upcall (void *class_ptr, + unsigned long int addr, + unsigned char mask[], + unsigned char rdata[], + int data_len) +{ + /* Raise an interrupt if there is one left to raise. */ + if ((NULL != raisev) && (next_raise < raisec)) + { + printf ("Raising interrupt %d\n", raisev[next_raise]); + or1ksim_interrupt_set (raisev[next_raise++]); + } + + return 0; /* Success */ + +} /* read_upcall () */ + + +/* --------------------------------------------------------------------------*/ +/*!Write upcall + + Upcall from Or1ksim to write a word to an external peripheral. If called + this will clear the next interrupt. + + @param[in] class_ptr A handle pass back from the initalization. Intended + for C++ callers, not used here. + @param[in] addr Address to write to. Ignored here. + @param[in] mask Byte mask for the write. Ignored here. + @param[in] wdata The data to write. Ignored here. + @param[in] data_len Number of bytes in mask and rdata. + + @return Zero on success, non-zero on failure. Always zero here. */ +/* --------------------------------------------------------------------------*/ +static int +write_upcall (void *class_ptr, + unsigned long int addr, + unsigned char mask[], + unsigned char wdata[], + int data_len) +{ + /* Clear an interrupt if there is one left to clear. */ + if ((NULL != clearv) && (next_clear < clearc)) + { + printf ("Clearing interrupt %d\n", clearv[next_clear]); + or1ksim_interrupt_clear (clearv[next_clear++]); + } + + return 0; /* Success */ + +} /* write_upcall () */ + + +/* --------------------------------------------------------------------------*/ +/*!Main program + + Build an or1ksim program using the library which loads a program and config + from the command line, and then drives interrupts. Usage: + + lib-inttest-level +|- +|- ... + + is run continuously. It requests that an interrupt be raised by a + read upcall and cleared by a write upcall. The sequence of interrupts is + specified to be raised (if preceded by '+') or cleared (if preceded by + '-'). This allows the program to test the effect of clearing the wrong + interrupt. + + @param[in] argc Number of elements in argv + @param[in] argv Vector of program name and arguments + + @return Return code for the program. */ +/* --------------------------------------------------------------------------*/ +int +main (int argc, + char *argv[]) +{ + /* Parse args */ + if (argc < 4) + { + fprintf (stderr, + "usage: lib-inttest-level " + "+|- +|- ...\n"); + return 1; + } + + /* Get all the interrupts sorted out. Count them, then place them in a + vector. */ + int i; + + for (i = 3; i < argc; i++) + { + int inum; + + switch (argv[i][0]) + { + case '+': + inum = atoi (&(argv[i][1])); + + if ((0 <= inum) && (inum < NUM_INTS)) + { + raisec++; + } + else + { + printf ("Warning: Invalid interrupt # %d to raise.\n", inum); + } + + break; + + case '-': + inum = atoi (&(argv[i][1])); + + if ((0 <= inum) && (inum < NUM_INTS)) + { + clearc++; + } + else + { + printf ("Warning: Invalid interrupt # %d to clear.\n", inum); + } + + break; + + + default: + printf ("Warning: No raise/clear specified - ignored\n"); + break; + } + } + + if ((0 == raisec) && (0 == clearc)) + { + printf ("ERROR: No interrupts specified.\n"); + return 1; + } + + /* Allocate space and populate the vectors. */ + raisev = (raisec > 0) ? calloc (raisec, sizeof (int)) : NULL; + clearv = (clearc > 0) ? calloc (clearc, sizeof (int)) : NULL; + + raisec = 0; + clearc = 0; + + for (i = 3; i < argc; i++) + { + int inum; + + switch (argv[i][0]) + { + case '+': + inum = atoi (&(argv[i][1])); + + if ((0 <= inum) && (inum < NUM_INTS)) + { + raisev[raisec++] = inum; + } + + break; + + case '-': + inum = atoi (&(argv[i][1])); + + if ((0 <= inum) && (inum < NUM_INTS)) + { + clearv[clearc++] = inum; + } + + break; + + + default: + printf ("Warning: No raise/clear specified - ignored\n"); + break; + } + } + + /* Start the counts */ + next_raise = 0; + next_clear = 0; + + /* Initialize the program. Put the initialization message afterwards, or it + will get swamped by the Or1ksim header. */ + if (0 == or1ksim_init (argv[1], argv[2], NULL, &read_upcall, &write_upcall)) + { + printf ("Initalization succeeded.\n"); + } + else + { + printf ("Initalization failed.\n"); + free (raisev); + free (clearv); + return 1; + } + + /* Run in bursts of 1ms until all interrupts have been set and cleared. */ + do + { + if (OR1KSIM_RC_OK != or1ksim_run (1.0e-3)) + { + printf ("ERROR: run failed\n"); + free (raisev); + free (clearv); + return 1; + } + } + while ((next_raise < raisec) || (next_clear < clearc)); + + /* One more burst to allow the device driver time to complete. */ + if (OR1KSIM_RC_OK != or1ksim_run (1.0e-3)) + { + printf ("ERROR: run failed\n"); + free (raisev); + free (clearv); + return 1; + } + + /* All interrupts should have been handled. */ + free (raisev); + free (clearv); + + printf ("Test completed successfully.\n"); + return 0; + +} /* main () */
openrisc/trunk/or1ksim/testsuite/test-code/lib-inttest/lib-inttest-level.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: openrisc/trunk/or1ksim/testsuite/test-code/lib-inttest/Makefile.am =================================================================== --- openrisc/trunk/or1ksim/testsuite/test-code/lib-inttest/Makefile.am (nonexistent) +++ openrisc/trunk/or1ksim/testsuite/test-code/lib-inttest/Makefile.am (revision 93) @@ -0,0 +1,40 @@ +# Makefile.am for libor1ksim test program: lib-inttest + +# Copyright (C) Embecosm Limited, 2010 + +# Contributor Jeremy Bennett + +# This file is part of OpenRISC 1000 Architectural Simulator. + +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 3 of the License, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. + +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . */ + +# ----------------------------------------------------------------------------- +# This code is commented throughout for use with Doxygen. +# ----------------------------------------------------------------------------- + + +# Test programs of the library interrupt driving functions. Two versions, one +# to drive edge based interrupts, one to drive level based interrupts. +check_PROGRAMS = lib-inttest-edge \ + lib-inttest-level + +# Edge based interrupt +lib_inttest_edge_SOURCES = lib-inttest-edge.c + +lib_inttest_edge_LDADD = $(top_builddir)/libsim.la + +# Level based interrupt +lib_inttest_level_SOURCES = lib-inttest-level.c + +lib_inttest_level_LDADD = $(top_builddir)/libsim.la
openrisc/trunk/or1ksim/testsuite/test-code/lib-inttest/Makefile.am Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: openrisc/trunk/or1ksim/testsuite/README =================================================================== --- openrisc/trunk/or1ksim/testsuite/README (revision 92) +++ openrisc/trunk/or1ksim/testsuite/README (revision 93) @@ -12,8 +12,8 @@ Tests are provided for the standalone simulator (or1ksim) and for the library (libsim.a). -At the time of writing a total of 21 tests of the standalone simulator compile -run and pass and 1 test of the library. +At the time of writing a total of 21 tests of the standalone simulator and 14 +tests of the library compile, run and pass. Configuration and make files are provided for further test programs. These come in three categories. @@ -45,8 +45,15 @@ Working tests ============= -A total of 21 tests: +A total of 14 tests of the libsim library: +int-edge: 6 tests of edge triggered interrupts. +int-level: 5 tests of level triggered interrupts. +lib-iftest: A test of the basic library interface functions. +upcalls: 2 tests of the upcall interface. + +A total of 21 tests of standalone Or1ksim: + basic: A test or a wide range of instructions and registers. cache: A test of the Or1ksim cache modeling cbasic: A minimal test in C @@ -72,8 +79,8 @@ Tests which build, but do not run to completion =============================================== -The following tests rely on VAPI in Or1ksim, so need a client to provide test -data over TCP/IP. +The following tests of standalone Or1ksim rely on VAPI in Or1ksim, so need a +client to provide test data over TCP/IP. acv-gpio: a test of the GPIO. acv-uart: a test of the UART @@ -81,8 +88,9 @@ Tests which build, but do not run at all ======================================== -These tests (which are built by the make file), do not appear to run at -all. The problem is in the linker script and/or the configuration for Or1ksim. +These tests of standalone Or1ksim (which are built by the make file), do not +appear to run at all. The problem is in the linker script and/or the +configuration for Or1ksim. mc-async: a test of the memory controller with asynchronous memory. mc-dram: a test of the memory controller with DRAM. @@ -93,10 +101,10 @@ Tests which do not build ======================== -The following test builds with a myriad of warnings. +The following test of standalone Or1ksim builds with a myriad of warnings. inst-set-test: a comprehensive test of the instruction set using C. -Upated by Jeremy Bennett (jeremy@jeremybennett.com) -19 April 2010 +Updated by Jeremy Bennett (jeremy@jeremybennett.com) +28 April 2010
/openrisc/trunk/or1ksim/peripheral/generic.c
81,129 → 81,30
};
 
 
/* Convert a 32-bit value from host to model endianess */
static unsigned long int
htoml (unsigned long int host_val)
{
unsigned char model_array[4];
/* --------------------------------------------------------------------------*/
/*!Read a byte from an external device
 
#ifdef OR32_BIG_ENDIAN
model_array[0] = (host_val >> 24) & 0xff;
model_array[1] = (host_val >> 16) & 0xff;
model_array[2] = (host_val >> 8) & 0xff;
model_array[3] = (host_val ) & 0xff;
#else
model_array[0] = (host_val ) & 0xff;
model_array[1] = (host_val >> 8) & 0xff;
model_array[2] = (host_val >> 16) & 0xff;
model_array[3] = (host_val >> 24) & 0xff;
#endif
To model Wishbone accurately, we always do this as a 4-byte access, with a
mask for the bytes we don't want.
 
unsigned long int *res = (unsigned long int *) model_array;
return *res;
Since this is only a byte, the endianess of the result is irrelevant.
 
} /* htoml () */
@note We are passed the device address, but we must convert it to a full
address for external use, to allow the single upcall handler to
decode multiple generic devices.
 
@param[in] addr The device address to read from (host endian).
@param[in] dat The device data structure
 
/* Convert a 16-bit value from host to model endianess */
static unsigned short int
htoms (unsigned short int host_val)
{
unsigned char model_array[2];
 
#ifdef OR32_BIG_ENDIAN
model_array[0] = (host_val >> 8) & 0xff;
model_array[1] = (host_val ) & 0xff;
#else
model_array[0] = (host_val ) & 0xff;
model_array[1] = (host_val >> 8) & 0xff;
#endif
 
unsigned short int *res = (unsigned short int *) model_array;
return *res;
 
} /* htoms () */
 
 
/* Convert a 32-bit value from model to host endianess */
static unsigned long int
mtohl (unsigned long int model_val)
{
unsigned char *model_array = (unsigned char *)(&model_val);
unsigned long int host_val;
 
#ifdef OR32_BIG_ENDIAN
host_val = model_array[0];
host_val = (host_val << 8) | model_array[1];
host_val = (host_val << 8) | model_array[2];
host_val = (host_val << 8) | model_array[3];
#else
host_val = model_array[3];
host_val = (host_val << 8) | model_array[2];
host_val = (host_val << 8) | model_array[1];
host_val = (host_val << 8) | model_array[0];
#endif
 
return host_val;
 
} /* mtohl () */
 
 
/* Convert a 32-bit value from model to host endianess */
static unsigned short int
mtohs (unsigned short int model_val)
{
unsigned char *model_array = (unsigned char *)(&model_val);
unsigned short int host_val;
 
#ifdef OR32_BIG_ENDIAN
host_val = model_array[0];
host_val = (host_val << 8) | model_array[1];
#else
host_val = model_array[1];
host_val = (host_val << 8) | model_array[0];
#endif
 
return host_val;
 
} /* mtohs () */
 
 
/* Generic read and write upcall routines. Note the address here is absolute,
not relative to the device. The mask uses host endianess, not Or1ksim
endianess. */
 
static unsigned long int
ext_read (unsigned long int addr,
unsigned long int mask)
{
return config.ext.read_up (config.ext.class_ptr, addr, mask);
 
} /* ext_callback() */
 
 
/* Generic read and write upcall routines. Note the address here is absolute,
not relative to the device. The mask and value use host endianess, not
Or1ksim endianess. */
 
static void
ext_write (unsigned long int addr,
unsigned long int mask,
unsigned long int value)
{
config.ext.write_up (config.ext.class_ptr, addr, mask, value);
 
} /* ext_callback() */
 
 
/* I/O routines. Note that address is relative to start of address space. */
 
@return The byte read. */
/* --------------------------------------------------------------------------*/
static uint8_t
generic_read_byte (oraddr_t addr, void *dat)
generic_read_byte (oraddr_t addr,
void *dat)
{
struct dev_generic *dev = (struct dev_generic *) dat;
 
if (!config.ext.class_ptr)
if (!config.ext.read_up)
{
fprintf (stderr, "Byte read from disabled generic device\n");
return 0;
216,33 → 117,52
}
else
{
unsigned long fulladdr = (unsigned long int) (addr + dev->baseaddr);
unsigned long wordaddr = fulladdr & 0xfffffffc;
unsigned long bytenum = fulladdr & 0x00000003;
unsigned long int fulladdr = (unsigned long int) (addr + dev->baseaddr);
unsigned long int wordaddr = fulladdr & 0xfffffffc;
int bytenum = fulladdr & 0x00000003;
 
uint8_t mask_array[4];
unsigned long res;
uint8_t *res_array;
unsigned char mask[4];
unsigned char res[4];
 
/* This works whatever the host endianess */
memset (mask_array, 0, 4);
mask_array[bytenum] = 0xff;
/* Set the mask, read and get the result */
memset (mask, 0, sizeof (mask));
mask[bytenum] = 0xff;
 
unsigned int *arg_ptr = (unsigned int *) mask_array;
res = ext_read (wordaddr, *arg_ptr);
res_array = (uint8_t *)(&res);
if (0 != config.ext.read_up (NULL, wordaddr, mask, res, 4))
{
fprintf (stderr, "Warning: external byte read failed.\n");
return 0;
}
 
return res_array[bytenum];
return res[bytenum];
}
} /* generic_read_byte() */
} /* generic_read_byte() */
 
 
/* --------------------------------------------------------------------------*/
/*!Write a byte to an external device
 
To model Wishbone accurately, we always do this as a 4-byte access, with a
mask for the bytes we don't want.
 
Since this is only a byte, the endianess of the value is irrelevant.
 
@note We are passed the device address, but we must convert it to a full
address for external use, to allow the single upcall handler to
decode multiple generic devices.
 
@param[in] addr The device address to write to (host endian)
@param[in] value The byte value to write
@param[in] dat The device data structure */
/* --------------------------------------------------------------------------*/
static void
generic_write_byte (oraddr_t addr, uint8_t value, void *dat)
generic_write_byte (oraddr_t addr,
uint8_t value,
void *dat)
{
struct dev_generic *dev = (struct dev_generic *) dat;
 
if (!config.ext.class_ptr)
if (!config.ext.write_up)
{
fprintf (stderr, "Byte write to disabled generic device\n");
}
253,33 → 173,50
}
else
{
unsigned long fulladdr = (unsigned long int) (addr + dev->baseaddr);
unsigned long wordaddr = fulladdr & 0xfffffffc;
unsigned long int fulladdr = (unsigned long int) (addr + dev->baseaddr);
unsigned long int wordaddr = fulladdr & 0xfffffffc;
int bytenum = fulladdr & 0x00000003;
 
unsigned long bytenum = fulladdr & 0x00000003;
uint8_t mask_array[4];
uint8_t value_array[4];
unsigned char mask[4];
unsigned char val[4];
 
/* This works whatever the host endianess */
memset (mask_array, 0, 4);
mask_array[bytenum] = 0xff;
memset (value_array, 0, 4);
value_array[bytenum] = value;
/* Set the mask and write data do the write. */
memset (mask, 0, sizeof (mask));
mask[bytenum] = 0xff;
val[bytenum] = value;
 
unsigned long int *arg1_ptr = (unsigned long int *)mask_array;
unsigned long int *arg2_ptr = (unsigned long int *)value_array;
ext_write (wordaddr, *arg1_ptr, *arg2_ptr);
if (0 != config.ext.write_up (NULL, wordaddr, mask, val, 4))
{
fprintf (stderr, "Warning: external byte write failed.\n");
}
}
} /* generic_write_byte() */
} /* generic_write_byte() */
 
 
/* Result is in model endianess */
/* --------------------------------------------------------------------------*/
/*!Read a half word from an external device
 
To model Wishbone accurately, we always do this as a 4-byte access, with a
mask for the bytes we don't want.
 
Since this is a half word, the result must be converted to host endianess.
 
@note We are passed the device address, but we must convert it to a full
address for external use, to allow the single upcall handler to
decode multiple generic devices.
 
@param[in] addr The device address to read from (host endian).
@param[in] dat The device data structure.
 
@return The half word read (host endian). */
/* --------------------------------------------------------------------------*/
static uint16_t
generic_read_hw (oraddr_t addr, void *dat)
generic_read_hw (oraddr_t addr,
void *dat)
{
struct dev_generic *dev = (struct dev_generic *) dat;
 
if (!config.ext.class_ptr)
if (!config.ext.read_up)
{
fprintf (stderr, "Half word read from disabled generic device\n");
return 0;
292,6 → 229,7
}
else if (addr & 0x1)
{
/* This should be trapped elsewhere - here for safety. */
fprintf (stderr,
"Unaligned half word read from 0x%" PRIxADDR " ignored\n",
addr);
299,40 → 237,60
}
else
{
unsigned long fulladdr = (unsigned long int) (addr + dev->baseaddr);
unsigned long wordaddr = fulladdr & 0xfffffffc;
unsigned long bytenum = fulladdr & 0x00000002;
unsigned long int fulladdr = (unsigned long int) (addr + dev->baseaddr);
unsigned long int wordaddr = fulladdr & 0xfffffffc;
int hwnum = fulladdr & 0x00000002;
 
uint8_t mask_array[4];
unsigned long res;
uint8_t *res_array;
uint8_t hwres_array[2];
unsigned char mask[4];
unsigned char res[4];
 
/* This works whatever the host endianess */
memset (mask_array, 0, 4);
mask_array[bytenum] = 0xff;
mask_array[bytenum + 1] = 0xff;
/* Set the mask, read and get the result */
memset (mask, 0, sizeof (mask));
mask[hwnum ] = 0xff;
mask[hwnum + 1] = 0xff;
 
unsigned int *arg_ptr = (unsigned int *) mask_array;
res = ext_read (wordaddr, *arg_ptr);
res_array = (uint8_t *)(&res);
if (0 != config.ext.read_up (NULL, wordaddr, mask, res, 4))
{
fprintf (stderr, "Warning: external half word read failed.\n");
return 0;
}
 
hwres_array[0] = res_array[bytenum];
hwres_array[1] = res_array[bytenum + 1];
 
uint16_t *hwres_ptr = (uint16_t *) hwres_array;
return htoms (*hwres_ptr);
/* Result converted according to endianess */
#ifdef OR32_BIG_ENDIAN
return (unsigned short int) res[hwnum ] << 8 |
(unsigned short int) res[hwnum + 1];
#else
return (unsigned short int) res[hwnum + 1] << 8 |
(unsigned short int) res[hwnum ];
#endif
}
} /* generic_read_hw() */
} /* generic_read_hw() */
 
 
/* Value is in model endianness */
/* --------------------------------------------------------------------------*/
/*!Write a half word to an external device
 
To model Wishbone accurately, we always do this as a 4-byte access, with a
mask for the bytes we don't want.
 
Since this is a half word, the value must be converted from host endianess.
 
@note We are passed the device address, but we must convert it to a full
address for external use, to allow the single upcall handler to
decode multiple generic devices.
 
@param[in] addr The device address to write to (host endian).
@param[in] value The half word value to write (model endian).
@param[in] dat The device data structure. */
/* --------------------------------------------------------------------------*/
static void
generic_write_hw (oraddr_t addr, uint16_t value, void *dat)
generic_write_hw (oraddr_t addr,
uint16_t value,
void *dat)
{
struct dev_generic *dev = (struct dev_generic *) dat;
 
if (!config.ext.class_ptr)
if (!config.ext.write_up)
{
fprintf (stderr, "Half word write to disabled generic device\n");
}
348,39 → 306,56
}
else
{
uint16_t host_value = mtohs (value);
unsigned long int fulladdr = (unsigned long int) (addr + dev->baseaddr);
unsigned long int wordaddr = fulladdr & 0xfffffffc;
int hwnum = fulladdr & 0x00000002;
 
unsigned long fulladdr = (unsigned long int) (addr + dev->baseaddr);
unsigned long wordaddr = fulladdr & 0xfffffffc;
unsigned long bytenum = fulladdr & 0x00000002;
unsigned char mask[4];
unsigned char val[4];
 
uint8_t mask_array[4];
uint8_t value_array[4];
uint8_t *hw_value_array;
/* Set the mask and write data do the write. */
memset (mask, 0, sizeof (mask));
mask[hwnum ] = 0xff;
mask[hwnum + 1] = 0xff;
 
/* This works whatever the host endianess */
memset (mask_array, 0, 4);
mask_array[bytenum] = 0xff;
mask_array[bytenum + 1] = 0xff;
/* Value converted according to endianess */
#ifdef OR32_BIG_ENDIAN
val[hwnum ] = (unsigned char) (value >> 8);
val[hwnum + 1] = (unsigned char) (value );
#else
val[hwnum + 1] = (unsigned char) (value >> 8);
val[hwnum ] = (unsigned char) (value );
#endif
 
memset (value_array, 0, 4);
hw_value_array = (uint8_t *)(&host_value);
value_array[bytenum] = hw_value_array[0];
value_array[bytenum + 1] = hw_value_array[1];
 
unsigned long int *arg1_ptr = (unsigned long int *)mask_array;
unsigned long int *arg2_ptr = (unsigned long int *)value_array;
ext_write (wordaddr, *arg1_ptr, *arg2_ptr);
if (0 != config.ext.write_up (NULL, wordaddr, mask, val, 4))
{
fprintf (stderr, "Warning: external half word write failed.\n");
}
}
} /* generic_write_hw() */
} /* generic_write_hw() */
 
 
/* --------------------------------------------------------------------------*/
/*!Read a full word from an external device
 
Since this is a full word, the result must be converted to host endianess.
 
@note We are passed the device address, but we must convert it to a full
address for external use, to allow the single upcall handler to
decode multiple generic devices.
 
@param[in] addr The device address to read from (host endian).
@param[in] dat The device data structure.
 
@return The full word read (host endian). */
/* --------------------------------------------------------------------------*/
static uint32_t
generic_read_word (oraddr_t addr, void *dat)
generic_read_word (oraddr_t addr,
void *dat)
{
struct dev_generic *dev = (struct dev_generic *) dat;
 
if (!config.ext.class_ptr)
if (!config.ext.read_up)
{
fprintf (stderr, "Full word read from disabled generic device\n");
return 0;
400,19 → 375,57
}
else
{
unsigned long wordaddr = (unsigned long int) (addr + dev->baseaddr);
unsigned long int wordaddr = (unsigned long int) (addr + dev->baseaddr);
 
return (uint32_t) htoml (ext_read (wordaddr, 0xffffffff));
unsigned char mask[4];
unsigned char res[4];
 
/* Set the mask, read and get the result */
memset (mask, 0xff, sizeof (mask));
 
if (0 != config.ext.read_up (NULL, wordaddr, mask, res, 4))
{
fprintf (stderr, "Warning: external full word read failed.\n");
return 0;
}
 
/* Result converted according to endianess */
#ifdef OR32_BIG_ENDIAN
return (unsigned long int) res[0] << 24 |
(unsigned long int) res[1] << 16 |
(unsigned long int) res[2] << 8 |
(unsigned long int) res[3];
#else
return (unsigned long int) res[3] << 24 |
(unsigned long int) res[2] << 16 |
(unsigned long int) res[1] << 8 |
(unsigned long int) res[0];
#endif
}
} /* generic_read_word() */
} /* generic_read_word() */
 
 
/* --------------------------------------------------------------------------*/
/*!Write a full word to an external device
 
Since this is a half word, the value must be converted from host endianess.
 
@note We are passed the device address, but we must convert it to a full
address for external use, to allow the single upcall handler to
decode multiple generic devices.
 
@param[in] addr The device address to write to (host endian).
@param[in] value The full word value to write (host endian).
@param[in] dat The device data structure. */
/* --------------------------------------------------------------------------*/
static void
generic_write_word (oraddr_t addr, uint32_t value, void *dat)
generic_write_word (oraddr_t addr,
uint32_t value,
void *dat)
{
struct dev_generic *dev = (struct dev_generic *) dat;
 
if (!config.ext.class_ptr)
if (!config.ext.write_up)
{
fprintf (stderr, "Full word write to disabled generic device\n");
}
428,12 → 441,33
}
else
{
unsigned long host_value = mtohl (value);
unsigned long wordaddr = (unsigned long int) (addr + dev->baseaddr);
unsigned long int wordaddr = (unsigned long int) (addr + dev->baseaddr);
 
ext_write (wordaddr, 0xffffffff, host_value);
unsigned char mask[4];
unsigned char val[4];
 
/* Set the mask and write data do the write. */
memset (mask, 0xff, sizeof (mask));
 
/* Value converted according to endianess */
#ifdef OR32_BIG_ENDIAN
val[0] = (unsigned char) (value >> 24);
val[1] = (unsigned char) (value >> 16);
val[2] = (unsigned char) (value >> 8);
val[3] = (unsigned char) (value );
#else
val[3] = (unsigned char) (value >> 24);
val[2] = (unsigned char) (value >> 16);
val[1] = (unsigned char) (value >> 8);
val[0] = (unsigned char) (value );
#endif
 
if (0 != config.ext.write_up (NULL, wordaddr, mask, val, 4))
{
fprintf (stderr, "Warning: external full word write failed.\n");
}
}
} /* generic_write_word() */
} /* generic_write_word() */
 
 
/* Reset is a null operation */
/openrisc/trunk/or1ksim/m4/libtool.m4
2470,13 → 2470,10
# before this can be enabled.
hardcode_into_libs=yes
 
# Add ABI-specific directories to the system library path.
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
 
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
 
# We used to test for /lib/ld.so.1 and disable shared libraries on
2488,6 → 2485,18
dynamic_linker='GNU/Linux ld.so'
;;
 
netbsdelf*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='NetBSD ld.elf_so'
;;
 
netbsd*)
version_type=sunos
need_lib_prefix=no
3079,7 → 3088,7
lt_cv_deplibs_check_method=pass_all
;;
 
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
3760,7 → 3769,7
;;
esac
;;
netbsd*)
netbsd* | netbsdelf*-gnu)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
4185,6 → 4194,9
cygwin* | mingw* | cegcc*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
4249,6 → 4261,9
openbsd*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
esac
 
_LT_TAGVAR(ld_shlibs, $1)=yes
4431,7 → 4446,7
fi
;;
 
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
4606,6 → 4621,7
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
_LT_TAGVAR(link_all_deplibs, $1)=no
else
# not using gcc
if test "$host_cpu" = ia64; then
4844,7 → 4860,7
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
 
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
/openrisc/trunk/or1ksim/m4/ltversion.m4
9,15 → 9,15
 
# Generated from ltversion.in.
 
# serial 3017 ltversion.m4
# serial 3012 ltversion.m4
# This file is part of GNU Libtool
 
m4_define([LT_PACKAGE_VERSION], [2.2.6b])
m4_define([LT_PACKAGE_REVISION], [1.3017])
m4_define([LT_PACKAGE_VERSION], [2.2.6])
m4_define([LT_PACKAGE_REVISION], [1.3012])
 
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.2.6b'
macro_revision='1.3017'
[macro_version='2.2.6'
macro_revision='1.3012'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
/openrisc/trunk/or1ksim/configure
1,7 → 1,7
#! /bin/sh
# From configure.ac Id: configure.ac 956 2010-04-21 17:16:24Z jeremy using automake version AC_ACVERSION.
# From configure.ac Id: configure.ac 961 2010-04-25 15:30:12Z jeremy using automake version AC_ACVERSION.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for or1ksim 2010-04-21.
# Generated by GNU Autoconf 2.63 for or1ksim 2010-04-28.
#
# Report bugs to <openrisc@opencores.org>.
#
766,8 → 766,8
# Identity of this package.
PACKAGE_NAME='or1ksim'
PACKAGE_TARNAME='or1ksim'
PACKAGE_VERSION='2010-04-21'
PACKAGE_STRING='or1ksim 2010-04-21'
PACKAGE_VERSION='2010-04-28'
PACKAGE_STRING='or1ksim 2010-04-28'
PACKAGE_BUGREPORT='openrisc@opencores.org'
 
# Factoring default headers for most tests.
1529,7 → 1529,7
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures or1ksim 2010-04-21 to adapt to many kinds of systems.
\`configure' configures or1ksim 2010-04-28 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
1600,7 → 1600,7
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of or1ksim 2010-04-21:";;
short | recursive ) echo "Configuration of or1ksim 2010-04-28:";;
esac
cat <<\_ACEOF
 
1708,7 → 1708,7
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
or1ksim configure 2010-04-21
or1ksim configure 2010-04-28
generated by GNU Autoconf 2.63
 
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
1742,7 → 1742,7
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by or1ksim $as_me 2010-04-21, which was
It was created by or1ksim $as_me 2010-04-28, which was
generated by GNU Autoconf 2.63. Invocation command line was
 
$ $0 $@
4078,8 → 4078,8
 
 
 
macro_version='2.2.6b'
macro_revision='1.3017'
macro_version='2.2.6'
macro_revision='1.3012'
 
 
 
5031,7 → 5031,7
lt_cv_deplibs_check_method=pass_all
;;
 
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
else
7753,6 → 7753,9
openbsd*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu)
link_all_deplibs=no
;;
esac
 
ld_shlibs=yes
7935,7 → 7938,7
fi
;;
 
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
8110,6 → 8113,7
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
link_all_deplibs=no
else
# not using gcc
if test "$host_cpu" = ia64; then
8524,7 → 8528,7
link_all_deplibs=yes
;;
 
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
9486,13 → 9490,10
# before this can be enabled.
hardcode_into_libs=yes
 
# Add ABI-specific directories to the system library path.
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
 
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
 
# We used to test for /lib/ld.so.1 and disable shared libraries on
9504,6 → 9505,18
dynamic_linker='GNU/Linux ld.so'
;;
 
netbsdelf*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='NetBSD ld.elf_so'
;;
 
netbsd*)
version_type=sunos
need_lib_prefix=no
10437,7 → 10450,7
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10440 "configure"
#line 10453 "configure"
#include "confdefs.h"
 
#if HAVE_DLFCN_H
10533,7 → 10546,7
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10536 "configure"
#line 10549 "configure"
#include "confdefs.h"
 
#if HAVE_DLFCN_H
11272,7 → 11285,7
 
# Define the identity of the package.
PACKAGE='or1ksim'
VERSION='2010-04-21'
VERSION='2010-04-28'
 
 
cat >>confdefs.h <<_ACEOF
17871,7 → 17884,7
-I\${top_srcdir}/cuc -I\${top_srcdir}/port -I\${top_srcdir}/argtable2"
 
 
ac_config_files="$ac_config_files Makefile argtable2/Makefile bpb/Makefile cache/Makefile cpu/Makefile cpu/common/Makefile cpu/or1k/Makefile cuc/Makefile debug/Makefile doc/Makefile mmu/Makefile peripheral/Makefile peripheral/channels/Makefile pm/Makefile pic/Makefile port/Makefile support/Makefile testsuite/Makefile testsuite/config/Makefile testsuite/lib/Makefile testsuite/libsim.tests/Makefile testsuite/or1ksim.tests/Makefile testsuite/test-code/Makefile testsuite/test-code/lib-iftest/Makefile tick/Makefile vapi/Makefile"
ac_config_files="$ac_config_files Makefile argtable2/Makefile bpb/Makefile cache/Makefile cpu/Makefile cpu/common/Makefile cpu/or1k/Makefile cuc/Makefile debug/Makefile doc/Makefile mmu/Makefile peripheral/Makefile peripheral/channels/Makefile pm/Makefile pic/Makefile port/Makefile support/Makefile testsuite/Makefile testsuite/config/Makefile testsuite/lib/Makefile testsuite/libsim.tests/Makefile testsuite/or1ksim.tests/Makefile testsuite/test-code/Makefile testsuite/test-code/lib-iftest/Makefile testsuite/test-code/lib-inttest/Makefile testsuite/test-code/lib-upcalls/Makefile tick/Makefile vapi/Makefile"
 
 
# yuck. I don't know why I cannot just substitute $CPU_ARCH in the above
18369,7 → 18382,7
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by or1ksim $as_me 2010-04-21, which was
This file was extended by or1ksim $as_me 2010-04-28, which was
generated by GNU Autoconf 2.63. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
18432,7 → 18445,7
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
or1ksim config.status 2010-04-21
or1ksim config.status 2010-04-28
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
18837,6 → 18850,8
"testsuite/or1ksim.tests/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/or1ksim.tests/Makefile" ;;
"testsuite/test-code/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/test-code/Makefile" ;;
"testsuite/test-code/lib-iftest/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/test-code/lib-iftest/Makefile" ;;
"testsuite/test-code/lib-inttest/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/test-code/lib-inttest/Makefile" ;;
"testsuite/test-code/lib-upcalls/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/test-code/lib-upcalls/Makefile" ;;
"tick/Makefile") CONFIG_FILES="$CONFIG_FILES tick/Makefile" ;;
"vapi/Makefile") CONFIG_FILES="$CONFIG_FILES vapi/Makefile" ;;
"cpu/dlx/Makefile") CONFIG_FILES="$CONFIG_FILES cpu/dlx/Makefile" ;;
/openrisc/trunk/or1ksim/libtoplevel.c
61,12 → 61,16
or1ksim_init (const char *config_file,
const char *image_file,
void *class_ptr,
unsigned long int (*upr) (void *class_ptr,
unsigned long int addr,
unsigned long int mask),
void (*upw) (void *class_ptr,
unsigned long int addr,
unsigned long int mask, unsigned long int wdata))
int (*upr) (void *class_ptr,
unsigned long int addr,
unsigned char mask[],
unsigned char rdata[],
int data_len),
int (*upw) (void *class_ptr,
unsigned long int addr,
unsigned char mask[],
unsigned char wdata[],
int data_len))
{
int dummy_argc;
char *dummy_argv[4];
322,7 → 326,7
if (!config.pic.edge_trigger)
{
fprintf (stderr, "Warning: or1ksim_interrupt should not be used for "
"edge triggered interrupts. Ignored\n");
"level triggered interrupts. Ignored\n");
}
else
{
349,7 → 353,7
if (config.pic.edge_trigger)
{
fprintf (stderr, "Warning: or1ksim_interrupt_set should not be used for "
"level triggered interrupts. Ignored\n");
"edge triggered interrupts. Ignored\n");
}
else
{
375,7 → 379,7
if (config.pic.edge_trigger)
{
fprintf (stderr, "Warning: or1ksim_interrupt_clear should not be used "
"for level triggered interrupts. Ignored\n");
"for edge triggered interrupts. Ignored\n");
}
else
{
/openrisc/trunk/or1ksim/sim-config.c
958,14 → 958,21
}
else
{
struct config_param *cur_param;
struct config_param *cur_param = NULL;
char *cur_p;
for (cur_param = cur_section->params; cur_param;
cur_param = cur_param->next)
if (strcmp (cur_param->name, param) == 0)
{
break;
}
/* If we have a corrupt file, this could be encountered outside
a section. So make sure cur_section is defined. */
if (cur_section)
{
for (cur_param = cur_section->params; cur_param;
cur_param = cur_param->next)
{
if (strcmp (cur_param->name, param) == 0)
{
break;
}
}
}
if (!cur_param)
{
fprintf (stderr, "Warning: Invalid parameter: %s; ignored\n",

powered by: WebSVN 2.1.0

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