From 0215c69bd6bb2d08e713288e3c677054b6a592b6 Mon Sep 17 00:00:00 2001 From: Scott Beamer Date: Fri, 11 Sep 2015 18:01:11 -0700 Subject: [PATCH] print out commit log (if enabled) for all privilege levels --- riscv/execute.cc | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/riscv/execute.cc b/riscv/execute.cc index bb7ed34..f64cbaa 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -7,18 +7,16 @@ static void commit_log(state_t* state, reg_t pc, insn_t insn) { #ifdef RISCV_ENABLE_COMMITLOG - if (get_field(state->mstatus, MSTATUS_IE)) { - uint64_t mask = (insn.length() == 8 ? uint64_t(0) : (uint64_t(1) << (insn.length() * 8))) - 1; - if (state->log_reg_write.addr) { - fprintf(stderr, "0x%016" PRIx64 " (0x%08" PRIx64 ") %c%2" PRIu64 " 0x%016" PRIx64 "\n", - pc, - insn.bits() & mask, - state->log_reg_write.addr & 1 ? 'f' : 'x', - state->log_reg_write.addr >> 1, - state->log_reg_write.data); - } else { - fprintf(stderr, "0x%016" PRIx64 " (0x%08" PRIx64 ")\n", pc, insn.bits() & mask); - } + uint64_t mask = (insn.length() == 8 ? uint64_t(0) : (uint64_t(1) << (insn.length() * 8))) - 1; + if (state->log_reg_write.addr) { + fprintf(stderr, "0x%016" PRIx64 " (0x%08" PRIx64 ") %c%2" PRIu64 " 0x%016" PRIx64 "\n", + pc, + insn.bits() & mask, + state->log_reg_write.addr & 1 ? 'f' : 'x', + state->log_reg_write.addr >> 1, + state->log_reg_write.data); + } else { + fprintf(stderr, "0x%016" PRIx64 " (0x%08" PRIx64 ")\n", pc, insn.bits() & mask); } state->log_reg_write.addr = 0; #endif -- 2.30.2