From 25a538ff20de23abb8d7eb2f959d6d333c110cb9 Mon Sep 17 00:00:00 2001 From: Nils Asmussen Date: Mon, 24 Feb 2020 13:45:22 +0100 Subject: [PATCH] arch-riscv: print information about faults. Change-Id: Ic69b788d508bab1044b693860c7d942963bed3f9 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25646 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- src/arch/riscv/faults.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/arch/riscv/faults.cc b/src/arch/riscv/faults.cc index 1d48d85db..2296992f2 100644 --- a/src/arch/riscv/faults.cc +++ b/src/arch/riscv/faults.cc @@ -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; -- 2.30.2