# HG changeset patch
# User Polina Dudnik <[email protected]>
# Date 1253556292 18000
# Node ID d480ef5b90289c816ec8eb3486772a1fbd7f97ff
# Parent  60e0df8086f05de6312c5897be563e6b0a5e5d47
Atomics bug fix

diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc
--- a/src/mem/ruby/system/Sequencer.cc
+++ b/src/mem/ruby/system/Sequencer.cc
@@ -45,7 +45,7 @@
 //Sequencer::Sequencer(int core_id, MessageBuffer* mandatory_q)
 
 #define LLSC_FAIL -2
-
+long int already = 0;
 Sequencer::Sequencer(const string & name)
   :RubyPort(name)
 {
@@ -354,9 +354,6 @@
 
 // Returns true if the sequencer already has a load or store outstanding
 int Sequencer::isReady(const RubyRequest& request) {
-  // POLINA: check if we are currently flushing the write buffer, if so Ruby 
is returned as not ready
-  // to simulate stalling of the front-end
-  // Do we stall all the sequencers? If it is atomic instruction - yes!
   if (m_outstanding_count >= m_max_outstanding_requests) {
     return LIBRUBY_BUFFER_FULL;
   }
@@ -417,6 +414,8 @@
   case RubyRequestType_IFETCH:
     if (m_atomic_reads > 0 && m_atomic_writes == 0) {
       m_controller->reset_atomics();
+      m_atomic_writes = 0;
+      m_atomic_reads = 0;
     }
     else if (m_atomic_writes > 0) {
       assert(m_atomic_reads > m_atomic_writes);
@@ -428,6 +427,8 @@
   case RubyRequestType_LD:
     if (m_atomic_reads > 0 && m_atomic_writes == 0) {
       m_controller->reset_atomics();
+      m_atomic_writes = 0;
+      m_atomic_reads = 0;
     }
     else if (m_atomic_writes > 0) {
       assert(m_atomic_reads > m_atomic_writes);
@@ -439,6 +440,8 @@
   case RubyRequestType_ST:
     if (m_atomic_reads > 0 && m_atomic_writes == 0) {
       m_controller->reset_atomics();
+      m_atomic_writes = 0;
+      m_atomic_reads = 0;
     }
     else if (m_atomic_writes > 0) {
       assert(m_atomic_reads > m_atomic_writes);
diff --git a/src/mem/slicc/symbols/StateMachine.cc 
b/src/mem/slicc/symbols/StateMachine.cc
--- a/src/mem/slicc/symbols/StateMachine.cc
+++ b/src/mem/slicc/symbols/StateMachine.cc
@@ -992,7 +992,6 @@
 
     out << "void " << component << "_Controller::reset_atomics()" << endl;
     out << "{" << endl;
-    out << "  assert(servicing_atomic > 0); " << endl;
     out << "  servicing_atomic = 0; " << endl;
     out << "  locked_read_request1 = Address(-1);" << endl;
     out << "  locked_read_request2 = Address(-1);" << endl;
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to