diff options
author | Nilay Vaish ext:(%2C%20Malek%20Musleh%20%3Cmalek.musleh%40gmail.com%3E) <nilay@cs.wisc.edu> | 2013-05-21 11:31:31 -0500 |
---|---|---|
committer | Nilay Vaish ext:(%2C%20Malek%20Musleh%20%3Cmalek.musleh%40gmail.com%3E) <nilay@cs.wisc.edu> | 2013-05-21 11:31:31 -0500 |
commit | 59a7abff29aa5a687e1693f003c20d7e2000c40a (patch) | |
tree | e1cf2cf822cf5b1002a6b72d8d613f65e0e1df8d /src/mem/protocol/MOESI_CMP_directory-L2cache.sm | |
parent | d3c33d91b68e917478dba48c03a674b21ebd2747 (diff) | |
download | gem5-59a7abff29aa5a687e1693f003c20d7e2000c40a.tar.xz |
ruby: add stats to .sm files, remove cache profiler
This patch changes the way cache statistics are collected in ruby.
As of now, there is separate entity called CacheProfiler which holds
statistical variables for caches. The CacheMemory class defines different
functions for accessing the CacheProfiler. These functions are then invoked
in the .sm files. I find this approach opaque and prone to error. Secondly,
we probably should not be paying the cost of a function call for recording
statistics.
Instead, this patch allows for accessing statistical variables in the
.sm files. The collection would become transparent. Secondly, it would happen
in place, so no function calls. The patch also removes the CacheProfiler class.
--HG--
rename : src/mem/slicc/ast/InfixOperatorExprAST.py => src/mem/slicc/ast/OperatorExprAST.py
Diffstat (limited to 'src/mem/protocol/MOESI_CMP_directory-L2cache.sm')
-rw-r--r-- | src/mem/protocol/MOESI_CMP_directory-L2cache.sm | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/mem/protocol/MOESI_CMP_directory-L2cache.sm b/src/mem/protocol/MOESI_CMP_directory-L2cache.sm index 6c61d3eb6..53a7ee027 100644 --- a/src/mem/protocol/MOESI_CMP_directory-L2cache.sm +++ b/src/mem/protocol/MOESI_CMP_directory-L2cache.sm @@ -1475,11 +1475,12 @@ machine(L2Cache, "Token protocol") } } - action(uu_profileMiss, "\u", desc="Profile the demand miss") { - peek(L1requestNetwork_in, RequestMsg) { - // AccessModeType not implemented - // profile_L2Cache_miss(convertToGenericType(in_msg.Type), in_msg.AccessMode, MessageSizeTypeToInt(in_msg.MessageSize), in_msg.Prefetch, machineIDToNodeID(in_msg.Requestor)); - } + action(uu_profileMiss, "\um", desc="Profile the demand miss") { + ++L2cache.demand_misses; + } + + action(uu_profileHit, "\uh", desc="Profile the demand hit") { + ++L2cache.demand_hits; } action(y_copyCacheStateToDir, "y", desc="Copy cache state to directory state") { @@ -1909,7 +1910,7 @@ machine(L2Cache, "Token protocol") y_copyCacheStateToDir; r_setMRU; rr_deallocateL2CacheBlock; - uu_profileMiss; + uu_profileHit; o_popL1RequestQueue; } @@ -1922,6 +1923,7 @@ machine(L2Cache, "Token protocol") transition(OLSX, L1_GETS, OLSXS) { d_sendDataToL1GETS; r_setMRU; + uu_profileHit; o_popL1RequestQueue; } @@ -2311,6 +2313,7 @@ machine(L2Cache, "Token protocol") transition(SLS, L1_GETS, SLSS ) { d_sendDataToL1GETS; r_setMRU; + uu_profileHit; o_popL1RequestQueue; } @@ -2333,6 +2336,7 @@ machine(L2Cache, "Token protocol") transition(OLS, L1_GETS, OLSS) { d_sendDataToL1GETS; r_setMRU; + uu_profileHit; o_popL1RequestQueue; } @@ -2361,10 +2365,11 @@ machine(L2Cache, "Token protocol") i_allocateTBE; // should count 0 of course h_countLocalSharersExceptRequestor; - d_sendDataToL1GETX + d_sendDataToL1GETX; y_copyCacheStateToDir; rr_deallocateL2CacheBlock; s_deallocateTBE; + uu_profileHit; o_popL1RequestQueue; } @@ -2380,12 +2385,14 @@ machine(L2Cache, "Token protocol") d_sendDataToL1GETX; r_setMRU; s_deallocateTBE; + uu_profileHit; o_popL1RequestQueue; } transition(S, L1_GETS, SS) { d_sendDataToL1GETS; r_setMRU; + uu_profileHit; o_popL1RequestQueue; } @@ -2397,6 +2404,7 @@ machine(L2Cache, "Token protocol") transition(O, L1_GETS, OO) { d_sendDataToL1GETS; r_setMRU; + uu_profileHit; o_popL1RequestQueue; } |