1 # This is a HACKED version of mcore
-sim.exp that is intended to
2 # support running tests
on Motorola
's proprietry MCore simulator.
4 # It is quite likely that thia file will need to be modified in
5 # order for you to use Motorola's simulator.
7 # This is a list of toolchains that are supported
on this board.
8 set_board_info target_install
{mcore
-elf
, mcore
-pe
}
10 #
Do general config stuff but
do not
load anything.
"jim" was
11 # chosen because it does not exist.
12 load_generic_config
"jim"
14 process_multilib_options
""
16 # We only support newlib
on this target. We assume that all multilib
17 # options have been specified before we
get here.
18 set_board_info compiler
"[find_gcc]"
19 set_board_info cflags
"[libgloss_include_flags] [newlib_include_flags]"
20 set_board_info ldflags
"[libgloss_link_flags] [newlib_link_flags]"
22 # No linker script needed.
23 set_board_info ldscript
"";
25 # The simulator doesn
't return exit statuses and we need to indicate this;
26 # the standard GCC wrapper will work with this target.
27 set_board_info needs_status_wrapper 1
29 # Doesn't pass arguments or signals
, can
't return results, and doesn't
31 set_board_info noargs
1
32 set_board_info gdb
,nosignals
1
33 set_board_info gdb
,noresults
1
34 set_board_info gdb
,noinferiorio
1
36 # Rather than
include the
normal simulator support files
,
37 # their functions are reproduced
(and modified
) here.
38 #
--------------------------------------------------------------
39 proc sim_spawn
{ dest cmdline
args } {
41 # Choose whoch simulator to run
42 ## XXX
- fixme
- this should be automatic based
on the
44 ## XXX
- fixme
- this should not be hardcoded.
45 set sim
"/home/nickc/bin/linux/sim-be"
46 #
set sim
"/home/nickc/bin/linux/sim-le"
50 # Create a script to run the
program
51 set handle
[open doit w
]
52 puts $handle
"load $cmdline"
58 return [eval remote_spawn host \
{ $sim $simflags
"-sdoit" \} $args];
61 proc sim_wait
{ dest timeout
} {
62 return [remote_wait host $timeout
];
65 proc sim_load
{ dest prog
args } {
67 if ![file
exists $prog
] then {
68 perror
"sim.exp: $prog to be downloaded does not exist."
69 verbose
-log "$prog to be downloaded does not exist." 3
70 return [list
"untested" ""];
73 set sim_time_limit
240
77 set res
[remote_spawn target
"${prog}"];
80 return [list
"fail" "remote_spawn failed"];
83 set state
[remote_wait target $sim_time_limit
];
84 set status [lindex $state
0];
85 set output
[lindex $state
1];
86 verbose
"Output is $output";
88 set status2
[check_for_board_status output
];
89 if { $status2
>= 0 } {
93 # FIXME
: Do we need to examine $
status?
94 # Yes
, we
do--what
if the simulator itself gets an error and coredumps?
96 verbose
"Return status was: $status" 2
102 return [list $result $output
];
105 set_board_info protocol
"sim";
107 # By default
, assume the simulator is slow. This causes some tests
108 # to either be simplified or skipped completely.
109 set_board_info slow_simulator
1
111 #
-----------------------------------------------------------
112 # find_sim
-- find a usable simulator
113 # This proc is local to this file and is used to locate a simulator to use.
114 # First we see
if SIM
=foo was specified
on the command line.
115 # Otherwise we search the build tree
, then $PATH.
117 proc find_sim
{ target_alias sim_dir sim_name
} {
119 ## XXX
- fixme
- this should not be hardcoded.
120 ## XXX
- fixme
- this should vary depending upon endianism selected.
122 return "/home/nickc/bin/linux/sim-be";
125 set_board_info is_simulator
1;