Skip to contentSkip to conversation

sim: port for OpenRISC

PATCH New Stafford Horne 2 participants 26 messages Nov 23, 2016 – Dec 18, 2016

lore
Share & tools
lore
#0 lore raw

cover sim: port for OpenRISC

Hello,

Please find attached the sim patches that allow to get a basic OpenRISC system running. This was used to verify the OpenRISC gdb port.

The main author is Peter Gavin who should have his FSF copyright in place.

Also some new tests were added specifically for openrisc. Please see the details of running the testsuite for sim below:

=== sim Summary ===

# of expected passes            17
/home/shorne/work/openrisc/build-gdb/sim/or1k/run 0.5

Thanks,
-Stafford

Peter Gavin (11):
sim: cgen: add rem (remainder) function (needed for OR1K lf.rem.[sd])
sim: cgen: add mul-o1flag, mul-o2flag RTL functions to CGEN
sim: cgen: allow suffix on generated arch.[ch] and cpuall.h
sim: or1k: add or1k target to sim
sim: or1k: add NOP_EXIT_SILENT; make simulator print exit code for

    NOP_EXIT;

sim: or1k: fix branching and exceptions in sim
sim: or1k: remove erroneous warning message in sim/or1k/or1k.c
sim: or1k: fix fl1 in sim
sim: or1k: regenerate sim files
sim: testsuite: add testsuite for or1k sim
sim: or1k: fix segfault when run without arguments

Stafford Horne (7):
sim: or1k: Get or1k sim building with latest sim common
sim: or1k: Regenerate cgen files
sim: or1k: Regenerate autotool files
sim: or1k: Implement register store/fetch
sim: or1k: Do trap breakpoint handling
sim: or1k: Implement fetch/store for ppc and sr
sim: or1k: add additional stubs for linux build

#1 lore raw

PATCH 1/18 sim: cgen: add rem (remainder) function (needed for OR1K lf.rem.[sd])

From: Peter Gavin <[email protected]>

* sim/common/ChangeLog-OR1K:
2012-03-14 Peter Gavin <[email protected]>

* cgen-accfp.c: add rem (remainder) function (needed for OR1K lf.rem.[sd]) (remsf) new function
(remdf) ditto
(struct cgen_fp_ops) add fields for rem[sdxt]f functions

---
 sim/common/cgen-accfp.c | 40 ++++++++++++++++++++++++++++++
 sim/common/cgen-fpu.h   |  4 +++
 sim/common/sim-fpu.c    | 66 +++++++++++++++++++++++++++++++++++++++++++++++++
 sim/common/sim-fpu.h    |  3 +++
 4 files changed, 113 insertions(+)
sim/common/cgen-accfp.c +40 -0
index afbca6d..d7124fe 100644
@@ -93,6 +93,25 @@ divsf (CGEN_FPU* fpu, SF x, SF y)
 }
 
 static SF
+remsf (CGEN_FPU* fpu, SF x, SF y)
+{
+  sim_fpu op1;
+  sim_fpu op2;
+  sim_fpu ans;
+  unsigned32 res;
+  sim_fpu_status status;
+
+  sim_fpu_32to (&op1, x);
+  sim_fpu_32to (&op2, y);
+  status = sim_fpu_rem (&ans, &op1, &op2);
+  if (status != 0)
+    (*fpu->ops->error) (fpu, status);
+  sim_fpu_to32 (&res, &ans);
+
+  return res;
+}
+
+static SF
 negsf (CGEN_FPU* fpu, SF x)
 {
   sim_fpu op1;
@@ -452,6 +471,25 @@ divdf (CGEN_FPU* fpu, DF x, DF y)
   return res;
 }
 
+static SF
+remdf (CGEN_FPU* fpu, DF x, DF y)
+{
+  sim_fpu op1;
+  sim_fpu op2;
+  sim_fpu ans;
+  unsigned64 res;
+  sim_fpu_status status;
+
+  sim_fpu_64to (&op1, x);
+  sim_fpu_64to (&op2, y);
+  status = sim_fpu_rem (&ans, &op1, &op2);
+  if (status != 0)
+    (*fpu->ops->error) (fpu, status);
+  sim_fpu_to64(&res, &ans);
+
+  return res;
+}
+
 static DF
 negdf (CGEN_FPU* fpu, DF x)
 {
@@ -664,6 +702,7 @@ cgen_init_accurate_fpu (SIM_CPU* cpu, CGEN_FPU* fpu, CGEN_FPU_ERROR_FN* error)
   o->subsf = subsf;
   o->mulsf = mulsf;
   o->divsf = divsf;
+  o->remsf = remsf;
   o->negsf = negsf;
   o->abssf = abssf;
   o->sqrtsf = sqrtsf;
@@ -682,6 +721,7 @@ cgen_init_accurate_fpu (SIM_CPU* cpu, CGEN_FPU* fpu, CGEN_FPU_ERROR_FN* error)
   o->subdf = subdf;
   o->muldf = muldf;
   o->divdf = divdf;
+  o->remdf = remdf;
   o->negdf = negdf;
   o->absdf = absdf;
   o->sqrtdf = sqrtdf;
sim/common/cgen-fpu.h +4 -0
index 134b4d0..5f9b55d 100644
@@ -69,6 +69,7 @@ struct cgen_fp_ops {
   SF (*subsf) (CGEN_FPU*, SF, SF);
   SF (*mulsf) (CGEN_FPU*, SF, SF);
   SF (*divsf) (CGEN_FPU*, SF, SF);
+  SF (*remsf) (CGEN_FPU*, SF, SF);
   SF (*negsf) (CGEN_FPU*, SF);
   SF (*abssf) (CGEN_FPU*, SF);
   SF (*sqrtsf) (CGEN_FPU*, SF);
@@ -93,6 +94,7 @@ struct cgen_fp_ops {
   DF (*subdf) (CGEN_FPU*, DF, DF);
   DF (*muldf) (CGEN_FPU*, DF, DF);
   DF (*divdf) (CGEN_FPU*, DF, DF);
+  DF (*remdf) (CGEN_FPU*, DF, DF);
   DF (*negdf) (CGEN_FPU*, DF);
   DF (*absdf) (CGEN_FPU*, DF);
   DF (*sqrtdf) (CGEN_FPU*, DF);
@@ -142,6 +144,7 @@ struct cgen_fp_ops {
   XF (*subxf) (CGEN_FPU*, XF, XF);
   XF (*mulxf) (CGEN_FPU*, XF, XF);
   XF (*divxf) (CGEN_FPU*, XF, XF);
+  XF (*remxf) (CGEN_FPU*, XF, XF);
   XF (*negxf) (CGEN_FPU*, XF);
   XF (*absxf) (CGEN_FPU*, XF);
   XF (*sqrtxf) (CGEN_FPU*, XF);
@@ -180,6 +183,7 @@ struct cgen_fp_ops {
   TF (*subtf) (CGEN_FPU*, TF, TF);
   TF (*multf) (CGEN_FPU*, TF, TF);
   TF (*divtf) (CGEN_FPU*, TF, TF);
+  TF (*remtf) (CGEN_FPU*, TF, TF);
   TF (*negtf) (CGEN_FPU*, TF);
   TF (*abstf) (CGEN_FPU*, TF);
   TF (*sqrttf) (CGEN_FPU*, TF);
sim/common/sim-fpu.c +66 -0

78 lines not on this page · raw message

sim/common/sim-fpu.h +3 -0
index eb00beb..2b1c9fe 100644
@@ -151,6 +151,7 @@ typedef enum
   sim_fpu_status_overflow = 4096,
   sim_fpu_status_underflow = 8192,
   sim_fpu_status_denorm = 16384,
+  sim_fpu_status_invalid_irx = 32768, /* (inf % X) */
 } sim_fpu_status;
 
 
@@ -230,6 +231,8 @@ INLINE_SIM_FPU (int) sim_fpu_mul (sim_fpu *f,
 				  const sim_fpu *l, const sim_fpu *r);
 INLINE_SIM_FPU (int) sim_fpu_div (sim_fpu *f,
 				  const sim_fpu *l, const sim_fpu *r);
+INLINE_SIM_FPU (int) sim_fpu_rem (sim_fpu *f,
+				  const sim_fpu *l, const sim_fpu *r);
 INLINE_SIM_FPU (int) sim_fpu_max (sim_fpu *f,
 				  const sim_fpu *l, const sim_fpu *r);
 INLINE_SIM_FPU (int) sim_fpu_min (sim_fpu *f,
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/18 sim: cgen: add mul-o1flag, mul-o2flag RTL functions to CGEN

In reply to Stafford Horne

From: Peter Gavin <[email protected]>

* sim/common/ChangeLog
2012-03-14 Peter Gavin <[email protected]>

* add mul-o1flag (1's complement unsigned multiply overflow flag) and mul-o2flag (2's complement signed multiply overflow flag)
* cgen-ops.h:
(MUL1OFSI) new function: 1's complement
(MUL2OFSI) new function: 2's complement

---
 sim/common/cgen-ops.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
sim/common/cgen-ops.h +18 -0
index 7ff1b4d..81ba02c 100644
@@ -631,6 +631,22 @@ SUBOFQI (QI a, QI b, BI c)
   return res;
 }
 
+SEMOPS_INLINE BI
+MUL2OFSI (SI a, SI b)
+{
+  DI tmp = MULDI (EXTSIDI(a), EXTSIDI(b));
+  BI res = tmp < -0x80000000LL || tmp > 0x7fffffffLL;
+  return res;
+}
+
+SEMOPS_INLINE BI
+MUL1OFSI (USI a, USI b)
+{
+  UDI tmp = MULDI (ZEXTSIDI(a), ZEXTSIDI(b));
+  BI res = (tmp > 0xFFFFFFFFULL);
+  return res;
+}
+
 #else
 
 SI ADDCSI (SI, SI, BI);
@@ -651,6 +667,8 @@ UBI ADDOFQI (QI, QI, BI);
 QI SUBCQI (QI, QI, BI);
 UBI SUBCFQI (QI, QI, BI);
 UBI SUBOFQI (QI, QI, BI);
+BI MUL1OFSI (SI a, SI b);
+BI MUL2OFSI (SI a, SI b);
 
 #endif
 
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/18 sim: cgen: allow suffix on generated arch.[ch] and cpuall.h

In reply to Stafford Horne

From: Peter Gavin <[email protected]>

sim/ChangeLog:

* Make-common.in: pass $(SUFFIX) to cgen.sh in cgen-arch target
* cgen.sh: append suffix to names of arch.[ch] and cpuall.h

---
 sim/common/Make-common.in | 2 +-
 sim/common/cgen.sh        | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
sim/common/Make-common.in +1 -1
index 3d99f62..a78255c 100644
@@ -566,7 +566,7 @@ CGEN_FLAGS_TO_PASS = \
 cgen-arch: force
 	$(SHELL) $(srccom)/cgen.sh arch $(srcdir) \
 		$(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
-		$(arch) "$(FLAGS)" ignored "$(isa)" $(mach) ignored \
+		$(arch) "$(FLAGS)" ignored "$(isa)" $(mach) "$(SUFFIX)" \
 		$(archfile) ignored
 
 cgen-cpu: force
sim/common/cgen.sh +3 -3
index 394ef2d..c03a4a7 100755
@@ -70,11 +70,11 @@ arch)
 		-B ${tmp}-arch.c1 \
 		-N ${tmp}-all.h1
 	sed $sedscript < ${tmp}-arch.h1 > ${tmp}-arch.h
-	${rootdir}/move-if-change ${tmp}-arch.h ${srcdir}/arch.h
+	${rootdir}/move-if-change ${tmp}-arch.h ${srcdir}/arch${suffix}.h
 	sed $sedscript < ${tmp}-arch.c1 > ${tmp}-arch.c
-	${rootdir}/move-if-change ${tmp}-arch.c ${srcdir}/arch.c
+	${rootdir}/move-if-change ${tmp}-arch.c ${srcdir}/arch${suffix}.c
 	sed $sedscript < ${tmp}-all.h1 > ${tmp}-all.h
-	${rootdir}/move-if-change ${tmp}-all.h ${srcdir}/cpuall.h
+	${rootdir}/move-if-change ${tmp}-all.h ${srcdir}/cpuall${suffix}.h
 
 	rm -f ${tmp}-arch.h1 ${tmp}-arch.c1 ${tmp}-all.h1
 	;;
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/18 sim: or1k: add or1k target to sim

In reply to Stafford Horne

From: Peter Gavin <[email protected]>

* sim/ChangeLog:
2012-05-13 Peter Gavin <[email protected]>

* configure.tgt: add or1k target
* configure: regenerate
* or1k/Makefile.in: new file
* or1k/aclocal.m4: new file
* or1k/arch.h: new file
* or1k/arch32.c: new file
* or1k/arch32.h: new file
* or1k/arch64.c: new file
* or1k/arch64.h: new file
* or1k/config.in: new file
* or1k/configure: new file
* or1k/configure.ac: new file
* or1k/cpu.h: new file
* or1k/cpu32.c: new file
* or1k/cpu32.h: new file
* or1k/cpu64.c: new file
* or1k/cpu64.h: new file
* or1k/cpuall.h: new file
* or1k/cpuall32.h: new file
* or1k/cpuall64.h: new file
* or1k/decode.h: new file
* or1k/decode32.c: new file
* or1k/decode32.h: new file
* or1k/decode64.c: new file
* or1k/decode64.h: new file
* or1k/eng.h: new file
* or1k/mloop.in: new file
* or1k/model32.c: new file
* or1k/model64.c: new file
* or1k/or1k-sim.h: new file
* or1k/or1k.c: new file
* or1k/or1k.h: new file
* or1k/or1k32-opc.h: new file
* or1k/or1k64-opc.h: new file
* or1k/sem32-switch.c: new file
* or1k/sem32.c: new file
* or1k/sem64-switch.c: new file
* or1k/sem64.c: new file
* or1k/sim-if.c: new file
* or1k/sim-main.h: new file
* or1k/tconfig.in: new file
* or1k/traps-linux.c: new file
* or1k/traps.c: new file

---
 sim/configure           |     9 +
 sim/configure.tgt       |     4 +
 sim/or1k/ChangeLog      |     8 +
 sim/or1k/Makefile.in    |   219 +
 sim/or1k/aclocal.m4     |    90 +
 sim/or1k/arch.h         |     5 +
 sim/or1k/arch32.c       |    38 +
 sim/or1k/arch32.h       |    50 +
 sim/or1k/arch64.c       |    38 +
 sim/or1k/arch64.h       |    50 +
 sim/or1k/config.in      |   151 +
 sim/or1k/configure      |  6715 ++++++++++++++++++++++++++++++
 sim/or1k/configure.ac   |    42 +
 sim/or1k/cpu.h          |     5 +
 sim/or1k/cpu32.c        | 10133 +++++++++++++++++++++++++++++++++++++++++++++
 sim/or1k/cpu32.h        |  4992 +++++++++++++++++++++++
 sim/or1k/cpu64.c        | 10149 ++++++++++++++++++++++++++++++++++++++++++++++
 sim/or1k/cpu64.h        |  5042 +++++++++++++++++++++++
 sim/or1k/cpuall.h       |     5 +
 sim/or1k/cpuall32.h     |    66 +
 sim/or1k/cpuall64.h     |    66 +
 sim/or1k/decode.h       |     5 +
 sim/or1k/decode32.c     |  2460 +++++++++++
 sim/or1k/decode32.h     |    93 +
 sim/or1k/decode64.c     |  2624 ++++++++++++
 sim/or1k/decode64.h     |    95 +
 sim/or1k/eng.h          |     5 +
 sim/or1k/mloop.in       |   223 +
 sim/or1k/model32.c      |  3639 +++++++++++++++++
 sim/or1k/model64.c      |   135 +
 sim/or1k/or1k-sim.h     |    19 +
 sim/or1k/or1k.c         |   290 ++
 sim/or1k/or1k.h         |    29 +
 sim/or1k/or1k32-opc.h   |   129 +
 sim/or1k/or1k64-opc.h   |   133 +
 sim/or1k/sem32-switch.c |  2594 ++++++++++++
 sim/or1k/sem32.c        |  2789 +++++++++++++
 sim/or1k/sem64-switch.c |  2890 +++++++++++++
 sim/or1k/sem64.c        |  3115 ++++++++++++++
 sim/or1k/sim-if.c       |   325 ++
 sim/or1k/sim-main.h     |    71 +
 sim/or1k/tconfig.in     |     8 +
 sim/or1k/traps-linux.c  |     8 +
 sim/or1k/traps.c        |     8 +
 44 files changed, 59564 insertions(+)
 create mode 100644 sim/or1k/ChangeLog
 create mode 100644 sim/or1k/Makefile.in
 create mode 100644 sim/or1k/aclocal.m4
 create mode 100644 sim/or1k/arch.h
 create mode 100644 sim/or1k/arch32.c
 create mode 100644 sim/or1k/arch32.h
 create mode 100644 sim/or1k/arch64.c
 create mode 100644 sim/or1k/arch64.h
 create mode 100644 sim/or1k/config.in
 create mode 100644 sim/or1k/configure
 create mode 100644 sim/or1k/configure.ac
 create mode 100644 sim/or1k/cpu.h
 create mode 100644 sim/or1k/cpu32.c
 create mode 100644 sim/or1k/cpu32.h
 create mode 100644 sim/or1k/cpu64.c
 create mode 100644 sim/or1k/cpu64.h
 create mode 100644 sim/or1k/cpuall.h
 create mode 100644 sim/or1k/cpuall32.h
 create mode 100644 sim/or1k/cpuall64.h
 create mode 100644 sim/or1k/decode.h
 create mode 100644 sim/or1k/decode32.c
 create mode 100644 sim/or1k/decode32.h
 create mode 100644 sim/or1k/decode64.c
 create mode 100644 sim/or1k/decode64.h
 create mode 100644 sim/or1k/eng.h
 create mode 100644 sim/or1k/mloop.in
 create mode 100644 sim/or1k/model32.c
 create mode 100644 sim/or1k/model64.c
 create mode 100644 sim/or1k/or1k-sim.h
 create mode 100644 sim/or1k/or1k.c
 create mode 100644 sim/or1k/or1k.h
 create mode 100644 sim/or1k/or1k32-opc.h
 create mode 100644 sim/or1k/or1k64-opc.h
 create mode 100644 sim/or1k/sem32-switch.c
 create mode 100644 sim/or1k/sem32.c
 create mode 100644 sim/or1k/sem64-switch.c
 create mode 100644 sim/or1k/sem64.c
 create mode 100644 sim/or1k/sim-if.c
 create mode 100644 sim/or1k/sim-main.h
 create mode 100644 sim/or1k/tconfig.in
 create mode 100644 sim/or1k/traps-linux.c
 create mode 100644 sim/or1k/traps.c
sim/configure +9 -0
index 2729e69..ae2f6964 100755
@@ -653,6 +653,7 @@ microblaze
 mips
 mn10300
 moxie
+or1k
 msp430
 rl78
 rx
@@ -3768,6 +3769,14 @@ subdirs="$subdirs aarch64"
 
 
        ;;
+   or1k-*-* | or1knd-*-*)
+
+  sim_arch=or1k
+  subdirs="$subdirs or1k"
+
+
+       sim_testsuite=yes
+       ;;
    rl78-*-*)
 
   sim_arch=rl78
sim/configure.tgt +4 -0
index c958fb3..82b0e89 100644
@@ -76,6 +76,10 @@ case "${target}" in
    msp430*-*-*)
        SIM_ARCH(msp430)
        ;;
+   or1k-*-* | or1knd-*-*)
+       SIM_ARCH(or1k)
+       sim_testsuite=yes
+       ;;
    rl78-*-*)
        SIM_ARCH(rl78)
        ;;
sim/or1k/ChangeLog new file +8 -0
new file mode 100644
index 0000000..3dc053a
@@ -0,0 +1,8 @@
+2012-05-17  Peter Gavin  <[email protected]>
+
+	* or1k.c (or1k32bf_nop) handle NOP_NOP, NOP_REPORT; warn if
+	unknown l.nop code is unknown
+
+2012-05-13  Peter Gavin  <[email protected]>
+
+	* initial commit
sim/or1k/Makefile.in new file +219 -0

219 lines not on this page · raw message

sim/or1k/aclocal.m4 new file +90 -0

90 lines not on this page · raw message

sim/or1k/arch.h new file +5 -0
new file mode 100644
index 0000000..88202a2
@@ -0,0 +1,5 @@
+#ifndef WANT_OR1K64
+#include "arch32.h"
+#else
+#include "arch64.h"
+#endif
sim/or1k/arch32.c new file +38 -0
new file mode 100644
index 0000000..769f54c
@@ -0,0 +1,38 @@
+/* Simulator support for or1k.
+
+THIS FILE IS MACHINE GENERATED WITH CGEN.
+
+Copyright 1996-2010 Free Software Foundation, Inc.
+
+This file is part of the GNU simulators.
+
+   This file 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, or (at your option)
+   any later version.
+
+   It 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, write to the Free Software Foundation, Inc.,
+   51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include "sim-main.h"
+#include "bfd.h"
+
+const MACH *sim_machs[] =
+{
+#ifdef HAVE_CPU_OR1K32BF
+  & or32_mach,
+#endif
+#ifdef HAVE_CPU_OR1K32BF
+  & or32nd_mach,
+#endif
+  0
+};
+
sim/or1k/arch32.h new file +50 -0

50 lines not on this page · raw message

sim/or1k/arch64.c new file +38 -0
new file mode 100644
index 0000000..e73f37b
@@ -0,0 +1,38 @@
+/* Simulator support for or1k.
+
+THIS FILE IS MACHINE GENERATED WITH CGEN.
+
+Copyright 1996-2010 Free Software Foundation, Inc.
+
+This file is part of the GNU simulators.
+
+   This file 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, or (at your option)
+   any later version.
+
+   It 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, write to the Free Software Foundation, Inc.,
+   51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include "sim-main.h"
+#include "bfd.h"
+
+const MACH *sim_machs[] =
+{
+#ifdef HAVE_CPU_OR1K64BF
+  & or64_mach,
+#endif
+#ifdef HAVE_CPU_OR1K64BF
+  & or64nd_mach,
+#endif
+  0
+};
+
sim/or1k/arch64.h new file +50 -0

50 lines not on this page · raw message

sim/or1k/config.in new file +151 -0

151 lines not on this page · raw message

sim/or1k/configure new file +6715 -0

2,320 lines not on this page · raw message

sim/or1k/configure.ac new file +42 -0

42 lines not on this page · raw message

sim/or1k/cpu.h new file +5 -0
new file mode 100644
index 0000000..1f2a5f3

Lines of this file are not shown. View the raw message.

sim/or1k/cpu32.c new file +10133 -0

10,133 lines not on this page · raw message

sim/or1k/cpu32.h new file +4992 -0

4,992 lines not on this page · raw message

sim/or1k/cpu64.c new file +10149 -0

10,149 lines not on this page · raw message

sim/or1k/cpu64.h new file +5042 -0

5,042 lines not on this page · raw message

sim/or1k/cpuall.h new file +5 -0
new file mode 100644
index 0000000..be6f87b

Lines of this file are not shown. View the raw message.

sim/or1k/cpuall32.h new file +66 -0

66 lines not on this page · raw message

sim/or1k/cpuall64.h new file +66 -0

66 lines not on this page · raw message

sim/or1k/decode.h new file +5 -0
new file mode 100644
index 0000000..fe96fbb

Lines of this file are not shown. View the raw message.

sim/or1k/decode32.c new file +2460 -0

2,460 lines not on this page · raw message

sim/or1k/decode32.h new file +93 -0

93 lines not on this page · raw message

sim/or1k/decode64.c new file +2624 -0

2,624 lines not on this page · raw message

sim/or1k/decode64.h new file +95 -0

95 lines not on this page · raw message

sim/or1k/eng.h new file +5 -0
new file mode 100644
index 0000000..a46cf86

Lines of this file are not shown. View the raw message.

sim/or1k/mloop.in new file +223 -0

223 lines not on this page · raw message

sim/or1k/model32.c new file +3639 -0

3,639 lines not on this page · raw message

sim/or1k/model64.c new file +135 -0

135 lines not on this page · raw message

sim/or1k/or1k-sim.h new file +19 -0
new file mode 100644
index 0000000..9e1754f

Lines of this file are not shown. View the raw message.

sim/or1k/or1k.c new file +290 -0

290 lines not on this page · raw message

sim/or1k/or1k.h new file +29 -0
new file mode 100644
index 0000000..513c946

Lines of this file are not shown. View the raw message.

sim/or1k/or1k32-opc.h new file +129 -0

129 lines not on this page · raw message

sim/or1k/or1k64-opc.h new file +133 -0

133 lines not on this page · raw message

sim/or1k/sem32-switch.c new file +2594 -0

2,594 lines not on this page · raw message

sim/or1k/sem32.c new file +2789 -0

2,789 lines not on this page · raw message

sim/or1k/sem64-switch.c new file +2890 -0

2,890 lines not on this page · raw message

sim/or1k/sem64.c new file +3115 -0

3,115 lines not on this page · raw message

sim/or1k/sim-if.c new file +325 -0

325 lines not on this page · raw message

sim/or1k/sim-main.h new file +71 -0

71 lines not on this page · raw message

sim/or1k/tconfig.in new file +8 -0
new file mode 100644
index 0000000..a1b463f

Lines of this file are not shown. View the raw message.

sim/or1k/traps-linux.c new file +8 -0
new file mode 100644
index 0000000..d2a111f

Lines of this file are not shown. View the raw message.

sim/or1k/traps.c new file +8 -0
new file mode 100644
index 0000000..d2a111f

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.

#5 lore raw

PATCH 5/18 sim: or1k: add NOP_EXIT_SILENT; make simulator print exit code for NOP_EXIT;

In reply to Stafford Horne

From: Peter Gavin <[email protected]>

make newlib's exit use NOP_EXIT_SILENT

---
 sim/or1k/ChangeLog |  8 ++++++++
 sim/or1k/or1k.c    |  3 +++
 sim/or1k/or1k.h    | 23 ++++++++++++-----------
 3 files changed, 23 insertions(+), 11 deletions(-)
sim/or1k/ChangeLog +8 -0
index 3dc053a..cd2617c 100644
@@ -1,3 +1,11 @@
+2012-05-21  Peter Gavin  <[email protected]>
+
+	* or1k.c (or1k32bf_nop) make NOP_EXIT report exit code on
+	simulator output; add NOP_EXIT_SILENT which silently exits. This
+	is needed to maintain compatibility with existing testsuites, but
+	we need to be able to silently exit for the gcc testsuite.
+	Newlib's exit will use NOP_EXIT_SILENT.
+
 2012-05-17  Peter Gavin  <[email protected]>
 
 	* or1k.c (or1k32bf_nop) handle NOP_NOP, NOP_REPORT; warn if
sim/or1k/or1k.c +3 -0
index 9f6e207..aca7333 100644
@@ -136,6 +136,9 @@ void or1k32bf_nop (sim_cpu *current_cpu, USI uimm16)
     break;
     
   case NOP_EXIT:
+    sim_io_printf (CPU_STATE(current_cpu), "exit(%d)\n", GET_H_GPR(3));
+    /* fall through */
+  case NOP_EXIT_SILENT:
     sim_engine_halt (sd, current_cpu, NULL, CPU_PC_GET (current_cpu), sim_exited, GET_H_GPR (3));
     break;
 
sim/or1k/or1k.h +12 -11
index 513c946..f1c9b73 100644
@@ -1,17 +1,18 @@
 #ifndef OR1K_H
 #define OR1K_H
 
-#define NOP_NOP       0x0
-#define NOP_EXIT      0x1
-#define NOP_REPORT    0x2
-#define NOP_PUTC      0x4
-#define NOP_CNT_RESET 0x5
-#define NOP_GET_TICKS 0x6
-#define NOP_GET_PS    0x7
-#define NOP_TRACE_ON  0x8
-#define NOP_TRACE_OFF 0x9
-#define NOP_RANDOM    0xa
-#define NOP_OR1KSIM   0xb
+#define NOP_NOP         0x0
+#define NOP_EXIT        0x1
+#define NOP_REPORT      0x2
+#define NOP_PUTC        0x4
+#define NOP_CNT_RESET   0x5
+#define NOP_GET_TICKS   0x6
+#define NOP_GET_PS      0x7
+#define NOP_TRACE_ON    0x8
+#define NOP_TRACE_OFF   0x9
+#define NOP_RANDOM      0xa
+#define NOP_OR1KSIM     0xb
+#define NOP_EXIT_SILENT 0xc
 
 #define NUM_SPR 0x20000
 #define SPR_GROUP_SHIFT 11
Signature · 1 line
2.7.4
#6 lore raw

PATCH 6/18 sim: or1k: fix branching and exceptions in sim

In reply to Stafford Horne

From: Peter Gavin <[email protected]>

sim/or1k/ChangeLog:

2012-06-22 Peter Gavin <[email protected]>

fix the way branches and exceptions are handled
* Makefile.in: build traps32.o and traps64.o instead of just traps.o
* configure.ac: pick the correct traps object
* configure: regenerated
* mloop.in:
(execute) pass idesc to @cpu at _insn_{before,after}, return vpc instead of result of @cpu at _insts_{after} (extract-pbb) end basic blocks at instructions marked FORCED-CTI
* sim-main.h:
(_sim_cpu) add fields delay_slot and next_delay_slot to track when
an instruction is in a delay slot
* or1k.c:
(or1k_cpu_init) initialized current_cpu->{next_,}delay_slot
(or1k32bf_insn_before) handle delay slot flags, check for invalid
instructions in delay slots
(or1k32bf_insn_after) handle delay slot flags
(or1k32bf_mfspr) move to traps.c
(or1k32bf_mtspr) ditto
(or1k32bf_exception) ditto
(or1k32bf_rfe) ditto
* or1k.h:
(SPR_ADDR_GROUP) new macro
(SPR_INDEX_MASK) ditto
(SPR_ADDR_INDEX) ditto
(or1k32bf_insn_before, or1k32bf_insn_after) add idesc argument
(or1k32bf_exception, or1k32bf_rfe, or1k32bf_nop) add prototypes
(or1k32bf_mfspr, or1k32bf_mtspr) ditto
* traps.h:
(sim_engine_invalid_instruction) new function
(or1k32bf_exception) new function (moved from or1k.c, but was just a stub)
(or1k32bf_rfe) ditto
(or1k32bf_mfspr) moved from or1k.c, some fixes
(or1k32bf_mtspr) moved from or1k.c, some fixes

* sim/testsuite/ChangeLog-OR1K:

2012-06-22 Peter Gavin <[email protected]>

* configure: regenerated

---
 sim/or1k/ChangeLog      |  38 +++++++++++
 sim/or1k/Makefile.in    |  19 +++++-
 sim/or1k/configure      |   8 +--
 sim/or1k/configure.ac   |   8 +--
 sim/or1k/mloop.in       |  27 +++++++-
 sim/or1k/or1k.c         | 116 +++++++++-----------------------
 sim/or1k/or1k.h         |  12 +++-
 sim/or1k/sim-main.h     |   5 ++
 sim/or1k/traps.c        | 173 +++++++++++++++++++++++++++++++++++++++++++++++-
 sim/testsuite/configure |   4 ++
 10 files changed, 307 insertions(+), 103 deletions(-)
sim/or1k/ChangeLog +38 -0
index cd2617c..90dc44a 100644
@@ -1,3 +1,41 @@
+2012-06-22  Peter Gavin  <[email protected]>
+
+	* configure: regenerated
+
+2012-06-22  Peter Gavin  <[email protected]>
+
+	fix the way branches and exceptions are handled
+	* Makefile.in: build traps32.o and traps64.o instead of just traps.o
+	* configure.ac: pick the correct traps object
+	* mloop.in:
+	(execute) pass idesc to @cpu at _insn_{before,after}, return vpc instead of result of @cpu at _insts_{after}
+	(extract-pbb) end basic blocks at instructions marked FORCED-CTI
+	* sim-main.h:
+	(_sim_cpu) add fields delay_slot and next_delay_slot to track when
+	an instruction is in a delay slot
+	* or1k.c:
+	(or1k_cpu_init) initialized current_cpu->{next_,}delay_slot
+	(or1k32bf_insn_before) handle delay slot flags, check for invalid
+	instructions in delay slots
+	(or1k32bf_insn_after) handle delay slot flags
+	(or1k32bf_mfspr) move to traps.c
+	(or1k32bf_mtspr) ditto
+	(or1k32bf_exception) ditto
+	(or1k32bf_rfe) ditto
+	* or1k.h:
+	(SPR_ADDR_GROUP) new macro
+	(SPR_INDEX_MASK) ditto
+	(SPR_ADDR_INDEX) ditto
+	(or1k32bf_insn_before, or1k32bf_insn_after) add idesc argument
+	(or1k32bf_exception, or1k32bf_rfe, or1k32bf_nop) add prototypes
+	(or1k32bf_mfspr, or1k32bf_mtspr) ditto
+	* traps.h:
+	(sim_engine_invalid_instruction) new function
+	(or1k32bf_exception) new function (moved from or1k.c, but was just a stub)
+	(or1k32bf_rfe) ditto
+	(or1k32bf_mfspr) moved from or1k.c, some fixes
+	(or1k32bf_mtspr) moved from or1k.c, some fixes
+
 2012-05-21  Peter Gavin  <[email protected]>
 
 	* or1k.c (or1k32bf_nop) make NOP_EXIT report exit code on
sim/or1k/Makefile.in +16 -3
index b89c070..35ef7e6 100644
@@ -92,9 +92,6 @@ SIM_EXTRA_CLEAN =
 
 arch = or1k
 
-traps.o: traps.c $(SIM_MAIN_DEPS)
-traps-linux.o: traps-linux.c $(SIM_MAIN_DEPS)
-
 # or1k32bf
 
 OR1K32BF_INCLUDE_DEPS = \
@@ -126,6 +123,14 @@ sim-if32.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h eng32.h
 	$(COMPILE) $<
 	$(POSTCOMPILE)
 
+traps32.o: traps.c $(SIM_MAIN_DEPS) eng32.h
+	$(COMPILE) $<
+	$(POSTCOMPILE)
+traps32-linux.o: traps-linux.c $(SIM_MAIN_DEPS) eng32.h
+	$(COMPILE) $<
+	$(POSTCOMPILE)
+
+
 # or1k64bf
 
 OR1K64BF_INCLUDE_DEPS = \
@@ -157,6 +162,14 @@ sim-if64.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h eng64.h
 	$(COMPILE) $<
 	$(POSTCOMPILE)
 
+traps64.o: traps.c $(SIM_MAIN_DEPS) eng64.h
+	$(COMPILE) $<
+	$(POSTCOMPILE)
+traps64-linux.o: traps-linux.c $(SIM_MAIN_DEPS) eng64.h
+	$(COMPILE) $<
+	$(POSTCOMPILE)
+
+
 # cgen support, enable with --enable-cgen-maint
 CGEN_MAINT = ; @true
 # The following line is commented in or out depending upon --enable-cgen-maint.
sim/or1k/configure +4 -4
index ea562d4..eb5e0a2 100644
@@ -2489,11 +2489,11 @@ sim_inline="-DDEFAULT_INLINE=0"
 
 
   case "${target_alias}" in
-  or1k*-linux*)
-    traps_obj=traps-linux.o
+  or1k-linux*|or1knd-linux*)
+    traps_obj=traps32-linux.o
     ;;
-  *)
-    traps_obj=traps.o
+  or1k-*|or1knd-*)
+    traps_obj=traps32.o
     ;;
   esac
 
sim/or1k/configure.ac +4 -4
index fde576b..d5dca70 100644
@@ -4,11 +4,11 @@ AC_INIT(Makefile.in)
 sinclude(../common/acinclude.m4)
   
   case "${target_alias}" in
-  or1k*-linux*)
-    traps_obj=traps-linux.o
+  or1k-linux*|or1knd-linux*)
+    traps_obj=traps32-linux.o
     ;;
-  *)
-    traps_obj=traps.o
+  or1k-*|or1knd-*)
+    traps_obj=traps32.o
     ;;
   esac
 
sim/or1k/mloop.in +24 -3
index 328d1e6..6f19c50 100644
@@ -62,7 +62,7 @@ execute (SIM_CPU *current_cpu, SCACHE *sc, int fast_p)
 {
   SEM_PC vpc;
   
-  @cpu at _insn_before (current_cpu, vpc);
+  @cpu@_insn_before (current_cpu, vpc, sc->argbuf.idesc);
 
   if (fast_p)
     {
@@ -124,7 +124,9 @@ execute (SIM_CPU *current_cpu, SCACHE *sc, int fast_p)
 #endif /* WITH_SEM_SWITCH_FULL */
     }
 
-  return @cpu at _insn_after (current_cpu, vpc);
+  @cpu at _insn_after (current_cpu, vpc, sc->argbuf.idesc);
+  
+  return vpc;
 }
 
 EOF
@@ -161,27 +163,46 @@ xextract-pbb)
 
 cat <<EOF
 {
+  SIM_DESC sd = CPU_STATE(current_cpu);
   const IDESC *idesc;
   int icount = 0;
 
   while (max_insns > 0) {
+
     USI insn = GETIMEMUSI (current_cpu, pc);
+
     idesc = extract (current_cpu, pc, insn, &sc->argbuf, FAST_P);
+
     SEM_SKIP_COMPILE (current_cpu, sc, 1);
+
     ++sc;
     --max_insns;
     ++icount;
     pc += 4;
-    if (CGEN_ATTR_BOOLS (CGEN_INSN_ATTRS ((idesc)->idata)) & CGEN_ATTR_MASK (CGEN_INSN_DELAYED_CTI))
+
+    if (CGEN_ATTR_BOOLS (CGEN_INSN_ATTRS ((idesc)->idata)) & CGEN_ATTR_MASK (CGEN_INSN_FORCED_CTI))
+      {
+        
+        SET_CTI_VPC (sc - 1);
+
+        break;
+
+      }
+    else if (CGEN_ATTR_BOOLS (CGEN_INSN_ATTRS ((idesc)->idata)) & CGEN_ATTR_MASK (CGEN_INSN_DELAYED_CTI))
       {
+
         /* handle delay slot */
         SET_CTI_VPC (sc - 1);
+
         insn = GETIMEMUSI (current_cpu, pc);
+
         idesc = extract (current_cpu, pc, insn, &sc->argbuf, FAST_P);
+        
         ++sc;
         --max_insns;
         ++icount;
         pc += 4;
+
         break;
       }
   }
sim/or1k/or1k.c +31 -85

144 lines not on this page · raw message

sim/or1k/or1k.h +10 -2
index f1c9b73..e71a845 100644
@@ -19,12 +19,20 @@
 #define SPR_GROUP_FIRST(group) (((UWI) SPR_GROUP_##group) << SPR_GROUP_SHIFT)
 #define SPR_GROUP_LAST(group) (SPR_GROUP_FIRST | (((UWI) 1 << SPR_GROUP_SHIFT) - 1))
 #define SPR_ADDR(group,index) (SPR_GROUP_FIRST(group) | ((UWI) SPR_INDEX_##group##_##index))
+#define SPR_ADDR_GROUP(addr) (((UWI) (addr)) >> SPR_GROUP_SHIFT)
+#define SPR_INDEX_MASK (~(~((UWI) 0) << SPR_GROUP_SHIFT))
+#define SPR_ADDR_INDEX(addr) (((UWI) (addr)) && SPR_INDEX_MASK)
 #define SPR_FIELD(group,index,field,val) ((SPR_FIELD_MASK_##group##_##index##_##field & (val)) >> SPR_FIELD_LSB_##group##_##index##_##field)
 
 #ifdef WANT_CPU_OR1K32BF
 void or1k32bf_cpu_init (SIM_DESC sd, sim_cpu *current_cpu);
-void or1k32bf_insn_before (sim_cpu *current_cpu, SEM_PC vpc);
-SEM_PC or1k32bf_insn_after (sim_cpu *current_cpu, SEM_PC vpc);
+void or1k32bf_insn_before (sim_cpu *current_cpu, SEM_PC vpc, IDESC *idesc);
+void or1k32bf_insn_after (sim_cpu *current_cpu, SEM_PC vpc, IDESC *idesc);
+void or1k32bf_exception (sim_cpu *current_cpu, USI pc, USI exnum);
+void or1k32bf_rfe (sim_cpu *current_cpu);
+void or1k32bf_nop (sim_cpu *current_cpu, USI uimm16);
+USI or1k32bf_mfspr (sim_cpu *current_cpu, USI addr);
+void or1k32bf_mtspr (sim_cpu *current_cpu, USI addr, USI val);
 #endif
 
 #endif
sim/or1k/sim-main.h +5 -0
index 8b27906..d26d616 100644
@@ -44,6 +44,11 @@ struct _sim_cpu {
      go after here.  Oh for a better language.  */
   UWI spr[NUM_SPR];
 
+  /* next instruction will be in delay slot */
+  BI next_delay_slot;
+  /* currently in delay slot */
+  BI delay_slot;
+
 #ifdef WANT_CPU_OR1K32BF
   OR1K32BF_CPU_DATA cpu_data;
 #endif
sim/or1k/traps.c +171 -2

179 lines not on this page · raw message

sim/testsuite/configure +4 -0
index bbc3bea..e37bdbd 100755
@@ -1888,6 +1888,10 @@ case "${target}" in
    msp430*-*-*)
        sim_arch=msp430
        ;;
+   or1k-*-* | or1knd-*-*)
+       sim_arch=or1k
+       sim_testsuite=yes
+       ;;
    rl78-*-*)
        sim_arch=rl78
        ;;
Signature · 1 line
2.7.4
#7 lore raw

PATCH 7/18 sim: or1k: remove erroneous warning message in sim/or1k/or1k.c

In reply to Stafford Horne

From: Peter Gavin <[email protected]>

sim/or1k/ChangeLog:

* or1k.c (or1k32bf_make_load_store_addr): remove stupid erroneous warning message

---
 sim/or1k/ChangeLog | 6 ++++++
 sim/or1k/or1k.c    | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)
sim/or1k/ChangeLog +6 -0
index 90dc44a..ccc2c85 100644
@@ -1,5 +1,11 @@
 2012-06-22  Peter Gavin  <[email protected]>
 
+	* or1k.c:
+	(or1k32bf_make_load_store_addr) remove stupid erroneous warning
+	message
+
+2012-06-22  Peter Gavin  <[email protected]>
+
 	* configure: regenerated
 
 2012-06-22  Peter Gavin  <[email protected]>
sim/or1k/or1k.c +0 -5
index 45147d2..776e720 100644
@@ -187,11 +187,6 @@ USI or1k32bf_make_load_store_addr (sim_cpu *current_cpu, USI base, SI offset, in
 {
   SIM_DESC sd = CPU_STATE(current_cpu);
 
-  if (!GET_H_SYS_SR_SM ()) {
-    sim_io_eprintf(sd, "WARNING: l.mfspr in user mode\n");
-    return;
-  }
-  
   USI addr = base + offset;
   
   if (GET_H_SYS_SR_LEE ()) {
Signature · 1 line
2.7.4
#8 lore raw

PATCH 8/18 sim: or1k: fix fl1 in sim

In reply to Stafford Horne

From: Peter Gavin <[email protected]>

sim/or1k/ChangeLog:

* or1k.c (or1k32bf_fl1): fix bug

---
 sim/or1k/ChangeLog | 5 +++++
 sim/or1k/or1k.c    | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
sim/or1k/ChangeLog +5 -0
index ccc2c85..5d120fe 100644
@@ -1,6 +1,11 @@
 2012-06-22  Peter Gavin  <[email protected]>
 
 	* or1k.c:
+	(or1k32bf_fl1) fix bug
+
+2012-06-22  Peter Gavin  <[email protected]>
+
+	* or1k.c:
 	(or1k32bf_make_load_store_addr) remove stupid erroneous warning
 	message
 
sim/or1k/or1k.c +2 -2
index 776e720..98225ab 100644
@@ -225,8 +225,8 @@ USI or1k32bf_fl1 (sim_cpu *current_cpu, USI val)
 {
   USI bit;
   USI ret;
-  for (bit = 1, ret = 1; bit; bit <<= 1, ret++) {
-    if (!(val & bit))
+  for (bit = 1 << 31, ret = 32; bit; bit >>= 1, ret--) {
+    if (val & bit)
       return ret;
   }
   return 0;
Signature · 1 line
2.7.4
#9 lore raw

PATCH 9/18 sim: or1k: regenerate sim files

In reply to Stafford Horne

From: Peter Gavin <[email protected]>

sim/or1k/ChangeLog:

* cpu32.c: regenerate
* cpu32.h: ditto
* cpu64.c: ditto
* cpu64.h: ditto
* decode32.c: ditto
* decode32.h: ditto
* decode64.c: ditto
* decode64.h: ditto
* model32.c: ditto
* sem32.c: ditto
* sem32-switch.c: ditto
* sem64.c: ditto
* sem64-switch.c: ditto

---
 sim/or1k/ChangeLog      |  16 ++++
 sim/or1k/cpu32.c        |  16 ++++
 sim/or1k/cpu32.h        |  36 ++++-----
 sim/or1k/cpu64.c        |  16 ++++
 sim/or1k/cpu64.h        |  36 ++++-----
 sim/or1k/decode32.c     | 197 ++++++++++++++++++-----------------------------
 sim/or1k/decode32.h     |  31 ++++----
 sim/or1k/decode64.c     | 201 +++++++++++++++++++-----------------------------
 sim/or1k/decode64.h     |  33 ++++----
 sim/or1k/model32.c      | 152 ++++++++++++++++++------------------
 sim/or1k/sem32-switch.c | 138 ++++++++++++++++-----------------
 sim/or1k/sem32.c        | 170 ++++++++++++++++++++--------------------
 sim/or1k/sem64-switch.c | 138 ++++++++++++++++-----------------
 sim/or1k/sem64.c        | 170 ++++++++++++++++++++--------------------
 14 files changed, 633 insertions(+), 717 deletions(-)
sim/or1k/ChangeLog +16 -0
index 5d120fe..c1038c3 100644
@@ -1,5 +1,21 @@
 2012-06-22  Peter Gavin  <[email protected]>
 
+	* cpu32.c: regenerate
+	* cpu32.h: ditto
+	* cpu64.c: ditto
+	* cpu64.h: ditto
+	* decode32.c: ditto
+	* decode32.h: ditto
+	* decode64.c: ditto
+	* decode64.h: ditto
+	* model32.c: ditto
+	* sem32.c: ditto
+	* sem32-switch.c: ditto
+	* sem64.c: ditto
+	* sem64-switch.c: ditto
+
+2012-06-22  Peter Gavin  <[email protected]>
+
 	* or1k.c:
 	(or1k32bf_fl1) fix bug
 
sim/or1k/cpu32.c +16 -0
index d503534..36b4040 100644
@@ -9292,6 +9292,22 @@ or1k32bf_h_mac_machi_set (SIM_CPU *current_cpu, USI newval)
   SET_H_MAC_MACHI (newval);
 }
 
+/* Get the value of h-tick-ttmr.  */
+
+USI
+or1k32bf_h_tick_ttmr_get (SIM_CPU *current_cpu)
+{
+  return GET_H_TICK_TTMR ();
+}
+
+/* Set a value for h-tick-ttmr.  */
+
+void
+or1k32bf_h_tick_ttmr_set (SIM_CPU *current_cpu, USI newval)
+{
+  SET_H_TICK_TTMR (newval);
+}
+
 /* Get the value of h-sys-vr-rev.  */
 
 USI
sim/or1k/cpu32.h +13 -23
index e3a8276..a31a935 100644
@@ -2944,6 +2944,11 @@ SET_H_SPR (ORSI (SLLSI (SPR_GROUP_MAC, 11), SPR_INDEX_MAC_MACLO), (x));\
 do { \
 SET_H_SPR (ORSI (SLLSI (SPR_GROUP_MAC, 11), SPR_INDEX_MAC_MACHI), (x));\
 ;} while (0)
+#define GET_H_TICK_TTMR() GET_H_SPR (ORSI (SLLSI (SPR_GROUP_TICK, 11), SPR_INDEX_TICK_TTMR))
+#define SET_H_TICK_TTMR(x) \
+do { \
+SET_H_SPR (ORSI (SLLSI (SPR_GROUP_TICK, 11), SPR_INDEX_TICK_TTMR), (x));\
+;} while (0)
 #define GET_H_SYS_VR_REV() or1k32bf_h_spr_field_get_raw (current_cpu, ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_VR), 5, 0)
 #define SET_H_SYS_VR_REV(x) \
 do { \
@@ -4364,6 +4369,8 @@ USI or1k32bf_h_mac_maclo_get (SIM_CPU *);
 void or1k32bf_h_mac_maclo_set (SIM_CPU *, USI);
 USI or1k32bf_h_mac_machi_get (SIM_CPU *);
 void or1k32bf_h_mac_machi_set (SIM_CPU *, USI);
+USI or1k32bf_h_tick_ttmr_get (SIM_CPU *);
+void or1k32bf_h_tick_ttmr_set (SIM_CPU *, USI);
 USI or1k32bf_h_sys_vr_rev_get (SIM_CPU *);
 void or1k32bf_h_sys_vr_rev_set (SIM_CPU *, USI);
 USI or1k32bf_h_sys_vr_cfg_get (SIM_CPU *);
@@ -4822,14 +4829,14 @@ struct scache {
   f_resv_7_4 = EXTRACT_LSB0_UINT (insn, 32, 7, 4); \
   f_op_3_4 = EXTRACT_LSB0_UINT (insn, 32, 3, 4); \
 
-#define EXTRACT_IFMT_L_SFGTU_VARS \
+#define EXTRACT_IFMT_L_SFGTS_VARS \
   UINT f_opcode; \
   UINT f_op_25_5; \
   UINT f_r2; \
   UINT f_r3; \
   UINT f_resv_10_11; \
   unsigned int length;
-#define EXTRACT_IFMT_L_SFGTU_CODE \
+#define EXTRACT_IFMT_L_SFGTS_CODE \
   length = 4; \
   f_opcode = EXTRACT_LSB0_UINT (insn, 32, 31, 6); \
   f_op_25_5 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
@@ -4837,19 +4844,6 @@ struct scache {
   f_r3 = EXTRACT_LSB0_UINT (insn, 32, 15, 5); \
   f_resv_10_11 = EXTRACT_LSB0_UINT (insn, 32, 10, 11); \
 
-#define EXTRACT_IFMT_L_SFGTUI_VARS \
-  UINT f_opcode; \
-  UINT f_op_25_5; \
-  UINT f_r2; \
-  UINT f_uimm16; \
-  unsigned int length;
-#define EXTRACT_IFMT_L_SFGTUI_CODE \
-  length = 4; \
-  f_opcode = EXTRACT_LSB0_UINT (insn, 32, 31, 6); \
-  f_op_25_5 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
-  f_r2 = EXTRACT_LSB0_UINT (insn, 32, 20, 5); \
-  f_uimm16 = EXTRACT_LSB0_UINT (insn, 32, 15, 16); \
-
 #define EXTRACT_IFMT_L_SFGTSI_VARS \
   UINT f_opcode; \
   UINT f_op_25_5; \
@@ -4882,20 +4876,16 @@ struct scache {
 
 #define EXTRACT_IFMT_L_MACI_VARS \
   UINT f_opcode; \
-  UINT f_resv_20_5; \
+  UINT f_resv_25_5; \
   UINT f_r2; \
-  UINT f_imm16_25_5; \
-  UINT f_imm16_10_11; \
-  INT f_simm16_split; \
+  INT f_simm16; \
   unsigned int length;
 #define EXTRACT_IFMT_L_MACI_CODE \
   length = 4; \
   f_opcode = EXTRACT_LSB0_UINT (insn, 32, 31, 6); \
-  f_resv_20_5 = EXTRACT_LSB0_UINT (insn, 32, 20, 5); \
+  f_resv_25_5 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
   f_r2 = EXTRACT_LSB0_UINT (insn, 32, 20, 5); \
-  f_imm16_25_5 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
-  f_imm16_10_11 = EXTRACT_LSB0_UINT (insn, 32, 10, 11); \
-  f_simm16_split = ((HI) (UINT) (((((f_imm16_25_5) << (11))) | (f_imm16_10_11))));\
+  f_simm16 = EXTRACT_LSB0_SINT (insn, 32, 15, 16); \
 
 #define EXTRACT_IFMT_LF_ADD_S_VARS \
   UINT f_opcode; \
sim/or1k/cpu64.c +16 -0
index 1cb4487..cd25e89 100644
@@ -9308,6 +9308,22 @@ or1k64bf_h_mac_machi_set (SIM_CPU *current_cpu, UDI newval)
   SET_H_MAC_MACHI (newval);
 }
 
+/* Get the value of h-tick-ttmr.  */
+
+UDI
+or1k64bf_h_tick_ttmr_get (SIM_CPU *current_cpu)
+{
+  return GET_H_TICK_TTMR ();
+}
+
+/* Set a value for h-tick-ttmr.  */
+
+void
+or1k64bf_h_tick_ttmr_set (SIM_CPU *current_cpu, UDI newval)
+{
+  SET_H_TICK_TTMR (newval);
+}
+
 /* Get the value of h-sys-vr-rev.  */
 
 UDI
sim/or1k/cpu64.h +13 -23
index c17c960..5bfbf9e 100644
@@ -2949,6 +2949,11 @@ SET_H_SPR (ORDI (SLLDI (SPR_GROUP_MAC, 11), SPR_INDEX_MAC_MACLO), (x));\
 do { \
 SET_H_SPR (ORDI (SLLDI (SPR_GROUP_MAC, 11), SPR_INDEX_MAC_MACHI), (x));\
 ;} while (0)
+#define GET_H_TICK_TTMR() GET_H_SPR (ORDI (SLLDI (SPR_GROUP_TICK, 11), SPR_INDEX_TICK_TTMR))
+#define SET_H_TICK_TTMR(x) \
+do { \
+SET_H_SPR (ORDI (SLLDI (SPR_GROUP_TICK, 11), SPR_INDEX_TICK_TTMR), (x));\
+;} while (0)
 #define GET_H_SYS_VR_REV() or1k64bf_h_spr_field_get_raw (current_cpu, ORDI (SLLDI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_VR), 5, 0)
 #define SET_H_SYS_VR_REV(x) \
 do { \
@@ -4371,6 +4376,8 @@ UDI or1k64bf_h_mac_maclo_get (SIM_CPU *);
 void or1k64bf_h_mac_maclo_set (SIM_CPU *, UDI);
 UDI or1k64bf_h_mac_machi_get (SIM_CPU *);
 void or1k64bf_h_mac_machi_set (SIM_CPU *, UDI);
+UDI or1k64bf_h_tick_ttmr_get (SIM_CPU *);
+void or1k64bf_h_tick_ttmr_set (SIM_CPU *, UDI);
 UDI or1k64bf_h_sys_vr_rev_get (SIM_CPU *);
 void or1k64bf_h_sys_vr_rev_set (SIM_CPU *, UDI);
 UDI or1k64bf_h_sys_vr_cfg_get (SIM_CPU *);
@@ -4821,14 +4828,14 @@ struct scache {
   f_resv_7_4 = EXTRACT_LSB0_UINT (insn, 32, 7, 4); \
   f_op_3_4 = EXTRACT_LSB0_UINT (insn, 32, 3, 4); \
 
-#define EXTRACT_IFMT_L_SFGTU_VARS \
+#define EXTRACT_IFMT_L_SFGTS_VARS \
   UINT f_opcode; \
   UINT f_op_25_5; \
   UINT f_r2; \
   UINT f_r3; \
   UINT f_resv_10_11; \
   unsigned int length;
-#define EXTRACT_IFMT_L_SFGTU_CODE \
+#define EXTRACT_IFMT_L_SFGTS_CODE \
   length = 4; \
   f_opcode = EXTRACT_LSB0_UINT (insn, 32, 31, 6); \
   f_op_25_5 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
@@ -4836,19 +4843,6 @@ struct scache {
   f_r3 = EXTRACT_LSB0_UINT (insn, 32, 15, 5); \
   f_resv_10_11 = EXTRACT_LSB0_UINT (insn, 32, 10, 11); \
 
-#define EXTRACT_IFMT_L_SFGTUI_VARS \
-  UINT f_opcode; \
-  UINT f_op_25_5; \
-  UINT f_r2; \
-  UINT f_uimm16; \
-  unsigned int length;
-#define EXTRACT_IFMT_L_SFGTUI_CODE \
-  length = 4; \
-  f_opcode = EXTRACT_LSB0_UINT (insn, 32, 31, 6); \
-  f_op_25_5 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
-  f_r2 = EXTRACT_LSB0_UINT (insn, 32, 20, 5); \
-  f_uimm16 = EXTRACT_LSB0_UINT (insn, 32, 15, 16); \
-
 #define EXTRACT_IFMT_L_SFGTSI_VARS \
   UINT f_opcode; \
   UINT f_op_25_5; \
@@ -4881,20 +4875,16 @@ struct scache {
 
 #define EXTRACT_IFMT_L_MACI_VARS \
   UINT f_opcode; \
-  UINT f_resv_20_5; \
+  UINT f_resv_25_5; \
   UINT f_r2; \
-  UINT f_imm16_25_5; \
-  UINT f_imm16_10_11; \
-  INT f_simm16_split; \
+  INT f_simm16; \
   unsigned int length;
 #define EXTRACT_IFMT_L_MACI_CODE \
   length = 4; \
   f_opcode = EXTRACT_LSB0_UINT (insn, 32, 31, 6); \
-  f_resv_20_5 = EXTRACT_LSB0_UINT (insn, 32, 20, 5); \
+  f_resv_25_5 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
   f_r2 = EXTRACT_LSB0_UINT (insn, 32, 20, 5); \
-  f_imm16_25_5 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
-  f_imm16_10_11 = EXTRACT_LSB0_UINT (insn, 32, 10, 11); \
-  f_simm16_split = ((HI) (UINT) (((((f_imm16_25_5) << (11))) | (f_imm16_10_11))));\
+  f_simm16 = EXTRACT_LSB0_SINT (insn, 32, 15, 16); \
 
 #define EXTRACT_IFMT_LF_ADD_S_VARS \
   UINT f_opcode; \
sim/or1k/decode32.c +75 -122

380 lines not on this page · raw message

sim/or1k/decode32.h +15 -16
index 56f4669..a854856 100644
@@ -49,11 +49,11 @@ typedef enum or1k32bf_insn_type {
  , OR1K32BF_INSN_L_FL1, OR1K32BF_INSN_L_ANDI, OR1K32BF_INSN_L_ORI, OR1K32BF_INSN_L_XORI
  , OR1K32BF_INSN_L_ADDI, OR1K32BF_INSN_L_ADDIC, OR1K32BF_INSN_L_MULI, OR1K32BF_INSN_L_EXTHS
  , OR1K32BF_INSN_L_EXTBS, OR1K32BF_INSN_L_EXTHZ, OR1K32BF_INSN_L_EXTBZ, OR1K32BF_INSN_L_EXTWS
- , OR1K32BF_INSN_L_EXTWZ, OR1K32BF_INSN_L_CMOV, OR1K32BF_INSN_L_SFGTU, OR1K32BF_INSN_L_SFGEU
- , OR1K32BF_INSN_L_SFLTU, OR1K32BF_INSN_L_SFLEU, OR1K32BF_INSN_L_SFGTS, OR1K32BF_INSN_L_SFGES
- , OR1K32BF_INSN_L_SFLTS, OR1K32BF_INSN_L_SFLES, OR1K32BF_INSN_L_SFGTUI, OR1K32BF_INSN_L_SFGEUI
- , OR1K32BF_INSN_L_SFLTUI, OR1K32BF_INSN_L_SFLEUI, OR1K32BF_INSN_L_SFGTSI, OR1K32BF_INSN_L_SFGESI
- , OR1K32BF_INSN_L_SFLTSI, OR1K32BF_INSN_L_SFLESI, OR1K32BF_INSN_L_SFEQ, OR1K32BF_INSN_L_SFEQI
+ , OR1K32BF_INSN_L_EXTWZ, OR1K32BF_INSN_L_CMOV, OR1K32BF_INSN_L_SFGTS, OR1K32BF_INSN_L_SFGTSI
+ , OR1K32BF_INSN_L_SFGTU, OR1K32BF_INSN_L_SFGTUI, OR1K32BF_INSN_L_SFGES, OR1K32BF_INSN_L_SFGESI
+ , OR1K32BF_INSN_L_SFGEU, OR1K32BF_INSN_L_SFGEUI, OR1K32BF_INSN_L_SFLTS, OR1K32BF_INSN_L_SFLTSI
+ , OR1K32BF_INSN_L_SFLTU, OR1K32BF_INSN_L_SFLTUI, OR1K32BF_INSN_L_SFLES, OR1K32BF_INSN_L_SFLESI
+ , OR1K32BF_INSN_L_SFLEU, OR1K32BF_INSN_L_SFLEUI, OR1K32BF_INSN_L_SFEQ, OR1K32BF_INSN_L_SFEQI
  , OR1K32BF_INSN_L_SFNE, OR1K32BF_INSN_L_SFNEI, OR1K32BF_INSN_L_MAC, OR1K32BF_INSN_L_MSB
  , OR1K32BF_INSN_L_MACI, OR1K32BF_INSN_L_CUST1, OR1K32BF_INSN_L_CUST2, OR1K32BF_INSN_L_CUST3
  , OR1K32BF_INSN_L_CUST4, OR1K32BF_INSN_L_CUST5, OR1K32BF_INSN_L_CUST6, OR1K32BF_INSN_L_CUST7
@@ -67,17 +67,16 @@ typedef enum or1k32bf_insn_type {
 /* Enum declaration for semantic formats in cpu family or1k32bf.  */
 typedef enum or1k32bf_sfmt_type {
   OR1K32BF_SFMT_EMPTY, OR1K32BF_SFMT_L_J, OR1K32BF_SFMT_L_JAL, OR1K32BF_SFMT_L_JR
- , OR1K32BF_SFMT_L_JALR, OR1K32BF_SFMT_L_BNF, OR1K32BF_SFMT_L_TRAP, OR1K32BF_SFMT_L_NOP_IMM
- , OR1K32BF_SFMT_L_MOVHI, OR1K32BF_SFMT_L_MACRC, OR1K32BF_SFMT_L_MFSPR, OR1K32BF_SFMT_L_MTSPR
- , OR1K32BF_SFMT_L_LWZ, OR1K32BF_SFMT_L_LWS, OR1K32BF_SFMT_L_LBZ, OR1K32BF_SFMT_L_LBS
- , OR1K32BF_SFMT_L_LHZ, OR1K32BF_SFMT_L_LHS, OR1K32BF_SFMT_L_SW, OR1K32BF_SFMT_L_SB
- , OR1K32BF_SFMT_L_SH, OR1K32BF_SFMT_L_SLL, OR1K32BF_SFMT_L_SLLI, OR1K32BF_SFMT_L_AND
- , OR1K32BF_SFMT_L_ADD, OR1K32BF_SFMT_L_ADDC, OR1K32BF_SFMT_L_DIV, OR1K32BF_SFMT_L_FF1
- , OR1K32BF_SFMT_L_ANDI, OR1K32BF_SFMT_L_XORI, OR1K32BF_SFMT_L_ADDI, OR1K32BF_SFMT_L_ADDIC
- , OR1K32BF_SFMT_L_EXTHS, OR1K32BF_SFMT_L_CMOV, OR1K32BF_SFMT_L_SFGTU, OR1K32BF_SFMT_L_SFGTUI
- , OR1K32BF_SFMT_L_SFGTSI, OR1K32BF_SFMT_L_MAC, OR1K32BF_SFMT_L_MACI, OR1K32BF_SFMT_L_CUST1
- , OR1K32BF_SFMT_LF_ADD_S, OR1K32BF_SFMT_LF_ITOF_S, OR1K32BF_SFMT_LF_FTOI_S, OR1K32BF_SFMT_LF_EQ_S
- , OR1K32BF_SFMT_LF_MADD_S
+ , OR1K32BF_SFMT_L_JALR, OR1K32BF_SFMT_L_BNF, OR1K32BF_SFMT_L_TRAP, OR1K32BF_SFMT_L_RFE
+ , OR1K32BF_SFMT_L_NOP_IMM, OR1K32BF_SFMT_L_MOVHI, OR1K32BF_SFMT_L_MACRC, OR1K32BF_SFMT_L_MFSPR
+ , OR1K32BF_SFMT_L_MTSPR, OR1K32BF_SFMT_L_LWZ, OR1K32BF_SFMT_L_LWS, OR1K32BF_SFMT_L_LBZ
+ , OR1K32BF_SFMT_L_LBS, OR1K32BF_SFMT_L_LHZ, OR1K32BF_SFMT_L_LHS, OR1K32BF_SFMT_L_SW
+ , OR1K32BF_SFMT_L_SB, OR1K32BF_SFMT_L_SH, OR1K32BF_SFMT_L_SLL, OR1K32BF_SFMT_L_SLLI
+ , OR1K32BF_SFMT_L_AND, OR1K32BF_SFMT_L_ADD, OR1K32BF_SFMT_L_ADDC, OR1K32BF_SFMT_L_DIV
+ , OR1K32BF_SFMT_L_FF1, OR1K32BF_SFMT_L_XORI, OR1K32BF_SFMT_L_ADDI, OR1K32BF_SFMT_L_ADDIC
+ , OR1K32BF_SFMT_L_EXTHS, OR1K32BF_SFMT_L_CMOV, OR1K32BF_SFMT_L_SFGTS, OR1K32BF_SFMT_L_SFGTSI
+ , OR1K32BF_SFMT_L_MAC, OR1K32BF_SFMT_L_MACI, OR1K32BF_SFMT_LF_ADD_S, OR1K32BF_SFMT_LF_ITOF_S
+ , OR1K32BF_SFMT_LF_FTOI_S, OR1K32BF_SFMT_LF_EQ_S, OR1K32BF_SFMT_LF_MADD_S
 } OR1K32BF_SFMT_TYPE;
 
 /* Function unit handlers (user written).  */
sim/or1k/decode64.c +77 -124

390 lines not on this page · raw message

sim/or1k/decode64.h +16 -17
index a5f5806..db5f56f 100644
@@ -49,11 +49,11 @@ typedef enum or1k64bf_insn_type {
  , OR1K64BF_INSN_L_FL1, OR1K64BF_INSN_L_ANDI, OR1K64BF_INSN_L_ORI, OR1K64BF_INSN_L_XORI
  , OR1K64BF_INSN_L_ADDI, OR1K64BF_INSN_L_ADDIC, OR1K64BF_INSN_L_MULI, OR1K64BF_INSN_L_EXTHS
  , OR1K64BF_INSN_L_EXTBS, OR1K64BF_INSN_L_EXTHZ, OR1K64BF_INSN_L_EXTBZ, OR1K64BF_INSN_L_EXTWS
- , OR1K64BF_INSN_L_EXTWZ, OR1K64BF_INSN_L_CMOV, OR1K64BF_INSN_L_SFGTU, OR1K64BF_INSN_L_SFGEU
- , OR1K64BF_INSN_L_SFLTU, OR1K64BF_INSN_L_SFLEU, OR1K64BF_INSN_L_SFGTS, OR1K64BF_INSN_L_SFGES
- , OR1K64BF_INSN_L_SFLTS, OR1K64BF_INSN_L_SFLES, OR1K64BF_INSN_L_SFGTUI, OR1K64BF_INSN_L_SFGEUI
- , OR1K64BF_INSN_L_SFLTUI, OR1K64BF_INSN_L_SFLEUI, OR1K64BF_INSN_L_SFGTSI, OR1K64BF_INSN_L_SFGESI
- , OR1K64BF_INSN_L_SFLTSI, OR1K64BF_INSN_L_SFLESI, OR1K64BF_INSN_L_SFEQ, OR1K64BF_INSN_L_SFEQI
+ , OR1K64BF_INSN_L_EXTWZ, OR1K64BF_INSN_L_CMOV, OR1K64BF_INSN_L_SFGTS, OR1K64BF_INSN_L_SFGTSI
+ , OR1K64BF_INSN_L_SFGTU, OR1K64BF_INSN_L_SFGTUI, OR1K64BF_INSN_L_SFGES, OR1K64BF_INSN_L_SFGESI
+ , OR1K64BF_INSN_L_SFGEU, OR1K64BF_INSN_L_SFGEUI, OR1K64BF_INSN_L_SFLTS, OR1K64BF_INSN_L_SFLTSI
+ , OR1K64BF_INSN_L_SFLTU, OR1K64BF_INSN_L_SFLTUI, OR1K64BF_INSN_L_SFLES, OR1K64BF_INSN_L_SFLESI
+ , OR1K64BF_INSN_L_SFLEU, OR1K64BF_INSN_L_SFLEUI, OR1K64BF_INSN_L_SFEQ, OR1K64BF_INSN_L_SFEQI
  , OR1K64BF_INSN_L_SFNE, OR1K64BF_INSN_L_SFNEI, OR1K64BF_INSN_L_MAC, OR1K64BF_INSN_L_MSB
  , OR1K64BF_INSN_L_MACI, OR1K64BF_INSN_L_CUST1, OR1K64BF_INSN_L_CUST2, OR1K64BF_INSN_L_CUST3
  , OR1K64BF_INSN_L_CUST4, OR1K64BF_INSN_L_CUST5, OR1K64BF_INSN_L_CUST6, OR1K64BF_INSN_L_CUST7
@@ -70,18 +70,17 @@ typedef enum or1k64bf_insn_type {
 /* Enum declaration for semantic formats in cpu family or1k64bf.  */
 typedef enum or1k64bf_sfmt_type {
   OR1K64BF_SFMT_EMPTY, OR1K64BF_SFMT_L_J, OR1K64BF_SFMT_L_JAL, OR1K64BF_SFMT_L_JR
- , OR1K64BF_SFMT_L_JALR, OR1K64BF_SFMT_L_BNF, OR1K64BF_SFMT_L_TRAP, OR1K64BF_SFMT_L_NOP_IMM
- , OR1K64BF_SFMT_L_MOVHI, OR1K64BF_SFMT_L_MACRC, OR1K64BF_SFMT_L_MFSPR, OR1K64BF_SFMT_L_MTSPR
- , OR1K64BF_SFMT_L_LWZ, OR1K64BF_SFMT_L_LWS, OR1K64BF_SFMT_L_LBZ, OR1K64BF_SFMT_L_LBS
- , OR1K64BF_SFMT_L_LHZ, OR1K64BF_SFMT_L_LHS, OR1K64BF_SFMT_L_SW, OR1K64BF_SFMT_L_SB
- , OR1K64BF_SFMT_L_SH, OR1K64BF_SFMT_L_SLL, OR1K64BF_SFMT_L_SLLI, OR1K64BF_SFMT_L_AND
- , OR1K64BF_SFMT_L_ADD, OR1K64BF_SFMT_L_ADDC, OR1K64BF_SFMT_L_DIV, OR1K64BF_SFMT_L_FF1
- , OR1K64BF_SFMT_L_ANDI, OR1K64BF_SFMT_L_XORI, OR1K64BF_SFMT_L_ADDI, OR1K64BF_SFMT_L_ADDIC
- , OR1K64BF_SFMT_L_EXTHS, OR1K64BF_SFMT_L_CMOV, OR1K64BF_SFMT_L_SFGTU, OR1K64BF_SFMT_L_SFGTUI
- , OR1K64BF_SFMT_L_SFGTSI, OR1K64BF_SFMT_L_MAC, OR1K64BF_SFMT_L_MACI, OR1K64BF_SFMT_L_CUST1
- , OR1K64BF_SFMT_LF_ADD_S, OR1K64BF_SFMT_LF_ADD_D, OR1K64BF_SFMT_LF_ITOF_S, OR1K64BF_SFMT_LF_ITOF_D
- , OR1K64BF_SFMT_LF_FTOI_S, OR1K64BF_SFMT_LF_FTOI_D, OR1K64BF_SFMT_LF_EQ_S, OR1K64BF_SFMT_LF_EQ_D
- , OR1K64BF_SFMT_LF_MADD_S, OR1K64BF_SFMT_LF_MADD_D
+ , OR1K64BF_SFMT_L_JALR, OR1K64BF_SFMT_L_BNF, OR1K64BF_SFMT_L_TRAP, OR1K64BF_SFMT_L_RFE
+ , OR1K64BF_SFMT_L_NOP_IMM, OR1K64BF_SFMT_L_MOVHI, OR1K64BF_SFMT_L_MACRC, OR1K64BF_SFMT_L_MFSPR
+ , OR1K64BF_SFMT_L_MTSPR, OR1K64BF_SFMT_L_LWZ, OR1K64BF_SFMT_L_LWS, OR1K64BF_SFMT_L_LBZ
+ , OR1K64BF_SFMT_L_LBS, OR1K64BF_SFMT_L_LHZ, OR1K64BF_SFMT_L_LHS, OR1K64BF_SFMT_L_SW
+ , OR1K64BF_SFMT_L_SB, OR1K64BF_SFMT_L_SH, OR1K64BF_SFMT_L_SLL, OR1K64BF_SFMT_L_SLLI
+ , OR1K64BF_SFMT_L_AND, OR1K64BF_SFMT_L_ADD, OR1K64BF_SFMT_L_ADDC, OR1K64BF_SFMT_L_DIV
+ , OR1K64BF_SFMT_L_FF1, OR1K64BF_SFMT_L_XORI, OR1K64BF_SFMT_L_ADDI, OR1K64BF_SFMT_L_ADDIC
+ , OR1K64BF_SFMT_L_EXTHS, OR1K64BF_SFMT_L_CMOV, OR1K64BF_SFMT_L_SFGTS, OR1K64BF_SFMT_L_SFGTSI
+ , OR1K64BF_SFMT_L_MAC, OR1K64BF_SFMT_L_MACI, OR1K64BF_SFMT_LF_ADD_S, OR1K64BF_SFMT_LF_ADD_D
+ , OR1K64BF_SFMT_LF_ITOF_S, OR1K64BF_SFMT_LF_ITOF_D, OR1K64BF_SFMT_LF_FTOI_S, OR1K64BF_SFMT_LF_FTOI_D
+ , OR1K64BF_SFMT_LF_EQ_S, OR1K64BF_SFMT_LF_EQ_D, OR1K64BF_SFMT_LF_MADD_S, OR1K64BF_SFMT_LF_MADD_D
 } OR1K64BF_SFMT_TYPE;
 
 /* Function unit handlers (user written).  */
sim/or1k/model32.c +76 -76

398 lines not on this page · raw message

sim/or1k/sem32-switch.c +67 -71

435 lines not on this page · raw message

sim/or1k/sem32.c +83 -87

490 lines not on this page · raw message

sim/or1k/sem64-switch.c +67 -71

435 lines not on this page · raw message

sim/or1k/sem64.c +83 -87

163 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.

#10 lore raw

PATCH 10/18 sim: testsuite: add testsuite for or1k sim

In reply to Stafford Horne

From: Peter Gavin <[email protected]>

* sim/testsuite/ChangeLog-OR1K:

* add testsuite for or1k

---
 sim/testsuite/sim/or1k/add.S                   | 546 +++++++++++++++++
 sim/testsuite/sim/or1k/alltests.exp            |  19 +
 sim/testsuite/sim/or1k/and.S                   | 208 +++++++
 sim/testsuite/sim/or1k/basic.S                 | 535 +++++++++++++++++
 sim/testsuite/sim/or1k/div.S                   | 198 +++++++
 sim/testsuite/sim/or1k/ext.S                   | 251 ++++++++
 sim/testsuite/sim/or1k/find.S                  | 119 ++++
 sim/testsuite/sim/or1k/flag.S                  | 405 +++++++++++++
 sim/testsuite/sim/or1k/jump.S                  | 121 ++++
 sim/testsuite/sim/or1k/load.S                  | 373 ++++++++++++
 sim/testsuite/sim/or1k/mac.S                   | 785 +++++++++++++++++++++++++
 sim/testsuite/sim/or1k/mfspr.S                 | 196 ++++++
 sim/testsuite/sim/or1k/mul.S                   | 277 +++++++++
 sim/testsuite/sim/or1k/or.S                    | 207 +++++++
 sim/testsuite/sim/or1k/or1k-asm-test-env.h     |  61 ++
 sim/testsuite/sim/or1k/or1k-asm-test-helpers.h | 134 +++++
 sim/testsuite/sim/or1k/or1k-asm-test.h         | 258 ++++++++
 sim/testsuite/sim/or1k/or1k-asm.h              |  20 +
 sim/testsuite/sim/or1k/or1k-test.ld            |  57 ++
 sim/testsuite/sim/or1k/ror.S                   | 186 ++++++
 sim/testsuite/sim/or1k/shift.S                 | 572 ++++++++++++++++++
 sim/testsuite/sim/or1k/spr-defs.h              | 590 +++++++++++++++++++
 sim/testsuite/sim/or1k/sub.S                   | 176 ++++++
 sim/testsuite/sim/or1k/xor.S                   | 210 +++++++
 24 files changed, 6504 insertions(+)
 create mode 100644 sim/testsuite/sim/or1k/add.S
 create mode 100644 sim/testsuite/sim/or1k/alltests.exp
 create mode 100644 sim/testsuite/sim/or1k/and.S
 create mode 100644 sim/testsuite/sim/or1k/basic.S
 create mode 100644 sim/testsuite/sim/or1k/div.S
 create mode 100644 sim/testsuite/sim/or1k/ext.S
 create mode 100644 sim/testsuite/sim/or1k/find.S
 create mode 100644 sim/testsuite/sim/or1k/flag.S
 create mode 100644 sim/testsuite/sim/or1k/jump.S
 create mode 100644 sim/testsuite/sim/or1k/load.S
 create mode 100644 sim/testsuite/sim/or1k/mac.S
 create mode 100644 sim/testsuite/sim/or1k/mfspr.S
 create mode 100644 sim/testsuite/sim/or1k/mul.S
 create mode 100644 sim/testsuite/sim/or1k/or.S
 create mode 100644 sim/testsuite/sim/or1k/or1k-asm-test-env.h
 create mode 100644 sim/testsuite/sim/or1k/or1k-asm-test-helpers.h
 create mode 100644 sim/testsuite/sim/or1k/or1k-asm-test.h
 create mode 100644 sim/testsuite/sim/or1k/or1k-asm.h
 create mode 100644 sim/testsuite/sim/or1k/or1k-test.ld
 create mode 100644 sim/testsuite/sim/or1k/ror.S
 create mode 100644 sim/testsuite/sim/or1k/shift.S
 create mode 100644 sim/testsuite/sim/or1k/spr-defs.h
 create mode 100644 sim/testsuite/sim/or1k/sub.S
 create mode 100644 sim/testsuite/sim/or1k/xor.S
sim/testsuite/sim/or1k/add.S new file +546 -0
new file mode 100644
index 0000000..ee565c3
@@ -0,0 +1,546 @@
+/* Tests instructions l.add, l.addc, l.addi and l.addic
+ *
+ * This is not a comprehensive test of any instruction (yet).
+ * Of course what is really needed is a comprehensive instruction test...
+ *
+ * 
+ * Copyright (C) 1999-2006 OpenCores
+ *   Contributors various OpenCores participants
+ * Copyright (C) 2010 Embecosm Limited
+ *   Contributor Jeremy Bennett <[email protected]>
+ * Copyright (C) 2012 R. Diez
+ *
+ * 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/>.
+ */
+# mach: or1k
+# output: report(0x00000001);\n
+# output: report(0x00000002);\n
+# output: report(0x00000003);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x00000001);\n
+# output: report(0x00000002);\n
+# output: report(0x00000003);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xffffffff);\n
+# output: report(0xfffffffe);\n
+# output: report(0xfffffffd);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x40000000);\n
+# output: report(0x3fffffff);\n
+# output: report(0x7fffffff);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x40000000);\n
+# output: report(0x40000000);\n
+# output: report(0x80000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xc0000000);\n
+# output: report(0xc0000000);\n
+# output: report(0x80000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xbfffffff);\n
+# output: report(0xbfffffff);\n
+# output: report(0x7ffffffe);\n
+# output: report(0x00000001);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xffffffff);\n
+# output: report(0xfffffffe);\n
+# output: report(0xfffffffd);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x00000001);\n
+# output: report(0x00000002);\n
+# output: report(0x00000003);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xffffffff);\n
+# output: report(0xfffffffe);\n
+# output: report(0xfffffffd);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x40000000);\n
+# output: report(0x3fffffff);\n
+# output: report(0x7fffffff);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x40000000);\n
+# output: report(0x3fffffff);\n
+# output: report(0x80000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x40000000);\n
+# output: report(0x40000000);\n
+# output: report(0x80000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xffffffff);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x00000000);\n
+# output: report(0xffffffff);\n
+# output: report(0x00000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xc0000000);\n
+# output: report(0xc0000000);\n
+# output: report(0x80000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xc0000000);\n
+# output: report(0xbfffffff);\n
+# output: report(0x80000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xbfffffff);\n
+# output: report(0xbfffffff);\n
+# output: report(0x7ffffffe);\n
+# output: report(0x00000001);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xffffffff);\n
+# output: report(0xfffffffe);\n
+# output: report(0xfffffffd);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x00000000);\n
+# output: report(0xffffffff);\n
+# output: report(0x00000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x00000001);\n
+# output: report(0x00000002);\n
+# output: report(0x00000003);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x00000001);\n
+# output: report(0x00000002);\n
+# output: report(0x00000003);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xffffffff);\n
+# output: report(0x0000fffe);\n
+# output: report(0xfffffffd);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x7fff8000);\n
+# output: report(0x00007fff);\n
+# output: report(0x7fffffff);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x7fffc000);\n
+# output: report(0x00004000);\n
+# output: report(0x80000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x80008000);\n
+# output: report(0x00008000);\n
+# output: report(0x80000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x80007fff);\n
+# output: report(0x00008000);\n
+# output: report(0x7fffffff);\n
+# output: report(0x00000001);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xffffffff);\n
+# output: report(0x0000fffe);\n
+# output: report(0xfffffffd);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x00000001);\n
+# output: report(0x00000002);\n
+# output: report(0x00000003);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xffffffff);\n
+# output: report(0x0000fffe);\n
+# output: report(0xfffffffd);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x7fff8000);\n
+# output: report(0x00007fff);\n
+# output: report(0x7fffffff);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x7fff8000);\n
+# output: report(0x00007fff);\n
+# output: report(0x80000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x7fffc000);\n
+# output: report(0x00004000);\n
+# output: report(0x80000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xffffffff);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x00000000);\n
+# output: report(0x0000ffff);\n
+# output: report(0x00000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x80008000);\n
+# output: report(0x00008000);\n
+# output: report(0x80000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x80007fff);\n
+# output: report(0x00008000);\n
+# output: report(0x80000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x80007fff);\n
+# output: report(0x00008000);\n
+# output: report(0x7fffffff);\n
+# output: report(0x00000001);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0xffffffff);\n
+# output: report(0x0000fffe);\n
+# output: report(0xfffffffd);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: report(0x00000000);\n
+# output: report(0x0000ffff);\n
+# output: report(0x00000000);\n
+# output: report(0x00000001);\n
+# output: report(0x00000000);\n
+# output: report(0x00000000);\n
+# output: \n
+# output: exit(0)\n
+
+#include "or1k-asm-test-helpers.h"
+
+
+        STANDARD_TEST_ENVIRONMENT
+
+        .section .exception_vectors
+        
+        // Alignment exception.
+	    .org	0x600
+        // TODO: print out address of instruction that caused the problem
+        
+        // Range exception.
+	    .org	0xb00
+
+        // TODO: The stack safety zone is not taken into consideration.
+        
+        // The handling is a bit dubious at present. We just patch the instruction with l.nop and
+        // restart. This will go wrong in branch delay slots. Really we need to single
+
+        // step past and then continue.
+
+
+        // TODO: do we need to patch the instruction? Can we not skip it somehow?
+
+        PUSH r2
+        PUSH r3
+
+        MOVE_FROM_SPR r2, SPR_EPCR_BASE  // Address of the instruction that caused the problem.
+
+	    LOAD_IMMEDIATE r3, 0x15000000	// Opcode for l.nop
+	    l.sw	-4(r2), r3  // TODO: temporary, remove at the end
+	    l.sw	 0(r2), r3
+	    l.sw	+4(r2), r3  // TODO: temporary, remove at the end
+
+        POP r3
+        POP r2
+
+	    l.rfe
+        
+
+        .section .text
+start_tests:
+        PUSH LINK_REGISTER_R9
+
+        
+        // ----------- Test l.add -----------
+        
+        // Add two small positive numbers
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.add, 1, 2
+
+        // The carry flag should be ignored.
+        TEST_INST_FF_I32_I32 SPR_SR_CY, SPR_SR_OV, l.add, 1, 2
+
+        // Add two small negative numbers, which should set the carry flag but not the overflow flag.
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.add, -1, -2
+
+        // Add two quite large positive numbers. Should set neither the overflow nor the carry flag.
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.add, 0x40000000, 0x3fffffff
+
+        // Add two large positive numbers. Should set the overflow, but not the carry flag.
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.add, 0x40000000, 0x40000000
+
+        // Add two quite large negative numbers. Should set the carry, but not the overflow flag.
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.add, -1073741824, -1073741824  // -1073741824 = 0xC0000000
+
+        // Add two large negative numbers. Should set both the overflow and carry flags.
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.add, 0xbfffffff, 0xbfffffff
+
+        
+        // ------ Check that range exceptions are triggered.
+        
+        SET_SPR_SR_FLAGS SPR_SR_OVE, r2, r3
+
+        // TODO: Disabled at the moment, as this test fails against the ORPSoC V2 core.
+        // Check that an overflow alone causes a RANGE Exception.
+        // TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.add, 0x40000000, 0x40000000
+
+        // Check that a carry alone does not cause a RANGE Exception.
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.add, 0xffffffff, 0xfffffffe
+
+        // TODO: Disabled at the moment, as this test fails against the ORPSoC V2 core.
+        // Check that carry and overflow together cause an exception.
+        // TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.add, 0xbfffffff, 0xbfffffff
+
+        CLEAR_SPR_SR_FLAGS SPR_SR_OVE, r2, r3
+
+
+        // ----------- Test l.addc -----------
+
+        // Add two small positive numbers
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV,  l.addc, 1, 2
+
+        // Add two small negative numbers. Sets the carry flag but not the overflow flag.
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.addc, -1, -2
+
+        // Add two quite large positive numbers. Should set neither the overflow nor the carry flag.
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.addc, 0x40000000, 0x3fffffff
+
+        // Add two quite large positive numbers with a carry in. Should set the overflow but not the carry flag.
+        TEST_INST_FF_I32_I32 SPR_SR_CY, SPR_SR_OV, l.addc, 0x40000000, 0x3fffffff
+
+        // Add two large positive numbers. Should set the overflow, but not the carry flag.
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.addc, 0x40000000, 0x40000000
+
+        // Add the largest unsigned value to zero with a carry. This potentially can break a
+        // simplistic test for carry that does not  consider the carry flag properly. Do it both ways around.
+        // TODO: investigate why this test is failing
+        TEST_INST_FF_I32_I32 SPR_SR_CY, SPR_SR_OV, l.addc, -1,  0
+        TEST_INST_FF_I32_I32 SPR_SR_CY, SPR_SR_OV, l.addc,  0, -1
+
+        // Add two quite large negative numbers. Should set the carry, but not the overflow flag.
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.addc, -1073741824, -1073741824  // -1073741824 = 0xC0000000
+
+        // Add two quite large negative numbers that would overflow, with a carry that just avoids
+        // the overflow. Should set the carry, but not the overflow flag.
+        TEST_INST_FF_I32_I32 SPR_SR_CY, SPR_SR_OV, l.addc, -1073741824, -1073741825  // -1073741824 = 0xC0000000, -1073741825 = 0xBFFFFFFF
+
+        // Add two large negative numbers. Should set both the overflow and  carry flags.
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.addc, -1073741825, -1073741825
+
+
+        // ------ Check that range exceptions are triggered.
+
+        SET_SPR_SR_FLAGS SPR_SR_OVE, r2, r3
+
+        // TODO: Disabled at the moment, as this test fails against the ORPSoC V2 core.
+        // Check that an overflow alone causes a RANGE Exception, even when it
+        // is the carry that causes the overflow.
+        // TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.addc, 0x40000000, 0x40000000
+        // TEST_INST_FF_I32_I32 SPR_SR_CY, SPR_SR_OV, l.addc, 0x40000000, 0x3fffffff
+
+        // Check that a carry alone does not cause a RANGE Exception, even when it is the carry that causes the overflow.
+        TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.addc, 0xffffffff, 0xfffffffe
+        TEST_INST_FF_I32_I32 SPR_SR_CY, SPR_SR_OV, l.addc, 0x00000000, 0xffffffff
+
+        // TODO: Disabled at the moment, as this test fails against the ORPSoC V2 core.
+        // Check that carry and overflow together cause an exception.
+        // TEST_INST_FF_I32_I32 0, SPR_SR_CY | SPR_SR_OV, l.addc, 0xbfffffff, 0xbfffffff
+
+        CLEAR_SPR_SR_FLAGS SPR_SR_OVE, r2, r3
+
+
+        // ----------- Test l.addi -----------
+
+        // Add two small positive numbers
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addi, 1, 2
+
+        // Check carry in is ignored.
+        TEST_INST_FF_I32_I16 SPR_SR_CY, SPR_SR_OV, l.addi, 1, 2
+
+        // Add two small negative numbers. Sets the carry flag but not the overflow flag.
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addi, 0xffffffff, 0xfffe
+
+        // Add two quite large positive numbers. Should set neither the overflow nor the carry flag.
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addi, 0x7fff8000, 0x7fff
+
+        // Add two large positive numbers. Should set the overflow, but not the carry flag.
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addi, 0x7fffc000, 0x4000
+        
+        // Add two quite large negative numbers. Should set the carry, but not the overflow flag.
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addi, 0x80008000, 0x8000
+
+        // Add two large negative numbers. Should set both the overflow and carry flags.
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addi, 0x80007fff, 0x8000
+
+        // ------ Check that range exceptions are triggered.
+
+        SET_SPR_SR_FLAGS SPR_SR_OVE, r2, r3
+
+        // TODO: Disabled at the moment, as this test fails against the ORPSoC V2 core.
+        // Check that an overflow alone causes a RANGE Exception.
+        // TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addi, 0x7fffc000, 0x4000
+
+        // Check that a carry alone does not cause a RANGE Exception.
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addi, 0xffffffff, 0xfffe
+
+        // TODO: Disabled at the moment, as this test fails against the ORPSoC V2 core.
+        // Check that carry and overflow together cause an exception.
+        // TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addi, 0x80007fff, 0x8000
+
+        CLEAR_SPR_SR_FLAGS SPR_SR_OVE, r2, r3
+
+
+        // ----------- Test l.addi -----------
+
+        // Add two small positive numbers
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addic, 1, 2
+
+        // Add two small negative numbers. Sets the carry flag but not the overflow flag.
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addic, 0xffffffff, 0xfffe
+
+        // Add two quite large positive numbers. Should set neither the overflow nor the carry flag.
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addic, 0x7fff8000, 0x7fff
+
+        // Add two quite large positive numbers with a carry in. Should set the overflow but not the carry flag.
+        TEST_INST_FF_I32_I16 SPR_SR_CY, SPR_SR_OV, l.addic, 0x7fff8000, 0x7fff
+
+        // Add two large positive numbers. Should set the overflow, but not the carry flag.
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addic, 0x7fffc000, 0x4000
+
+        // Add the largest unsigned value to zero with a carry. This  potentially can break a simplistic
+        // test for carry that does not  consider the carry flag properly. Do it both ways around.
+        TEST_INST_FF_I32_I16 SPR_SR_CY, SPR_SR_OV, l.addic, 0xffffffff, 0x0000
+        TEST_INST_FF_I32_I16 SPR_SR_CY, SPR_SR_OV, l.addic, 0x00000000, 0xffff
+
+        // Add two quite large negative numbers. Should set the carry, but not the overflow flag.
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addic, 0x80008000, 0x8000
+
+        // Add two quite large negative numbers that would overflow, with a carry that just avoids the overflow.
+        // Should set the carry, but not the overflow flag. flag.
+        TEST_INST_FF_I32_I16 SPR_SR_CY, SPR_SR_OV, l.addic, 0x80007fff, 0x8000
+
+        // Add two large negative numbers. Should set both the overflow and carry flags.
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addic, 0x80007fff, 0x8000
+
+        // ------ Check that range exceptions are triggered.
+
+        SET_SPR_SR_FLAGS SPR_SR_OVE, r2, r3
+        
+        // Check that an overflow alone causes a RANGE Exception, even when it
+        //   is the carry that causes the overflow.
+        // TODO: Disabled at the moment, as this test fails against the ORPSoC V2 core.
+        // TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addic, 0x7fffc000, 0x4000
+        // TEST_INST_FF_I32_I16 SPR_SR_CY, SPR_SR_OV, l.addic, 0x7fffc000, 0x3fff
+
+        // Check that a carry alone does not cause a RANGE Exception, even
+        // when it is the carry that causes the overflow.
+        TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addic, 0xffffffff, 0xfffe
+        TEST_INST_FF_I32_I16 SPR_SR_CY, SPR_SR_OV, l.addic, 0x00000000, 0xffff
+
+        // Check that carry and overflow together cause an exception.
+        // TEST_INST_FF_I32_I16 0, SPR_SR_CY | SPR_SR_OV, l.addic, 0x80007fff, 0x8000
+        
+        CLEAR_SPR_SR_FLAGS SPR_SR_OVE, r2, r3
+
+        
+        POP LINK_REGISTER_R9
+        RETURN_TO_LINK_REGISTER_R9
sim/testsuite/sim/or1k/alltests.exp new file +19 -0
new file mode 100644
index 0000000..f10379e
@@ -0,0 +1,19 @@
+# OR1K simulator testsuite.
+
+if [istarget or1k*-*-*] {
+    
+    set all_machs "or1k"
+
+    global global_ld_options
+    set global_ld_options "-T $srcdir/$subdir/or1k-test.ld"
+    
+    foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.S]] {
+        
+        if ![runtest_file_p $runtests $src] {
+            continue
+        }
+                
+        run_sim_test $src $all_machs
+    }
+
+}
\ No newline at end of file
sim/testsuite/sim/or1k/and.S new file +208 -0

208 lines not on this page · raw message

sim/testsuite/sim/or1k/basic.S new file +535 -0

535 lines not on this page · raw message

sim/testsuite/sim/or1k/div.S new file +198 -0

198 lines not on this page · raw message

sim/testsuite/sim/or1k/ext.S new file +251 -0

251 lines not on this page · raw message

sim/testsuite/sim/or1k/find.S new file +119 -0

119 lines not on this page · raw message

sim/testsuite/sim/or1k/flag.S new file +405 -0

405 lines not on this page · raw message

sim/testsuite/sim/or1k/jump.S new file +121 -0

121 lines not on this page · raw message

sim/testsuite/sim/or1k/load.S new file +373 -0

373 lines not on this page · raw message

sim/testsuite/sim/or1k/mac.S new file +785 -0

224 lines not on this page · raw message

sim/testsuite/sim/or1k/mfspr.S new file +196 -0

196 lines not on this page · raw message

sim/testsuite/sim/or1k/mul.S new file +277 -0

277 lines not on this page · raw message

sim/testsuite/sim/or1k/or.S new file +207 -0

207 lines not on this page · raw message

sim/testsuite/sim/or1k/or1k-asm-test-env.h new file +61 -0

61 lines not on this page · raw message

sim/testsuite/sim/or1k/or1k-asm-test-helpers.h new file +134 -0

134 lines not on this page · raw message

sim/testsuite/sim/or1k/or1k-asm-test.h new file +258 -0

258 lines not on this page · raw message

sim/testsuite/sim/or1k/or1k-asm.h new file +20 -0
new file mode 100644
index 0000000..c328b20

Lines of this file are not shown. View the raw message.

sim/testsuite/sim/or1k/or1k-test.ld new file +57 -0

57 lines not on this page · raw message

sim/testsuite/sim/or1k/ror.S new file +186 -0

186 lines not on this page · raw message

sim/testsuite/sim/or1k/shift.S new file +572 -0

572 lines not on this page · raw message

sim/testsuite/sim/or1k/spr-defs.h new file +590 -0

590 lines not on this page · raw message

sim/testsuite/sim/or1k/sub.S new file +176 -0

176 lines not on this page · raw message

sim/testsuite/sim/or1k/xor.S new file +210 -0

210 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.

#11 lore raw

PATCH 11/18 sim: or1k: fix segfault when run without arguments

In reply to Stafford Horne

From: Peter Gavin <[email protected]>

sim/or1k/ChangeLog:

* sim-if.c: (sim_open) push check for delay slot mode further down in function so other checks happen first. This prevents a segfault when the simulator is run without arguments.

---
 sim/or1k/ChangeLog |  6 ++++++
 sim/or1k/sim-if.c  | 19 ++++++++++---------
 2 files changed, 16 insertions(+), 9 deletions(-)
sim/or1k/ChangeLog +6 -0
index c1038c3..ff7ca8d 100644
@@ -1,3 +1,9 @@
+2012-09-06  Peter Gavin  <[email protected]>
+
+	* sim-if.c: (sim_open) push check for delay slot mode further down
+	in function so other checks happen first.  This prevents a
+	segfault when the simulator is run without arguments.
+
 2012-06-22  Peter Gavin  <[email protected]>
 
 	* cpu32.c: regenerate
sim/or1k/sim-if.c +10 -9
index c257ae6..23a8a9e 100644
@@ -235,14 +235,6 @@ sim_open (kind, callback, abfd, argv)
       return 0;
     }
 
-  if ((or1k_cpucfgr & SPR_FIELD_MASK_SYS_CPUCFGR_ND) &&
-      (STATE_ARCHITECTURE (sd)->mach != bfd_mach_or1knd)) {
-    sim_io_eprintf (sd, "WARNING: CPUCFGR ND flag set, but loading non-or1knd binary\n");
-  } else if (!(or1k_cpucfgr & SPR_FIELD_MASK_SYS_CPUCFGR_ND) &&
-             (STATE_ARCHITECTURE (sd)->mach != bfd_mach_or1k)) {
-    sim_io_eprintf (sd, "WARNING: CPUCFGR ND flag not set, but loading non-or1k binary\n");
-  }
-  
   /* Establish any remaining configuration options.  */
   if (sim_config (sd) != SIM_RC_OK)
     {
@@ -255,7 +247,16 @@ sim_open (kind, callback, abfd, argv)
       free_state (sd);
       return 0;
     }
-
+  
+  /* make sure delay slot mode is consistent with the loaded binary */
+  if ((or1k_cpucfgr & SPR_FIELD_MASK_SYS_CPUCFGR_ND) &&
+      (STATE_ARCHITECTURE (sd)->mach != bfd_mach_or1knd)) {
+    sim_io_eprintf (sd, "WARNING: CPUCFGR ND flag set, but loading non-or1knd binary\n");
+  } else if (!(or1k_cpucfgr & SPR_FIELD_MASK_SYS_CPUCFGR_ND) &&
+             (STATE_ARCHITECTURE (sd)->mach != bfd_mach_or1k)) {
+    sim_io_eprintf (sd, "WARNING: CPUCFGR ND flag not set, but loading non-or1k binary\n");
+  }
+  
   /* Open a copy of the cpu descriptor table.  */
   {
     CGEN_CPU_DESC cd = or1k_cgen_cpu_open_1 (STATE_ARCHITECTURE (sd)->printable_name,
Signature · 1 line
2.7.4
#12 lore raw

PATCH 12/18 sim: or1k: Get or1k sim building with latest sim common

In reply to Stafford Horne

There have been a few type name changes.
* Update configure.ac to use new ENDIAN config tpes
* Update mloop to use new CGEN_TRACE.. instead of TRACE..
* Change singnature of sim_create_inferior to have const param
* Remove sim_close as its covered by sim_close in common now
* Move WITH_SCACHE_PBB into sim-main.h from tconfig.in
* Remove SIM_HANDLES_LMA as it seems its not needed anymore from tcofig.in
* Remove tconfig.in

---
 sim/or1k/configure.ac |  5 ++---
 sim/or1k/mloop.in     |  6 +++---
 sim/or1k/sim-if.c     | 14 +++-----------
 sim/or1k/sim-main.h   |  2 ++
 sim/or1k/tconfig.in   |  8 --------
 5 files changed, 10 insertions(+), 25 deletions(-)
 delete mode 100644 sim/or1k/tconfig.in
sim/or1k/configure.ac +2 -3
index d5dca70..c248d0a 100644
@@ -24,11 +24,10 @@ sinclude(../common/acinclude.m4)
 
 SIM_AC_COMMON
 
-SIM_AC_OPTION_ENDIAN(BIG_ENDIAN)
+SIM_AC_OPTION_ENDIAN(BIG)
 SIM_AC_OPTION_ALIGNMENT(STRICT_ALIGNMENT)
-SIM_AC_OPTION_HOSTENDIAN
 SIM_AC_OPTION_BITSIZE([32], [31], [32])
-SIM_AC_OPTION_SCACHE([16384])
+SIM_AC_OPTION_SCACHE(16384)
 SIM_AC_OPTION_DEFAULT_MODEL([$default_model])
 SIM_AC_OPTION_ENVIRONMENT
 SIM_AC_OPTION_INLINE()
sim/or1k/mloop.in +3 -3
index 6f19c50..092ce7d 100644
@@ -97,8 +97,8 @@ execute (SIM_CPU *current_cpu, SCACHE *sc, int fast_p)
           if (PROFILE_MODEL_P (current_cpu)
               && ARGBUF_PROFILE_P (abuf))
             @cpu at _model_insn_before (current_cpu, 1 /*first_p*/);
-          TRACE_INSN_INIT (current_cpu, abuf, 1);
-          TRACE_INSN (current_cpu, idata,
+          CGEN_TRACE_INSN_INIT (current_cpu, abuf, 1);
+          CGEN_TRACE_INSN (current_cpu, idata,
                       (const struct argbuf *) abuf, abuf->addr);
         }
 #if WITH_SCACHE
@@ -117,7 +117,7 @@ execute (SIM_CPU *current_cpu, SCACHE *sc, int fast_p)
               cycles = (*idesc->timing->model_fn) (current_cpu, sc);
               @cpu at _model_insn_after (current_cpu, 1 /*last_p*/, cycles);
             }
-          TRACE_INSN_FINI (current_cpu, abuf, 1);
+          CGEN_TRACE_INSN_FINI (current_cpu, abuf, 1);
         }
 #else
       abort ();
sim/or1k/sim-if.c +3 -11
index 23a8a9e..e643fa1 100644
@@ -174,7 +174,7 @@ sim_open (kind, callback, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback *callback;
      struct bfd *abfd;
-     char **argv;
+     char * const *argv;
 {
   SIM_DESC sd = sim_state_alloc (kind, callback);
   char c;
@@ -297,21 +297,13 @@ sim_open (kind, callback, abfd, argv)
   return sd;
 }
 
-void
-sim_close (sd, quitting)
-     SIM_DESC sd;
-     int quitting;
-{
-  or1k_cgen_cpu_close (CPU_CPU_DESC (STATE_CPU (sd, 0)));
-  sim_module_uninstall (sd);
-}
 
 SIM_RC
 sim_create_inferior (sd, abfd, argv, envp)
      SIM_DESC sd;
      struct bfd *abfd;
-     char **argv;
-     char **envp;
+     char * const *argv;
+     char * const *envp;
 {
   SIM_CPU *current_cpu = STATE_CPU (sd, 0);
   SIM_ADDR addr;
sim/or1k/sim-main.h +2 -0
index d26d616..f0b4e07 100644
@@ -1,6 +1,8 @@
 #ifndef SIM_MAIN_H
 #define SIM_MAIN_H
 
+#define WITH_SCACHE_PBB 1
+
 #include "ansidecl.h"
 #include "or1k-desc.h"
 #include "sim-basics.h"
sim/or1k/tconfig.in deleted +0 -8
deleted file mode 100644
index a1b463f..0000000
@@ -1,8 +0,0 @@
-#ifndef OR1K_TCONFIG_H
-#define OR1K_TCONFIG_H
-
-#define SIM_HANDLES_LMA 1
-
-#define WITH_SCACHE_PBB 1
-
-#endif
\ No newline at end of file
Signature · 1 line
2.7.4
#13 lore raw

PATCH 13/18 sim: or1k: Regenerate cgen files

In reply to Stafford Horne

These files have been regenerated using latest cgen which has been updated to generate code that is compatible with the current sim common api.

---
 sim/or1k/arch32.c       |   2 +-
 sim/or1k/arch64.c       |   2 +-
 sim/or1k/cpu32.c        |  32 ++++
 sim/or1k/cpu32.h        |  40 ++++-
 sim/or1k/cpu64.c        |  32 ++++
 sim/or1k/cpu64.h        |  40 ++++-
 sim/or1k/cpuall32.h     |   4 +-
 sim/or1k/cpuall64.h     |   4 +-
 sim/or1k/decode32.c     | 192 ++++++++++++++++++---
 sim/or1k/decode32.h     |  68 ++++----
 sim/or1k/decode64.c     | 196 ++++++++++++++++++---
 sim/or1k/decode64.h     |  77 +++++----
 sim/or1k/model32.c      | 180 ++++++++++++++++++-
 sim/or1k/model64.c      |  10 +-
 sim/or1k/or1k32-opc.h   | 129 --------------
 sim/or1k/or1k64-opc.h   | 133 ---------------
 sim/or1k/sem32-switch.c | 408 +++++++++++++++++++++++++++++--------------
 sim/or1k/sem32.c        | 418 +++++++++++++++++++++++++++++++--------------
 sim/or1k/sem64-switch.c | 436 +++++++++++++++++++++++++++++++---------------
 sim/or1k/sem64.c        | 446 +++++++++++++++++++++++++++++++++---------------
 20 files changed, 1921 insertions(+), 928 deletions(-)
 delete mode 100644 sim/or1k/or1k32-opc.h
 delete mode 100644 sim/or1k/or1k64-opc.h
sim/or1k/arch32.c +1 -1
index 769f54c..83a9815 100644
@@ -25,7 +25,7 @@ This file is part of the GNU simulators.
 #include "sim-main.h"
 #include "bfd.h"
 
-const MACH *sim_machs[] =
+const SIM_MACH *sim_machs[] =
 {
 #ifdef HAVE_CPU_OR1K32BF
   & or32_mach,
sim/or1k/arch64.c +1 -1
index e73f37b..c3f7597 100644
@@ -25,7 +25,7 @@ This file is part of the GNU simulators.
 #include "sim-main.h"
 #include "bfd.h"
 
-const MACH *sim_machs[] =
+const SIM_MACH *sim_machs[] =
 {
 #ifdef HAVE_CPU_OR1K64BF
   & or64_mach,
sim/or1k/cpu32.c +32 -0
index 36b4040..14e11ec 100644
@@ -10140,6 +10140,38 @@ or1k32bf_h_sys_fpcsr_dzf_set (SIM_CPU *current_cpu, USI newval)
   SET_H_SYS_FPCSR_DZF (newval);
 }
 
+/* Get the value of h-atomic-reserve.  */
+
+BI
+or1k32bf_h_atomic_reserve_get (SIM_CPU *current_cpu)
+{
+  return CPU (h_atomic_reserve);
+}
+
+/* Set a value for h-atomic-reserve.  */
+
+void
+or1k32bf_h_atomic_reserve_set (SIM_CPU *current_cpu, BI newval)
+{
+  CPU (h_atomic_reserve) = newval;
+}
+
+/* Get the value of h-atomic-address.  */
+
+SI
+or1k32bf_h_atomic_address_get (SIM_CPU *current_cpu)
+{
+  return CPU (h_atomic_address);
+}
+
+/* Set a value for h-atomic-address.  */
+
+void
+or1k32bf_h_atomic_address_set (SIM_CPU *current_cpu, SI newval)
+{
+  CPU (h_atomic_address) = newval;
+}
+
 /* Record trace results for INSN.  */
 
 void
sim/or1k/cpu32.h +38 -2
index a31a935..771fcdc 100644
@@ -53,6 +53,14 @@ typedef struct {
 do { \
 SET_H_SPR ((((index)) + (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_GPR0))), (x));\
 ;} while (0)
+  /* atomic reserve flag */
+  BI h_atomic_reserve;
+#define GET_H_ATOMIC_RESERVE() CPU (h_atomic_reserve)
+#define SET_H_ATOMIC_RESERVE(x) (CPU (h_atomic_reserve) = (x))
+  /* atomic reserve address */
+  SI h_atomic_address;
+#define GET_H_ATOMIC_ADDRESS() CPU (h_atomic_address)
+#define SET_H_ATOMIC_ADDRESS(x) (CPU (h_atomic_address) = (x))
   } hardware;
 #define CPU_CGEN_HW(cpu) (& (cpu)->cpu_data.hardware)
 } OR1K32BF_CPU_DATA;
@@ -4475,6 +4483,10 @@ USI or1k32bf_h_sys_fpcsr_inf_get (SIM_CPU *);
 void or1k32bf_h_sys_fpcsr_inf_set (SIM_CPU *, USI);
 USI or1k32bf_h_sys_fpcsr_dzf_get (SIM_CPU *);
 void or1k32bf_h_sys_fpcsr_dzf_set (SIM_CPU *, USI);
+BI or1k32bf_h_atomic_reserve_get (SIM_CPU *);
+void or1k32bf_h_atomic_reserve_set (SIM_CPU *, BI);
+SI or1k32bf_h_atomic_address_get (SIM_CPU *);
+void or1k32bf_h_atomic_address_set (SIM_CPU *, SI);
 
 /* These must be hand-written.  */
 extern CPUREG_FETCH_FN or1k32bf_fetch_register;
@@ -4622,6 +4634,17 @@ struct scache {
   f_resv_20_5 = EXTRACT_LSB0_UINT (insn, 32, 20, 5); \
   f_uimm16 = EXTRACT_LSB0_UINT (insn, 32, 15, 16); \
 
+#define EXTRACT_IFMT_L_MSYNC_VARS \
+  UINT f_opcode; \
+  UINT f_op_25_5; \
+  UINT f_resv_20_21; \
+  unsigned int length;
+#define EXTRACT_IFMT_L_MSYNC_CODE \
+  length = 4; \
+  f_opcode = EXTRACT_LSB0_UINT (insn, 32, 31, 6); \
+  f_op_25_5 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
+  f_resv_20_21 = EXTRACT_LSB0_UINT (insn, 32, 20, 21); \
+
 #define EXTRACT_IFMT_L_RFE_VARS \
   UINT f_opcode; \
   UINT f_resv_25_26; \
@@ -4719,7 +4742,7 @@ struct scache {
 
 #define EXTRACT_IFMT_L_SW_VARS \
   UINT f_opcode; \
-  UINT f_r1; \
+  UINT f_r2; \
   UINT f_r3; \
   UINT f_imm16_25_5; \
   UINT f_imm16_10_11; \
@@ -4728,12 +4751,25 @@ struct scache {
 #define EXTRACT_IFMT_L_SW_CODE \
   length = 4; \
   f_opcode = EXTRACT_LSB0_UINT (insn, 32, 31, 6); \
-  f_r1 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
+  f_r2 = EXTRACT_LSB0_UINT (insn, 32, 20, 5); \
   f_r3 = EXTRACT_LSB0_UINT (insn, 32, 15, 5); \
   f_imm16_25_5 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
   f_imm16_10_11 = EXTRACT_LSB0_UINT (insn, 32, 10, 11); \
   f_simm16_split = ((HI) (UINT) (((((f_imm16_25_5) << (11))) | (f_imm16_10_11))));\
 
+#define EXTRACT_IFMT_L_SWA_VARS \
+  UINT f_opcode; \
+  UINT f_r2; \
+  UINT f_r3; \
+  INT f_simm16; \
+  unsigned int length;
+#define EXTRACT_IFMT_L_SWA_CODE \
+  length = 4; \
+  f_opcode = EXTRACT_LSB0_UINT (insn, 32, 31, 6); \
+  f_r2 = EXTRACT_LSB0_UINT (insn, 32, 20, 5); \
+  f_r3 = EXTRACT_LSB0_UINT (insn, 32, 15, 5); \
+  f_simm16 = EXTRACT_LSB0_SINT (insn, 32, 15, 16); \
+
 #define EXTRACT_IFMT_L_SLL_VARS \
   UINT f_opcode; \
   UINT f_r1; \
sim/or1k/cpu64.c +32 -0
index cd25e89..5f5d605 100644
@@ -10156,6 +10156,38 @@ or1k64bf_h_sys_fpcsr_dzf_set (SIM_CPU *current_cpu, UDI newval)
   SET_H_SYS_FPCSR_DZF (newval);
 }
 
+/* Get the value of h-atomic-reserve.  */
+
+BI
+or1k64bf_h_atomic_reserve_get (SIM_CPU *current_cpu)
+{
+  return CPU (h_atomic_reserve);
+}
+
+/* Set a value for h-atomic-reserve.  */
+
+void
+or1k64bf_h_atomic_reserve_set (SIM_CPU *current_cpu, BI newval)
+{
+  CPU (h_atomic_reserve) = newval;
+}
+
+/* Get the value of h-atomic-address.  */
+
+SI
+or1k64bf_h_atomic_address_get (SIM_CPU *current_cpu)
+{
+  return CPU (h_atomic_address);
+}
+
+/* Set a value for h-atomic-address.  */
+
+void
+or1k64bf_h_atomic_address_set (SIM_CPU *current_cpu, SI newval)
+{
+  CPU (h_atomic_address) = newval;
+}
+
 /* Record trace results for INSN.  */
 
 void
sim/or1k/cpu64.h +38 -2
index 5bfbf9e..d3a93e7 100644
@@ -53,6 +53,14 @@ typedef struct {
 do { \
 SET_H_SPR ((((index)) + (ORDI (SLLDI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_GPR0))), (x));\
 ;} while (0)
+  /* atomic reserve flag */
+  BI h_atomic_reserve;
+#define GET_H_ATOMIC_RESERVE() CPU (h_atomic_reserve)
+#define SET_H_ATOMIC_RESERVE(x) (CPU (h_atomic_reserve) = (x))
+  /* atomic reserve address */
+  SI h_atomic_address;
+#define GET_H_ATOMIC_ADDRESS() CPU (h_atomic_address)
+#define SET_H_ATOMIC_ADDRESS(x) (CPU (h_atomic_address) = (x))
   } hardware;
 #define CPU_CGEN_HW(cpu) (& (cpu)->cpu_data.hardware)
 } OR1K64BF_CPU_DATA;
@@ -4482,6 +4490,10 @@ UDI or1k64bf_h_sys_fpcsr_inf_get (SIM_CPU *);
 void or1k64bf_h_sys_fpcsr_inf_set (SIM_CPU *, UDI);
 UDI or1k64bf_h_sys_fpcsr_dzf_get (SIM_CPU *);
 void or1k64bf_h_sys_fpcsr_dzf_set (SIM_CPU *, UDI);
+BI or1k64bf_h_atomic_reserve_get (SIM_CPU *);
+void or1k64bf_h_atomic_reserve_set (SIM_CPU *, BI);
+SI or1k64bf_h_atomic_address_get (SIM_CPU *);
+void or1k64bf_h_atomic_address_set (SIM_CPU *, SI);
 
 /* These must be hand-written.  */
 extern CPUREG_FETCH_FN or1k64bf_fetch_register;
@@ -4621,6 +4633,17 @@ struct scache {
   f_resv_20_5 = EXTRACT_LSB0_UINT (insn, 32, 20, 5); \
   f_uimm16 = EXTRACT_LSB0_UINT (insn, 32, 15, 16); \
 
+#define EXTRACT_IFMT_L_MSYNC_VARS \
+  UINT f_opcode; \
+  UINT f_op_25_5; \
+  UINT f_resv_20_21; \
+  unsigned int length;
+#define EXTRACT_IFMT_L_MSYNC_CODE \
+  length = 4; \
+  f_opcode = EXTRACT_LSB0_UINT (insn, 32, 31, 6); \
+  f_op_25_5 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
+  f_resv_20_21 = EXTRACT_LSB0_UINT (insn, 32, 20, 21); \
+
 #define EXTRACT_IFMT_L_RFE_VARS \
   UINT f_opcode; \
   UINT f_resv_25_26; \
@@ -4718,7 +4741,7 @@ struct scache {
 
 #define EXTRACT_IFMT_L_SW_VARS \
   UINT f_opcode; \
-  UINT f_r1; \
+  UINT f_r2; \
   UINT f_r3; \
   UINT f_imm16_25_5; \
   UINT f_imm16_10_11; \
@@ -4727,12 +4750,25 @@ struct scache {
 #define EXTRACT_IFMT_L_SW_CODE \
   length = 4; \
   f_opcode = EXTRACT_LSB0_UINT (insn, 32, 31, 6); \
-  f_r1 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
+  f_r2 = EXTRACT_LSB0_UINT (insn, 32, 20, 5); \
   f_r3 = EXTRACT_LSB0_UINT (insn, 32, 15, 5); \
   f_imm16_25_5 = EXTRACT_LSB0_UINT (insn, 32, 25, 5); \
   f_imm16_10_11 = EXTRACT_LSB0_UINT (insn, 32, 10, 11); \
   f_simm16_split = ((HI) (UINT) (((((f_imm16_25_5) << (11))) | (f_imm16_10_11))));\
 
+#define EXTRACT_IFMT_L_SWA_VARS \
+  UINT f_opcode; \
+  UINT f_r2; \
+  UINT f_r3; \
+  INT f_simm16; \
+  unsigned int length;
+#define EXTRACT_IFMT_L_SWA_CODE \
+  length = 4; \
+  f_opcode = EXTRACT_LSB0_UINT (insn, 32, 31, 6); \
+  f_r2 = EXTRACT_LSB0_UINT (insn, 32, 20, 5); \
+  f_r3 = EXTRACT_LSB0_UINT (insn, 32, 15, 5); \
+  f_simm16 = EXTRACT_LSB0_SINT (insn, 32, 15, 16); \
+
 #define EXTRACT_IFMT_L_SLL_VARS \
   UINT f_opcode; \
   UINT f_r1; \
sim/or1k/cpuall32.h +2 -2
index 182bc74..7e792fa 100644
@@ -33,8 +33,8 @@ This file is part of the GNU simulators.
 #include "decode.h"
 #endif
 
-extern const MACH or32_mach;
-extern const MACH or32nd_mach;
+extern const SIM_MACH or32_mach;
+extern const SIM_MACH or32nd_mach;
 
 #ifndef WANT_CPU
 /* The ARGBUF struct.  */
sim/or1k/cpuall64.h +2 -2
index 8207d8b..7a58a18 100644
@@ -33,8 +33,8 @@ This file is part of the GNU simulators.
 #include "decode64.h"
 #endif
 
-extern const MACH or64_mach;
-extern const MACH or64nd_mach;
+extern const SIM_MACH or64_mach;
+extern const SIM_MACH or64nd_mach;
 
 #ifndef WANT_CPU
 /* The ARGBUF struct.  */
sim/or1k/decode32.c +169 -23

297 lines not on this page · raw message

sim/or1k/decode32.h +35 -33

81 lines not on this page · raw message

sim/or1k/decode64.c +171 -25

312 lines not on this page · raw message

sim/or1k/decode64.h +40 -37

90 lines not on this page · raw message

sim/or1k/model32.c +175 -5

281 lines not on this page · raw message

sim/or1k/model64.c +5 -5
index 4fa3399..93107d2 100644
@@ -45,19 +45,19 @@ This file is part of the GNU simulators.
 #define TIMING_DATA(td) 0
 #endif
 
-static const MODEL or64_models[] =
+static const SIM_MODEL or64_models[] =
 {
   { 0 }
 };
 
-static const MODEL or64nd_models[] =
+static const SIM_MODEL or64nd_models[] =
 {
   { 0 }
 };
 
 /* The properties of this cpu's implementation.  */
 
-static const MACH_IMP_PROPERTIES or1k64bf_imp_properties =
+static const SIM_MACH_IMP_PROPERTIES or1k64bf_imp_properties =
 {
   sizeof (SIM_CPU),
 #if WITH_SCACHE
@@ -99,7 +99,7 @@ or64_init_cpu (SIM_CPU *cpu)
 #endif
 }
 
-const MACH or64_mach =
+const SIM_MACH or64_mach =
 {
   "or64", "or1k64", MACH_OR64,
   64, 64, & or64_models[0], & or1k64bf_imp_properties,
@@ -125,7 +125,7 @@ or64nd_init_cpu (SIM_CPU *cpu)
 #endif
 }
 
-const MACH or64nd_mach =
+const SIM_MACH or64nd_mach =
 {
   "or64nd", "or1k64nd", MACH_OR64ND,
   64, 64, & or64nd_models[0], & or1k64bf_imp_properties,
sim/or1k/or1k32-opc.h deleted +0 -129

129 lines not on this page · raw message

sim/or1k/or1k64-opc.h deleted +0 -133

133 lines not on this page · raw message

sim/or1k/sem32-switch.c +283 -125

1,130 lines not on this page · raw message

sim/or1k/sem32.c +293 -125

247 lines not on this page · raw message

sim/or1k/sem64-switch.c +297 -139

436 lines not on this page · raw message

sim/or1k/sem64.c +307 -139

446 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.

#14 lore raw

PATCH 14/18 sim: or1k: Regenerate autotool files

In reply to Stafford Horne

After chaning the configure.am this is require

---
 sim/or1k/Makefile.in |     2 +-
 sim/or1k/aclocal.m4  |    61 +-
 sim/or1k/config.in   |   101 +-
 sim/or1k/configure   | 14576 ++++++++++++++++++++++++++++++++++++++++---------
 4 files changed, 12111 insertions(+), 2629 deletions(-)
sim/or1k/Makefile.in +1 -1
index 35ef7e6..df95012 100644
@@ -1,4 +1,4 @@
-# Makefile template for Configure for the m32r simulator
+# Makefile template for Configure for the or1k simulator
 # Copyright (C) 1996-2000, 2003-2004, 2007-2012 Free Software
 # Foundation, Inc.
 # Contributed by Cygnus Support.
sim/or1k/aclocal.m4 +45 -16

104 lines not on this page · raw message

sim/or1k/config.in +99 -2

162 lines not on this page · raw message

sim/or1k/configure +11966 -2610

2,729 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.

#15 lore raw

PATCH 15/18 sim: or1k: Implement register store/fetch

In reply to Stafford Horne

There was a comment questioning the use of these. But as soon as I run any basic test gdb complains that these are not implemented.

More tests and basic run and execute work now.

---
 sim/or1k/or1k-sim.h |  2 +-
 sim/or1k/or1k.c     | 31 ++++++++++++++++++++++++++++---
 2 files changed, 29 insertions(+), 4 deletions(-)
sim/or1k/or1k-sim.h +1 -1
index 9e1754f..7213caa 100644
@@ -4,7 +4,7 @@
 #include "symcat.h"
 
 /* GDB register numbers. */
-#define PC_REGNUM	16
+#define PC_REGNUM	33
 
 /* Misc. profile data.  */
 typedef struct {
sim/or1k/or1k.c +28 -3
index 98225ab..565a018 100644
@@ -9,27 +9,52 @@
 #include "sim-main.h"
 #include "symcat.h"
 #include "cgen-ops.h"
+#include "cgen-mem.h"
+#include "cpuall.h"
 
 #include <string.h>
 
-/* not sure what the point of these is */
 int XCONCAT2(WANT_CPU,_fetch_register) (sim_cpu *current_cpu, int rn, unsigned char *buf, int len)
 {
-  return -1;
+   if (rn < 32)
+    SETTWI (buf, XCONCAT2(WANT_CPU,_h_gpr_get) (current_cpu, rn));
+  else
+    switch (rn)
+      {
+      case PC_REGNUM :
+        SETTWI (buf, XCONCAT2(WANT_CPU,_h_pc_get) (current_cpu));
+        break;
+      default :
+         return 0;
+      }
+  return sizeof(WI); /* WI from arch.h */
 }
 
 int XCONCAT2(WANT_CPU,_store_register) (sim_cpu *current_cpu, int rn, unsigned char *buf, int len)
 {
-  return -1;
+  if (rn < 32)
+    XCONCAT2(WANT_CPU,_h_gpr_set) (current_cpu, rn, GETTWI (buf));
+  else
+    switch (rn)
+      {
+      case PC_REGNUM :
+        XCONCAT2(WANT_CPU,_h_pc_set) (current_cpu, GETTWI (buf));
+        break;
+      default :
+         return 0;
+      }
+  return sizeof(WI); /* WI from arch.h */
 }
 
 #ifdef WANT_CPU_OR1K32BF
 int or1k32bf_model_or1200_u_exec (sim_cpu * UNUSED current_cpu, const IDESC * UNUSED idesc, int unit_num, int referenced)
 {
+  return -1;
 }
 
 int or1k32bf_model_or1200nd_u_exec (sim_cpu * UNUSED current_cpu, const IDESC * UNUSED idesc, int unit_num, int referenced)
 {
+  return -1;
 }
 
 void or1k32bf_model_insn_before (sim_cpu * UNUSED current_cpu, int UNUSED first_p)
Signature · 1 line
2.7.4
#16 lore raw

PATCH 16/18 sim: or1k: Do trap breakpoint handling

In reply to Stafford Horne

Breakpoints were not implemented in the sim. This change allows for trap instructions (inserted when gdb sets breakpoints) to transfer control back to GDB allowing breakpoints to work with 'target sim'

After implementing this gdb test suite is looking better with:

                === gdb Summary ===
 # of expected passes            15981
 # of unexpected failures        509
 # of expected failures          27
 # of known failures             47
 # of unresolved testcases       34
 # of untested testcases         174
 # of unsupported tests          309
---
 sim/or1k/traps.c | 70 ++++++++++++++++++++++++++++++--------------------------
 1 file changed, 37 insertions(+), 33 deletions(-)
sim/or1k/traps.c +37 -33
index 526f2e7..235d9b5 100644
@@ -17,48 +17,52 @@ sim_engine_invalid_insn (SIM_CPU *current_cpu, IADDR cia, SEM_PC vpc)
 #ifdef WANT_CPU_OR1K32BF
   or1k32bf_exception (current_cpu, cia, EXCEPT_ILLEGAL);
 #endif
-  
+
   return vpc;
 }
 
 void or1k32bf_exception (sim_cpu *current_cpu, USI pc, USI exnum)
 {
   SIM_DESC sd = CPU_STATE(current_cpu);
-  
-  SET_H_SYS_ESR0 (GET_H_SYS_SR ());
-  
-  SET_H_SYS_SR_DSX (current_cpu->delay_slot);
-  
-  switch (exnum) {
-  case EXCEPT_RESET:
-    break;
 
-  case EXCEPT_SYSCALL:
-    SET_H_SYS_EPCR0 (pc + 4 - (current_cpu->delay_slot ? 4 : 0));
-    break;
+  if (exnum == EXCEPT_TRAP) {
+    /* Trap, used for breakpoints, sends control back to gdb breakpoint handling */
+    sim_engine_halt (sd, current_cpu, NULL, pc, sim_stopped, SIM_SIGTRAP);
+  } else {
+
+    /* Calculate the exception program counter */
+    switch (exnum) {
+    case EXCEPT_RESET:
+      break;
+
+    case EXCEPT_SYSCALL:
+      SET_H_SYS_EPCR0 (pc + 4 - (current_cpu->delay_slot ? 4 : 0));
+      break;
+
+    case EXCEPT_BUSERR:
+    case EXCEPT_ALIGN:
+    case EXCEPT_ILLEGAL:
+      SET_H_SYS_EPCR0 (pc - (current_cpu->delay_slot ? 4 : 0));
+      break;
+
+    default:
+      sim_io_error (sd, "unexpected exception 0x%x raised at PC 0x%08x", exnum, pc);
+      break;
+    }
 
-  case EXCEPT_BUSERR:
-  case EXCEPT_ALIGN:
-  case EXCEPT_RANGE:
-  case EXCEPT_TRAP:
-  case EXCEPT_ILLEGAL:
-    SET_H_SYS_EPCR0 (pc - (current_cpu->delay_slot ? 4 : 0));
-    break;
+    /* Store the curent SR into ESR0 */
+    SET_H_SYS_ESR0 (GET_H_SYS_SR ());
 
-  default:
-    sim_io_error (sd, "unexpected exception 0x%x raised at PC 0x%08x", exnum, pc);
-    break;
-    
+    /* Indicate in SR if the failed instruction is in delay slot or not */
+    SET_H_SYS_SR_DSX (current_cpu->delay_slot);
+
+    current_cpu->next_delay_slot = 0;
+
+    /* jump program counter into handler */
+    IADDR handler_pc = (GET_H_SYS_SR_EPH() ? 0xf0000000 : 0x00000000) + (exnum << 8);
+
+    sim_engine_restart (sd, current_cpu, NULL, handler_pc);
   }
-  
-  current_cpu->next_delay_slot = 0;
-  
-  IADDR handler_pc = (GET_H_SYS_SR_EPH() ? 0xf0000000 : 0x00000000) + (exnum << 8);
-  
-  sim_engine_restart (CPU_STATE (current_cpu),
-                      current_cpu,
-                      NULL,
-                      handler_pc);
 }
 
 void or1k32bf_rfe (sim_cpu *current_cpu)
@@ -97,8 +101,8 @@ USI or1k32bf_mfspr (sim_cpu *current_cpu, USI addr)
   case SPR_ADDR(SYS,PPC):
   case SPR_ADDR(SYS,FPCSR):
   case SPR_ADDR(SYS,EPCR0):
-  case SPR_ADDR(MAC,MACHI):
   case SPR_ADDR(MAC,MACLO):
+  case SPR_ADDR(MAC,MACHI):
     break;
 
   default:
Signature · 1 line
2.7.4
#17 lore raw

PATCH 17/18 sim: or1k: Implement fetch/store for ppc and sr

In reply to Stafford Horne

This was causing some tests to failure due to warnings.

---
 sim/or1k/or1k-sim.h |  2 ++
 sim/or1k/or1k.c     | 12 ++++++++++++
 2 files changed, 14 insertions(+)
sim/or1k/or1k-sim.h +2 -0
index 7213caa..2ad6f8c 100644
@@ -4,7 +4,9 @@
 #include "symcat.h"
 
 /* GDB register numbers. */
+#define PPC_REGNUM	32
 #define PC_REGNUM	33
+#define SR_REGNUM	34
 
 /* Misc. profile data.  */
 typedef struct {
sim/or1k/or1k.c +12 -0
index 565a018..9f50c33 100644
@@ -21,9 +21,15 @@ int XCONCAT2(WANT_CPU,_fetch_register) (sim_cpu *current_cpu, int rn, unsigned c
   else
     switch (rn)
       {
+      case PPC_REGNUM :
+        SETTWI (buf, XCONCAT2(WANT_CPU,_h_sys_ppc_get) (current_cpu));
+        break;
       case PC_REGNUM :
         SETTWI (buf, XCONCAT2(WANT_CPU,_h_pc_get) (current_cpu));
         break;
+      case SR_REGNUM :
+        SETTWI (buf, XCONCAT2(WANT_CPU,_h_sys_sr_get) (current_cpu));
+        break;
       default :
          return 0;
       }
@@ -37,9 +43,15 @@ int XCONCAT2(WANT_CPU,_store_register) (sim_cpu *current_cpu, int rn, unsigned c
   else
     switch (rn)
       {
+      case PPC_REGNUM :
+        XCONCAT2(WANT_CPU,_h_sys_ppc_set) (current_cpu, GETTWI (buf));
+        break;
       case PC_REGNUM :
         XCONCAT2(WANT_CPU,_h_pc_set) (current_cpu, GETTWI (buf));
         break;
+      case SR_REGNUM :
+        XCONCAT2(WANT_CPU,_h_sys_sr_set) (current_cpu, GETTWI (buf));
+        break;
       default :
          return 0;
       }
Signature · 1 line
2.7.4
#18 lore raw

PATCH 18/18 sim: or1k: add additional stubs for linux build

In reply to Stafford Horne

Building for linux the traps interface requires to be expanded more. For now just add stubs to get building.

sim/or1k/ChangeLog:

* sim/or1k/traps-linux.c (or1k32bf_exception): create dummy

---
 sim/or1k/traps-linux.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
sim/or1k/traps-linux.c +21 -0
index d2a111f..263657f 100644
@@ -6,3 +6,24 @@ sim_engine_invalid_insn (SIM_CPU *current_cpu, IADDR cia, SEM_PC vpc)
   /* TODO */
   abort();
 }
+
+void or1k32bf_exception (sim_cpu *current_cpu, USI pc, USI exnum)
+{
+  /* TODO */
+  abort();
+}
+
+void or1k32bf_rfe (sim_cpu *current_cpu)
+{
+  abort();
+}
+
+USI or1k32bf_mfspr (sim_cpu *current_cpu, USI addr)
+{
+  abort();
+}
+
+void or1k32bf_mtspr (sim_cpu *current_cpu, USI addr, USI val)
+{
+  abort();
+}
Signature · 1 line
2.7.4
#19 lore raw

cover sim: port for OpenRISC

In reply to Stafford Horne

Hello,

Sorry, for the spam. Some of these sim patches are too large for the sourceware.org server and getting bounced with:

ezmlm-reject: fatal: Sorry, I don't accept messages larger than 400000 bytes (#5.2.3)

I don't think I can really split them up:
[PATCH 04/18] sim: or1k: add or1k target to sim [PATCH 14/18] sim: or1k: Regenerate autotool files

If you are interested, all patches are being staged in my github repo here:

https://github.com/stffrdhrn/binutils-gdb/commits/or1k-upstream

Also,

The following changes since commit
ca3cbe5cd7715d1559d55f8e71be1dd7340f13b1:

Fix spelling mistakes in comments in shell scripts (2016-11-22 16:05:00
+0000)

are available in the git repository at:

https://github.com/stffrdhrn/binutils-gdb.git

for you to fetch changes up to 42cbafbf5fc83efe133995121aa0c357939546e2:

gdb: or1k: Refactor to new bp_kind_from_pc and pb_from_kind (2016-11-23
18:47:43 +0900)

-Stafford

Quoted 42 lines · Stafford Horne

Hello,

Please find attached the sim patches that allow to get a basic OpenRISC system running. This was used to verify the OpenRISC gdb port.

The main author is Peter Gavin who should have his FSF copyright in place.

Also some new tests were added specifically for openrisc. Please see the details of running the testsuite for sim below:

=== sim Summary ===

# of expected passes            17
/home/shorne/work/openrisc/build-gdb/sim/or1k/run 0.5

Thanks,
-Stafford

Peter Gavin (11):
sim: cgen: add rem (remainder) function (needed for OR1K lf.rem.[sd])
sim: cgen: add mul-o1flag, mul-o2flag RTL functions to CGEN
sim: cgen: allow suffix on generated arch.[ch] and cpuall.h
sim: or1k: add or1k target to sim
sim: or1k: add NOP_EXIT_SILENT; make simulator print exit code for
NOP_EXIT;
sim: or1k: fix branching and exceptions in sim
sim: or1k: remove erroneous warning message in sim/or1k/or1k.c
sim: or1k: fix fl1 in sim
sim: or1k: regenerate sim files
sim: testsuite: add testsuite for or1k sim
sim: or1k: fix segfault when run without arguments

Stafford Horne (7):
sim: or1k: Get or1k sim building with latest sim common
sim: or1k: Regenerate cgen files
sim: or1k: Regenerate autotool files
sim: or1k: Implement register store/fetch
sim: or1k: Do trap breakpoint handling
sim: or1k: Implement fetch/store for ppc and sr
sim: or1k: add additional stubs for linux build

#20 lore raw

cover sim: port for OpenRISC

In reply to Stafford Horne
Quoted 1 line · Stafford Horne

The main author is Peter Gavin who should have his FSF copyright in place.

what about yourself ? all authors should have papers in place.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.librecores.org/pipermail/openrisc/attachments/20161125/cfe845aa/attachment.sig>

#21 lore raw

cover sim: port for OpenRISC

Quoted 4 lines · Mike Frysinger
Quoted 1 line · Stafford Horne

The main author is Peter Gavin who should have his FSF copyright in place.

what about yourself ? all authors should have papers in place.

Hello,

I do not yet, but I would like to. According to the gcc contributing guidelines [1] it mentions:

See some documentation by the FSF for details and contact us (either via the gcc at gcc.gnu.org list or the GCC maintainer that is taking care of your contributions) to obtain the relevant forms.

I know this is not gcc, but gdb, but I thought it might be the same process. Since it mentions 'via .. maintainer .. taking care of your ..' I thought it best I submit these patches first.

Could you send me the forms?

[1] https://gcc.gnu.org/contribute.html

-Stafford

#22 lore raw

cover sim: port for OpenRISC

Quoted 18 lines · Stafford Horne
Quoted 4 lines · Mike Frysinger
Quoted 1 line · Stafford Horne

The main author is Peter Gavin who should have his FSF copyright in place.

what about yourself ? all authors should have papers in place.

Hello,

I do not yet, but I would like to. According to the gcc contributing guidelines [1] it mentions:

See some documentation by the FSF for details and contact us (either via the gcc at gcc.gnu.org list or the GCC maintainer that is taking care of your contributions) to obtain the relevant forms.

Quoted 7 lines

I know this is not gcc, but gdb, but I thought it might be the same process. Since it mentions 'via .. maintainer .. taking care of your ..' I thought it best I submit these patches first.

Could you send me the forms?

[1] https://gcc.gnu.org/contribute.html

Hello,

I was able to get these forms submitted, but I may have made a mistake. Please, help clarify, I sent the program name as "GDB". However does that cover work on all of binutils-gdb? Or just gdb?

If needed I can request again.

-Stafford

#23 lore raw

cover sim: port for OpenRISC

Quoted 18 lines · Stafford Horne
Quoted 17 lines · Stafford Horne
Quoted 4 lines · Mike Frysinger
Quoted 1 line · Stafford Horne

The main author is Peter Gavin who should have his FSF copyright in place.

what about yourself ? all authors should have papers in place.

I do not yet, but I would like to. According to the gcc contributing guidelines [1] it mentions:

See some documentation by the FSF for details and contact us (either via the gcc at gcc.gnu.org list or the GCC maintainer that is taking care of your contributions) to obtain the relevant forms.

I know this is not gcc, but gdb, but I thought it might be the same process. Since it mentions 'via .. maintainer .. taking care of your ..' I thought it best I submit these patches first.

Quoted 7 lines
Quoted 3 lines

Could you send me the forms?

[1] https://gcc.gnu.org/contribute.html

I was able to get these forms submitted, but I may have made a mistake. Please, help clarify, I sent the program name as "GDB". However does that cover work on all of binutils-gdb? Or just gdb?

i think each project is considered sep. you'll want binutils, gdb, and
sim. this is the form i used in the past (directions at the top):
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=doc/Copyright/request-assign.future;hb=HEAD
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.librecores.org/pipermail/openrisc/attachments/20161216/71fd579b/attachment.sig>

#24 lore raw

cover sim: port for OpenRISC

Hi Mike,

Quoted 23 lines · Mike Frysinger
Quoted 22 lines · Stafford Horne
Quoted 20 lines · Stafford Horne
Quoted 4 lines · Mike Frysinger
Quoted 1 line · Stafford Horne

The main author is Peter Gavin who should have his FSF copyright in place.

what about yourself ? all authors should have papers in place.

I do not yet, but I would like to. According to the gcc contributing guidelines [1] it mentions:

See some documentation by the FSF for details and contact us (either via the gcc at gcc.gnu.org list or the GCC maintainer that is taking care of your contributions) to obtain the relevant forms.

I know this is not gcc, but gdb, but I thought it might be the same process. Since it mentions 'via .. maintainer .. taking care of your ..' I thought it best I submit these patches first.

Could you send me the forms?

[1] https://gcc.gnu.org/contribute.html

Quoted 8 lines
Quoted 3 lines

I was able to get these forms submitted, but I may have made a mistake. Please, help clarify, I sent the program name as "GDB". However does that cover work on all of binutils-gdb? Or just gdb?

i think each project is considered sep. you'll want binutils, gdb, and sim. this is the form i used in the past (directions at the top):
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=doc/Copyright/request-assign.future;hb=HEAD
-mike

Right, those are the same forms I used. I will additionally request sim and binutils.

-Stafford

#25 lore raw

cover sim: port for OpenRISC

Quoted 28 lines · Stafford Horne
Quoted 27 lines · Mike Frysinger
Quoted 25 lines · Stafford Horne
Quoted 13 lines · Stafford Horne
Quoted 4 lines · Mike Frysinger
Quoted 1 line · Stafford Horne

The main author is Peter Gavin who should have his FSF copyright in place.

what about yourself ? all authors should have papers in place.

I do not yet, but I would like to. According to the gcc contributing guidelines [1] it mentions:

See some documentation by the FSF for details and contact us (either via the gcc at gcc.gnu.org list or the GCC maintainer that is taking care of your contributions) to obtain the relevant forms.

Quoted 7 lines

I know this is not gcc, but gdb, but I thought it might be the same process. Since it mentions 'via .. maintainer .. taking care of your ..' I thought it best I submit these patches first.

Could you send me the forms?

[1] https://gcc.gnu.org/contribute.html

I was able to get these forms submitted, but I may have made a mistake. Please, help clarify, I sent the program name as "GDB". However does that cover work on all of binutils-gdb? Or just gdb?

Quoted 6 lines
Quoted 3 lines

i think each project is considered sep. you'll want binutils, gdb, and sim. this is the form i used in the past (directions at the top):
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=doc/Copyright/request-assign.future;hb=HEAD

Right, those are the same forms I used. I will additionally request sim and binutils.

thanks. let us know when it's sorted and we can start the review.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.librecores.org/pipermail/openrisc/attachments/20161217/735ed721/attachment.sig>