1 |
# Copyright (C) 1993 - 2001 Free Software Foundation, Inc. |
# Copyright (C) 1993 - 2002, 2003 Free Software Foundation, Inc. |
2 |
|
|
3 |
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
4 |
# it under the terms of the GNU General Public License as published by |
# it under the terms of the GNU General Public License as published by |
82 |
|
|
83 |
set output ""; |
set output ""; |
84 |
|
|
85 |
|
if { [board_info target sim,protocol] == "sid" } { |
86 |
|
set cmd "-e \"set cpu-loader file [list $prog]\"" |
87 |
|
} elseif { [board_info target sim,protocol] == "rawsid" } { |
88 |
|
set cmd "--load=$prog" |
89 |
|
} else { |
90 |
|
set cmd $prog |
91 |
|
} |
92 |
|
|
93 |
# Run the program with a limited amount of real time. While |
# Run the program with a limited amount of real time. While |
94 |
# this isn't as nice as limiting the amount of CPU time, it |
# this isn't as nice as limiting the amount of CPU time, it |
95 |
# will have to do. |
# will have to do. |
96 |
if { $inpfile != "" } { |
if { $inpfile != "" } { |
97 |
set res [remote_spawn target "${prog} < $inpfile" "readonly"]; |
set res [remote_spawn target "${cmd} < $inpfile" "readonly"]; |
98 |
} else { |
} else { |
99 |
set res [remote_spawn target "${prog}"]; |
set res [remote_spawn target "${cmd}"]; |
100 |
} |
} |
101 |
|
|
102 |
if { $res <= 0 } { |
if { $res <= 0 } { |