/*
- * Copyright (c) 2013-2014,2018-2019 ARM Limited
+ * Copyright (c) 2013-2014,2018-2020 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
#include "debug/Activity.hh"
#include "debug/Branch.hh"
#include "debug/Drain.hh"
+#include "debug/ExecFaulting.hh"
#include "debug/MinorExecute.hh"
#include "debug/MinorInterrupt.hh"
#include "debug/MinorMem.hh"
committed = true;
if (fault != NoFault) {
+ if (inst->traceData) {
+ if (DTRACE(ExecFaulting)) {
+ inst->traceData->setFaulting(true);
+ } else {
+ delete inst->traceData;
+ inst->traceData = NULL;
+ }
+ }
+
DPRINTF(MinorExecute, "Fault in execute of inst: %s fault: %s\n",
*inst, fault->name());
fault->invoke(thread, inst->staticInst);
/*
* Copyright 2014 Google, Inc.
- * Copyright (c) 2010-2014, 2017 ARM Limited
+ * Copyright (c) 2010-2014, 2017, 2020 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
tid, head_inst->seqNum);
if (head_inst->traceData) {
if (DTRACE(ExecFaulting)) {
+ head_inst->traceData->setFaulting(true);
head_inst->traceData->setFetchSeq(head_inst->seqNum);
head_inst->traceData->setCPSeq(thread[tid]->numOp);
head_inst->traceData->dump();
/*
* Copyright 2014 Google, Inc.
- * Copyright (c) 2012-2013,2015,2017-2019 ARM Limited
+ * Copyright (c) 2012-2013,2015,2017-2020 ARM Limited
* All rights reserved.
*
* The license below extends only to copyright in the software and shall
if (fault == NoFault) {
countInst();
ppCommit->notify(std::make_pair(thread, curStaticInst));
- }
- else if (traceData && !DTRACE(ExecFaulting)) {
- delete traceData;
- traceData = NULL;
+ } else if (traceData) {
+ traceFault();
}
if (fault != NoFault &&
/*
- * Copyright (c) 2010-2012, 2015, 2017, 2018 ARM Limited
+ * Copyright (c) 2010-2012, 2015, 2017, 2018, 2020 ARM Limited
* Copyright (c) 2013 Advanced Micro Devices, Inc.
* All rights reserved
*
#include "cpu/static_inst.hh"
#include "cpu/thread_context.hh"
#include "debug/Decode.hh"
+#include "debug/ExecFaulting.hh"
#include "debug/Fetch.hh"
#include "debug/Quiesce.hh"
#include "mem/packet.hh"
}
}
+void
+BaseSimpleCPU::traceFault()
+{
+ if (DTRACE(ExecFaulting)) {
+ traceData->setFaulting(true);
+ } else {
+ delete traceData;
+ traceData = NULL;
+ }
+}
+
void
BaseSimpleCPU::checkForInterrupts()
{
/*
- * Copyright (c) 2011-2012,2015,2018 ARM Limited
+ * Copyright (c) 2011-2012,2015,2018,2020 ARM Limited
* Copyright (c) 2013 Advanced Micro Devices, Inc.
* All rights reserved
*
Status _status;
+ /**
+ * Handler used when encountering a fault; its purpose is to
+ * tear down the InstRecord. If a fault is meant to be traced,
+ * the handler won't delete the record and it will annotate
+ * the record as coming from a faulting instruction.
+ */
+ void traceFault();
+
public:
void checkForInterrupts();
void setupFetchRequest(const RequestPtr &req);
/*
* Copyright 2014 Google, Inc.
- * Copyright (c) 2010-2013,2015,2017-2018 ARM Limited
+ * Copyright (c) 2010-2013,2015,2017-2018, 2020 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
updateCycleCounts();
updateCycleCounters(BaseCPU::CPU_STATE_ON);
- if (traceData) {
- // Since there was a fault, we shouldn't trace this instruction.
- delete traceData;
- traceData = NULL;
+ if ((fault != NoFault) && traceData) {
+ traceFault();
}
postExecute();
// ifetch
if (_status == BaseSimpleCPU::Running) {
if (fault != NoFault && traceData) {
- // If there was a fault, we shouldn't trace this instruction.
- delete traceData;
- traceData = NULL;
+ traceFault();
}
postExecute();
// keep an instruction count
if (fault == NoFault)
countInst();
- else if (traceData && !DTRACE(ExecFaulting)) {
- delete traceData;
- traceData = NULL;
+ else if (traceData) {
+ traceFault();
}
postExecute();
if (fault == NoFault)
countInst();
else if (traceData) {
- // If there was a fault, we shouldn't trace this instruction.
- delete traceData;
- traceData = NULL;
+ traceFault();
}
delete pkt;