From 807168a1de1b101622d084c5fe160cf41ff3f59d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Vilanova?= Date: Tue, 8 Jan 2013 08:54:12 -0500 Subject: util: add m5_fail op. Used as a command in full-system scripts helps the user ensure the benchmarks have finished successfully. For example, one can use: /path/to/benchmark args || /sbin/m5 fail 1 and thus ensure gem5 will exit with an error if the benchmark fails. --- src/sim/pseudo_inst.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/sim/pseudo_inst.cc') diff --git a/src/sim/pseudo_inst.cc b/src/sim/pseudo_inst.cc index aafa5672b..a57bdb2ce 100644 --- a/src/sim/pseudo_inst.cc +++ b/src/sim/pseudo_inst.cc @@ -218,6 +218,13 @@ m5exit(ThreadContext *tc, Tick delay) exitSimLoop("m5_exit instruction encountered", 0, when); } +void +m5fail(ThreadContext *tc, Tick delay, uint64_t code) +{ + Tick when = curTick() + delay * SimClock::Int::ns; + exitSimLoop("m5_fail instruction encountered", code, when); +} + void loadsymbol(ThreadContext *tc) { -- cgit v1.2.3