summaryrefslogtreecommitdiff
path: root/src/cpu/base.cc
diff options
context:
space:
mode:
authorDam Sunwoo <dam.sunwoo@arm.com>2013-04-22 13:20:31 -0400
committerDam Sunwoo <dam.sunwoo@arm.com>2013-04-22 13:20:31 -0400
commit2c1e34431326381833de289b1d90f2427ba16c98 (patch)
tree2f1b7a0e9a400d5b5d660b4386d4b993cbd0e31c /src/cpu/base.cc
parent121b15a54da77ef77e98ff59621e1c5b0f1f1f52 (diff)
downloadgem5-2c1e34431326381833de289b1d90f2427ba16c98.tar.xz
cpu: generate SimPoint basic block vector profiles
This patch is based on http://reviews.m5sim.org/r/1474/ originally written by Mitch Hayenga. Basic block vectors are generated (simpoint.bb.gz in simout folder) based on start and end addresses of basic blocks. Some comments to the original patch are addressed and hooks are added to create and resume from checkpoints based on instruction counts dictated by external SimPoint analysis tools. SimPoint creation/resuming options will be implemented as a separate patch.
Diffstat (limited to 'src/cpu/base.cc')
-rw-r--r--src/cpu/base.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cpu/base.cc b/src/cpu/base.cc
index de0f8b23b..c7c1dadda 100644
--- a/src/cpu/base.cc
+++ b/src/cpu/base.cc
@@ -153,6 +153,18 @@ BaseCPU::BaseCPU(Params *p, bool is_checker)
}
}
+ // Set up instruction-count-based termination events for SimPoints
+ // Typically, there are more than one action points.
+ // Simulation.py is responsible to take the necessary actions upon
+ // exitting the simulation loop.
+ if (!p->simpoint_start_insts.empty()) {
+ const char *cause = "simpoint starting point found";
+ for (size_t i = 0; i < p->simpoint_start_insts.size(); ++i) {
+ Event *event = new SimLoopExitEvent(cause, 0);
+ comInstEventQueue[0]->schedule(event, p->simpoint_start_insts[i]);
+ }
+ }
+
if (p->max_insts_all_threads != 0) {
const char *cause = "all threads reached the max instruction count";