summaryrefslogtreecommitdiff
path: root/src/mem/ruby/slicc_interface
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/slicc_interface')
-rw-r--r--src/mem/ruby/slicc_interface/AbstractController.cc27
-rw-r--r--src/mem/ruby/slicc_interface/AbstractController.hh22
-rw-r--r--src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.cc10
-rw-r--r--src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh4
4 files changed, 46 insertions, 17 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]++;
}
diff --git a/src/mem/ruby/slicc_interface/AbstractController.hh b/src/mem/ruby/slicc_interface/AbstractController.hh
index 40356cac5..0e3af44a1 100644
--- a/src/mem/ruby/slicc_interface/AbstractController.hh
+++ b/src/mem/ruby/slicc_interface/AbstractController.hh
@@ -51,6 +51,7 @@ class AbstractController : public ClockedObject, public Consumer
public:
typedef RubyControllerParams Params;
AbstractController(const Params *p);
+ void init();
const Params *params() const { return (const Params *)_params; }
virtual MessageBuffer* getMandatoryQueue() const = 0;
virtual const int & getVersion() const = 0;
@@ -84,12 +85,22 @@ class AbstractController : public ClockedObject, public Consumer
virtual void enqueuePrefetch(const Address&, const RubyRequestType&)
{ fatal("Prefetches not implemented!");}
+ public:
+ MachineID getMachineID() const { return m_machineID; }
+ uint64_t getFullyBusyCycles() const { return m_fully_busy_cycles; }
+ uint64_t getRequestCount() const { return m_request_count; }
+ const std::map<std::string, uint64_t>& getRequestProfileMap() const
+ { return m_requestProfileMap; }
+
+ protected:
+ //! Profiles original cache requests including PUTs
+ void profileRequest(const std::string &request);
+
protected:
int m_transitions_per_cycle;
int m_buffer_size;
int m_recycle_latency;
std::string m_name;
- std::map<std::string, std::string> m_cfg;
NodeID m_version;
Network* m_net_ptr;
MachineID m_machineID;
@@ -101,6 +112,15 @@ class AbstractController : public ClockedObject, public Consumer
int m_max_in_port_rank;
int m_cur_in_port_rank;
int m_number_of_TBEs;
+
+ //! Counter for the number of cycles when the transitions carried out
+ //! were equal to the maximum allowed
+ uint64_t m_fully_busy_cycles;
+
+ //! Map for couting requests of different types. The controller should
+ //! call requisite function for updating the count.
+ std::map<std::string, uint64_t> m_requestProfileMap;
+ uint64_t m_request_count;
};
#endif // __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCONTROLLER_HH__
diff --git a/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.cc b/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.cc
index 2dd8671a1..b8503c2cb 100644
--- a/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.cc
+++ b/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.cc
@@ -36,16 +36,6 @@
using namespace std;
void
-profile_request(const string& L1CacheState, const string& L2CacheState,
- const string& directoryState, const string& requestType)
-{
- string requestStr = L1CacheState + ":" + L2CacheState + ":" +
- directoryState + ":" + requestType;
-
- g_system_ptr->getProfiler()->profileRequest(requestStr);
-}
-
-void
profile_outstanding_request(int outstanding)
{
g_system_ptr->getProfiler()->profileOutstandingRequest(outstanding);
diff --git a/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh b/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh
index 799671435..1796d9442 100644
--- a/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh
+++ b/src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh
@@ -46,10 +46,6 @@ void profile_outstanding_persistent_request(int outstanding);
void profile_outstanding_request(int outstanding);
void profile_sharing(const Address& addr, AccessType type, NodeID requestor,
const Set& sharers, const Set& owner);
-void profile_request(const std::string& L1CacheStateStr,
- const std::string& L2CacheStateStr,
- const std::string& directoryStateStr,
- const std::string& requestTypeStr);
void profile_miss(const RubyRequest& msg, NodeID id);
void profile_token_retry(const Address& addr, AccessType type, int count);
void profile_filter_action(int action);