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

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk/or1ksim
    from Rev 114 to Rev 115
    Reverse comparison

Rev 114 → Rev 115

/cpu/or32/or32.c
497,8 → 497,8
EF (l_cmov), OR32_R_FLAG, it_move},
{"l.ff1", "rD,rA", "11 0x8 DDDDD AAAAA ---- --00 ---- 0xF",
EF (l_ff1), 0, it_arith},
{"l.fl1", "rD,rA", "11 0x8 DDDDD AAAAA ---- --01 ---- 0xF", EFI, 0,
it_arith},
{"l.fl1", "rD,rA", "11 0x8 DDDDD AAAAA ---- --01 ---- 0xF",
EF (l_fl1), 0, it_arith},
 
{"l.sfeq", "rA,rB", "11 0x9 00000 AAAAA BBBB B--- ---- ----",
EF (l_sfeq), OR32_W_FLAG, it_compare},
/cpu/or32/insnset.c
611,6 → 611,18
INSTRUCTION (l_ff1) {
SET_PARAM0(ffs(PARAM1));
}
INSTRUCTION (l_fl1) {
orreg_t t = (orreg_t)PARAM1;
 
/* Reverse the word and use ffs */
t = (((t & 0xaaaaaaaa) >> 1) | ((t & 0x55555555) << 1));
t = (((t & 0xcccccccc) >> 2) | ((t & 0x33333333) << 2));
t = (((t & 0xf0f0f0f0) >> 4) | ((t & 0x0f0f0f0f) << 4));
t = (((t & 0xff00ff00) >> 8) | ((t & 0x00ff00ff) << 8));
t = ffs ((t >> 16) | (t << 16));
SET_PARAM0 (0 == t ? t : 33 - t);
}
/******* Floating point instructions *******/
/* Single precision */
INSTRUCTION (lf_add_s) {
/NEWS
10,6 → 10,7
The following bugs are fixed.
* Bug 1770: l.div does not set carry or give correct exception.
* Bug 1771: l.add* do not correctly set the overflow flag.
* Bug 1772: l.fl1 not implemented.
* Bug 1776: l.addic is not implemented.
 
The following bugs are either cannot be reproduced or will not be fixed.
/ChangeLog
1,8 → 1,15
2010-06-10 Jeremy Bennett <jeremy.bennett@embecosm.com>
* peripheral/Makefile.am: mc-defines.h added to sources.
* cpu/or32/insnset.c <l_fl1>: New entry.
* cpu/or32/or32.c <or32_opcodes>: l.fl1 enabled.
* NEWS: Updated with new bugs fixed.
 
2010-06-10 Jeremy Bennett <jeremy.bennett@embecosm.com>
* peripheral/Makefile.am: mc-defines.h added to sources.
* cpu/or32/insnset.c <l_addc>: Updated to handle overflow and
exceptions correctly.
* cpu/or32/or32.c <or32_opcodes>: l.addic enabled.
* NEWS: Updated with new bugs fixed.
 
2010-06-09 Jeremy Bennett <jeremy.bennett@embecosm.com>
* configure: Regenerated.
11,6 → 18,7
* cpu/or32/insnset.c <l_add>: Updated to handle overflow and
exceptions correctly.
* peripheral/Makefile.am: mc-defines.h added to sources.
* NEWS: Updated with new bugs fixed.
 
2010-06-08 Jeremy Bennett <jeremy.bennett@embecosm.com>
* configure: Regenerated.
/testsuite/test-code-or1k/inst-set-test/is-add-test.S
50,9 → 50,9
* 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.
* Problems in this area were reported in Bugs 1771 and 1776. 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).
*
/testsuite/test-code-or1k/inst-set-test/Makefile.in
59,7 → 59,7
build_triplet = @build@
host_triplet = @host@
check_PROGRAMS = is-add-test$(EXEEXT) is-div-test$(EXEEXT) \
is-lws-test$(EXEEXT) $(am__EXEEXT_1)
is-find-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
96,6 → 96,12
is_div_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(is_div_test_LDFLAGS) $(LDFLAGS) -o $@
am_is_find_test_OBJECTS = is-find-test.$(OBJEXT)
is_find_test_OBJECTS = $(am_is_find_test_OBJECTS)
is_find_test_DEPENDENCIES = inst-set-test.lo
is_find_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(is_find_test_LDFLAGS) $(LDFLAGS) -o $@
am_is_lws_test_OBJECTS = is-lws-test.$(OBJEXT)
is_lws_test_OBJECTS = $(am_is_lws_test_OBJECTS)
is_lws_test_DEPENDENCIES = inst-set-test.lo
122,10 → 128,11
$(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)
$(is_find_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)
$(is_div_test_SOURCES) $(is_find_test_SOURCES) \
$(is_lws_test_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
257,17 → 264,22
 
# The new instruction set tests.
is_add_test_SOURCES = inst-set-test.h \
is-add-test.S
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.S
 
is_div_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld
is_div_test_LDADD = inst-set-test.lo
is_find_test_SOURCES = inst-set-test.h \
is-find-test.S
 
is_find_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld
is_find_test_LDADD = inst-set-test.lo
is_lws_test_SOURCES = inst-set-test.h \
is-lws-test.S
is-lws-test.S
 
is_lws_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld
is_lws_test_LDADD = inst-set-test.lo
341,6 → 353,9
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)
is-find-test$(EXEEXT): $(is_find_test_OBJECTS) $(is_find_test_DEPENDENCIES)
@rm -f is-find-test$(EXEEXT)
$(is_find_test_LINK) $(is_find_test_OBJECTS) $(is_find_test_LDADD) $(LIBS)
is-lws-test$(EXEEXT): $(is_lws_test_OBJECTS) $(is_lws_test_DEPENDENCIES)
@rm -f is-lws-test$(EXEEXT)
$(is_lws_test_LINK) $(is_lws_test_OBJECTS) $(is_lws_test_LDADD) $(LIBS)
355,6 → 370,7
@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-find-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is-lws-test.Po@am__quote@
 
.S.o:
/testsuite/test-code-or1k/inst-set-test/is-find-test.S
0,0 → 1,124
/* is-find.test.S. l.ff1 and l.fl1 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.ff1 and l.fl1 should fine the first and last bits in a register
* respectively.
*
* Problems in this area were reported in Bug 1772. 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"
 
/* ----------------------------------------------------------------------------
* A macro to carry out a test of find
*
* Arguments
* opc: The opcode
* op: First operand value
* res: Expected result
* str: Output string
* ------------------------------------------------------------------------- */
#define TEST_FIND(opc, op, res, str) \
LOAD_CONST (r4,33) /* Invalid result */ ;\
LOAD_CONST (r5,op) /* Load number to analyse */ ;\
opc r4,r5 ;\
CHECK_RES (str, r4, res)
 
.section .text
.global _start
_start:
 
/* ----------------------------------------------------------------------------
* Test of find first 1, l.ff1
* ------------------------------------------------------------------------- */
_ff1:
LOAD_STR (r3, "l.ff1\n")
l.jal _puts
l.nop
 
/* Try a range of candidates. */
TEST_FIND (l.ff1, 0x00000001, 1, "ff1 (0x00000001) = 1: ")
TEST_FIND (l.ff1, 0x80000000, 32, "ff1 (0x80000000) = 32: ")
TEST_FIND (l.ff1, 0x55555555, 1, "ff1 (0x55555555) = 1: ")
TEST_FIND (l.ff1, 0xaaaaaaaa, 2, "ff1 (0xaaaaaaaa) = 2: ")
TEST_FIND (l.ff1, 0x00018000, 16, "ff1 (0x00018000) = 16: ")
TEST_FIND (l.ff1, 0xc0000000, 31, "ff1 (0xc0000000) = 31: ")
TEST_FIND (l.ff1, 0x00000000, 0, "ff1 (0x00000000) = 0: ")
 
/* ----------------------------------------------------------------------------
* Test of find first 1, l.fl1
* ------------------------------------------------------------------------- */
_fl1:
LOAD_STR (r3, "l.fl1\n")
l.jal _puts
l.nop
 
/* Try a range of candidates. */
TEST_FIND (l.fl1, 0x00000001, 1, "fl1 (0x00000001) = 1: ")
TEST_FIND (l.fl1, 0x80000000, 32, "fl1 (0x80000000) = 32: ")
TEST_FIND (l.fl1, 0x55555555, 31, "fl1 (0x55555555) = 31: ")
TEST_FIND (l.fl1, 0xaaaaaaaa, 32, "fl1 (0xaaaaaaaa) = 32: ")
TEST_FIND (l.fl1, 0x00018000, 17, "fl1 (0x00018000) = 17: ")
TEST_FIND (l.fl1, 0xc0000000, 32, "fl1 (0xc0000000) = 32: ")
TEST_FIND (l.fl1, 0x00000000, 0, "fl1 (0x00000000) = 0: ")
 
/* ----------------------------------------------------------------------------
* All done
* ------------------------------------------------------------------------- */
_exit:
LOAD_STR (r3, "Test completed\n")
l.jal _puts
l.nop
 
TEST_EXIT
testsuite/test-code-or1k/inst-set-test/is-find-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: testsuite/test-code-or1k/inst-set-test/Makefile.am =================================================================== --- testsuite/test-code-or1k/inst-set-test/Makefile.am (revision 114) +++ testsuite/test-code-or1k/inst-set-test/Makefile.am (revision 115) @@ -43,25 +43,31 @@ # The test programs check_PROGRAMS = is-add-test \ is-div-test \ + is-find-test \ is-lws-test \ $(INST_SET_TEST_OLD) # The new instruction set tests. -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_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_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 = 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 +is_find_test_SOURCES = inst-set-test.h \ + is-find-test.S +is_find_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld +is_find_test_LDADD = inst-set-test.lo +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 + # The old test which builds with warnings and runs with errors inst_set_test_old_SOURCES = inst-set-test-old.c
/testsuite/test-code-or1k/ChangeLog
1,4 → 1,10
2010-06-10 Jeremy Bennett <jeremy.bennett@embecosm.com>
* inst-set-test/is-add-test.S: Commenting corrected.
* inst-set-test/is-find-test.S: Created.
* inst-set-test/Makefile.am: Updated for new tests
* inst-set-test/Makefile.in: Regenerated.
 
2010-06-10 Jeremy Bennett <jeremy.bennett@embecosm.com>
* inst-set-test/is-add-test.S: Added tests for l.addi and l.addic
 
2010-06-09 Jeremy Bennett <jeremy.bennett@embecosm.com>
/testsuite/or1ksim.tests/inst-set-test.exp
24,46 → 24,8
# -----------------------------------------------------------------------------
 
 
# Run the l.lws test
run_or1ksim "lws-test" \
[list "!l.lws" \
" l.lws r4,0(r5): r4=0xdeadbeef: OK" \
" l.lws r4,0(r5): r4=0x00000000: OK" \
" l.lws r4,0(r5): r4=0x7fffffff: OK" \
" l.lws r4,0(r5): r4=0x80000000: OK" \
" l.lws r4,0(r5): r4=0xffffffff: OK" \
" l.lws r4,0(r5): r4=0x00000000: OK" \
" l.lws r4,0(r5): r4=0x7fffffff: OK" \
" l.lws r4,0(r5): r4=0x80000000: OK" \
" l.lws r4,0(r5): r4=0xffffffff: OK" \
" l.lws r4,0(r5): r4=0xdeadbeef: OK" \
" l.lws r4,0(r5): r4=0x00000000: OK" \
" l.lws r4,0(r5): r4=0x7fffffff: OK" \
" l.lws r4,0(r5): r4=0x80000000: OK" \
"!Test completed" \
"!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" \
run_or1ksim "add-test" \
[list "!l.add" \
" 0x00000001 + 0x00000002 = 0x00000003: OK" \
" - carry flag set: FALSE" \
260,3 → 222,64
"!report(0xdeaddead);" \
"!exit(0)"] \
"inst-set-test.cfg" "inst-set-test/is-add-test"
 
# Run the l.div and l.divu test
run_or1ksim "div-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.ff1 and l.fl1 test
run_or1ksim "find-test" \
[list "!l.ff1" \
" ff1 (0x00000001) = 1: OK" \
" ff1 (0x80000000) = 32: OK" \
" ff1 (0x55555555) = 1: OK" \
" ff1 (0xaaaaaaaa) = 2: OK" \
" ff1 (0x00018000) = 16: OK" \
" ff1 (0xc0000000) = 31: OK" \
" ff1 (0x00000000) = 0: OK" \
"!l.fl1" \
" fl1 (0x00000001) = 1: OK" \
" fl1 (0x80000000) = 32: OK" \
" fl1 (0x55555555) = 31: OK" \
" fl1 (0xaaaaaaaa) = 32: OK" \
" fl1 (0x00018000) = 17: OK" \
" fl1 (0xc0000000) = 32: OK" \
" fl1 (0x00000000) = 0: OK" \
"!Test completed" \
"!report(0xdeaddead);" \
"!exit(0)"] \
"inst-set-test.cfg" "inst-set-test/is-find-test"
 
# Run the l.lws test
run_or1ksim "lws-test" \
[list "!l.lws" \
" l.lws r4,0(r5): r4=0xdeadbeef: OK" \
" l.lws r4,0(r5): r4=0x00000000: OK" \
" l.lws r4,0(r5): r4=0x7fffffff: OK" \
" l.lws r4,0(r5): r4=0x80000000: OK" \
" l.lws r4,0(r5): r4=0xffffffff: OK" \
" l.lws r4,0(r5): r4=0x00000000: OK" \
" l.lws r4,0(r5): r4=0x7fffffff: OK" \
" l.lws r4,0(r5): r4=0x80000000: OK" \
" l.lws r4,0(r5): r4=0xffffffff: OK" \
" l.lws r4,0(r5): r4=0xdeadbeef: OK" \
" l.lws r4,0(r5): r4=0x00000000: OK" \
" l.lws r4,0(r5): r4=0x7fffffff: OK" \
" l.lws r4,0(r5): r4=0x80000000: OK" \
"!Test completed" \
"!report(0xdeaddead);" \
"!exit(0)"] \
"inst-set-test.cfg" "inst-set-test/is-lws-test"
/testsuite/ChangeLog
1,8 → 1,14
2010-06-10 Jeremy Bennett <jeremy.bennett@embecosm.com>
* or1ksim.tests/inst-set-test.exp: Added find tests.
* README: Updated with new tests.
 
2010-06-10 Jeremy Bennett <jeremy.bennett@embecosm.com>
* or1ksim.tests/inst-set-test.exp: Extended addition tests.
* README: Updated with new tests.
 
2010-06-09 Jeremy Bennett <jeremy.bennett@embecosm.com>
* or1ksim.tests/inst-set-test.exp: Added division and addition tests.
* README: Updated with new tests.
 
2010-06-06 Jeremy Bennett <jeremy.bennett@embecosm.com>
* or1ksim.tests/inst-set-test.cfg: Created.
/testsuite/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,247 tests compile, run and pass. That
figure is broken down into 983 tests of the standalone simulator and 264 tests
At the time of writing a total of 1,261 tests compile, run and pass. That
figure is broken down into 997 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 983 tests of standalone Or1ksim:
A total of 997 tests of standalone Or1ksim:
 
basic: 8 tests of a wide range of instructions and registers.
cache: 5 tests of the Or1ksim cache modeling
67,7 → 67,8
local-global: 1 test of C local and global variables.
inst-set-test: A collection of tests of individual instructions
is-add-test 180 tests of the l.add* instructions (Bugs 1771, 1776)
is-div-test: 4 tests of the l.div and l.divu instruction (Bug 1770).
is-div-test: 4 tests of the l.div and l.divu instructions (Bug 1770).
is-find-test: 14 tests of the l.ff1 and l.fl1 instructions (Bug 1772).
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.
/configure
1,5 → 1,5
#! /bin/sh
# From configure.ac Id: configure.ac 1030 2010-06-06 17:29:07Z jeremy using automake version AC_ACVERSION.
# From configure.ac Id: configure.ac 1032 2010-06-10 17:04:04Z jeremy using automake version AC_ACVERSION.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for or1ksim 2010-06-09.
#

powered by: WebSVN 2.1.0

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