|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Copyright (C) 2010, 2011, 2012, 2013 Embecosm Limited |
| 4 | +# Copyright (C) 2013-2015 Synopsys, Inc. |
| 5 | + |
| 6 | +# Contributor Jeremy Bennett <[email protected]> |
| 7 | +# Contributor Joern Rennecke <[email protected]> |
| 8 | +# Contributor Anton Kolesov <[email protected]> |
| 9 | + |
| 10 | +# This file is additional DejaGnu procs to support telnet based testing. |
| 11 | + |
| 12 | +# This program is free software; you can redistribute it and/or modify it |
| 13 | +# under the terms of the GNU General Public License as published by the Free |
| 14 | +# Software Foundation; either version 3 of the License, or (at your option) |
| 15 | +# any later version. |
| 16 | + |
| 17 | +# This program is distributed in the hope that it will be useful, but WITHOUT |
| 18 | +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 19 | +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 20 | +# more details. |
| 21 | + |
| 22 | +# You should have received a copy of the GNU General Public License along |
| 23 | +# with this program. If not, see <http://www.gnu.org/licenses/>. |
| 24 | + |
| 25 | +# ARC Bare Metal DejaGnu nSim Simulator Support |
| 26 | +# ============================================= |
| 27 | + |
| 28 | +# This board specification is for use with the ARC nSim simulator. |
| 29 | + |
| 30 | +# This is a list of toolchains that are supported on this board. |
| 31 | +set_board_info target_install ${target_triplet} |
| 32 | + |
| 33 | +# Load the generic configuration for this board. This will define a basic set |
| 34 | +# of routines needed by the tool to communicate with the board. Depends on the |
| 35 | +# tool. |
| 36 | +load_generic_config "gdb-comm" |
| 37 | + |
| 38 | +# Some extra procs for testing with nSim. This must go after gdb-comm, as it |
| 39 | +# overrides one of the function in gdb-comm. |
| 40 | +search_and_load_file "library file" "nsim-extra.exp" ${boards_dir} |
| 41 | + |
| 42 | +# GDB tests require special treatment, they ignore "gdb-comm" configuration |
| 43 | +# unless "monitor" GDB test suite configuration is loaded. |
| 44 | +if { $tool == "gdb" } { |
| 45 | + load_lib "../config/monitor.exp" |
| 46 | +} |
| 47 | + |
| 48 | +# Any multilib options are set in an environment variable. |
| 49 | +process_multilib_options "$env(ARC_MULTILIB_OPTIONS)" |
| 50 | + |
| 51 | +set xldflags "" |
| 52 | + |
| 53 | +# We only support newlib on this target. We assume that all multilib |
| 54 | +# options have been specified before we get here. |
| 55 | +set_board_info compiler "[find_gcc]" |
| 56 | +set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" |
| 57 | +set_board_info ldflags "[libgloss_link_flags] ${xldflags} [newlib_link_flags]" |
| 58 | + |
| 59 | +# No linker script needed. |
| 60 | +set_board_info ldscript "" |
| 61 | + |
| 62 | +# This is a very simple board, that expects that OpenOCD has already been |
| 63 | +# started. It would be possible to allow automatic start/restart by using same |
| 64 | +# infrastructure as in nsim-gdb. |
| 65 | +set_board_info netport "localhost:3333" |
| 66 | + |
| 67 | +# GDB protocol to be used |
| 68 | +set_board_info gdb_protocol "remote" |
| 69 | + |
| 70 | +# Use 'continue' instead of 'run' when executing a test |
| 71 | +set_board_info gdb_run_command "continue" |
| 72 | + |
| 73 | +# On occations GDB cannot connect to nSIM and reboots it. By default amount of |
| 74 | +# reboots is limited to 15, after that all execution tests will be reported as |
| 75 | +# UNTESTED. We need to set an effectively infinite number of reboots so that |
| 76 | +# all execute tests will finish. |
| 77 | +set_board_info max_reload_reboots 1500000 |
| 78 | + |
| 79 | +# Doesn't pass arguments or signals, can't return results, and doesn't |
| 80 | +# do inferiorio. |
| 81 | +set_board_info noargs 1 |
| 82 | +set_board_info gdb,nosignals 1 |
| 83 | +set_board_info gdb,noresults 1 |
| 84 | +set_board_info gdb,noinferiorio 1 |
| 85 | +set_board_info needs_status_wrapper "" |
| 86 | + |
| 87 | +if { $tool == "gdb" } { |
| 88 | + # We use gdbserver to run applications |
| 89 | + set_board_info use_gdb_stub 1 |
| 90 | + # GDB jumps to start_symbols after loading. Default value is `start'. |
| 91 | + set_board_info gdb,start_symbol "__start" |
| 92 | + set_board_info gdb,do_reload_on_run 1 |
| 93 | + set_board_info gdb,no_hardware_watchpoints 1 |
| 94 | + # This duplicates the one without 'gdb,' |
| 95 | + set_board_info gdb,noargs 1 |
| 96 | + set_board_info gdb,nofileio 1 |
| 97 | +} |
| 98 | + |
| 99 | +# vim: noexpandtab sts=4 ts=8: |
0 commit comments