I'm running [1] PRU regression tests using this baseboard definition and mainline Binutils, GCC, Newlib and GNU Simulator.
[1] https://github.com/dinuxbg/gnupru/blob/master/testing/buildbot-pru.sh ChangeLog: * Makefile.am: Add pru-sim.exp. * Makefile.in: Ditto. * baseboards/pru-sim.exp: New file. Signed-off-by: Dimitar Dimitrov <dimi...@dinux.eu> --- Makefile.am | 1 + Makefile.in | 1 + baseboards/pru-sim.exp | 60 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 baseboards/pru-sim.exp diff --git a/Makefile.am b/Makefile.am index 29fa4f4..dfbfd40 100644 --- a/Makefile.am +++ b/Makefile.am @@ -130,6 +130,7 @@ baseboard_DATA = \ baseboards/pi.exp \ baseboards/powerpc-sim.exp \ baseboards/powerpcle-sim.exp \ + baseboards/pru-sim.exp \ baseboards/qemu.exp \ baseboards/riscv-sim.exp \ baseboards/rx-sim.exp \ diff --git a/Makefile.in b/Makefile.in index ef6ba88..8d5d55b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -460,6 +460,7 @@ baseboard_DATA = \ baseboards/pi.exp \ baseboards/powerpc-sim.exp \ baseboards/powerpcle-sim.exp \ + baseboards/pru-sim.exp \ baseboards/qemu.exp \ baseboards/riscv-sim.exp \ baseboards/rx-sim.exp \ diff --git a/baseboards/pru-sim.exp b/baseboards/pru-sim.exp new file mode 100644 index 0000000..40c597e --- /dev/null +++ b/baseboards/pru-sim.exp @@ -0,0 +1,60 @@ +# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# +# This file is part of DejaGnu. +# +# DejaGnu 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. +# +# DejaGnu 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 DejaGnu; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +# This is a list of toolchains that are supported on this board. +set_board_info target_install {pru-elf} + +# Load the generic configuration for this board, This will define a basic +# set of routines needed by the tool to communicate with the board. +load_generic_config "sim" + +# basic-sim.exp is a basic description for the standard Cygnus simulator. +load_base_board_description "basic-sim" + +# The name of the simulator is "pru". +setup_sim pru + +# No multilib flags needed by default. +process_multilib_options "" + +# The compiler used to build for this board. This has *nothing* to do +# with what compiler is tested if we're testing gcc. +set_board_info compiler "[find_gcc]" + +# PRU arguments are mostly passed in registers. But GCC regression tests +# are written with other machines in mind, so the builtin_apply's +# aruments stack size is non-zero. On top of that, the stack top for +# PRU's main is very close to the end of SRAM. Close enough that the +# spurious "stack copy" reads outside of the DRAM area, causing a +# simulator abort. For example, see how builtin-apply-3.c copies 16 +# bytes from the arguments stack, while PRU has passed all of its +# arguments in registers. +# +# Temporary solution is to add a few bytes of "guard" space, so that +# existing GCC testcases can be executed successfully. Hence set the +# stack top a few bytes below the simulator's DRAM end. +set workaround_ldflags "-Wl,--defsym=_stack_top=0x3fff800" + +set_board_info cflags "-mmcu=sim [libgloss_include_flags] [newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] $workaround_ldflags" + +# No support for signals on this target. +set_board_info gdb,nosignals 1 + +# Low-end workstations might require even larger timeouts. +set timeout 120 -- 2.20.1