RISC-V: Add mcycle/minstret support for -icount auto
authorMichael Clark <mjc@sifive.com>
Fri, 6 Apr 2018 00:46:19 +0000 (12:46 +1200)
committerMichael Clark <mjc@sifive.com>
Sat, 5 May 2018 22:39:38 +0000 (10:39 +1200)
commit6fce529c4b3ecbff17bbd930f6beaac9a6067114
tree5254f5e326c722b518b78791aec540628ddb95b4
parent8c59f5c1b5aabbad92871bf62bb302fef017e322
RISC-V: Add mcycle/minstret support for -icount auto

Previously the mycycle/minstret CSRs and rdcycle/rdinstret
psuedo instructions would return the time as a proxy for an
increasing instruction counter in the absence of having a
precise instruction count. If QEMU is invoked with -icount,
the mcycle/minstret CSRs and rdcycle/rdinstret psuedo
instructions will return the instruction count.

Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/op_helper.c
target/riscv/translate.c