summaryrefslogtreecommitdiff
path: root/src/mem/ruby/profiler/Profiler.cc
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2013-04-23 00:03:02 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2013-04-23 00:03:02 -0500
commitaa86800e7a142f41a8fe957c367c133dea8d61bf (patch)
tree8d39b0c46569e171263c36de91f9b543502eb783 /src/mem/ruby/profiler/Profiler.cc
parente23e3bea8bc332626e026078dc8b23c983fc890f (diff)
downloadgem5-aa86800e7a142f41a8fe957c367c133dea8d61bf.tar.xz
ruby: patch checkpoint restore with garnet
Due to recent changes to clocking system in Ruby and the way Ruby restores state from a checkpoint, garnet was failing to run from a checkpointed state. The problem is that Ruby resets the time to zero while warming up the caches. If any component records a local copy of the time (read calls curCycle()) before the simulation has started, then that component will not operate until that time is reached. In the context of this particular patch, the Garnet Network class calls curCycle() at multiple places. Any non-operational component can block in requests in the memory system, which the system interprets as a deadlock. This patch makes changes so that Garnet can successfully run from checkpointed state. It adds a globally visible time at which the actual execution started. This time is initialized in RubySystem::startup() function. This variable is only meant for components with in Ruby. This replaces the private variable that was maintained within Garnet since it is not possible to figure out the correct time when the value of this variable can be set. The patch also does away with all cases where curCycle() is called with in some Ruby component before the system has actually started executing. This is required due to the quirky manner in which ruby restores from a checkpoint.
Diffstat (limited to 'src/mem/ruby/profiler/Profiler.cc')
-rw-r--r--src/mem/ruby/profiler/Profiler.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc
index 4d05a5698..e9c2aed29 100644
--- a/src/mem/ruby/profiler/Profiler.cc
+++ b/src/mem/ruby/profiler/Profiler.cc
@@ -515,11 +515,7 @@ Profiler::clearStats()
m_cycles_executed_at_start.resize(m_num_of_sequencers);
for (int i = 0; i < m_num_of_sequencers; i++) {
- if (g_system_ptr == NULL) {
- m_cycles_executed_at_start[i] = 0;
- } else {
- m_cycles_executed_at_start[i] = g_system_ptr->curCycle();
- }
+ m_cycles_executed_at_start[i] = g_system_ptr->curCycle();
}
m_busyBankCount = 0;