Replaced RMW with Locked. RMW will be used for the coherence-aided atomics other...
authorPolina Dudnik <pdudnik@gmail.com>
Mon, 13 Jul 2009 16:37:56 +0000 (11:37 -0500)
committerPolina Dudnik <pdudnik@gmail.com>
Mon, 13 Jul 2009 16:37:56 +0000 (11:37 -0500)
src/mem/ruby/libruby.cc
src/mem/ruby/libruby.hh
src/mem/ruby/recorder/TraceRecord.cc
src/mem/ruby/system/DMASequencer.cc
src/mem/ruby/system/Sequencer.cc

index d21b29dec6ea9c3eb46c3ef2f17a4757ee33c612..d356009609f528641da1f0cb7c4cdc412c0eabbb 100644 (file)
@@ -19,10 +19,10 @@ string RubyRequestType_to_string(const RubyRequestType& obj)
     return "LD";
   case RubyRequestType_ST:
     return "ST";
-  case RubyRequestType_RMW_Read:
-    return "RMW_Read";
-  case RubyRequestType_RMW_Write:
-    return "RMW_Write";
+  case RubyRequestType_Locked_Read:
+    return "Locked_Read";
+  case RubyRequestType_Locked_Write:
+    return "Locked_Write";
   case RubyRequestType_NULL:
   default:
     assert(0);
@@ -38,10 +38,10 @@ RubyRequestType string_to_RubyRequestType(std::string str)
     return RubyRequestType_LD;
   else if (str == "ST")
     return RubyRequestType_ST;
-  else if (str == "RMW_Read")
-    return RubyRequestType_RMW_Read;
-  else if (str == "RMW_Write")
-    return RubyRequestType_RMW_Write;
+  else if (str == "Locked_Read")
+    return RubyRequestType_Locked_Read;
+  else if (str == "Locked_Write")
+    return RubyRequestType_Locked_Write;
   else
     assert(0);
   return RubyRequestType_NULL;
index 8edcfa0fc1e5b9089dd92e9b00672b5e95c030a0..85de794f1e52aca7aac786688eaf890a7ebd8d84 100644 (file)
@@ -11,8 +11,8 @@ enum RubyRequestType {
   RubyRequestType_IFETCH,
   RubyRequestType_LD,
   RubyRequestType_ST,
-  RubyRequestType_RMW_Read,
-  RubyRequestType_RMW_Write
+  RubyRequestType_Locked_Read,
+  RubyRequestType_Locked_Write
 };
 
 enum RubyAccessMode {
index 1521d2a3fc805b10aaadb976fef3e53fc252a342..6cc33665b4f514036464aeb59b1f8dd144a1c516 100644 (file)
@@ -47,7 +47,10 @@ TraceRecord::TraceRecord(const string & sequencer_name, const Address& data_addr
 
   // Don't differentiate between store misses and atomic requests in
   // the trace
-  if (m_type == RubyRequestType_RMW) {
+  if (m_type == RubyRequestType_Locked_Read) {
+    m_type = RubyRequestType_ST;
+  }
+  if (m_type == RubyRequestType_Locked_Write) {
     m_type = RubyRequestType_ST;
   }
 }
index 4aa0921130508f087c6d84e0bf398466f84dd0c4..ec5e0b49f820df926545e1a7ff23527603bcab67 100644 (file)
@@ -46,7 +46,8 @@ int64_t DMASequencer::makeRequest(const RubyRequest & request)
     break;
   case RubyRequestType_NULL:
   case RubyRequestType_IFETCH:
-  case RubyRequestType_RMW:
+  case RubyRequestType_Locked_Read:
+  case RubyRequestType_Locked_Write:
     assert(0);
   }
 
index db60bb11a1986f33061da4a12f9931037a7bdb0e..c3a8e9424e05e13684668058386df2ffe704a29a 100644 (file)
@@ -201,8 +201,8 @@ bool Sequencer::insertRequest(SequencerRequest* request) {
   Address line_addr(request->ruby_request.paddr);
   line_addr.makeLineAddress();
   if ((request->ruby_request.type == RubyRequestType_ST) ||
-      (request->ruby_request.type == RubyRequestType_RMW_Read) ||  
-      (request->ruby_request.type == RubyRequestType_RMW_Write)) {
+      (request->ruby_request.type == RubyRequestType_Locked_Read) ||  
+      (request->ruby_request.type == RubyRequestType_Locked_Write)) {
     if (m_writeRequestTable.exist(line_addr)) {
       m_writeRequestTable.lookup(line_addr) = request;
       //      return true;
@@ -238,8 +238,8 @@ void Sequencer::removeRequest(SequencerRequest* srequest) {
   Address line_addr(ruby_request.paddr);
   line_addr.makeLineAddress();
   if ((ruby_request.type == RubyRequestType_ST) ||
-      (ruby_request.type == RubyRequestType_RMW_Read) ||
-      (ruby_request.type == RubyRequestType_RMW_Write)) {
+      (ruby_request.type == RubyRequestType_Locked_Read) ||
+      (ruby_request.type == RubyRequestType_Locked_Write)) {
     m_writeRequestTable.deallocate(line_addr);
   } else {
     m_readRequestTable.deallocate(line_addr);
@@ -258,10 +258,10 @@ void Sequencer::writeCallback(const Address& address, DataBlock& data) {
   removeRequest(request);
 
   assert((request->ruby_request.type == RubyRequestType_ST) ||
-         (request->ruby_request.type == RubyRequestType_RMW_Read) ||
-         (request->ruby_request.type == RubyRequestType_RMW_Write));
+         (request->ruby_request.type == RubyRequestType_Locked_Read) ||
+         (request->ruby_request.type == RubyRequestType_Locked_Write));
   // POLINA: the assumption is that atomics are only on data cache and not instruction cache
-  if (request->ruby_request.type == RubyRequestType_RMW_Read) {
+  if (request->ruby_request.type == RubyRequestType_Locked_Read) {
     m_dataCache_ptr->setLocked(address, m_version);
   }
 
@@ -364,7 +364,7 @@ int64_t Sequencer::makeRequest(const RubyRequest & request)
     SequencerRequest *srequest = new SequencerRequest(request, id, g_eventQueue_ptr->getTime());
     bool found = insertRequest(srequest);
     if (!found)
-      if (request.type == RubyRequestType_RMW_Write) {
+      if (request.type == RubyRequestType_Locked_Write) {
         if (!m_dataCache_ptr->isLocked(line_address(Address(request.paddr)), m_version)) {
           return -2;
         }
@@ -396,10 +396,10 @@ void Sequencer::issueRequest(const RubyRequest& request) {
   case RubyRequestType_ST:
     ctype = CacheRequestType_ST;
     break;
-  case RubyRequestType_RMW_Read:
+  case RubyRequestType_Locked_Read:
     ctype = CacheRequestType_ATOMIC;
     break;
-  case RubyRequestType_RMW_Write:
+  case RubyRequestType_Locked_Write:
     ctype = CacheRequestType_ATOMIC;
     break;
   default: