projects
/
riscv-isa-sim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6025b02
)
Fix performance bug when CSR accesses are common
author
Andrew Waterman
<waterman@cs.berkeley.edu>
Sun, 31 May 2015 22:47:11 +0000
(15:47 -0700)
committer
Andrew Waterman
<waterman@cs.berkeley.edu>
Mon, 1 Jun 2015 01:29:45 +0000
(18:29 -0700)
processor_t::step was returning without doing much work, causing the HTIF
to be ticked far more often than necessary.
riscv/processor.cc
patch
|
blob
|
history
diff --git
a/riscv/processor.cc
b/riscv/processor.cc
index b8e848bd61cbeae8eb1a9e5423bb0ceaa66e1809..7162a393b30b407022922a1cff9fc45b48b1df8c 100644
(file)
--- a/
riscv/processor.cc
+++ b/
riscv/processor.cc
@@
-280,6
+280,10
@@
void processor_t::step(size_t n)
}
update_timer(&state, instret);
+
+ // tail-recurse if we didn't execute as many instructions as we'd hoped
+ if (instret < n)
+ step(n - instret);
}
void processor_t::push_privilege_stack()