Ruby: Convert AccessModeType to RubyAccessMode
authorNilay Vaish <nilay@cs.wisc.edu>
Sat, 19 Mar 2011 23:34:37 +0000 (18:34 -0500)
committerNilay Vaish <nilay@cs.wisc.edu>
Sat, 19 Mar 2011 23:34:37 +0000 (18:34 -0500)
This patch converts AccessModeType to RubyAccessMode so that both the
protocol dependent and independent code uses the same access mode.

21 files changed:
src/cpu/testers/rubytest/Check.cc
src/cpu/testers/rubytest/Check.hh
src/mem/protocol/MESI_CMP_directory-msg.sm
src/mem/protocol/MOESI_CMP_directory-msg.sm
src/mem/protocol/MOESI_CMP_token-L1cache.sm
src/mem/protocol/MOESI_CMP_token-dir.sm
src/mem/protocol/MOESI_CMP_token-msg.sm
src/mem/protocol/RubySlicc_Exports.sm
src/mem/protocol/RubySlicc_Types.sm
src/mem/ruby/profiler/AccessTraceForAddress.cc
src/mem/ruby/profiler/AccessTraceForAddress.hh
src/mem/ruby/profiler/AddressProfiler.cc
src/mem/ruby/profiler/AddressProfiler.hh
src/mem/ruby/profiler/CacheProfiler.cc
src/mem/ruby/profiler/CacheProfiler.hh
src/mem/ruby/profiler/Profiler.hh
src/mem/ruby/slicc_interface/RubyRequest.hh
src/mem/ruby/system/CacheMemory.cc
src/mem/ruby/system/CacheMemory.hh
src/mem/ruby/system/Sequencer.cc
src/mem/ruby/system/Sequencer.hh

index a33351312819c486239fe0580a4a8631a58f5e49..9eed7270bd2be3715e5e94afad2a5b5df1a8268d 100644 (file)
@@ -44,7 +44,7 @@ Check::Check(const Address& address, const Address& pc,
     pickInitiatingNode();
     changeAddress(address);
     m_pc = pc;
-    m_access_mode = AccessModeType(random() % AccessModeType_NUM);
+    m_access_mode = RubyAccessMode(random() % RubyAccessMode_NUM);
     m_store_count = 0;
 }
 
index 1ce795a2182a7757311b9bb4d7ede20a7fc19c66..d16c10f57bce1a556c13a4c4393edc6ecaf62033 100644 (file)
@@ -33,7 +33,7 @@
 #include <iostream>
 
 #include "cpu/testers/rubytest/RubyTester.hh"
-#include "mem/protocol/AccessModeType.hh"
+#include "mem/protocol/RubyAccessMode.hh"
 #include "mem/protocol/TesterStatus.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
@@ -73,7 +73,7 @@ class Check
     NodeID m_initiatingNode;
     Address m_address;
     Address m_pc;
-    AccessModeType m_access_mode;
+    RubyAccessMode m_access_mode;
     int m_num_cpu_sequencers;
     RubyTester* m_tester_ptr;
 };
index dff49a8c80fe8e3529d31e2d580d8f11729f8a6d..2292ac1d132f84c238aeec6fa8a4f59f828178d7 100644 (file)
@@ -62,7 +62,7 @@ enumeration(CoherenceResponseType, desc="...") {
 structure(RequestMsg, desc="...", interface="NetworkMessage") {
   Address Address,              desc="Physical address for this request";
   CoherenceRequestType Type,    desc="Type of request (GetS, GetX, PutX, etc)";
-  AccessModeType AccessMode,    desc="user/supervisor access type";
+  RubyAccessMode AccessMode,    desc="user/supervisor access type";
   MachineID Requestor      ,    desc="What component request";
   NetDest Destination,          desc="What components receive the request, includes MachineType and num";
   MessageSizeType MessageSize,  desc="size category of the message";
index c901fb4ffa517c541c389c6bfa3b58d89ab8ca39..07cc51c9a7d314a3b672dc59f844dc176d537501 100644 (file)
@@ -84,7 +84,7 @@ structure(RequestMsg, desc="...", interface="NetworkMessage") {
   DataBlock DataBlk,           desc="data for the cache line (DMA WRITE request)";
   int Acks,                    desc="How many acks to expect";
   MessageSizeType MessageSize, desc="size category of the message";
-  AccessModeType AccessMode,    desc="user/supervisor access type";
+  RubyAccessMode AccessMode,    desc="user/supervisor access type";
   PrefetchBit Prefetch,         desc="Is this a prefetch request";
 }
 
index 7683b485fcaaa87c021cbd347261f5220a57ece2..f801bebd869d2bbd4f79aed57ebc960d69fc9ed3 100644 (file)
@@ -149,7 +149,7 @@ machine(L1Cache, "Token protocol")
 
     AccessType AccessType,                desc="Type of request (used for profiling)";
     Time IssueTime,                       desc="Time the request was issued";
-    AccessModeType AccessMode,    desc="user/supervisor access type";
+    RubyAccessMode AccessMode,    desc="user/supervisor access type";
     PrefetchBit Prefetch,         desc="Is this a prefetch request";
   }
 
index 5cad4d448bef6f8416dd38e61385b113cfb93fbc..c411d1c4b3021a9b34b35170518dfe39449ea8d9 100644 (file)
@@ -424,7 +424,7 @@ machine(Directory, "Token protocol")
         out_msg.Destination.add(map_Address_to_Directory(address));
         out_msg.MessageSize := MessageSizeType:Persistent_Control;
         out_msg.Prefetch := PrefetchBit:No;
-        out_msg.AccessMode := AccessModeType:SupervisorMode;
+        out_msg.AccessMode := RubyAccessMode:Supervisor;
       }
       markPersistentEntries(address);
       starving := true;
@@ -466,7 +466,7 @@ machine(Directory, "Token protocol")
         out_msg.RetryNum := 0;
         out_msg.MessageSize := MessageSizeType:Broadcast_Control;
         out_msg.Prefetch := PrefetchBit:No;
-        out_msg.AccessMode := AccessModeType:SupervisorMode;
+        out_msg.AccessMode := RubyAccessMode:Supervisor;
       }
     }
   }
@@ -494,7 +494,7 @@ machine(Directory, "Token protocol")
         out_msg.Destination.add(map_Address_to_Directory(address));
         out_msg.MessageSize := MessageSizeType:Persistent_Control;
         out_msg.Prefetch := PrefetchBit:No;
-        out_msg.AccessMode := AccessModeType:SupervisorMode;
+        out_msg.AccessMode := RubyAccessMode:Supervisor;
       }
       markPersistentEntries(address);
       starving := true;
@@ -532,7 +532,7 @@ machine(Directory, "Token protocol")
         out_msg.RetryNum := 0;
         out_msg.MessageSize := MessageSizeType:Broadcast_Control;
         out_msg.Prefetch := PrefetchBit:No;
-        out_msg.AccessMode := AccessModeType:SupervisorMode;
+        out_msg.AccessMode := RubyAccessMode:Supervisor;
       }
     }
   }
index fd7266c99459525db4454c63f9c92a5e3a2bb5de..6f1504d54bc845e38d72e9b7d17fd103b40345a7 100644 (file)
@@ -78,7 +78,7 @@ structure(PersistentMsg, desc="...", interface="NetworkMessage") {
   MachineID Requestor,            desc="Node who initiated the request";
   NetDest Destination,             desc="Destination set";
   MessageSizeType MessageSize, desc="size category of the message";
-  AccessModeType AccessMode,    desc="user/supervisor access type";
+  RubyAccessMode AccessMode,    desc="user/supervisor access type";
   PrefetchBit Prefetch,         desc="Is this a prefetch request";
 }
 
@@ -91,7 +91,7 @@ structure(RequestMsg, desc="...", interface="NetworkMessage") {
   bool isLocal,                    desc="Is this request from a local L1";
   int RetryNum,                    desc="retry sequence number";
   MessageSizeType MessageSize, desc="size category of the message";
-  AccessModeType AccessMode,    desc="user/supervisor access type";
+  RubyAccessMode AccessMode,    desc="user/supervisor access type";
   PrefetchBit Prefetch,         desc="Is this a prefetch request";
 }
 
index e3eb8ebeb9d3e8bff397a8321fa15ff676b93146..7258e9ccdccec83472637eca6d9ae63e41129314 100644 (file)
@@ -193,10 +193,11 @@ enumeration(AccessType, desc="...") {
   Write, desc="Writing to cache";
 }
 
-// AccessModeType
-enumeration(AccessModeType, default="AccessModeType_UserMode", desc="...") {
-  SupervisorMode, desc="Supervisor mode";
-  UserMode,       desc="User mode";
+// RubyAccessMode
+enumeration(RubyAccessMode, default="RubyAccessMode_User", desc="...") {
+  Supervisor, desc="Supervisor mode";
+  User,       desc="User mode";
+  Device, desc="Device mode";
 }
 
 enumeration(PrefetchBit, default="PrefetchBit_No", desc="...") {
@@ -212,7 +213,7 @@ structure(CacheMsg, desc="...", interface="Message") {
   Address PhysicalAddress,   desc="Physical address for this request";
   CacheRequestType Type,     desc="Type of request (LD, ST, etc)";
   Address ProgramCounter,    desc="Program counter of the instruction that caused the miss";
-  AccessModeType AccessMode, desc="user/supervisor access type";
+  RubyAccessMode AccessMode, desc="user/supervisor access type";
   int Size,                  desc="size in bytes of access";
   PrefetchBit Prefetch,      desc="Is this a prefetch request";
 }
@@ -223,7 +224,7 @@ structure(SequencerMsg, desc="...", interface="Message") {
   Address PhysicalAddress,   desc="Physical address for this request";
   SequencerRequestType Type,     desc="Type of request (LD, ST, etc)";
   Address ProgramCounter,    desc="Program counter of the instruction that caused the miss";
-  AccessModeType AccessMode, desc="user/supervisor access type";
+  RubyAccessMode AccessMode, desc="user/supervisor access type";
   DataBlock DataBlk,         desc="Data";
   int Len,                   desc="size in bytes of access";
   PrefetchBit Prefetch,      desc="Is this a prefetch request";
index c856dd921d691d590fafef4201716e2638c3fc89..d9c3077a2ad4cacee14e07503c36e3798029b3eb 100644 (file)
@@ -129,7 +129,7 @@ structure (CacheMemory, external = "yes") {
   void profileMiss(CacheMsg);
 
   void profileGenericRequest(GenericRequestType,
-                             AccessModeType,
+                             RubyAccessMode,
                              PrefetchBit);
 
   void setMRU(Address);
index e7aaa2515ed7377f8774146d047887f16963137b..9cbf7116375399a1e5218add0669fd01d7145ed6 100644 (file)
@@ -59,7 +59,7 @@ AccessTraceForAddress::print(std::ostream& out) const
 
 void
 AccessTraceForAddress::update(CacheRequestType type,
-                              AccessModeType access_mode, NodeID cpu,
+                              RubyAccessMode access_mode, NodeID cpu,
                               bool sharing_miss)
 {
     m_touched_by.add(cpu);
@@ -74,7 +74,7 @@ AccessTraceForAddress::update(CacheRequestType type,
         //  ERROR_MSG("Trying to add invalid access to trace");
     }
 
-    if (access_mode == AccessModeType_UserMode) {
+    if (access_mode == RubyAccessMode_User) {
         m_user++;
     }
 
index b950f2be2f05660b833318f5a319b0532e80b9a6..9b6db237655bb01d70be348c9467a5d6a6f9cc6a 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <iostream>
 
-#include "mem/protocol/AccessModeType.hh"
+#include "mem/protocol/RubyAccessMode.hh"
 #include "mem/protocol/CacheRequestType.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
@@ -50,7 +50,7 @@ class AccessTraceForAddress
     ~AccessTraceForAddress();
 
     void setAddress(const Address& addr) { m_addr = addr; }
-    void update(CacheRequestType type, AccessModeType access_mode, NodeID cpu,
+    void update(CacheRequestType type, RubyAccessMode access_mode, NodeID cpu,
                 bool sharing_miss);
     int getTotal() const;
     int getSharing() const { return m_sharing; }
index 5c1b7352c3ae36985f020aebd7f1c18148ee44f0..6ec0e20bad7ab13fffae92f754a8fec9e2a93f60 100644 (file)
@@ -257,7 +257,7 @@ AddressProfiler::profileGetX(const Address& datablock, const Address& PC,
     m_getx_sharing_histogram.add(num_indirections);
     bool indirection_miss = (num_indirections > 0);
 
-    addTraceSample(datablock, PC, CacheRequestType_ST, AccessModeType(0),
+    addTraceSample(datablock, PC, CacheRequestType_ST, RubyAccessMode(0),
                    requestor, indirection_miss);
 }
 
@@ -274,14 +274,14 @@ AddressProfiler::profileGetS(const Address& datablock, const Address& PC,
     m_gets_sharing_histogram.add(num_indirections);
     bool indirection_miss = (num_indirections > 0);
 
-    addTraceSample(datablock, PC, CacheRequestType_LD, AccessModeType(0),
+    addTraceSample(datablock, PC, CacheRequestType_LD, RubyAccessMode(0),
                    requestor, indirection_miss);
 }
 
 void
 AddressProfiler::addTraceSample(Address data_addr, Address pc_addr,
                                 CacheRequestType type,
-                                AccessModeType access_mode, NodeID id,
+                                RubyAccessMode access_mode, NodeID id,
                                 bool sharing_miss)
 {
     if (m_all_instructions) {
index 5422fe0951d0608bc036f72b17ee29dfaaaadfcd..fe822c116f8b78515919b9022caea3a8da4788c1 100644 (file)
@@ -55,7 +55,7 @@ class AddressProfiler
     void clearStats();
 
     void addTraceSample(Address data_addr, Address pc_addr,
-                        CacheRequestType type, AccessModeType access_mode,
+                        CacheRequestType type, RubyAccessMode access_mode,
                         NodeID id, bool sharing_miss);
     void profileRetry(const Address& data_addr, AccessType type, int count);
     void profileGetX(const Address& datablock, const Address& PC,
index a969b9074e7300af6c4c41a47dbafee5ebf4d411..fcad227fb3e7a6cadef525494628b6116ca40792 100644 (file)
@@ -94,10 +94,10 @@ CacheProfiler::printStats(ostream& out) const
 
         out << endl;
 
-        for (int i = 0; i < AccessModeType_NUM; i++){
+        for (int i = 0; i < RubyAccessMode_NUM; i++){
             if (m_accessModeTypeHistogram[i] > 0) {
                 out << description << "_access_mode_type_"
-                    << (AccessModeType) i << ":   "
+                    << (RubyAccessMode) i << ":   "
                     << m_accessModeTypeHistogram[i] << "    "
                     << 100.0 * m_accessModeTypeHistogram[i] / requests
                     << "%" << endl;
@@ -122,14 +122,14 @@ CacheProfiler::clearStats()
     m_prefetches = 0;
     m_sw_prefetches = 0;
     m_hw_prefetches = 0;
-    for (int i = 0; i < AccessModeType_NUM; i++) {
+    for (int i = 0; i < RubyAccessMode_NUM; i++) {
         m_accessModeTypeHistogram[i] = 0;
     }
 }
 
 void
 CacheProfiler::addCacheStatSample(CacheRequestType requestType,
-                                  AccessModeType accessType, 
+                                  RubyAccessMode accessType,
                                   PrefetchBit pfBit)
 {
     m_cacheRequestType[requestType]++;
@@ -138,7 +138,7 @@ CacheProfiler::addCacheStatSample(CacheRequestType requestType,
 
 void
 CacheProfiler::addGenericStatSample(GenericRequestType requestType,
-                                    AccessModeType accessType, 
+                                    RubyAccessMode accessType,
                                     PrefetchBit pfBit)
 {
     m_genericRequestType[requestType]++;
@@ -146,7 +146,7 @@ CacheProfiler::addGenericStatSample(GenericRequestType requestType,
 }
 
 void
-CacheProfiler::addStatSample(AccessModeType accessType, 
+CacheProfiler::addStatSample(RubyAccessMode accessType,
                              PrefetchBit pfBit)
 {
     m_misses++;
index 2e59c9d82a97276783b423b50bcec894641e38d8..9a8fdefb46eefdaed2937ec7acd5c39aeabcd49a 100644 (file)
@@ -33,7 +33,7 @@
 #include <string>
 #include <vector>
 
-#include "mem/protocol/AccessModeType.hh"
+#include "mem/protocol/RubyAccessMode.hh"
 #include "mem/protocol/CacheRequestType.hh"
 #include "mem/protocol/GenericRequestType.hh"
 #include "mem/protocol/PrefetchBit.hh"
@@ -51,11 +51,11 @@ class CacheProfiler
     void clearStats();
 
     void addCacheStatSample(CacheRequestType requestType, 
-                            AccessModeType type,
+                            RubyAccessMode type,
                             PrefetchBit pfBit);
 
     void addGenericStatSample(GenericRequestType requestType, 
-                              AccessModeType type,
+                              RubyAccessMode type,
                               PrefetchBit pfBit);
 
     void print(std::ostream& out) const;
@@ -64,7 +64,7 @@ class CacheProfiler
     // Private copy constructor and assignment operator
     CacheProfiler(const CacheProfiler& obj);
     CacheProfiler& operator=(const CacheProfiler& obj);
-    void addStatSample(AccessModeType type, PrefetchBit pfBit);
+    void addStatSample(RubyAccessMode type, PrefetchBit pfBit);
 
     std::string m_description;
     int64 m_misses;
@@ -72,7 +72,7 @@ class CacheProfiler
     int64 m_prefetches;
     int64 m_sw_prefetches;
     int64 m_hw_prefetches;
-    int64 m_accessModeTypeHistogram[AccessModeType_NUM];
+    int64 m_accessModeTypeHistogram[RubyAccessMode_NUM];
 
     std::vector<int> m_cacheRequestType;
     std::vector<int> m_genericRequestType;
index c0cee1d7d292b55b7fd075180f7369069b19f7d9..a3eb8cd712dbc55e344fa2a57725f5fa860bec72 100644 (file)
@@ -51,7 +51,7 @@
 #include <vector>
 
 #include "base/hashmap.hh"
-#include "mem/protocol/AccessModeType.hh"
+#include "mem/protocol/RubyAccessMode.hh"
 #include "mem/protocol/AccessType.hh"
 #include "mem/protocol/CacheRequestType.hh"
 #include "mem/protocol/GenericMachineType.hh"
index b97e8cbbc0c3d9c0d002fae3511581617a813dd3..6d0e23bfee193633bc8671f9e88b62819d1864c4 100644 (file)
@@ -32,7 +32,7 @@
 #include <ostream>
 
 #include "mem/packet.hh"
-#include "mem/protocol/AccessModeType.hh"
+#include "mem/protocol/RubyAccessMode.hh"
 #include "mem/protocol/CacheRequestType.hh"
 #include "mem/protocol/Message.hh"
 #include "mem/protocol/PrefetchBit.hh"
@@ -53,12 +53,6 @@ enum RubyRequestType {
   RubyRequestType_NUM
 };
 
-enum RubyAccessMode {
-  RubyAccessMode_User,
-  RubyAccessMode_Supervisor,
-  RubyAccessMode_Device
-};
-
 class RubyRequest
 {
   public:
index b80c1c35601f95651d7d12678f52584a631c4074..7fcb5431be67f7985ca29edb7da8aa4438c84c88 100644 (file)
@@ -353,7 +353,7 @@ CacheMemory::profileMiss(const CacheMsg& msg)
 
 void
 CacheMemory::profileGenericRequest(GenericRequestType requestType,
-                                   AccessModeType accessType,
+                                   RubyAccessMode accessType,
                                    PrefetchBit pfBit)
 {
     m_profiler_ptr->addGenericStatSample(requestType, 
index 1f0ffd500f3a5e7f82b7df6d48994dc4488b661b..6e311edc3fa794d06369f32e220d62fadeb3e46c 100644 (file)
@@ -110,7 +110,7 @@ class CacheMemory : public SimObject
     void profileMiss(const CacheMsg & msg);
 
     void profileGenericRequest(GenericRequestType requestType,
-                               AccessModeType accessType,
+                               RubyAccessMode accessType,
                                PrefetchBit pfBit);
 
     void getMemoryValue(const Address& addr, char* value,
index 800352eed299ffb9e7ffc9d34ff20e451840cfe7..7f916957b932145871b32cf5d4c5bc58b26be211 100644 (file)
@@ -644,16 +644,16 @@ Sequencer::issueRequest(const RubyRequest& request)
         assert(0);
     }
 
-    AccessModeType amtype;
+    RubyAccessMode amtype;
     switch(request.access_mode){
       case RubyAccessMode_User:
-        amtype = AccessModeType_UserMode;
+        amtype = RubyAccessMode_User;
         break;
       case RubyAccessMode_Supervisor:
-        amtype = AccessModeType_SupervisorMode;
+        amtype = RubyAccessMode_Supervisor;
         break;
       case RubyAccessMode_Device:
-        amtype = AccessModeType_UserMode;
+        amtype = RubyAccessMode_User;
         break;
       default:
         assert(0);
@@ -686,7 +686,7 @@ Sequencer::issueRequest(const RubyRequest& request)
 #if 0
 bool
 Sequencer::tryCacheAccess(const Address& addr, CacheRequestType type,
-                          AccessModeType access_mode,
+                          RubyAccessMode access_mode,
                           int size, DataBlock*& data_ptr)
 {
     CacheMemory *cache =
index 453a8cbaecbccb8bd4cc7a7c5c8f6f284a16170d..7793af889266dae961622d7fa3bdca073c6024f8 100644 (file)
@@ -32,7 +32,7 @@
 #include <iostream>
 
 #include "base/hashmap.hh"
-#include "mem/protocol/AccessModeType.hh"
+#include "mem/protocol/RubyAccessMode.hh"
 #include "mem/protocol/CacheRequestType.hh"
 #include "mem/protocol/GenericMachineType.hh"
 #include "mem/protocol/PrefetchBit.hh"
@@ -113,7 +113,7 @@ class Sequencer : public RubyPort, public Consumer
 
   private:
     bool tryCacheAccess(const Address& addr, CacheRequestType type,
-                        const Address& pc, AccessModeType access_mode,
+                        const Address& pc, RubyAccessMode access_mode,
                         int size, DataBlock*& data_ptr);
     void issueRequest(const RubyRequest& request);