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/slicc_interface/AbstractController.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/slicc_interface/AbstractController.cc')
-rw-r--r-- | src/mem/ruby/slicc_interface/AbstractController.cc | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/mem/ruby/slicc_interface/AbstractController.cc b/src/mem/ruby/slicc_interface/AbstractController.cc index 359512afc..adf411f82 100644 --- a/src/mem/ruby/slicc_interface/AbstractController.cc +++ b/src/mem/ruby/slicc_interface/AbstractController.cc @@ -30,7 +30,8 @@ #include "mem/ruby/system/System.hh" AbstractController::AbstractController(const Params *p) - : ClockedObject(p), Consumer(this) + : ClockedObject(p), Consumer(this), m_fully_busy_cycles(0), + m_request_count(0) { m_version = p->version; m_transitions_per_cycle = p->transitions_per_cycle; @@ -38,5 +39,27 @@ AbstractController::AbstractController(const Params *p) m_recycle_latency = p->recycle_latency; m_number_of_TBEs = p->number_of_TBEs; m_is_blocking = false; - p->ruby_system->registerAbstractController(this); +} + +void +AbstractController::init() +{ + params()->ruby_system->registerAbstractController(this); +} + +void +AbstractController::clearStats() +{ + m_requestProfileMap.clear(); + m_request_count = 0; +} + +void +AbstractController::profileRequest(const std::string &request) +{ + m_request_count++; + + // if it doesn't exist, conveniently, it will be created with the + // default value which is 0 + m_requestProfileMap[request]++; } |