1 # Copyright
(C
) 1997-2016 Free Software Foundation
, Inc.
3 # This file is part of DejaGnu.
5 # DejaGnu is free software
: you can redistribute it and
/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation
, either version
3 of the License
, or
8 #
(at your option
) any later version.
10 # DejaGnu is distributed in the hope that it will be useful
, but
11 # WITHOUT
ANY WARRANTY
; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License
for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with DejaGnu.
If not
, see
<http
://www.gnu.org
/licenses
/>.
18 # find_sim
-- find a usable simulator
19 # This proc is local to this file and is used to locate a simulator to use.
20 # First we see
if SIM
=foo was specified
on the command line.
21 # Otherwise we search the build tree
, then $PATH.
23 proc find_sim
{ target_alias sim_dir sim_name
} {
27 if {[info exists SIM
]} {
31 if {[isremote host
]} {
32 if {![board_info host
exists no_transform_name
]} {
33 return $target_alias
-$sim_name
39 # We have to search because tool_root_dir may actually point to that blasted
40 #
"target" subdirectory.
41 set try
[lookfor_file $tool_root_dir sim
/$sim_dir
/$sim_name
]
45 return $target_alias
-$sim_name
48 proc setup_sim
{ subdir_name
} {
53 if {[info exists target_alias
]} {
56 if {[board_info $board
exists target_install
]} {
57 set tmp
[lindex
[board_info $board target_install
] 0]
61 if {![board_info $board
exists sim
]} {
62 set_board_info sim
[find_sim $tmp $subdir_name run
]
65 verbose
"Using simulator [board_info $board sim]\n"
68 set_board_info is_simulator
1
70 # Most simulators need the image reloaded and reinitialized to rerun.
71 set_board_info gdb
,do_reload_on_run
1