aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsthiruva <sthiruva@gmail.com>2020-09-29 10:36:02 +0530
committerGitHub <noreply@github.com>2020-09-28 22:06:02 -0700
commite7cdd757248358235f3231cecf6aafdf23201d4e (patch)
tree71e80c0b721966c9077214486a475b28742d1395
parent9d1fb489c2cc7bcb6e25e36a23b2cf963774618a (diff)
downloadspike-e7cdd757248358235f3231cecf6aafdf23201d4e.zip
spike-e7cdd757248358235f3231cecf6aafdf23201d4e.tar.gz
spike-e7cdd757248358235f3231cecf6aafdf23201d4e.tar.bz2
Add core id to lines generated by --log-commits (#556)
* Add core id to lines generated by --log-commits * Fixing the format specifier for cpuid in log-commits Co-authored-by: Shajid Thiruvathodi <sthiruva@valtrix.in>
-rw-r--r--riscv/execute.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc
index a6c7f10..84e9c5f 100644
--- a/riscv/execute.cc
+++ b/riscv/execute.cc
@@ -70,6 +70,10 @@ static void commit_log_print_insn(processor_t *p, reg_t pc, insn_t insn)
int xlen = p->get_state()->last_inst_xlen;
int flen = p->get_state()->last_inst_flen;
+ // print core id on all lines so it is easy to grep
+ uint64_t id = p->get_csr(CSR_MHARTID);
+ fprintf(log_file, "core%4" PRId64 ": ", id);
+
fprintf(log_file, "%1d ", priv);
commit_log_print_value(log_file, xlen, pc);
fprintf(log_file, " (");