arch-riscv: print information about faults.
authorNils Asmussen <nils.asmussen@barkhauseninstitut.org>
Mon, 24 Feb 2020 12:45:22 +0000 (13:45 +0100)
committerNils Asmussen <nils.asmussen@barkhauseninstitut.org>
Thu, 26 Mar 2020 08:28:43 +0000 (08:28 +0000)
Change-Id: Ic69b788d508bab1044b693860c7d942963bed3f9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25646
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

src/arch/riscv/faults.cc

index 1d48d85dbaca50b684f76abb32e76d568e63ddc8..2296992f28333a4dfd62dd6589b1be1017d759a8 100644 (file)
@@ -2,6 +2,7 @@
  * Copyright (c) 2016 RISC-V Foundation
  * Copyright (c) 2016 The University of Virginia
  * Copyright (c) 2018 TU Dresden
+ * Copyright (c) 2020 Barkhausen Institut
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -36,6 +37,7 @@
 #include "arch/riscv/utility.hh"
 #include "cpu/base.hh"
 #include "cpu/thread_context.hh"
+#include "debug/Fault.hh"
 #include "sim/debug.hh"
 #include "sim/full_system.hh"
 
@@ -53,6 +55,9 @@ RiscvFault::invoke(ThreadContext *tc, const StaticInstPtr &inst)
 {
     PCState pcState = tc->pcState();
 
+    DPRINTFS(Fault, tc->getCpuPtr(), "Fault (%s) at PC: %s\n",
+             name(), pcState);
+
     if (FullSystem) {
         PrivilegeMode pp = (PrivilegeMode)tc->readMiscReg(MISCREG_PRV);
         PrivilegeMode prv = PRV_M;