From 3853d785943cf93125ba296b64e24247d2f43e64 Mon Sep 17 00:00:00 2001 From: "Michiel W. van Tol" Date: Tue, 19 May 2020 18:41:11 +0100 Subject: [PATCH] sim: Add faulting flag to instruction tracing interface This patch adds a faulting flag to InstRecord. This allows tracers to identify that the traced instruction has faulted, when ExecFaulting is enabled. It can be set with InstRecord::setFaulting() and read with Instrecord::getFaulting(). Change-Id: I390392d59de930533eab101e96dc4d3c76500748 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30134 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/sim/insttracer.hh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/sim/insttracer.hh b/src/sim/insttracer.hh index 2e9806d3b..284e04a53 100644 --- a/src/sim/insttracer.hh +++ b/src/sim/insttracer.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 ARM Limited + * Copyright (c) 2014, 2017, 2020 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -143,6 +143,12 @@ class InstRecord */ bool predicate; + /** + * Did the execution of this instruction fault? (requires ExecFaulting + * to be enabled) + */ + bool faulting; + public: InstRecord(Tick _when, ThreadContext *_thread, const StaticInstPtr _staticInst, @@ -151,7 +157,8 @@ class InstRecord : when(_when), thread(_thread), staticInst(_staticInst), pc(_pc), macroStaticInst(_macroStaticInst), addr(0), size(0), flags(0), fetch_seq(0), cp_seq(0), data_status(DataInvalid), mem_valid(false), - fetch_seq_valid(false), cp_seq_valid(false), predicate(true) + fetch_seq_valid(false), cp_seq_valid(false), predicate(true), + faulting(false) { } virtual ~InstRecord() @@ -218,6 +225,8 @@ class InstRecord void setPredicate(bool val) { predicate = val; } + void setFaulting(bool val) { faulting = val; } + virtual void dump() = 0; public: @@ -241,6 +250,8 @@ class InstRecord InstSeqNum getCpSeq() const { return cp_seq; } bool getCpSeqValid() const { return cp_seq_valid; } + + bool getFaulting() const { return faulting; } }; class InstTracer : public SimObject -- 2.30.2