diff options
author | John Ingalls <43973001+johningalls-sifive@users.noreply.github.com> | 2019-12-16 15:55:39 -0800 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2019-12-16 15:55:39 -0800 |
commit | 363c76a8947a476d13f270dacff00430ca7c460c (patch) | |
tree | 28a18e7a01497058d51de6e9c718006c09607c7d /riscv/execute.cc | |
parent | e3cc8b69d101921a836ca76f67b6bb032ecc3d11 (diff) | |
download | spike-363c76a8947a476d13f270dacff00430ca7c460c.zip spike-363c76a8947a476d13f270dacff00430ca7c460c.tar.gz spike-363c76a8947a476d13f270dacff00430ca7c460c.tar.bz2 |
extend the commit and memory writes log feature with memory reads (#370)
Diffstat (limited to 'riscv/execute.cc')
-rw-r--r-- | riscv/execute.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc index a623eb6..e138683 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -42,7 +42,8 @@ static void commit_log_print_insn(state_t* state, reg_t pc, insn_t insn) { #ifdef RISCV_ENABLE_COMMITLOG auto& reg = state->log_reg_write; - auto& mem = state->log_mem_write; + auto& load = state->log_mem_read; + auto& store = state->log_mem_write; int priv = state->last_inst_priv; int xlen = state->last_inst_xlen; int flen = state->last_inst_flen; @@ -59,15 +60,20 @@ static void commit_log_print_insn(state_t* state, reg_t pc, insn_t insn) fprintf(stderr, " %c%2d ", fp ? 'f' : 'x', rd); commit_log_print_value(size, reg.data.v[1], reg.data.v[0]); } - if (mem.size) { + if (load.size) { fprintf(stderr, " mem "); - commit_log_print_value(xlen, 0, mem.addr); + commit_log_print_value(xlen, 0, load.addr); + } + if (store.size) { + fprintf(stderr, " mem "); + commit_log_print_value(xlen, 0, store.addr); fprintf(stderr, " "); - commit_log_print_value(mem.size << 3, 0, mem.value); + commit_log_print_value(store.size << 3, 0, store.value); } fprintf(stderr, "\n"); reg.addr = 0; - mem.size = 0; + load.size = 0; + store.size = 0; #endif } |