diff options
author | Rob Savoye <rob@welcomehome.org> | 2001-02-05 04:14:59 +0000 |
---|---|---|
committer | Rob Savoye <rob@welcomehome.org> | 2001-02-05 04:14:59 +0000 |
commit | 20f1185dd84bcadf4b238d1d2ca18f5ca79157d4 (patch) | |
tree | da300d5097593bc1d61123a8e32179914440e85f /baseboards/basic-sim.exp | |
download | dejagnu-20f1185dd84bcadf4b238d1d2ca18f5ca79157d4.zip dejagnu-20f1185dd84bcadf4b238d1d2ca18f5ca79157d4.tar.gz dejagnu-20f1185dd84bcadf4b238d1d2ca18f5ca79157d4.tar.bz2 |
Initial revision
Diffstat (limited to 'baseboards/basic-sim.exp')
-rw-r--r-- | baseboards/basic-sim.exp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/baseboards/basic-sim.exp b/baseboards/basic-sim.exp new file mode 100644 index 0000000..3fa7c4d --- /dev/null +++ b/baseboards/basic-sim.exp @@ -0,0 +1,51 @@ +# find_sim -- find a usable simulator +# This proc is local to this file and is used to locate a simulator to use. +# First we see if SIM=foo was specified on the command line. +# Otherwise we search the build tree, then $PATH. + +proc find_sim { target_alias sim_dir sim_name } { + global tool_root_dir; + global SIM + + if [info exists SIM] { + return $SIM + } + + if [is_remote host] { + if ![board_info host exists no_transform_name] { + return ${target_alias}-${sim_name}; + } else { + return ${sim_name}; + } + } + + # We have to search because tool_root_dir may actually point to that blasted + # "target" subdirectory. + set try [lookfor_file ${tool_root_dir} sim/${sim_dir}/${sim_name}]; + if { $try != "" } { + return $try; + } + return ${target_alias}-${sim_name}; +} + +proc setup_sim { subdir_name } { + global target_alias; + global tool_root_dir; + global board; + + if [info exists target_alias] { + set tmp $target_alias; + } else { + if [board_info $board exists target_install] { + set tmp [lindex [board_info $board target_install] 0]; + } + } + + if ![board_info $board exists sim] { + set_board_info sim [find_sim $tmp $subdir_name run]; + } + + verbose "Using simulator [board_info $board sim]\n" +} + +set_board_info is_simulator 1; |