diff options
author | Chih-Min Chao <chihmin.chao@sifive.com> | 2020-03-03 20:24:49 -0800 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2020-03-09 19:59:47 -0700 |
commit | 2be050171015bb662a4495422c9e31f0be8a9c3a (patch) | |
tree | ee2ba637dab51239bbc3294175fd16c9ce30d518 /riscv/execute.cc | |
parent | c949a75893a3c8df98a407d216ee995c82d4db4f (diff) | |
download | spike-2be050171015bb662a4495422c9e31f0be8a9c3a.zip spike-2be050171015bb662a4495422c9e31f0be8a9c3a.tar.gz spike-2be050171015bb662a4495422c9e31f0be8a9c3a.tar.bz2 |
commitlog: enhance vector dump
1. don't duplicate vconfig for lmul >=2 case
2. add l# to show prenset vl value
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'riscv/execute.cc')
-rw-r--r-- | riscv/execute.cc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc index 6e897ec..12dd781 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -63,6 +63,7 @@ static void commit_log_print_insn(processor_t* p, reg_t pc, insn_t insn) fprintf(stderr, " ("); commit_log_print_value(insn.length() * 8, 0, insn.bits()); fprintf(stderr, ")"); + bool show_vec = false; for (auto item : reg) { if (item.first == 0) @@ -72,6 +73,7 @@ static void commit_log_print_insn(processor_t* p, reg_t pc, insn_t insn) int size; int rd = item.first >> 2; bool is_vec = false; + bool is_vreg = false; switch (item.first & 3) { case 0: size = xlen; @@ -84,6 +86,9 @@ static void commit_log_print_insn(processor_t* p, reg_t pc, insn_t insn) case 2: size = p->VU.VLEN; prefix = 'v'; + is_vreg = true; + break; + case 3: is_vec = true; break; default: @@ -91,14 +96,18 @@ static void commit_log_print_insn(processor_t* p, reg_t pc, insn_t insn) break; } - if (is_vec) - fprintf(stderr, " e%ld m%ld", p->VU.vsew, p->VU.vlmul); + if (!show_vec && (is_vreg || is_vec)) { + fprintf(stderr, " e%ld m%ld l%ld", p->VU.vsew, p->VU.vlmul, p->VU.vl); + show_vec = true; + } - fprintf(stderr, " %c%2d ", prefix, rd); - if (is_vec) + if (!is_vec) { + fprintf(stderr, " %c%2d ", prefix, rd); + if (is_vreg) commit_log_print_value(size, &p->VU.elt<uint8_t>(rd, 0)); - else + else commit_log_print_value(size, item.second.v[1], item.second.v[0]); + } } for (auto item : load) { |