Index: /trunk/modules/vci_mem_cache_v4/caba/source/src/vci_mem_cache_v4.cpp
===================================================================
--- /trunk/modules/vci_mem_cache_v4/caba/source/src/vci_mem_cache_v4.cpp	(revision 5)
+++ /trunk/modules/vci_mem_cache_v4/caba/source/src/vci_mem_cache_v4.cpp	(revision 6)
@@ -34,4 +34,5 @@
 //#define DEBUG_VCI_MEM_CACHE 1
 #define RANDOMIZE_SC
+#define NCYCLES -1
 namespace soclib { namespace caba {
 
@@ -579,4 +580,5 @@
 
 #if DEBUG_VCI_MEM_CACHE 
+if(m_cpt_cycles > NCYCLES){
     std::cout << "---------------------------------------------" << std::dec << std::endl;
     std::cout << "MEM_CACHE " << m_srcid_ini << " ; Time = " << m_cpt_cycles << std::endl
@@ -596,4 +598,5 @@
       << " - ALLOC_UPT FSM  = " << alloc_upt_fsm_str[r_alloc_upt_fsm] << std::endl
       << " - ALLOC_HEAP FSM = " << alloc_heap_fsm_str[r_alloc_heap_fsm] << std::endl;
+}
 #endif
 
@@ -2509,4 +2512,5 @@
             if(!hit_inval) {
 #ifdef DEBUG_VCI_MEM_CACHE
+if(m_cpt_total_cycles > NCYCLES)
               std::cout << "MEM_CACHE WARNING: cleanup with no corresponding entry at address : " << std::hex << (r_cleanup_nline.read()*4*m_words) << std::dec << std::endl;
 #endif
@@ -2704,5 +2708,9 @@
                         r_llsc_fsm = SC_TRT_LOCK;
                     } else {
-                        r_llsc_fsm = SC_UPT_LOCK;
+                        if( !r_llsc_to_init_cmd_multi_req.read() && 
+                            !r_llsc_to_init_cmd_brdcast_req.read()  )
+                            r_llsc_fsm = SC_UPT_LOCK;
+                        else
+                            r_llsc_fsm = SC_WAIT;
                     }
                 } else {
@@ -2722,24 +2730,9 @@
           size_t word	= m_x[(vci_addr_t)(m_cmd_llsc_addr_fifo.read())]; 
 
-          if(!r_llsc_count.read()){ // no update
-            // write data in cache
-            m_cache_data[way][set][word] = r_llsc_wdata.read();
-            if(r_llsc_cpt.read()==4)
-                m_cache_data[way][set][word+1] = m_cmd_llsc_wdata_fifo.read();
-          }
+          m_cache_data[way][set][word] = r_llsc_wdata.read();
+          if(r_llsc_cpt.read()==4)
+              m_cache_data[way][set][word+1] = m_cmd_llsc_wdata_fifo.read();
           
-          if(r_llsc_count.read()) {  // Shared line
-#ifdef LOCK_DEBUG
-            std::cout << "SC, shared line" << std::endl;
-#endif
-
-            if( !r_llsc_to_init_cmd_multi_req.read() && 
-                !r_llsc_to_init_cmd_brdcast_req.read()  )
-                r_llsc_fsm = SC_UPT_LOCK;
-            else
-                r_llsc_fsm = SC_WAIT;
-          } else {
-            r_llsc_fsm = SC_RSP_TRUE;
-          }
+          r_llsc_fsm = SC_RSP_TRUE;
           break;
         }
