aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-11-24 08:47:59 +0000
committerNick Clifton <nickc@redhat.com>2015-11-24 08:47:59 +0000
commit2e8cf49e1387eba9c4ce062885b99a6eb76c01f8 (patch)
tree363800e2edad589cb37f72e10fc842097a8ec9c4 /sim/testsuite
parent351e610191016136a49ee2a0889f1c4929169fc6 (diff)
downloadgdb-2e8cf49e1387eba9c4ce062885b99a6eb76c01f8.zip
gdb-2e8cf49e1387eba9c4ce062885b99a6eb76c01f8.tar.gz
gdb-2e8cf49e1387eba9c4ce062885b99a6eb76c01f8.tar.bz2
Add an AArch64 simulator to GDB.
sim * configure.tgt: Add aarch64 entry. * configure: Regenerate. * sim/aarch64/configure.ac: New configure template. * sim/aarch64/aclocal.m4: Generate. * sim/aarch64/config.in: Generate. * sim/aarch64/configure: Generate. * sim/aarch64/cpustate.c: New file - functions for accessing AArch64 registers. * sim/aarch64/cpustate.h: New header. * sim/aarch64/decode.h: New header. * sim/aarch64/interp.c: New file - interface between GDB and simulator. * sim/aarch64/Makefile.in: New makefile template. * sim/aarch64/memory.c: New file - functions for simulating aarch64 memory accesses. * sim/aarch64/memory.h: New header. * sim/aarch64/sim-main.h: New header. * sim/aarch64/simulator.c: New file - aarch64 simulator functions. * sim/aarch64/simulator.h: New header. include/gdb * sim-aarch64.h: New file. sim/test * configure: Regenerate. * sim/aarch64: New directory.
Diffstat (limited to 'sim/testsuite')
-rw-r--r--sim/testsuite/ChangeLog5
-rwxr-xr-xsim/testsuite/configure3
-rw-r--r--sim/testsuite/sim/aarch64/ChangeLog3
-rw-r--r--sim/testsuite/sim/aarch64/allinsn.exp15
-rw-r--r--sim/testsuite/sim/aarch64/pass.s7
-rw-r--r--sim/testsuite/sim/aarch64/testutils.inc72
6 files changed, 105 insertions, 0 deletions
diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog
index e6525a9..f790420 100644
--- a/sim/testsuite/ChangeLog
+++ b/sim/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-11-24 Nick Clifton <nickc@redhat.com>
+
+ * configure: Regenerate.
+ * sim/aarch64: New directory.
+
2015-11-14 Mike Frysinger <vapier@gentoo.org>
* lib/sim-defs.exp (slurp_options): Pull in global subdir/srcdir.
diff --git a/sim/testsuite/configure b/sim/testsuite/configure
index c5980fe..287245b 100755
--- a/sim/testsuite/configure
+++ b/sim/testsuite/configure
@@ -1827,6 +1827,9 @@ sim_common=yes
sim_igen=no
sim_arch=
case "${target}" in
+ aarch64*-*-*)
+ sim_arch=aarch64
+ ;;
arm*-*-*)
sim_arch=arm
;;
diff --git a/sim/testsuite/sim/aarch64/ChangeLog b/sim/testsuite/sim/aarch64/ChangeLog
new file mode 100644
index 0000000..8aacf49
--- /dev/null
+++ b/sim/testsuite/sim/aarch64/ChangeLog
@@ -0,0 +1,3 @@
+2015-11-24 Nick Clifton <nickc@redhat.com>
+
+ * pass.s, allinsn.exp, testutils.inc: New files.
diff --git a/sim/testsuite/sim/aarch64/allinsn.exp b/sim/testsuite/sim/aarch64/allinsn.exp
new file mode 100644
index 0000000..54d6478
--- /dev/null
+++ b/sim/testsuite/sim/aarch64/allinsn.exp
@@ -0,0 +1,15 @@
+# AArch64 simulator testsuite
+
+if [istarget aarch64*-*] {
+ # all machines
+ set all_machs "aarch64"
+
+ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.s]] {
+ # If we're only testing specific files and this isn't one of them,
+ # skip it.
+ if ![runtest_file_p $runtests $src] {
+ continue
+ }
+ run_sim_test $src $all_machs
+ }
+}
diff --git a/sim/testsuite/sim/aarch64/pass.s b/sim/testsuite/sim/aarch64/pass.s
new file mode 100644
index 0000000..7ce7de5
--- /dev/null
+++ b/sim/testsuite/sim/aarch64/pass.s
@@ -0,0 +1,7 @@
+# check that the sim doesn't die immediately.
+# mach: aarch64
+
+.include "testutils.inc"
+
+ start
+ pass
diff --git a/sim/testsuite/sim/aarch64/testutils.inc b/sim/testsuite/sim/aarch64/testutils.inc
new file mode 100644
index 0000000..c8897aa
--- /dev/null
+++ b/sim/testsuite/sim/aarch64/testutils.inc
@@ -0,0 +1,72 @@
+# MACRO: exit
+# Terminates execution.
+ .macro exit nr
+
+ stp x29, x30, [sp,#-32]!
+ mov x4, #0x26
+ mov x7, #\nr
+ mov x29, sp
+ movk x4, #0x2, lsl #16
+ add x1, x29, #0x10
+ str x4, [x29,#16]
+ str x7, [x29,#24]
+ mov w0, #0x18
+ hlt #0xf000
+
+ .endm
+
+# MACRO: swiwrite
+# Writes the string in X1 to stdout
+ .macro swiwrite len
+
+ stp x29, x30, [sp,#-48]!
+ mov x0, #1
+ mov x2, #\len
+ mov x29, sp
+ str x0, [x29,#24]
+ str x1, [x29,#32]
+ str x2, [x29,#40]
+ mov w0, #0x5
+ add x1, x29, #0x18
+ hlt #0xf000
+ ldp x29, x30, [sp],#48
+ ret
+
+ .endm
+
+# MACRO: pass
+# Write 'pass' to stdout and quit
+ .macro pass
+
+ adrp x1, .Lpass
+ add x1, x1, :lo12:.Lpass
+
+ swiwrite 5
+ exit 0
+
+ .data
+.Lpass:
+ .asciz "pass\n"
+ .endm
+
+# MACRO: fail
+# Write 'fail' to stdout and quit
+ .macro fail
+
+ adrp x1, .Lfail
+ add x1, x1, :lo12:.Lfail
+ swiwrite 5
+ exit 0
+
+ .data
+.Lfail:
+ .asciz "fail\n"
+ .endm
+
+# MACRO: start
+# All assembler tests should start with a call to "start"
+ .macro start
+ .text
+.global _start
+_start:
+ .endm