Index: /branches/v5/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp
===================================================================
--- /branches/v5/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp	(revision 462)
+++ /branches/v5/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp	(revision 463)
@@ -1900,4 +1900,9 @@
         }
 
+        // wait if pending request to CC_SEND. This way if there are pending
+        // CLACK they can be treated in this state and then a deadlock
+        // situation is avoided
+        if ( r_icache_cc_send_req.read() ) break;
+
         // CC request handler
 
@@ -1955,11 +1960,7 @@
     case ICACHE_CC_INVAL:  	// hit inval : switch slot to ZOMBI state
     {
-        // return to CC_CHECK if pending request to CC_SEND
-        // to handle possible pending CLACK and avoid deadlock
-        if (r_icache_cc_send_req.read())
-        {
-            r_icache_fsm = ICACHE_CC_CHECK;
-            break; 
-        } 
+        assert (not r_icache_cc_send_req.read() &&
+                "ERROR in ICACHE_CC_INVAL: the r_icache_cc_send_req "
+                "must not be set");
 
 #ifdef INSTRUMENTATION
@@ -1996,12 +1997,7 @@
     case ICACHE_CC_UPDT:	// hit update : write one word per cycle
     {
-
-        // if pending request to CC_SEND or if the CC_UPDT data is not ready to
-        // handle possible pending CLACK and avoid deadlock
-        if ( r_icache_cc_send_req.read() )
-        {
-            r_icache_fsm = ICACHE_CC_CHECK;
-            break;
-        }
+        assert (not r_icache_cc_send_req.read() &&
+                "ERROR in ICACHE_CC_UPDT: the r_icache_cc_send_req "
+                "must not be set");
 
         if ( not r_cc_receive_updt_fifo_be.rok() ) break;
@@ -4657,4 +4653,9 @@
         }
 
+        // wait if pending request to CC_SEND. This way if there are pending
+        // CLACK they can be treated in this state and then a deadlock
+        // situation is avoided
+        if ( r_dcache_cc_send_req.read() ) break;
+
         // CC request handler
        
@@ -4754,11 +4755,7 @@
         }
 
-        // return to CC_CHECK if pending request to CC_SEND
-        // to handle possible pending CLACK and avoid deadlock
-        if ( r_dcache_cc_send_req.read() )
-        {
-            r_dcache_fsm = DCACHE_CC_CHECK;
-            break;
-        }
+        assert (not r_dcache_cc_send_req.read() &&
+                "ERROR in DCACHE_CC_INVAL: the r_dcache_cc_send_req "
+                "must not be set");
 
         // Switch slot state to ZOMBI and send CLEANUP command 
@@ -4821,11 +4818,7 @@
         }
 
-        // if pending request to CC_SEND or if the CC_UPDT data is not ready to
-        // handle possible pending CLACK and avoid deadlock
-        if ( r_dcache_cc_send_req.read() )
-        {
-            r_dcache_fsm = DCACHE_CC_CHECK;
-            break;
-        }
+        assert (not r_dcache_cc_send_req.read() &&
+                "ERROR in DCACHE_CC_INVAL: the r_dcache_cc_send_req "
+                "must not be set");
         
         if ( not r_cc_receive_updt_fifo_be.rok() ) break;
