diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2013-02-10 21:26:22 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2013-02-10 21:26:22 -0600 |
commit | a49b1df3f0d1e1c9ce46675d9fce7787d98caca7 (patch) | |
tree | 9c79c45ad9d0c19cff355a156f7e5ac2ee715998 /src/mem/ruby/system/System.cc | |
parent | 10f1f8c6a49fa96ffb420eaa8cdd3641128ec9ec (diff) | |
download | gem5-a49b1df3f0d1e1c9ce46675d9fce7787d98caca7.tar.xz |
ruby: record fully busy cycle with in the controller
This patch does several things. First, the counter for fully busy cycles for a
controller is now kept with in the controller, instead of being part of the profiler.
Second, the topology class no longer keeps an array of controllers which was only
used for printing stats. Instead, ruby system will now ask each controller to print
the stats. Thirdly, the statistical variable for recording how many different types
were created is being moved in to the controller from the profiler. Note that for
printing, the profiler will collate results from different controllers.
Diffstat (limited to 'src/mem/ruby/system/System.cc')
-rw-r--r-- | src/mem/ruby/system/System.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc index 01e50ef0b..d2c7d357b 100644 --- a/src/mem/ruby/system/System.cc +++ b/src/mem/ruby/system/System.cc @@ -72,7 +72,6 @@ RubySystem::RubySystem(const Params *p) m_memory_size_bits = ceilLog2(m_memory_size_bytes); } - g_system_ptr = this; if (p->no_mem_vec) { m_mem_vec_ptr = NULL; } else { @@ -86,6 +85,12 @@ RubySystem::RubySystem(const Params *p) m_warmup_enabled = false; m_cooldown_enabled = false; + + // Setup the global variables used in Ruby + g_system_ptr = this; + + // Resize to the size of different machine types + g_abs_controls.resize(MachineType_NUM); } void @@ -111,6 +116,9 @@ void RubySystem::registerAbstractController(AbstractController* cntrl) { m_abs_cntrl_vec.push_back(cntrl); + + MachineID id = cntrl->getMachineID(); + g_abs_controls[id.getType()][id.getNum()] = cntrl; } void @@ -144,6 +152,15 @@ RubySystem::printStats(ostream& out) m_profiler_ptr->printStats(out); m_network_ptr->printStats(out); + + for (uint32_t i = 0;i < g_abs_controls.size(); ++i) { + for (map<uint32_t, AbstractController *>::iterator it = + g_abs_controls[i].begin(); + it != g_abs_controls[i].end(); ++it) { + + ((*it).second)->printStats(out); + } + } } void @@ -397,6 +414,9 @@ RubySystem::resetStats() { m_profiler_ptr->clearStats(); m_network_ptr->clearStats(); + for (uint32_t cntrl = 0; cntrl < m_abs_cntrl_vec.size(); cntrl++) { + m_abs_cntrl_vec[cntrl]->clearStats(); + } } bool |