ruby: Cleaned up sequencer. Removed LogTM specific code.
authorDerek Hower <drh5@cs.wisc.edu>
Mon, 11 May 2009 17:38:45 +0000 (10:38 -0700)
committerDerek Hower <drh5@cs.wisc.edu>
Mon, 11 May 2009 17:38:45 +0000 (10:38 -0700)
src/mem/protocol/RubySlicc_Exports.sm
src/mem/ruby/recorder/TraceRecord.cc
src/mem/ruby/system/Sequencer.cc
src/mem/ruby/system/Sequencer.hh
src/mem/ruby/system/StoreBuffer.cc
src/mem/ruby/tester/Check.cc
src/mem/ruby/tester/DetermGETXGenerator.cc
src/mem/ruby/tester/DetermInvGenerator.cc
src/mem/ruby/tester/DetermSeriesGETSGenerator.cc
src/mem/ruby/tester/RequestGenerator.cc

index 36622cb40a56f1f7d27eacb0589d9eedd9def1b7..b8752cffc915eafb0b4b7eeeba15a4790b493f87 100644 (file)
@@ -238,8 +238,6 @@ structure(CacheMsg, desc="...", interface="Message") {
   //int TransactionLevel,         desc="Transaction Level of this request";
   //uint64 SequenceNumber,   desc="Sequence number of this request";
   int ThreadID,            desc="The SMT thread that initiated this request";
-  uint64 Timestamp,        desc="The transaction timestamp of this request. Last commit time if request is non-transactional";
-  bool ExposedAction,      desc="Is this request part of an exposed action";
   //uint64 RequestTime,      desc="The cycle in which this request was issued";
 }
 
index 3116edf93b64afd949fee22c834d0d83bb164287..fd5f25ab9c78db856fb123c8975adaa187135507 100644 (file)
@@ -78,7 +78,7 @@ void TraceRecord::issueRequest() const
   Sequencer* sequencer_ptr = chip_ptr->getSequencer((m_node_num/RubyConfig::numberofSMTThreads())%RubyConfig::numberOfProcsPerChip());
   assert(sequencer_ptr != NULL);
 
-  CacheMsg request(m_data_address, m_data_address, m_type, m_pc_address, AccessModeType_UserMode, 0, PrefetchBit_Yes, 0, Address(0), 0 /* only 1 SMT thread */, 0, false);
+  CacheMsg request(m_data_address, m_data_address, m_type, m_pc_address, AccessModeType_UserMode, 0, PrefetchBit_Yes, 0, Address(0), 0 /* only 1 SMT thread */);
 
   // Clear out the sequencer
   while (!sequencer_ptr->empty()) {
index 5cf4a3acf105f8b0998c7bb535727114f28403d3..43b0df1b127acf74ff319844bad7f93620a68d25 100644 (file)
 #include "Protocol.hh"
 #include "Map.hh"
 #include "interface.hh"
-//#include "XactCommitArbiter.hh"
-// #include "TransactionInterfaceManager.hh"
-//#include "TransactionVersionManager.hh"
-//#include "LazyTransactionVersionManager.hh"
-
-//#define XACT_MGR g_system_ptr->getChip(m_chip_ptr->getID())->getTransactionInterfaceManager(m_version)
 
 Sequencer::Sequencer(AbstractChip* chip_ptr, int version) {
   m_chip_ptr = chip_ptr;
@@ -158,11 +152,8 @@ int Sequencer::getNumberOutstandingDemand(){
     Vector<Address> keys = m_readRequestTable_ptr[p]->keys();
     for (int i=0; i< keys.size(); i++) {
       CacheMsg& request = m_readRequestTable_ptr[p]->lookup(keys[i]);
-      // don't count transactional begin/commit requests
-      if(request.getType() != CacheRequestType_BEGIN_XACT && request.getType() != CacheRequestType_COMMIT_XACT){
-        if(request.getPrefetch() == PrefetchBit_No){
-          total_demand++;
-        }
+      if(request.getPrefetch() == PrefetchBit_No){
+        total_demand++;
       }
     }
 
@@ -394,8 +385,6 @@ bool Sequencer::insertRequest(const CacheMsg& request) {
   }
 
   if ((request.getType() == CacheRequestType_ST) ||
-      (request.getType() == CacheRequestType_ST_XACT) ||
-      (request.getType() == CacheRequestType_LDX_XACT) ||
       (request.getType() == CacheRequestType_ATOMIC)) {
     if (m_writeRequestTable_ptr[thread]->exist(line_address(request.getAddress()))) {
       m_writeRequestTable_ptr[thread]->lookup(line_address(request.getAddress())) = request;
@@ -436,8 +425,6 @@ void Sequencer::removeRequest(const CacheMsg& request) {
   assert(m_outstanding_count == total_outstanding);
 
   if ((request.getType() == CacheRequestType_ST) ||
-      (request.getType() == CacheRequestType_ST_XACT) ||
-      (request.getType() == CacheRequestType_LDX_XACT) ||
       (request.getType() == CacheRequestType_ATOMIC)) {
     m_writeRequestTable_ptr[thread]->deallocate(line_address(request.getAddress()));
   } else {
@@ -497,8 +484,6 @@ void Sequencer::writeCallback(const Address& address, DataBlock& data, GenericMa
   removeRequest(request);
 
   assert((request.getType() == CacheRequestType_ST) ||
-         (request.getType() == CacheRequestType_ST_XACT) ||
-         (request.getType() == CacheRequestType_LDX_XACT) ||
          (request.getType() == CacheRequestType_ATOMIC));
 
   hitCallback(request, data, respondingMach, thread);
@@ -549,7 +534,6 @@ void Sequencer::readCallback(const Address& address, DataBlock& data, GenericMac
   removeRequest(request);
 
   assert((request.getType() == CacheRequestType_LD) ||
-         (request.getType() == CacheRequestType_LD_XACT) ||
          (request.getType() == CacheRequestType_IFETCH)
          );
 
@@ -625,8 +609,6 @@ void Sequencer::hitCallback(const CacheMsg& request, DataBlock& data, GenericMac
 
   bool write =
     (type == CacheRequestType_ST) ||
-    (type == CacheRequestType_ST_XACT) ||
-    (type == CacheRequestType_LDX_XACT) ||
     (type == CacheRequestType_ATOMIC);
 
   if (TSO && write) {
@@ -654,130 +636,6 @@ void Sequencer::hitCallback(const CacheMsg& request, DataBlock& data, GenericMac
   }
 }
 
-void Sequencer::readConflictCallback(const Address& address) {
-  // process oldest thread first
-  int thread = -1;
-  Time oldest_time = 0;
-  int smt_threads = RubyConfig::numberofSMTThreads();
-  for(int t=0; t < smt_threads; ++t){
-    if(m_readRequestTable_ptr[t]->exist(address)){
-      CacheMsg & request = m_readRequestTable_ptr[t]->lookup(address);
-      if(thread == -1 || (request.getTime() < oldest_time) ){
-        thread = t;
-        oldest_time = request.getTime();
-      }
-    }
-  }
-  // make sure we found an oldest thread
-  ASSERT(thread != -1);
-
-  CacheMsg & request = m_readRequestTable_ptr[thread]->lookup(address);
-
-  readConflictCallback(address, GenericMachineType_NULL, thread);
-}
-
-void Sequencer::readConflictCallback(const Address& address, GenericMachineType respondingMach, int thread) {
-  assert(address == line_address(address));
-  assert(m_readRequestTable_ptr[thread]->exist(line_address(address)));
-
-  CacheMsg request = m_readRequestTable_ptr[thread]->lookup(address);
-  assert( request.getThreadID() == thread );
-  removeRequest(request);
-
-  assert((request.getType() == CacheRequestType_LD) ||
-         (request.getType() == CacheRequestType_LD_XACT) ||
-         (request.getType() == CacheRequestType_IFETCH)
-         );
-
-  conflictCallback(request, respondingMach, thread);
-}
-
-void Sequencer::writeConflictCallback(const Address& address) {
-  // process oldest thread first
-  int thread = -1;
-  Time oldest_time = 0;
-  int smt_threads = RubyConfig::numberofSMTThreads();
-  for(int t=0; t < smt_threads; ++t){
-    if(m_writeRequestTable_ptr[t]->exist(address)){
-      CacheMsg & request = m_writeRequestTable_ptr[t]->lookup(address);
-      if(thread == -1 || (request.getTime() < oldest_time) ){
-        thread = t;
-        oldest_time = request.getTime();
-      }
-    }
-  }
-  // make sure we found an oldest thread
-  ASSERT(thread != -1);
-
-  CacheMsg & request = m_writeRequestTable_ptr[thread]->lookup(address);
-
-  writeConflictCallback(address, GenericMachineType_NULL, thread);
-}
-
-void Sequencer::writeConflictCallback(const Address& address, GenericMachineType respondingMach, int thread) {
-  assert(address == line_address(address));
-  assert(m_writeRequestTable_ptr[thread]->exist(line_address(address)));
-  CacheMsg request = m_writeRequestTable_ptr[thread]->lookup(address);
-  assert( request.getThreadID() == thread);
-  removeRequest(request);
-
-  assert((request.getType() == CacheRequestType_ST) ||
-         (request.getType() == CacheRequestType_ST_XACT) ||
-         (request.getType() == CacheRequestType_LDX_XACT) ||
-         (request.getType() == CacheRequestType_ATOMIC));
-
-  conflictCallback(request, respondingMach, thread);
-
-}
-
-void Sequencer::conflictCallback(const CacheMsg& request, GenericMachineType respondingMach, int thread) {
-  assert(XACT_MEMORY);
-  int size = request.getSize();
-  Address request_address = request.getAddress();
-  Address request_logical_address = request.getLogicalAddress();
-  Address request_line_address = line_address(request_address);
-  CacheRequestType type = request.getType();
-  int threadID = request.getThreadID();
-  Time issued_time = request.getTime();
-  int logical_proc_no = ((m_chip_ptr->getID() * RubyConfig::numberOfProcsPerChip()) + m_version) * RubyConfig::numberofSMTThreads() + threadID;
-
-  DEBUG_MSG(SEQUENCER_COMP, MedPrio, size);
-
-  assert(g_eventQueue_ptr->getTime() >= issued_time);
-  Time miss_latency = g_eventQueue_ptr->getTime() - issued_time;
-
-  if (PROTOCOL_DEBUG_TRACE) {
-    g_system_ptr->getProfiler()->profileTransition("Seq", (m_chip_ptr->getID()*RubyConfig::numberOfProcsPerChip()+m_version), -1, request.getAddress(), "", "Conflict", "",
-                                                   int_to_string(miss_latency)+" cycles "+GenericMachineType_to_string(respondingMach)+" "+CacheRequestType_to_string(request.getType())+" "+PrefetchBit_to_string(request.getPrefetch()));
-  }
-
-  DEBUG_MSG(SEQUENCER_COMP, MedPrio, request_address);
-  DEBUG_MSG(SEQUENCER_COMP, MedPrio, request.getPrefetch());
-  if (request.getPrefetch() == PrefetchBit_Yes) {
-    DEBUG_MSG(SEQUENCER_COMP, MedPrio, "return");
-    g_system_ptr->getProfiler()->swPrefetchLatency(miss_latency, type, respondingMach);
-    return; // Ignore the software prefetch, don't callback the driver
-  }
-
-  bool write =
-    (type == CacheRequestType_ST) ||
-    (type == CacheRequestType_ST_XACT) ||
-    (type == CacheRequestType_LDX_XACT) ||
-    (type == CacheRequestType_ATOMIC);
-
-  // Copy the correct bytes out of the cache line into the subblock
-  SubBlock subblock(request_address, request_logical_address, size);
-
-  // Call into the Driver (Tester or Simics)
-  g_system_ptr->getDriver()->conflictCallback(m_chip_ptr->getID()*RubyConfig::numberOfProcsPerChip()+m_version, subblock, type, threadID);
-
-  // If the request was a Store or Atomic, apply the changes in the SubBlock to the DataBlock
-  // (This is only triggered for the non-TSO case)
-  if (write) {
-    assert(!TSO);
-  }
-}
-
 void Sequencer::printDebug(){
   //notify driver of debug
   g_system_ptr->getDriver()->printDebug();
@@ -814,9 +672,7 @@ Sequencer::isReady(const Packet* pkt) const
                    PrefetchBit_No,  // Not a prefetch
                    0,              // Version number
                    Address(logical_addr),   // Virtual Address
-                   thread,              // SMT thread
-                   0,          // TM specific - timestamp of memory request
-                   false      // TM specific - whether request is part of escape action
+                   thread              // SMT thread
                    );
   isReady(request);
 }
@@ -834,8 +690,6 @@ Sequencer::isReady(const CacheMsg& request) const
   // request outstanding for the line
   bool write =
     (request.getType() == CacheRequestType_ST) ||
-    (request.getType() == CacheRequestType_ST_XACT) ||
-    (request.getType() == CacheRequestType_LDX_XACT) ||
     (request.getType() == CacheRequestType_ATOMIC);
 
   // LUKE - disallow more than one request type per address
@@ -891,9 +745,7 @@ Sequencer::makeRequest(const Packet* pkt, void* data)
                    PrefetchBit_No, // Not a prefetch
                    0,              // Version number
                    Address(logical_addr),   // Virtual Address
-                   thread,         // SMT thread
-                   0,              // TM specific - timestamp of memory request
-                   false           // TM specific - whether request is part of escape action
+                   thread         // SMT thread
                    );
   makeRequest(request);
 }
@@ -902,8 +754,6 @@ void
 Sequencer::makeRequest(const CacheMsg& request)
 {
   bool write = (request.getType() == CacheRequestType_ST) ||
-    (request.getType() == CacheRequestType_ST_XACT) ||
-    (request.getType() == CacheRequestType_LDX_XACT) ||
     (request.getType() == CacheRequestType_ATOMIC);
 
   if (TSO && (request.getPrefetch() == PrefetchBit_No) && write) {
index cd936a52804e947e7ec892b63a16b92b27b1fd7e..a3924b9496d8e0f4f041d2fcfd099bdfea45213b 100644 (file)
@@ -83,12 +83,6 @@ public:
   CacheMsg & getReadRequest( const Address & addr, int thread );
   CacheMsg & getWriteRequest( const Address & addr, int thread );
 
-  // called by Ruby when transaction completes
-  void writeConflictCallback(const Address& address);
-  void readConflictCallback(const Address& address);
-  void writeConflictCallback(const Address& address, GenericMachineType respondingMach, int thread);
-  void readConflictCallback(const Address& address, GenericMachineType respondingMach, int thread);
-
   void writeCallback(const Address& address, DataBlock& data);
   void readCallback(const Address& address, DataBlock& data);
   void writeCallback(const Address& address);
@@ -131,7 +125,7 @@ public:
 private:
   // Private Methods
   bool tryCacheAccess(const Address& addr, CacheRequestType type, const Address& pc, AccessModeType access_mode, int size, DataBlock*& data_ptr);
-  void conflictCallback(const CacheMsg& request, GenericMachineType respondingMach, int thread);
+  //  void conflictCallback(const CacheMsg& request, GenericMachineType respondingMach, int thread);
   void hitCallback(const CacheMsg& request, DataBlock& data, GenericMachineType respondingMach, int thread);
   bool insertRequest(const CacheMsg& request);
 
index 4dc54a4810fe1ddb4b97c398299a5e6c6f0e9e22..7e5682fde2a828e0231d8e5294716bade8aa9fb5 100644 (file)
@@ -255,7 +255,7 @@ void StoreBuffer::processHeadOfQueue()
     assert(m_pending == false);
     m_pending = true;
     m_pending_address = entry.m_subblock.getAddress();
-    CacheMsg request(entry.m_subblock.getAddress(), entry.m_subblock.getAddress(), entry.m_type, entry.m_pc, entry.m_access_mode, entry.m_size, PrefetchBit_No, 0, Address(0), entry.m_thread, 0, false);
+    CacheMsg request(entry.m_subblock.getAddress(), entry.m_subblock.getAddress(), entry.m_type, entry.m_pc, entry.m_access_mode, entry.m_size, PrefetchBit_No, 0, Address(0), entry.m_thread);
     m_chip_ptr->getSequencer(m_version)->doRequest(request);
   }
 }
index 3e26497092a2b0ecf797ae65fad96af0c56b76a6..0b278d110d28b5e364715b17a6e4b05e7dec98cf 100644 (file)
@@ -85,7 +85,7 @@ void Check::initiatePrefetch(Sequencer* targetSequencer_ptr)
     type = CacheRequestType_ST;
   }
   assert(targetSequencer_ptr != NULL);
-  CacheMsg request(m_address, m_address, type, m_pc, m_access_mode, 0, PrefetchBit_Yes, 0, Address(0), 0 /* only 1 SMT thread */, 0, false);
+  CacheMsg request(m_address, m_address, type, m_pc, m_access_mode, 0, PrefetchBit_Yes, 0, Address(0), 0 /* only 1 SMT thread */);
   if (targetSequencer_ptr->isReady(request)) {
     targetSequencer_ptr->makeRequest(request);
   }
@@ -109,7 +109,7 @@ void Check::initiateAction()
     type = CacheRequestType_ATOMIC;
   }
 
-  CacheMsg request(Address(m_address.getAddress()+m_store_count), Address(m_address.getAddress()+m_store_count), type, m_pc, m_access_mode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */, 0, false);
+  CacheMsg request(Address(m_address.getAddress()+m_store_count), Address(m_address.getAddress()+m_store_count), type, m_pc, m_access_mode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */);
   Sequencer* sequencer_ptr = initiatingSequencer();
   if (sequencer_ptr->isReady(request) == false) {
     DEBUG_MSG(TESTER_COMP, MedPrio, "failed to initiate action - sequencer not ready\n");
@@ -132,7 +132,7 @@ void Check::initiateCheck()
     type = CacheRequestType_IFETCH;
   }
 
-  CacheMsg request(m_address, m_address, type, m_pc, m_access_mode, CHECK_SIZE, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */, 0, false);
+  CacheMsg request(m_address, m_address, type, m_pc, m_access_mode, CHECK_SIZE, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */);
   Sequencer* sequencer_ptr = initiatingSequencer();
   if (sequencer_ptr->isReady(request) == false) {
     DEBUG_MSG(TESTER_COMP, MedPrio, "failed to initiate check - sequencer not ready\n");
index 1caebbdab885c07fac189c41ff16ca5933053a97..7e9c500c937efe94fb57817af78d8486fb50d6d3 100644 (file)
@@ -137,7 +137,7 @@ void DetermGETXGenerator::pickAddress()
 void DetermGETXGenerator::initiateStore()
 {
   DEBUG_MSG(TESTER_COMP, MedPrio, "initiating Store");
-  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_ST, Address(3), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */, 0, false));
+  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_ST, Address(3), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */));
 }
 
 Sequencer* DetermGETXGenerator::sequencer() const
index 020c2fe96ce1c7d94076a894610f86cd65aa4b28..07c1a4b01d1c28f10fb9623997fd3e3dd0f4cb5b 100644 (file)
@@ -181,13 +181,13 @@ void DetermInvGenerator::pickLoadAddress()
 void DetermInvGenerator::initiateLoad()
 {
   DEBUG_MSG(TESTER_COMP, MedPrio, "initiating Load");
-  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_LD, Address(1), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */, 0, false));
+  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_LD, Address(1), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */));
 }
 
 void DetermInvGenerator::initiateStore()
 {
   DEBUG_MSG(TESTER_COMP, MedPrio, "initiating Store");
-  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_ST, Address(3), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */, 0, false));
+  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_ST, Address(3), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */));
 }
 
 Sequencer* DetermInvGenerator::sequencer() const
index 815919559e44c9a08bd7b4b8654346abbff91dc2..479b8b6173601df54d3447b513e28b542e4f4f26 100644 (file)
@@ -135,7 +135,7 @@ void DetermSeriesGETSGenerator::pickAddress()
 void DetermSeriesGETSGenerator::initiateLoad()
 {
   DEBUG_MSG(TESTER_COMP, MedPrio, "initiating Load");
-  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_IFETCH, Address(3), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */, 0, false));
+  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_IFETCH, Address(3), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */));
 }
 
 Sequencer* DetermSeriesGETSGenerator::sequencer() const
index 71a18331530f165fb700678dcda71f1c52cab864..b216e06fe3cab72626a1014b4e9c64a73c6ef9d1 100644 (file)
@@ -169,19 +169,19 @@ void RequestGenerator::pickAddress()
 void RequestGenerator::initiateTest()
 {
   DEBUG_MSG(TESTER_COMP, MedPrio, "initiating Test");
-  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_LD, Address(1), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */, 0, false));
+  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_LD, Address(1), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */));
 }
 
 void RequestGenerator::initiateSwap()
 {
   DEBUG_MSG(TESTER_COMP, MedPrio, "initiating Swap");
-  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_ATOMIC, Address(2), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */, 0, false));
+  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_ATOMIC, Address(2), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */));
 }
 
 void RequestGenerator::initiateRelease()
 {
   DEBUG_MSG(TESTER_COMP, MedPrio, "initiating Release");
-  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_ST, Address(3), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */, 0, false));
+  sequencer()->makeRequest(CacheMsg(m_address, m_address, CacheRequestType_ST, Address(3), AccessModeType_UserMode, 1, PrefetchBit_No, 0, Address(0), 0 /* only 1 SMT thread */));
 }
 
 Sequencer* RequestGenerator::sequencer() const