diff options
author | Andrew Waterman <andrew@sifive.com> | 2022-02-19 01:17:54 -0800 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2022-02-19 01:17:54 -0800 |
commit | d84569bd6222fb003579781f5a5c63bc844f3384 (patch) | |
tree | 581fcc497f2d157edb75c3e827aa99f5032e28dc /riscv/execute.cc | |
parent | 0dd29aaf59b3ab40f023f09f0d13a15cfb27b534 (diff) | |
parent | cd668d2f067d802879a7842bc3bed50fa61b2ead (diff) | |
download | riscv-isa-sim-d84569bd6222fb003579781f5a5c63bc844f3384.zip riscv-isa-sim-d84569bd6222fb003579781f5a5c63bc844f3384.tar.gz riscv-isa-sim-d84569bd6222fb003579781f5a5c63bc844f3384.tar.bz2 |
Merge branch 'minstret-mcycle-split' of https://github.com/rswarbrick/riscv-isa-sim
Diffstat (limited to 'riscv/execute.cc')
-rw-r--r-- | riscv/execute.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc index 3f7584e..41a15b7 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -349,6 +349,14 @@ void processor_t::step(size_t n) } state.minstret->bump(instret); + + // By default, bump the MCYCLE register by the same delta. This models a + // machine where each instruction takes exactly one cycle to retire. In a + // cosimulation environment, the RTL might manually update MCYCLE + // separately. It should do that between the end of this step() and the + // start of the next one. + state.mcycle->bump(instret); + n -= instret; } } |