aboutsummaryrefslogtreecommitdiff
path: root/riscv/execute.cc
diff options
context:
space:
mode:
authorChristopher Celio <celio@eecs.berkeley.edu>2017-11-20 11:41:31 -0800
committerAndrew Waterman <aswaterman@gmail.com>2017-11-20 11:41:31 -0800
commit86426a333608827faf6cb712ed06cf10ff3f73cd (patch)
treea3754a82734c310d3586f10222b49d77b31cfec7 /riscv/execute.cc
parentf8a83a80525264761a982cdb4074cb09ac72d7de (diff)
downloadspike-86426a333608827faf6cb712ed06cf10ff3f73cd.zip
spike-86426a333608827faf6cb712ed06cf10ff3f73cd.tar.gz
spike-86426a333608827faf6cb712ed06cf10ff3f73cd.tar.bz2
Fix commitlog. (#162)
A regression caused any instruction with rd=x0 to not be emitted.
Diffstat (limited to 'riscv/execute.cc')
-rw-r--r--riscv/execute.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc
index abffeea..25e9520 100644
--- a/riscv/execute.cc
+++ b/riscv/execute.cc
@@ -43,18 +43,21 @@ static void commit_log_print_insn(state_t* state, reg_t pc, insn_t insn)
int priv = state->last_inst_priv;
int xlen = state->last_inst_xlen;
int flen = state->last_inst_flen;
+
+ fprintf(stderr, "%1d ", priv);
+ commit_log_print_value(xlen, 0, pc);
+ fprintf(stderr, " (");
+ commit_log_print_value(insn.length() * 8, 0, insn.bits());
+
if (reg.addr) {
bool fp = reg.addr & 1;
int rd = reg.addr >> 1;
int size = fp ? flen : xlen;
-
- fprintf(stderr, "%1d ", priv);
- commit_log_print_value(xlen, 0, pc);
- fprintf(stderr, " (");
- commit_log_print_value(insn.length() * 8, 0, insn.bits());
fprintf(stderr, ") %c%2d ", fp ? 'f' : 'x', rd);
commit_log_print_value(size, reg.data.v[1], reg.data.v[0]);
fprintf(stderr, "\n");
+ } else {
+ fprintf(stderr, ")\n");
}
reg.addr = 0;
#endif