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
/openrisc/trunk/or1ksim/testsuite
- from Rev 110 to Rev 112
- ↔ Reverse comparison
Rev 110 → Rev 112
/test-code-or1k/eth/Makefile.in
72,7 → 72,7
CONFIG_HEADER = $(top_builddir)/config.h |
CONFIG_CLEAN_FILES = |
CONFIG_CLEAN_VPATH_FILES = |
am_eth_OBJECTS = eth-eth.$(OBJEXT) |
am_eth_OBJECTS = eth.$(OBJEXT) |
eth_OBJECTS = $(am_eth_OBJECTS) |
eth_DEPENDENCIES = ../except/except.lo ../support/libsupport.la |
eth_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ |
210,8 → 210,10
top_build_prefix = @top_build_prefix@ |
top_builddir = @top_builddir@ |
top_srcdir = @top_srcdir@ |
eth_SOURCES = eth.c |
eth_CPPFLAGS = -I$(srcdir)/../../../peripheral |
eth_SOURCES = eth.c \ |
eth.h \ |
fields.h |
|
eth_LDFLAGS = -T$(srcdir)/../default.ld |
eth_LDADD = ../except/except.lo \ |
../support/libsupport.la |
269,7 → 271,7
distclean-compile: |
-rm -f *.tab.c |
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eth-eth.Po@am__quote@ |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eth.Po@am__quote@ |
|
.c.o: |
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< |
292,20 → 294,6
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< |
|
eth-eth.o: eth.c |
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(eth_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT eth-eth.o -MD -MP -MF $(DEPDIR)/eth-eth.Tpo -c -o eth-eth.o `test -f 'eth.c' || echo '$(srcdir)/'`eth.c |
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/eth-eth.Tpo $(DEPDIR)/eth-eth.Po |
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='eth.c' object='eth-eth.o' libtool=no @AMDEPBACKSLASH@ |
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(eth_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o eth-eth.o `test -f 'eth.c' || echo '$(srcdir)/'`eth.c |
|
eth-eth.obj: eth.c |
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(eth_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT eth-eth.obj -MD -MP -MF $(DEPDIR)/eth-eth.Tpo -c -o eth-eth.obj `if test -f 'eth.c'; then $(CYGPATH_W) 'eth.c'; else $(CYGPATH_W) '$(srcdir)/eth.c'; fi` |
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/eth-eth.Tpo $(DEPDIR)/eth-eth.Po |
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='eth.c' object='eth-eth.obj' libtool=no @AMDEPBACKSLASH@ |
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(eth_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o eth-eth.obj `if test -f 'eth.c'; then $(CYGPATH_W) 'eth.c'; else $(CYGPATH_W) '$(srcdir)/eth.c'; fi` |
|
mostlyclean-libtool: |
-rm -f *.lo |
|
/test-code-or1k/eth/Makefile.am
27,7 → 27,9
# A test program of the OR1K Ethernet |
check_PROGRAMS = eth |
|
eth_SOURCES = eth.c |
eth_SOURCES = eth.c \ |
eth.h \ |
fields.h |
|
eth_LDFLAGS = -T$(srcdir)/../default.ld |
|
/test-code-or1k/eth/fields.h
0,0 → 1,64
/* fields.h -- Some macros to help with bit field definitions |
|
Copyright (C) 2001 by Erez Volk, erez@opencores.org |
Copyright (C) 2008 Embecosm Limited |
|
Contributor Jeremy Bennett <jeremy.bennett@embecosm.com> |
|
This file is part of Or1ksim, the 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 program is commented throughout in a fashion suitable for processing |
with Doxygen. */ |
|
|
#ifndef FIELDS__H |
#define FIELDS__H |
|
|
/* Macros to get/set a field in a register |
* Example: |
* unsigned long done, priority, channel_csr; |
* |
* priority = GET_FIELD( channel_csr, DMA_CH_CSR, PRIORITY ); |
* SET_FIELD( channel_csr, DMA_CH_CSR, PRIORITY, priority ); |
* |
* done = TEST_FLAG( channel_csr, DMA_CH_CSR, DONE ); |
* SET_FLAG( channel_csr, DMA_CH_CSR, DONE ); |
* CLEAR_FLAG( channel_csr, DMA_CH_CSR, DONE ); |
* ASSIGN_FLAG( channel_csr, DMA_CH_CSR, done ); |
* |
* For each field, we then define e.g. |
* #define DMA_CH_CSR_PRIORITY_OFFSET 13 |
* #define DMA_CH_CSR_PRIORITY_WIDTH 3 // not needed for flags, which always have width = 1 |
*/ |
|
#define FLAG_SHIFT(reg_name,flag_name) (reg_name##_##flag_name##_OFFSET) |
#define FLAG_MASK(reg_name,flag_name) (1LU << reg_name##_##flag_name##_OFFSET) |
|
#define TEST_FLAG(reg_value,reg_name,flag_name) (((reg_value ) >> reg_name##_##flag_name##_OFFSET) & 1LU) |
#define SET_FLAG(reg_value,reg_name,flag_name) { (reg_value) |= 1LU << reg_name##_##flag_name##_OFFSET; } |
#define CLEAR_FLAG(reg_value,reg_name,flag_name) { (reg_value) &= ~(1LU << reg_name##_##flag_name##_OFFSET); } |
#define ASSIGN_FLAG(reg_value,reg_name,flag_name,flag_value) { \ |
(reg_value) = flag_value ? ((reg_value) | (1LU << reg_name##_##flag_name##_OFFSET)) : ((reg_value) & ~(1LU << reg_name##_##flag_name##_OFFSET)); } |
|
#define FIELD_SHIFT(reg_name,field_name) (reg_name##_##field_name##_OFFSET) |
#define FIELD_MASK(reg_name,field_name) ((~(~0LU << reg_name##_##field_name##_WIDTH)) << reg_name##_##field_name##_OFFSET) |
|
#define GET_FIELD(reg_value,reg_name,field_name) (((reg_value) >> reg_name##_##field_name##_OFFSET) & (~(~0LU << reg_name##_##field_name##_WIDTH))) |
#define SET_FIELD(reg_value,reg_name,field_name,field_value) { \ |
(reg_value) = ((reg_value) & ~((~(~0LU << reg_name##_##field_name##_WIDTH)) << reg_name##_##field_name##_OFFSET)) | ((field_value) << reg_name##_##field_name##_OFFSET); } |
|
#endif /* FIELDS__H */ |
test-code-or1k/eth/fields.h
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: test-code-or1k/mc-dram/mc-dram.c
===================================================================
--- test-code-or1k/mc-dram/mc-dram.c (revision 110)
+++ test-code-or1k/mc-dram/mc-dram.c (revision 112)
@@ -31,7 +31,7 @@
#include "mc-dram.h"
#include "config.h"
-#include "mc_defines.h"
+#include "mc-defines.h"
#include "gpio.h"
#include "fields.h"
/test-code-or1k/mc-ssram/mc-ssram.c
31,7 → 31,7
#include "mc-ssram.h" |
|
#include "config.h" |
#include "mc_defines.h" |
#include "mc-defines.h" |
#include "gpio.h" |
#include "fields.h" |
|
/test-code-or1k/inst-set-test/is-add-test.S
0,0 → 1,352
/* is-add-test.S. l.add, l.addc, l.addi and l.addic instruction test of Or1ksim |
* |
* 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/>. |
*/ |
|
/* ---------------------------------------------------------------------------- |
* Coding conventions |
* |
* A simple rising stack is provided starting at _stack and pointed to by |
* r1. r1 points to the next free word. Only 32-bit registers may be pushed |
* onto the stack. |
* |
* Local labels up to 49 are reserved for macros. Each is used only once in |
* all macros. You can get in a serious mess if you get local label clashing |
* in macros. |
* |
* Arguments to functions are passed in r3 through r8. |
* r9 is the link (return address) |
* r11 is for returning results |
* |
* Only r1 and r2 are preserved across function calls. It is up to the callee |
* to save any other registers required. |
* ------------------------------------------------------------------------- */ |
|
/* ---------------------------------------------------------------------------- |
* Test coverage |
* |
* The l.add, l.addc, l.addi and l.addic instructions should set the carry and |
* overflow flags. |
* |
* In addition the l.addc and l.addic instructions should add in the carry |
* bit. |
* |
* Problems in this area were reported in Bug 1771. Having fixed the problem, |
* this is (in good software engineering style), a regression test to go with |
* the fix. |
* |
* This is not a comprehensive test of any instruction (yet). |
* |
* Of course what is really needed is a comprehensive instruction test... |
* ------------------------------------------------------------------------- */ |
|
|
#include "inst-set-test.h" |
|
.section .text |
.global _start |
_start: |
|
/* ---------------------------------------------------------------------------- |
* Test of add signed, l.add |
* ------------------------------------------------------------------------- */ |
_add: |
LOAD_STR (r3, "l.add\n") |
l.jal _puts |
l.nop |
|
/* Add two small positive numbers */ |
LOAD_CONST (r2, ~(SPR_SR_CY | SPR_SR_OV)) /* Clear flags */ |
l.mfspr r3,r0,SPR_SR |
l.and r3,r3,r2 |
l.mtspr r0,r3,SPR_SR |
|
LOAD_CONST (r5,1) /* Add two small positive numbers */ |
LOAD_CONST (r6,2) |
l.add r4,r5,r6 |
l.mfspr r2,r0,SPR_SR /* So we can examine the carry flag */ |
PUSH (r2) |
CHECK_RES ("0x00000001 + 0x00000002 = 0x00000003: ", r4, 0x00000003) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_CY) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- carry flag set: ", FALSE) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_OV) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- overflow flag set: ", FALSE) |
|
/* Add two small negative numbers */ |
LOAD_CONST (r2, ~(SPR_SR_CY | SPR_SR_OV)) /* Clear flags */ |
l.mfspr r3,r0,SPR_SR |
l.and r3,r3,r2 |
l.mtspr r0,r3,SPR_SR |
|
LOAD_CONST (r5,0xffffffff) /* Add two small negative numbers */ |
LOAD_CONST (r6,0xfffffffe) |
l.add r4,r5,r6 |
l.mfspr r2,r0,SPR_SR /* So we can examine the carry flag */ |
PUSH (r2) |
CHECK_RES ("0xffffffff + 0xfffffffe = 0xfffffffd: ", r4, 0xfffffffd) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_CY) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- carry flag set: ", TRUE) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_OV) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- overflow flag set: ", FALSE) |
|
/* Add two quite large positive numbers. Should set neither the |
overflow nor the carry flag. */ |
LOAD_CONST (r2, ~(SPR_SR_CY | SPR_SR_OV)) /* Clear flags */ |
l.mfspr r3,r0,SPR_SR |
l.and r3,r3,r2 |
l.mtspr r0,r3,SPR_SR |
|
LOAD_CONST (r5,0x40000000) /* Add two large positive numbers */ |
LOAD_CONST (r6,0x3fffffff) |
l.add r4,r5,r6 |
l.mfspr r2,r0,SPR_SR /* So we can examine the carry flag */ |
PUSH (r2) |
CHECK_RES ("0x40000000 + 0x3fffffff = 0x7fffffff: ", r4, 0x7fffffff) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_CY) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- carry flag set: ", FALSE) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_OV) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- overflow flag set: ", FALSE) |
|
/* Add two large positive numbers. Should set the overflow, but not |
the carry flag. */ |
LOAD_CONST (r2, ~(SPR_SR_CY | SPR_SR_OV)) /* Clear flags */ |
l.mfspr r3,r0,SPR_SR |
l.and r3,r3,r2 |
l.mtspr r0,r3,SPR_SR |
|
LOAD_CONST (r5,0x40000000) /* Add two large positive numbers */ |
LOAD_CONST (r6,0x40000000) |
l.add r4,r5,r6 |
l.mfspr r2,r0,SPR_SR /* So we can examine the carry flag */ |
PUSH (r2) |
CHECK_RES ("0x40000000 + 0x40000000 = 0x80000000: ", r4, 0x80000000) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_CY) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- carry flag set: ", FALSE) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_OV) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- overflow flag set: ", TRUE) |
|
/* Add two quite large negative numbers. Should set the carry, but not |
the overflow flag. flag. */ |
LOAD_CONST (r2, ~(SPR_SR_CY | SPR_SR_OV)) /* Clear flags */ |
l.mfspr r3,r0,SPR_SR |
l.and r3,r3,r2 |
l.mtspr r0,r3,SPR_SR |
|
LOAD_CONST (r5,0xc0000000) /* Add two large positive numbers */ |
LOAD_CONST (r6,0xc0000000) |
l.add r4,r5,r6 |
l.mfspr r2,r0,SPR_SR /* So we can examine the carry flag */ |
PUSH (r2) |
CHECK_RES ("0xc0000000 + 0xc0000000 = 0x80000000: ", r4, 0x80000000) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_CY) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- carry flag set: ", TRUE) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_OV) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- overflow flag set: ", FALSE) |
|
/* Add two large negative numbers. Should set both the overflow and |
carry flags. */ |
LOAD_CONST (r2, ~(SPR_SR_CY | SPR_SR_OV)) /* Clear flags */ |
l.mfspr r3,r0,SPR_SR |
l.and r3,r3,r2 |
l.mtspr r0,r3,SPR_SR |
|
LOAD_CONST (r5,0xbfffffff) /* Add two large negative numbers */ |
LOAD_CONST (r6,0xbfffffff) |
l.add r4,r5,r6 |
l.mfspr r2,r0,SPR_SR /* So we can examine the carry flag */ |
PUSH (r2) |
CHECK_RES ("0xbfffffff + 0xbfffffff = 0x7ffffffe: ", r4, 0x7ffffffe) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_CY) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- carry flag set: ", TRUE) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_OV) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- overflow flag set: ", TRUE) |
|
/* Check that range exceptions are triggered */ |
LOAD_CONST (r2, SPR_SR_OVE) /* Set OVE */ |
l.mfspr r3,r0,SPR_SR |
l.or r3,r3,r2 |
l.mtspr r0,r3,SPR_SR |
|
LOAD_STR (r3, " OVE flag set\n") |
l.jal _puts |
l.nop |
|
/* Check that an overflow alone causes a RANGE Exception. */ |
LOAD_CONST (r2, ~(SPR_SR_CY | SPR_SR_OV)) /* Clear flags */ |
l.mfspr r3,r0,SPR_SR |
l.and r3,r3,r2 |
l.mtspr r0,r3,SPR_SR |
|
LOAD_CONST (r5,0x40000000) /* Add two large positive numbers */ |
LOAD_CONST (r6,0x40000000) |
l.add r4,r5,r6 |
l.mfspr r2,r0,SPR_SR /* So we can examine the carry flag */ |
PUSH (r2) |
CHECK_RES ("0x40000000 + 0x40000000 = 0x80000000: ", r4, 0x80000000) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_CY) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- carry flag set: ", FALSE) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_OV) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- overflow flag set: ", TRUE) |
|
/* Check that a carry alone does not cause a RANGE Exception. */ |
LOAD_CONST (r2, ~(SPR_SR_CY | SPR_SR_OV)) /* Clear flags */ |
l.mfspr r3,r0,SPR_SR |
l.and r3,r3,r2 |
l.mtspr r0,r3,SPR_SR |
|
LOAD_CONST (r5,0xffffffff) /* Add two small negative numbers */ |
LOAD_CONST (r6,0xfffffffe) |
l.add r4,r5,r6 |
l.mfspr r2,r0,SPR_SR /* So we can examine the carry flag */ |
PUSH (r2) |
CHECK_RES ("0xffffffff + 0xfffffffe = 0xfffffffd: ", r4, 0xfffffffd) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_CY) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- carry flag set: ", TRUE) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_OV) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- overflow flag set: ", FALSE) |
|
/* Check that carry and overflow together cause an exception. */ |
LOAD_CONST (r2, ~(SPR_SR_CY | SPR_SR_OV)) /* Clear flags */ |
l.mfspr r3,r0,SPR_SR |
l.and r3,r3,r2 |
l.mtspr r0,r3,SPR_SR |
|
LOAD_CONST (r5,0xbfffffff) /* Add two large negative numbers */ |
LOAD_CONST (r6,0xbfffffff) |
l.add r4,r5,r6 |
l.mfspr r2,r0,SPR_SR /* So we can examine the carry flag */ |
PUSH (r2) |
CHECK_RES ("0xbfffffff + 0xbfffffff = 0x7ffffffe: ", r4, 0x7ffffffe) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_CY) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- carry flag set: ", TRUE) |
|
POP(r2) /* Retrieve SR */ |
PUSH(r2) |
LOAD_CONST (r4, SPR_SR_OV) /* The carry bit */ |
l.and r2,r2,r4 |
l.sfeq r2,r4 |
CHECK_FLAG ("- overflow flag set: ", TRUE) |
|
/* Finished checking range exceptions */ |
LOAD_CONST (r2, ~SPR_SR_OVE) /* Clear OVE */ |
l.mfspr r3,r0,SPR_SR |
l.and r3,r3,r2 |
l.mtspr r0,r3,SPR_SR |
|
LOAD_STR (r3, " OVE flag cleared\n") |
l.jal _puts |
l.nop |
|
/* ---------------------------------------------------------------------------- |
* All done |
* ------------------------------------------------------------------------- */ |
_exit: |
LOAD_STR (r3, "Test completed\n") |
l.jal _puts |
l.nop |
|
TEST_EXIT |
test-code-or1k/inst-set-test/is-add-test.S
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: test-code-or1k/inst-set-test/Makefile.in
===================================================================
--- test-code-or1k/inst-set-test/Makefile.in (revision 110)
+++ test-code-or1k/inst-set-test/Makefile.in (revision 112)
@@ -58,8 +58,8 @@
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-check_PROGRAMS = is-div-test$(EXEEXT) is-lws-test$(EXEEXT) \
- $(am__EXEEXT_1)
+check_PROGRAMS = is-add-test$(EXEEXT) is-div-test$(EXEEXT) \
+ is-lws-test$(EXEEXT) $(am__EXEEXT_1)
subdir = inst-set-test
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -84,6 +84,12 @@
inst_set_test_old_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(inst_set_test_old_LDFLAGS) $(LDFLAGS) -o $@
+am_is_add_test_OBJECTS = is-add-test.$(OBJEXT)
+is_add_test_OBJECTS = $(am_is_add_test_OBJECTS)
+is_add_test_DEPENDENCIES = inst-set-test.lo
+is_add_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(is_add_test_LDFLAGS) $(LDFLAGS) -o $@
am_is_div_test_OBJECTS = is-div-test.$(OBJEXT)
is_div_test_OBJECTS = $(am_is_div_test_OBJECTS)
is_div_test_DEPENDENCIES = inst-set-test.lo
@@ -115,10 +121,11 @@
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libinst_set_test_la_SOURCES) $(inst_set_test_old_SOURCES) \
+ $(is_add_test_SOURCES) $(is_div_test_SOURCES) \
+ $(is_lws_test_SOURCES)
+DIST_SOURCES = $(libinst_set_test_la_SOURCES) \
+ $(inst_set_test_old_SOURCES) $(is_add_test_SOURCES) \
$(is_div_test_SOURCES) $(is_lws_test_SOURCES)
-DIST_SOURCES = $(libinst_set_test_la_SOURCES) \
- $(inst_set_test_old_SOURCES) $(is_div_test_SOURCES) \
- $(is_lws_test_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -240,7 +247,7 @@
# Tests of the instruction set. Broken out into separate tests, to avoid them
# getting too large. The original instruction set test is still here, but not
# built by default.
-EXTRA_DIST = inst-set.ld
+EXTRA_DIST = inst-set-test.ld
@BUILD_ALL_TESTS_FALSE@INST_SET_TEST_OLD =
@BUILD_ALL_TESTS_TRUE@INST_SET_TEST_OLD = inst-set-test-old
@@ -249,10 +256,19 @@
libinst_set_test_la_SOURCES = inst-set-test.S
# The new instruction set tests.
-is_div_test_SOURCES = is-div-test.S
+is_add_test_SOURCES = inst-set-test.h \
+ is-add-test.S
+
+is_add_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld
+is_add_test_LDADD = inst-set-test.lo
+is_div_test_SOURCES = inst-set-test.h \
+ is-div-test.S
+
is_div_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld
is_div_test_LDADD = inst-set-test.lo
-is_lws_test_SOURCES = is-lws-test.S
+is_lws_test_SOURCES = inst-set-test.h \
+ is-lws-test.S
+
is_lws_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld
is_lws_test_LDADD = inst-set-test.lo
@@ -319,6 +335,9 @@
inst-set-test-old$(EXEEXT): $(inst_set_test_old_OBJECTS) $(inst_set_test_old_DEPENDENCIES)
@rm -f inst-set-test-old$(EXEEXT)
$(inst_set_test_old_LINK) $(inst_set_test_old_OBJECTS) $(inst_set_test_old_LDADD) $(LIBS)
+is-add-test$(EXEEXT): $(is_add_test_OBJECTS) $(is_add_test_DEPENDENCIES)
+ @rm -f is-add-test$(EXEEXT)
+ $(is_add_test_LINK) $(is_add_test_OBJECTS) $(is_add_test_LDADD) $(LIBS)
is-div-test$(EXEEXT): $(is_div_test_OBJECTS) $(is_div_test_DEPENDENCIES)
@rm -f is-div-test$(EXEEXT)
$(is_div_test_LINK) $(is_div_test_OBJECTS) $(is_div_test_LDADD) $(LIBS)
@@ -334,6 +353,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inst-set-test-old.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inst-set-test.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is-add-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is-div-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is-lws-test.Po@am__quote@
/test-code-or1k/inst-set-test/Makefile.am
27,7 → 27,7
# Tests of the instruction set. Broken out into separate tests, to avoid them |
# getting too large. The original instruction set test is still here, but not |
# built by default. |
EXTRA_DIST = inst-set.ld |
EXTRA_DIST = inst-set-test.ld |
|
if BUILD_ALL_TESTS |
INST_SET_TEST_OLD = inst-set-test-old |
41,16 → 41,24
libinst_set_test_la_SOURCES = inst-set-test.S |
|
# The test programs |
check_PROGRAMS = is-div-test \ |
check_PROGRAMS = is-add-test \ |
is-div-test \ |
is-lws-test \ |
$(INST_SET_TEST_OLD) |
|
# The new instruction set tests. |
is_div_test_SOURCES = is-div-test.S |
is_add_test_SOURCES = inst-set-test.h \ |
is-add-test.S |
is_add_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld |
is_add_test_LDADD = inst-set-test.lo |
|
is_div_test_SOURCES = inst-set-test.h \ |
is-div-test.S |
is_div_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld |
is_div_test_LDADD = inst-set-test.lo |
|
is_lws_test_SOURCES = is-lws-test.S |
is_lws_test_SOURCES = inst-set-test.h \ |
is-lws-test.S |
is_lws_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld |
is_lws_test_LDADD = inst-set-test.lo |
|
/test-code-or1k/ChangeLog
1,3 → 1,14
2010-06-09 Jeremy Bennett <jeremy.bennett@embecosm.com> |
* inst-set-test/is-add-test.S: Created. |
* inst-set-test/Makefile.am: Updated for new tests |
* inst-set-test/Makefile.in: Regenerated. |
|
2010-06-08 Jeremy Bennett <jeremy.bennett@embecosm.com> |
* mc-sync/mc-sync.c: mc_defines.h -> mc-defines.h. |
* mc-ssram/mc-ssram.c: mc_defines.h -> mc-defines.h. |
* mc-dram/mc-dram.c: mc_defines.h -> mc-defines.h. |
* mc-async/mc-async.c: mc_defines.h -> mc-defines.h. |
|
2010-06-08 Julius Baxter <julius.baxter@orsoc.se> |
* eth/eth.h: Created from ethernet peripheral's header. |
* eth/Makefile.am: Removed eth_CPPFLAGS. |
5,6 → 16,7
* mc-ssram/mc-ssram.c: Changed include of mc.h to mc_defines.h |
* mc-dram/mc-dram.c: Changed include of mc.h to mc_defines.h |
* mc-async/mc-async.c: Changed include of mc.h to mc_defines.h |
|
2010-06-06 Jeremy Bennett <jeremy.bennett@embecosm.com> |
* configure: Regenerated. |
* configure.ac: Removed creation of lws-test makefile. |
16,6 → 28,7
* inst-set-test/inst-set-test.h: Created using macros from |
lws-test/lws-test.S. |
* inst-set-test/Makefile.am: Updated for new tests |
* inst-set-test/Makefile.in: Regenerated. |
* inst-set-test/is-lws-test.S: Created from lws-test/lws-test.S |
* lws-test: Directory deleted. |
* lws-test/lws-test.S: Deleted. |
/test-code-or1k/mc-sync/mc-sync.c
31,7 → 31,7
#include "mc-sync.h" |
|
#include "config.h" |
#include "mc_defines.h" |
#include "mc-defines.h" |
#include "gpio.h" |
#include "fields.h" |
|
/test-code-or1k/mc-async/mc-async.c
31,7 → 31,7
#include "mc-async.h" |
|
#include "config.h" |
#include "mc_defines.h" |
#include "mc-defines.h" |
#include "gpio.h" |
#include "fields.h" |
|
/or1ksim.tests/inst-set-test.exp
44,3 → 44,63
"!report(0xdeaddead);" \ |
"!exit(0)"] \ |
"inst-set-test.cfg" "inst-set-test/is-lws-test" |
|
# Run the l.div and l.divu test |
run_or1ksim "lws-test" \ |
[list "!l.div" \ |
"! RANGE exception" \ |
" - caused by: report(0xe0853309);" \ |
"! - SR value: report(0x00008601);" \ |
" 1 / 0 (with error) carry flag set: TRUE" \ |
"!l.divu" \ |
"! RANGE exception" \ |
" - caused by: report(0xe085330a);" \ |
"! - SR value: report(0x00008601);" \ |
" 1 / 0 (with error) carry flag set: TRUE" \ |
"!Test completed" \ |
"!report(0xdeaddead);" \ |
"!exit(0)"] \ |
"inst-set-test.cfg" "inst-set-test/is-div-test" |
|
# Run the l.add, l.addc, l.addi and l.addic tests |
run_or1ksim "lws-test" \ |
[list "!l.add" \ |
" 0x00000001 + 0x00000002 = 0x00000003: OK" \ |
" - carry flag set: FALSE" \ |
" - overflow flag set: FALSE" \ |
" 0xffffffff + 0xfffffffe = 0xfffffffd: OK" \ |
" - carry flag set: TRUE" \ |
" - overflow flag set: FALSE" \ |
" 0x40000000 + 0x3fffffff = 0x7fffffff: OK" \ |
" - carry flag set: FALSE" \ |
" - overflow flag set: FALSE" \ |
" 0x40000000 + 0x40000000 = 0x80000000: OK" \ |
" - carry flag set: FALSE" \ |
" - overflow flag set: TRUE" \ |
" 0xc0000000 + 0xc0000000 = 0x80000000: OK" \ |
" - carry flag set: TRUE" \ |
" - overflow flag set: FALSE" \ |
" 0xbfffffff + 0xbfffffff = 0x7ffffffe: OK" \ |
" - carry flag set: TRUE" \ |
" - overflow flag set: TRUE" \ |
"! OVE flag set" \ |
" RANGE exception" \ |
" - caused by: report(0xe0853000);" \ |
" - SR value: report(0x00009a01);" \ |
" 0x40000000 + 0x40000000 = 0x80000000: OK" \ |
" - carry flag set: FALSE" \ |
" - overflow flag set: TRUE" \ |
" 0xffffffff + 0xfffffffe = 0xfffffffd: OK" \ |
" - carry flag set: TRUE" \ |
" - overflow flag set: FALSE" \ |
" RANGE exception" \ |
" - caused by: report(0xe0853000);" \ |
" - SR value: report(0x00009e01);" \ |
" 0xbfffffff + 0xbfffffff = 0x7ffffffe: OK" \ |
" - carry flag set: TRUE" \ |
" - overflow flag set: TRUE" \ |
"! OVE flag cleared" \ |
"!Test completed" \ |
"!report(0xdeaddead);" \ |
"!exit(0)"] \ |
"inst-set-test.cfg" "inst-set-test/is-add-test" |
/ChangeLog
1,3 → 1,6
2010-06-09 Jeremy Bennett <jeremy.bennett@embecosm.com> |
* or1ksim.tests/inst-set-test.exp: Added division and addition tests. |
|
2010-06-06 Jeremy Bennett <jeremy.bennett@embecosm.com> |
* or1ksim.tests/inst-set-test.cfg: Created. |
* or1ksim.tests/inst-set-test.exp: Created. |
/README
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 1,063 tests compile, run and pass. That |
figure is broken down into 799 tests of the standalone simulator and 264 tests |
At the time of writing a total of 1,100 tests compile, run and pass. That |
figure is broken down into 836 tests of the standalone simulator and 264 tests |
of the library |
|
Configuration and make files are provided for further test programs. These |
46,7 → 46,7
Working tests |
============= |
|
A total of 799 tests of standalone Or1ksim: |
A total of 836 tests of standalone Or1ksim: |
|
basic: 8 tests of a wide range of instructions and registers. |
cache: 5 tests of the Or1ksim cache modeling |
66,7 → 66,8
kbdtest: 26 tests of the PS2 keyboard interface. |
local-global: 1 test of C local and global variables. |
inst-set-test: A collection of tests of individual instructions |
is-div-test: 2 tests of tje l.div and l.divu instruction (Bug 1770). |
is-add-test 33 tests of the l.add* instructions (Bugs) |
is-div-test: 4 tests of the l.div and l.divu instruction (Bug 1770). |
is-lws-test: 13 tests of the l.lws instruction (Bug 1767). |
mem-test: 16 tests of simple memory access. |
mmu: 110 tests of the MMU. |