summaryrefslogtreecommitdiff
path: root/src/mem/ruby/profiler
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2013-02-10 21:43:17 -0600
committerNilay Vaish <nilay@cs.wisc.edu>2013-02-10 21:43:17 -0600
commitcb7782f78d337527d8ea3d593645fc67cca54d23 (patch)
treeac0602477455b2364a32f788b0e1e6bae1fa999b /src/mem/ruby/profiler
parent253e8edf13c4d7bee6bd13f84fdfa6cf40a0c5c3 (diff)
downloadgem5-cb7782f78d337527d8ea3d593645fc67cca54d23.tar.xz
ruby: enable multiple clock domains
This patch allows ruby to have multiple clock domains. As I understand with this patch, controllers can have different frequencies. The entire network needs to run at a single frequency. The idea is that with in an object, time is treated in terms of cycles. But the messages that are passed from one entity to another should contain the time in Ticks. As of now, this is only true for the message buffers, but not for the links in the network. As I understand the code, all the entities in different networks (simple, garnet-fixed, garnet-flexible) should be clocked at the same frequency. Another problem is that the directory controller has to operate at the same frequency as the ruby system. This is because the memory controller does not make use of the Message Buffer, and instead implements a buffer of its own. So, it has no idea of the frequency at which the directory controller is operating and uses ruby system's frequency for scheduling events.
Diffstat (limited to 'src/mem/ruby/profiler')
-rw-r--r--src/mem/ruby/profiler/Profiler.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc
index e15285784..e78e7ede5 100644
--- a/src/mem/ruby/profiler/Profiler.cc
+++ b/src/mem/ruby/profiler/Profiler.cc
@@ -113,13 +113,13 @@ Profiler::wakeup()
for (int i = 0; i < m_num_of_sequencers; i++) {
perProcCycleCount[i] =
- g_system_ptr->getTime() - m_cycles_executed_at_start[i] + 1;
+ g_system_ptr->curCycle() - m_cycles_executed_at_start[i] + 1;
// The +1 allows us to avoid division by zero
}
ostream &out = *m_periodic_output_file_ptr;
- out << "ruby_cycles: " << g_system_ptr->getTime()-m_ruby_start << endl
+ out << "ruby_cycles: " << g_system_ptr->curCycle()-m_ruby_start << endl
<< "mbytes_resident: " << process_memory_resident() << endl
<< "mbytes_total: " << process_memory_total() << endl;
@@ -270,7 +270,7 @@ Profiler::printStats(ostream& out, bool short_stats)
double minutes = seconds / 60.0;
double hours = minutes / 60.0;
double days = hours / 24.0;
- Cycles ruby_cycles = g_system_ptr->getTime()-m_ruby_start;
+ Cycles ruby_cycles = g_system_ptr->curCycle()-m_ruby_start;
if (!short_stats) {
out << "Elapsed_time_in_seconds: " << seconds << endl;
@@ -293,7 +293,7 @@ Profiler::printStats(ostream& out, bool short_stats)
out << "Virtual_time_in_days: " << days << endl;
out << endl;
- out << "Ruby_current_time: " << g_system_ptr->getTime() << endl;
+ out << "Ruby_current_time: " << g_system_ptr->curCycle() << endl;
out << "Ruby_start_time: " << m_ruby_start << endl;
out << "Ruby_cycles: " << ruby_cycles << endl;
out << endl;
@@ -312,7 +312,7 @@ Profiler::printStats(ostream& out, bool short_stats)
for (int i = 0; i < m_num_of_sequencers; i++) {
perProcCycleCount[i] =
- g_system_ptr->getTime() - m_cycles_executed_at_start[i] + 1;
+ g_system_ptr->curCycle() - m_cycles_executed_at_start[i] + 1;
// The +1 allows us to avoid division by zero
}
@@ -497,7 +497,7 @@ Profiler::printResourceUsage(ostream& out) const
void
Profiler::clearStats()
{
- m_ruby_start = g_system_ptr->getTime();
+ m_ruby_start = g_system_ptr->curCycle();
m_real_time_start_time = time(NULL);
m_cycles_executed_at_start.resize(m_num_of_sequencers);
@@ -505,7 +505,7 @@ Profiler::clearStats()
if (g_system_ptr == NULL) {
m_cycles_executed_at_start[i] = 0;
} else {
- m_cycles_executed_at_start[i] = g_system_ptr->getTime();
+ m_cycles_executed_at_start[i] = g_system_ptr->curCycle();
}
}
@@ -563,7 +563,7 @@ Profiler::clearStats()
//g_eventQueue_ptr->triggerAllEvents();
// update the start time
- m_ruby_start = g_system_ptr->getTime();
+ m_ruby_start = g_system_ptr->curCycle();
}
void
@@ -734,7 +734,7 @@ Profiler::rubyWatch(int id)
uint64 tr = 0;
Address watch_address = Address(tr);
- DPRINTFN("%7s %3s RUBY WATCH %d\n", g_system_ptr->getTime(), id,
+ DPRINTFN("%7s %3s RUBY WATCH %d\n", g_system_ptr->curCycle(), id,
watch_address);
// don't care about success or failure