diff options
author | Andrew Waterman <aswaterman@gmail.com> | 2018-02-13 10:43:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-13 10:43:36 -0800 |
commit | 4c1c92f59f7b021eb2fa3b373b60f0e8b7c08a17 (patch) | |
tree | b7a3bb08ae4addebe2a6b7c6858e3417c6cb4291 | |
parent | fd0dbf46c3d9f8b005d35dfed79dbd4b4b0f974a (diff) | |
download | spike-4c1c92f59f7b021eb2fa3b373b60f0e8b7c08a17.zip spike-4c1c92f59f7b021eb2fa3b373b60f0e8b7c08a17.tar.gz spike-4c1c92f59f7b021eb2fa3b373b60f0e8b7c08a17.tar.bz2 |
Implement cycleh/instreth CSRs for RV32 (#172)
-rw-r--r-- | riscv/processor.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/riscv/processor.cc b/riscv/processor.cc index 516a708..8cca490 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -565,6 +565,11 @@ reg_t processor_t::get_csr(int which) case CSR_MINSTRET: case CSR_MCYCLE: return state.minstret; + case CSR_INSTRETH: + case CSR_CYCLEH: + if (ctr_ok && xlen == 32) + return state.minstret >> 32; + break; case CSR_MINSTRETH: case CSR_MCYCLEH: if (xlen == 32) |