20 |
set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" |
set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" |
21 |
|
|
22 |
# No linker script needed. |
# No linker script needed. |
23 |
set_board_info ldscript ""; |
set_board_info ldscript "" |
24 |
|
|
25 |
# The simulator doesn't return exit statuses and we need to indicate this; |
# The simulator doesn't return exit statuses and we need to indicate this; |
26 |
# the standard GCC wrapper will work with this target. |
# the standard GCC wrapper will work with this target. |
55 |
puts $handle "quit" |
puts $handle "quit" |
56 |
close $handle |
close $handle |
57 |
|
|
58 |
return [eval remote_spawn host \{ $sim $simflags "-sdoit" \} $args]; |
return [eval remote_spawn host \{ $sim $simflags "-sdoit" \} $args] |
59 |
} |
} |
60 |
|
|
61 |
proc sim_wait { dest timeout } { |
proc sim_wait { dest timeout } { |
62 |
return [remote_wait host $timeout]; |
return [remote_wait host $timeout] |
63 |
} |
} |
64 |
|
|
65 |
proc sim_load { dest prog args } { |
proc sim_load { dest prog args } { |
67 |
if ![file exists $prog] then { |
if ![file exists $prog] then { |
68 |
perror "sim.exp: $prog to be downloaded does not exist." |
perror "sim.exp: $prog to be downloaded does not exist." |
69 |
verbose -log "$prog to be downloaded does not exist." 3 |
verbose -log "$prog to be downloaded does not exist." 3 |
70 |
return [list "untested" ""]; |
return [list "untested" ""] |
71 |
} |
} |
72 |
|
|
73 |
set sim_time_limit 240 |
set sim_time_limit 240 |
74 |
|
|
75 |
set output ""; |
set output "" |
76 |
|
|
77 |
set res [remote_spawn target "${prog}"]; |
set res [remote_spawn target "${prog}"] |
78 |
|
|
79 |
if { $res <= 0 } { |
if { $res <= 0 } { |
80 |
return [list "fail" "remote_spawn failed"]; |
return [list "fail" "remote_spawn failed"] |
81 |
} |
} |
82 |
|
|
83 |
set state [remote_wait target $sim_time_limit]; |
set state [remote_wait target $sim_time_limit] |
84 |
set status [lindex $state 0]; |
set status [lindex $state 0] |
85 |
set output [lindex $state 1]; |
set output [lindex $state 1] |
86 |
verbose "Output is $output"; |
verbose "Output is $output" |
87 |
|
|
88 |
set status2 [check_for_board_status output]; |
set status2 [check_for_board_status output] |
89 |
if { $status2 >= 0 } { |
if { $status2 >= 0 } { |
90 |
set status $status2 |
set status $status2 |
91 |
} |
} |
99 |
} else { |
} else { |
100 |
set result "fail" |
set result "fail" |
101 |
} |
} |
102 |
return [list $result $output]; |
return [list $result $output] |
103 |
} |
} |
104 |
|
|
105 |
set_board_info protocol "sim"; |
set_board_info protocol "sim" |
106 |
|
|
107 |
# By default, assume the simulator is slow. This causes some tests |
# By default, assume the simulator is slow. This causes some tests |
108 |
# to either be simplified or skipped completely. |
# to either be simplified or skipped completely. |
119 |
## XXX - fixme - this should not be hardcoded. |
## XXX - fixme - this should not be hardcoded. |
120 |
## XXX - fixme - this should vary depending upon endianism selected. |
## XXX - fixme - this should vary depending upon endianism selected. |
121 |
|
|
122 |
return "/home/nickc/bin/linux/sim-be"; |
return "/home/nickc/bin/linux/sim-be" |
123 |
} |
} |
124 |
|
|
125 |
set_board_info is_simulator 1; |
set_board_info is_simulator 1 |