aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/lib
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2020-12-09 22:26:30 -0500
committerMike Frysinger <vapier@gentoo.org>2021-04-03 16:19:16 -0400
commit26da232cbd6dd920da9521e508e42d1a46180ab4 (patch)
tree76451bdc21196c61c8c36787c74239660437b777 /sim/testsuite/lib
parenta389375f5b5fb67acdda6be028526ac44df2fbff (diff)
downloadbinutils-26da232cbd6dd920da9521e508e42d1a46180ab4.zip
binutils-26da232cbd6dd920da9521e508e42d1a46180ab4.tar.gz
binutils-26da232cbd6dd920da9521e508e42d1a46180ab4.tar.bz2
sim: example-synacor: a simple implementation for reference
Provide a simple example simulator for people porting to new targets to use as a reference. This one has the advantage of being used by people and having a fun program available for it. It doesn't require a special target -- the example simulators can be built for any existing port.
Diffstat (limited to 'sim/testsuite/lib')
-rw-r--r--sim/testsuite/lib/sim-defs.exp7
1 files changed, 7 insertions, 0 deletions
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 0157f9b..e1254a3 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -378,6 +378,13 @@ proc run_sim_test { name requested_machs } {
set options "$options timeout=$opts(timeout)"
}
+ if [string match "example" "$mach"] {
+ set objcopy [find_binutils_prog objcopy]
+ set comp_output [remote_exec host $objcopy "-O binary -j .text ${name}.x ${name}.bin"]
+ file rename -force "${name}.bin" "${name}.x"
+ append opts(sim,$mach) " --target binary"
+ }
+
set result [sim_run ${name}.x "$opts(sim,$mach) $global_sim_options" "$opts(progopts)" "" "$options"]
set return_code [lindex $result 0]
set output [lindex $result 1]