1 # find_sim
-- find a usable simulator
2 # This proc is local to this file and is used to locate a simulator to use.
3 # First we see
if SIM
=foo was specified
on the command line.
4 # Otherwise we search the build tree
, then $PATH.
6 proc find_sim
{ target_alias sim_dir sim_name
} {
10 if [info exists SIM
] {
15 if ![board_info host
exists no_transform_name
] {
16 return $
{target_alias
}-$
{sim_name
};
22 # We have to search because tool_root_dir may actually point to that blasted
23 #
"target" subdirectory.
24 set try
[lookfor_file $
{tool_root_dir
} sim
/$
{sim_dir
}/$
{sim_name
}];
28 return $
{target_alias
}-$
{sim_name
};
31 proc setup_sim
{ subdir_name
} {
36 if [info exists target_alias
] {
37 set tmp $target_alias
;
39 if [board_info $board
exists target_install
] {
40 set tmp
[lindex
[board_info $board target_install
] 0];
44 if ![board_info $board
exists sim
] {
45 set_board_info sim
[find_sim $tmp $subdir_name run
];
48 verbose
"Using simulator [board_info $board sim]\n"
51 set_board_info is_simulator
1;