Index: branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
===================================================================
--- branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp	(revision 612)
+++ branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp	(revision 644)
@@ -371,4 +371,5 @@
         p_clk( "p_clk" ),
         p_resetn( "p_resetn" ),
+        p_irq( "p_irq" ),
         p_vci_tgt( "p_vci_tgt" ),
         p_vci_ixr( "p_vci_ixr" ),
@@ -819,4 +820,51 @@
     }
 
+   
+    /////////////////////////////////////////
+    tmpl(void)::reset_counters()
+    /////////////////////////////////////////
+    {
+        m_cpt_reset_count        = m_cpt_cycles;
+        m_cpt_read_local         = 0;
+        m_cpt_read_remote        = 0;
+        m_cpt_read_cost          = 0;
+        m_cpt_write_local        = 0;
+        m_cpt_write_remote       = 0;
+        m_cpt_write_flits_local  = 0;
+        m_cpt_write_flits_remote = 0;
+        m_cpt_write_cost         = 0;
+        m_cpt_ll_local           = 0;
+        m_cpt_ll_remote          = 0;
+        m_cpt_ll_cost            = 0;
+        m_cpt_sc_local           = 0;
+        m_cpt_sc_remote          = 0;
+        m_cpt_sc_cost            = 0;
+        m_cpt_cas_local          = 0;
+        m_cpt_cas_remote         = 0;
+        m_cpt_cas_cost           = 0;
+        m_cpt_update             = 0;
+        m_cpt_update_local       = 0;
+        m_cpt_update_remote      = 0;
+        m_cpt_update_cost        = 0;
+        m_cpt_minval             = 0;
+        m_cpt_minval_local       = 0;
+        m_cpt_minval_remote      = 0;
+        m_cpt_minval_cost        = 0;
+        m_cpt_binval             = 0;
+        m_cpt_cleanup_local      = 0;
+        m_cpt_cleanup_remote     = 0;
+        m_cpt_cleanup_cost       = 0;
+        m_cpt_read_miss          = 0;
+        m_cpt_write_miss         = 0;
+        m_cpt_write_dirty        = 0;
+        m_cpt_trt_rb             = 0;
+        m_cpt_trt_full           = 0;
+        m_cpt_get                = 0;
+        m_cpt_put                = 0;
+        m_cpt_ncc_to_cc_read     = 0;
+        m_cpt_ncc_to_cc_write    = 0;
+        m_cpt_ncc_to_cc          = 0;
+    }
+
 
     /////////////////////////////////////////
@@ -831,4 +879,5 @@
             std::cout << "----------------------------------" << std::dec << std::endl;
             std::cout
+                << "[000] COUNTERS RESET AT CYCLE   = " << m_cpt_reset_count << std::endl
                 << "[001] NUMBER OF CYCLES          = " << m_cpt_cycles << std::endl
                 << std::endl
@@ -1117,5 +1166,6 @@
 
             // Activity counters
-            m_cpt_cycles                  = 0;
+            m_cpt_reset_count        = 0;
+            m_cpt_cycles             = 0;
             m_cpt_read_local         = 0;
             m_cpt_read_remote        = 0;
@@ -1151,9 +1201,9 @@
             m_cpt_write_miss              = 0;
             m_cpt_write_dirty             = 0;
-            m_cpt_write_broadcast = 0;
-            m_cpt_trt_rb          = 0;
+            m_cpt_write_broadcast         = 0;
+            m_cpt_trt_rb                  = 0;
             m_cpt_trt_full                = 0;
-            m_cpt_get             = 0;
-            m_cpt_put             = 0;
+            m_cpt_get                     = 0;
+            m_cpt_put                     = 0;
             m_cpt_dir_unused              = 0;
             m_cpt_upt_unused              = 0;
@@ -3456,10 +3506,14 @@
 
                         assert ((r_write_count.read() == 1) and "NCC to CC req without copy");
-                        if(!match_inval and !r_write_to_cc_send_req.read())
-                        {
-                            r_write_to_cc_send_req = true;
-                            r_write_to_cc_send_dest = r_write_copy;
+
+                        if( not match_inval                          and 
+                            not r_write_to_cc_send_req.read()        and
+                            not r_write_to_cc_send_multi_req.read()  and
+                            not r_write_to_cc_send_brdcast_req.read()   )
+                        {
+                            r_write_to_cc_send_req   = true;
+                            r_write_to_cc_send_dest  = r_write_copy;
                             r_write_to_cc_send_nline = nline;
-                            r_write_to_cleanup_req = true;
+                            r_write_to_cleanup_req   = true;
                             r_write_to_cleanup_nline = nline;
 
@@ -3480,13 +3534,14 @@
                         {
                             std::cout << "  <MEMC " << name() << " WRITE_IVT_LOCK_HIT_WB> get access to the UPT: "
-                                << " Inval requested =  " << (!match_inval and !r_write_to_cc_send_req.read())
+                                << " Inval requested =  " << (not match_inval and not r_write_to_cc_send_req.read())
                                 << std::endl;
                         }
 #endif
+                        break;
                     }
 #if DEBUG_MEMC_WRITE
                     if(m_debug)
                     {
-                        std::cout << "  <MEMC " << name() << " WRITE_IVT_LOCK_HIT_WB> failed to access to the UPT: "
+                        std::cout << "  <MEMC " << name() << " WRITE_IVT_LOCK_HIT_WB> failed to access to the IVT: "
                             << std::endl;
                     }
@@ -3560,6 +3615,7 @@
                         // coherence update required
                     {
-                        if(!r_write_to_cc_send_multi_req.read() and
-                                !r_write_to_cc_send_brdcast_req.read())
+                        if( not r_write_to_cc_send_multi_req.read()   and
+                            not r_write_to_cc_send_brdcast_req.read() and
+                            not r_write_to_cc_send_req.read()            )
                         {
                             r_write_fsm = WRITE_UPT_LOCK;
@@ -3685,6 +3741,7 @@
                 // send the request if only one copy
                 {
-                    assert(not r_write_to_cc_send_multi_req.read()   and
+                    assert( not r_write_to_cc_send_multi_req.read()   and
                             not r_write_to_cc_send_brdcast_req.read() and
+                            not r_write_to_cc_send_req.read()         and
                             "Error in VCI_MEM_CACHE : pending multicast or broadcast\n"
                             "transaction in WRITE_UPT_REQ state"
@@ -4286,5 +4343,7 @@
             case WRITE_BC_CC_SEND:    // Post a coherence broadcast request to CC_SEND FSM
                 {
-                    if(!r_write_to_cc_send_multi_req.read() and !r_write_to_cc_send_brdcast_req.read())
+                    if( not r_write_to_cc_send_multi_req.read()   and
+                        not r_write_to_cc_send_brdcast_req.read() and
+                        not r_write_to_cc_send_req.read()            )
                     {
                         r_write_to_cc_send_multi_req   = false;
@@ -7234,4 +7293,5 @@
                     }
 
+                    // READ
                     if(r_read_to_cc_send_req.read())
                     {
@@ -7240,4 +7300,5 @@
                     }
 
+                    // WRITE
                     if(r_write_to_cc_send_req.read())
                     {
@@ -7246,17 +7307,4 @@
                     }
 
-
-                    // WRITE
-                    if(r_read_to_cc_send_req.read())
-                    {
-                        r_cc_send_fsm = CC_SEND_READ_NCC_INVAL_HEADER;
-                        break;
-                    }
-
-                    if(r_write_to_cc_send_req.read())
-                    {
-                        r_cc_send_fsm = CC_SEND_WRITE_NCC_INVAL_HEADER;
-                        break;
-                    }
                     if(m_write_to_cc_send_inst_fifo.rok() or
                             r_write_to_cc_send_multi_req.read())
